Skip to main content

Crate themis

Crate themis 

Source
Expand description

Themis: governance and authorization decisions.

A single engine resolves three access models over the same permission catalog:

A decision goes through three stages: overrides (Override), collection of the applicable grants and combination by a Strategy. The default strategy (MostSpecific) lets the most specific target decide and, within it, deny beats allow.

Grant changes and role assignments go through Governance, which applies invariants (no self-management, no leaving a scope without an administrator, prohibitions) before the change is persisted and, with the audit feature, records each decision in an audit trail (audit).

The crate does no IO and does not depend on an async runtime, and it compiles to WebAssembly. Real time, caching and transports live in themis-sync and the adapters.

See the repository README for the full guide.

Re-exports§

pub use attr::Attributes;
pub use attr::Value;
pub use audit::AuditAction;
pub use audit::AuditError;
pub use audit::AuditLevel;
pub use audit::AuditOutcome;
pub use audit::AuditRecord;
pub use audit::AuditSink;
pub use audit::Auditor;
pub use audit::JsonLinesAudit;
pub use audit::MemoryAuditLog;
pub use audit::RoleChange;
pub use catalog::Catalog;
pub use catalog::CatalogBuilder;
pub use catalog::CatalogError;
pub use catalog::CatalogErrors;
pub use catalog::CatalogExport;
pub use catalog::CatalogRule;
pub use catalog::FnRule;
pub use catalog::PermissionDef;
pub use catalog::RequireMeta;
pub use condition::Condition;
pub use condition::ConditionError;
pub use condition::ConditionRegistry;
pub use condition::EvalContext;
pub use condition::Operand;
pub use decision::Decision;
pub use decision::Reason;
pub use decision::Request;
pub use engine::CapabilitySet;
pub use engine::Context;
pub use engine::Engine;
pub use engine::EngineBuilder;
pub use engine::EngineError;
pub use engine::GrantError;
pub use explain::ConditionTrace;
pub use explain::Explanation;
pub use explain::GrantTrace;
pub use explain::OverrideOutcome;
pub use explain::OverrideStep;
pub use explain::TraceResult;
pub use explain::Verdict;
pub use explain::trace_condition;
pub use governance::CatalogConformance;
pub use governance::Forbid;
pub use governance::Governance;
pub use governance::Invariant;
pub use governance::Mutation;
pub use governance::NoLockout;
pub use governance::NoSelfManagement;
pub use governance::Proposal;
pub use governance::RequirePermission;
pub use governance::Violation;
pub use grant::Effect;
pub use grant::Grant;
pub use grant::GrantSource;
pub use grant::SubjectMatcher;
pub use grant::TargetSelector;
pub use overrides::FnOverride;
pub use overrides::Override;
pub use overrides::PermissionHolder;
pub use overrides::ResourceOwner;
pub use rbac::RbacError;
pub use rbac::RoleGraph;
pub use rebac::InMemoryTuples;
pub use rebac::RebacError;
pub use rebac::RelationSchema;
pub use rebac::Rewrite;
pub use rebac::Tuple;
pub use rebac::TupleStore;
pub use rebac::TupleSubject;
pub use resource::Anchor;
pub use resource::GLOBAL;
pub use resource::ObjectRef;
pub use resource::Resource;
pub use spec::EngineSpec;
pub use spec::InvariantSpec;
pub use spec::OverrideRule;
pub use spec::OverrideSpec;
pub use spec::RelationSpec;
pub use spec::RoleSpec;
pub use spec::SpecError;
pub use spec::StrategySpec;
pub use strategy::Candidate;
pub use strategy::DenyOverrides;
pub use strategy::FirstApplicable;
pub use strategy::MostSpecific;
pub use strategy::PermitOverrides;
pub use strategy::Strategy;
pub use subject::ANONYMOUS;
pub use subject::AUTHENTICATED;
pub use subject::RoleAssignment;
pub use subject::Subject;

Modules§

attr
audit
Audit trail of permission changes (feature audit).
catalog
condition
decision
engine
explain
Full trace of a decision: why each grant got in or stayed out, what each override answered and how the strategy chose. crate::Engine::explain returns the same Decision as crate::Engine::decide, plus the path that led to it.
governance
grant
overrides
rbac
rebac
resource
spec
Declarative configuration of the engine and of governance, in JSON, TOML or YAML.
strategy
subject