lock the service forge accounts out of creating organizations
This commit is contained in:
parent
07028557d1
commit
87dc4c5533
1 changed files with 55 additions and 12 deletions
|
|
@ -288,4 +288,25 @@ mod tests {
|
|||
assert!(format!("{err:#}").contains("not the swarm builder's"));
|
||||
assert!(lockdown_patch(&seen, LOGIN).is_none());
|
||||
}
|
||||
|
||||
/// An existing account is locked out of repo creation and of
|
||||
/// organizations on every pass.
|
||||
#[tokio::test]
|
||||
async fn the_job_locks_the_builder_out_of_repos_and_organizations() {
|
||||
use super::super::tests::{lockdown_patch, stub_forge};
|
||||
|
||||
let (client, seen) = stub_forge(
|
||||
(409, r#"{"message":"user already exists"}"#),
|
||||
(200, r#"{"email":"builder@services.hyperhive.local"}"#),
|
||||
(200, "{}"),
|
||||
)
|
||||
.await;
|
||||
client
|
||||
.ensure_builder_user()
|
||||
.await
|
||||
.expect("the builder's own account");
|
||||
let body = lockdown_patch(&seen, LOGIN).expect("no lockdown PATCH sent");
|
||||
assert_eq!(body["max_repo_creation"], 0);
|
||||
assert_eq!(body["allow_create_organization"], false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue