681afe2626
Remove GitLab CI linter configuration and update module path from `gitlab.com/unboundsoftware/shiny/authz_client` to `git.unbound.se/shiny/authz_client` in all relevant files. These changes reflect a migration to a new hosting service.
1.2 KiB
1.2 KiB
authz_client
Shared Go library for authorization service client integration.
Shared Documentation
@../docs/claude/architecture.md @../docs/claude/go-services.md @../docs/claude/conventions.md
Library Information
Purpose
Provides a client for the authz-service, handling privilege management for users across companies. Used by all microservices that need to check user permissions.
Usage
import client "git.unbound.se/shiny/authz_client"
// Create handler with options
handler := client.New(client.WithBaseURL("http://authz-service"))
// Check user privileges
privileges := handler.Get(email, companyID)
if privileges.Invoicing {
// User has invoicing privileges
}
Privileges
The CompanyPrivileges struct contains permission flags:
Admin- Administrative accessCompany- Company managementConsumer- Consumer/customer accessTime- Time trackingInvoicing- Invoice managementAccounting- Accounting accessSupplier- Supplier managementSalary- Salary/payroll access
Event Handling
Implements goamqp message handlers to receive privilege update events from the authz-service, keeping the local privilege cache up-to-date.