unitycatalog_server/api/
mod.rs1pub use agent_skills::AgentSkillHandler;
2pub use agents::AgentHandler;
3pub use catalogs::CatalogHandler;
4pub use credentials::CredentialHandler;
5pub use entity_tag_assignments::EntityTagAssignmentHandler;
6pub use external_locations::ExternalLocationHandler;
7pub use functions::FunctionHandler;
8pub use model_versions::ModelVersionHandler;
9pub use policies::PolicyHandler;
10pub use providers::ProviderHandler;
11pub use recipients::RecipientHandler;
12pub use registered_models::RegisteredModelHandler;
13pub use schemas::SchemaHandler;
14pub use shares::ShareHandler;
15pub use staging_tables::StagingTableHandler;
16pub use tables::TableHandler;
17pub use tag_policies::TagPolicyHandler;
18pub use temporary_credentials::TemporaryCredentialHandler;
19pub use volumes::VolumeHandler;
20
21use crate::policy::{Permission, Principal};
22use unitycatalog_common::models::ResourceIdent;
23
24pub mod agent_skills;
38pub mod agents;
39pub mod catalogs;
40pub mod credentials;
41pub mod entity_tag_assignments;
42pub mod external_locations;
43pub mod functions;
44pub mod model_versions;
45pub mod policies;
46pub mod providers;
47pub mod recipients;
48pub mod registered_models;
49pub mod schemas;
50pub mod shares;
51pub mod staging_tables;
52pub mod tables;
53pub mod tag_policies;
54pub mod temporary_credentials;
55pub mod volumes;
56
57#[derive(Debug, Clone)]
58pub struct RequestContext {
59 pub recipient: Principal,
60}
61
62impl RequestContext {
63 pub fn recipient(&self) -> &Principal {
64 &self.recipient
65 }
66}
67
68impl AsRef<Principal> for RequestContext {
69 fn as_ref(&self) -> &Principal {
70 &self.recipient
71 }
72}
73
74pub trait SecuredAction: Send + Sync {
75 fn resource(&self) -> ResourceIdent;
77
78 fn permission(&self) -> &'static Permission;
80}