scratchstack_aws_principal/
lib.rs

1#![warn(clippy::all)]
2#![deny(rustdoc::missing_crate_level_docs)]
3#![deny(rustdoc::broken_intra_doc_links)]
4#![deny(missing_docs)]
5
6//! Actor principals for AWS and AWS-like services.
7//!
8//! Principals come in two "flavors": actor principals and policy principals. Policy principals are used in Aspen
9//! documents and have a source ("AWS", "CanonicalUser", "Federated", or "Service") and an associated value which may
10//! contain wildcards. These are implemented in the [`scratchstack-aspen` crate](https://docs.rs/scratchstack-aspen).
11//!
12//! On the service implementation side, actor principals (represented by [Principal] here) are exact, without
13//! wildcards. Beyond the core details, there are additional details attached to a principal actor that can be
14//! referenced in
15//! [policy variables](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html).
16//! For example, IAM users have a
17//! [universally unique ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-unique-ids).
18//! If the `/Sales/Bob` user is deleted and re-created, these two users will have the same ARN but different unique IDs
19//! that can be referenced via the `aws:userid` condition key. These details are carried in [SessionData] structures
20//! apart from the [Principal] itself.
21
22mod assumed_role;
23mod canonical_user;
24mod error;
25mod federated_user;
26mod principal;
27mod root_user;
28mod service;
29mod session;
30mod user;
31
32/// Validation routines used internally by `scratchstack-aws-principal` but may be useful elsewhere.
33pub mod utils;
34
35pub use {
36    assumed_role::AssumedRole,
37    canonical_user::CanonicalUser,
38    error::PrincipalError,
39    federated_user::FederatedUser,
40    principal::{Principal, PrincipalIdentity, PrincipalSource},
41    root_user::RootUser,
42    service::Service,
43    session::{SessionData, SessionValue},
44    user::User,
45    utils::IamIdPrefix,
46};