Merge branch 'claude-docs' into 'main'
docs: add CLAUDE.md for Claude Code integration See merge request unboundsoftware/shiny/authz_client!258
This commit was merged in pull request #261.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
.idea
|
.idea
|
||||||
|
.claude
|
||||||
/release
|
/release
|
||||||
coverage.txt
|
coverage.txt
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
```go
|
||||||
|
import client "gitlab.com/unboundsoftware/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 access
|
||||||
|
- `Company` - Company management
|
||||||
|
- `Consumer` - Consumer/customer access
|
||||||
|
- `Time` - Time tracking
|
||||||
|
- `Invoicing` - Invoice management
|
||||||
|
- `Accounting` - Accounting access
|
||||||
|
- `Supplier` - Supplier management
|
||||||
|
- `Salary` - 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.
|
||||||
Reference in New Issue
Block a user