use super::{AuthContext, AuthDecision, Authenticator};
use appcore_core::{AppId, CommandName, NodeId};
struct MockAuthenticator;
impl Authenticator for MockAuthenticator {
fn authenticate(&self, _context: &AuthContext) -> AuthDecision {
AuthDecision::Allow
}
}
#[test]
fn mock_authenticator_works() {
let auth = MockAuthenticator;
let context = AuthContext {
app_id: AppId::new("example-app".to_string()).unwrap(),
node_id: NodeId::new("node-a".to_string()).unwrap(),
command_name: CommandName::new("runtime.start".to_string()).unwrap(),
};
assert_eq!(auth.authenticate(&context), AuthDecision::Allow);
}