Expand description
Authorization and governance for Guts.
This crate provides:
- Permissions: Granular access control (Read, Write, Admin)
- Organizations: Multi-user repository ownership
- Teams: Group-based permission management
- Collaborators: Direct repository access grants
- Branch Protection: Rules for protecting important branches
- Webhooks: Event notifications for CI/CD integration
§Example
use guts_auth::{AuthStore, Permission, OrgMember, OrgRole};
// Create a store
let store = AuthStore::new();
// Create an organization
let org = store.create_organization(
"acme".into(),
"Acme Corporation".into(),
"owner_pubkey".into(),
).unwrap();
// Create a team with write access
let team = store.create_team(
org.id,
"backend".into(),
Permission::Write,
"owner_pubkey".into(),
).unwrap();
// Add a member to the team
store.add_team_member(team.id, "developer_pubkey".into()).unwrap();
// Add a repository to the team
store.add_team_repo(team.id, "acme/api".into()).unwrap();
// Check permissions
assert!(store.check_permission("developer_pubkey", "acme/api", Permission::Write));Structs§
- Auth
Store - Thread-safe in-memory store for authorization data.
- Branch
Protection - Branch protection rule for a repository.
- Branch
Protection Request - Request to create or update branch protection.
- Collaborator
- A collaborator on a repository.
- Collaborator
Request - Request to add or update a collaborator.
- Collaborator
Response - Response with collaborator information.
- Create
Webhook Request - Request to create a webhook.
- OrgMember
- A member of an organization.
- Organization
- An organization for multi-user repository ownership.
- Permission
Grant - A permission grant for a specific resource.
- Team
- A team within an organization.
- Update
Webhook Request - Request to update a webhook.
- Webhook
- A webhook subscription for a repository.
- Webhook
Payload - Webhook delivery payload.
- Webhook
Repository - Repository information for webhook payloads.
Enums§
- Auth
Error - Errors that can occur in authorization operations.
- OrgRole
- Role within an organization.
- Permission
- Permission level for repository access.
- Webhook
Event - Events that can trigger webhooks.
Type Aliases§
- Result
- Result type for auth operations.