cut off hives that left the roster: forge token, team seat, token secret, login role
This commit is contained in:
parent
f8a0388457
commit
11fec06a50
1 changed files with 830 additions and 21 deletions
|
|
@ -358,11 +358,11 @@ async fn write_agent_policy_and_entities(
|
|||
mod tests {
|
||||
use std::{cell::Cell, time::Duration};
|
||||
|
||||
use crate::store::fake::FakeAccess;
|
||||
use crate::store::{AccessStore, fake::FakeAccess};
|
||||
|
||||
use super::{
|
||||
RETRY_ATTEMPTS, RETRY_INTERVAL, RETRY_WINDOW, Unreachable, attached_policies, policy,
|
||||
provision_with, retry_until_ok, write_agent_policy_and_entities,
|
||||
provision_with, retry_until_ok, write_agent_policy_and_entities, write_role,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
|
@ -472,6 +472,20 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn a_hive_whose_role_was_deleted_gets_it_back_when_it_is_in_the_roster_again() {
|
||||
let store = FakeAccess::default();
|
||||
write_role(&store, "pr1ma", "CA").await.expect("accepted");
|
||||
assert!(store.role("hive-pr1ma").is_some());
|
||||
store
|
||||
.delete_cert_role("auth/cert", "hive-pr1ma")
|
||||
.await
|
||||
.expect("accepted");
|
||||
assert_eq!(store.role("hive-pr1ma"), None);
|
||||
write_role(&store, "pr1ma", "CA").await.expect("accepted");
|
||||
assert!(store.role("hive-pr1ma").is_some());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn without_an_authority_the_policy_is_written_and_no_role_is() {
|
||||
let store = FakeAccess::default();
|
||||
|
|
|
|||
Loading…
Reference in a new issue