From 1fd3ae5123229f2e404aa4b70acf512ca51fa7fe Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Wed, 31 Dec 2025 21:57:03 +0100 Subject: [PATCH] docs: add CLAUDE.md for Claude Code integration --- .gitignore | 1 + CLAUDE.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 CLAUDE.md diff --git a/.gitignore b/.gitignore index 660ad3d..31bb341 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea +.claude /release coverage.txt diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..68e59e0 --- /dev/null +++ b/CLAUDE.md @@ -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.