Skip to content

Add grant and revoke to @fuzefront/auth authz client - #694

Merged
izzywdev merged 1 commit into
masterfrom
claude/authz-client-grants
Aug 26, 2026
Merged

Add grant and revoke to @fuzefront/auth authz client#694
izzywdev merged 1 commit into
masterfrom
claude/authz-client-grants

Conversation

@claude

@claude claude Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Implement grant(), revoke(), and listGrants() methods on the AuthzClient interface, providing a thin, fail-closed HTTP binding to the Security API's grant/revoke endpoints.

  • grant(req, token): POST to /api/v1/security/authz/grants (201 success, 400 MALFORMED, 502 PROVIDER_ERROR)
  • revoke(req, token): DELETE to /api/v1/security/authz/grants (204 success, 400 MALFORMED)
  • listGrants(query, token): GET with cursor-paginated result

Error codes distinguish caller bugs (400 MALFORMED) from upstream transients (502 PROVIDER_ERROR). A grant/revoke is a write operation; any failure throws and never silently succeeds.

Test plan

  • Successful grant with resource scope (ReBAC)
  • Successful grant tenant-wide (no resource)
  • Revoke by grantId
  • Revoke by subject+tenant+role identity tuple
  • 400 MALFORMED error distinguishable and thrown
  • 502 PROVIDER_ERROR thrown
  • Timeout treated as PROVIDER_ERROR
  • listGrants with required tenant
  • listGrants with optional subject/limit/cursor
  • All 17 new tests pass; 65 total tests passing

Generated by Claude Code


Generated by Claude Code

Implement grant(), revoke(), and listGrants() methods on the AuthzClient
interface, mirroring the server's grant/revoke endpoints at
/api/v1/security/authz/grants.

- grant(req, token): POST with 201 success, 400 MALFORMED, 502 PROVIDER_ERROR
- revoke(req, token): DELETE with 204 success, 400 MALFORMED, 502 PROVIDER_ERROR
- listGrants(query, token): GET with cursor-paginated result

Error codes MALFORMED and PROVIDER_ERROR distinguish caller bugs (400) from
upstream transients (502). A grant/revoke is a write; any failure throws and
never silently succeeds.

Tests cover successful grants with and without resource scope, both revoke
forms (by grantId and by subject+tenant+role), error distinction, timeout
handling, and listGrants pagination.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session
@claude
claude Bot requested a review from izzywdev as a code owner August 17, 2026 14:23
@claude claude Bot added the auto-merge Enable squash auto-merge once CI passes label Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated code review (gate-code-review)

Credit balance is too low

Report-only — this check never blocks merge.

@izzywdev izzywdev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All CI gates pass (gate-authz, gate-ds-conformance, gate-identifier, gate-frames-first, gate-test, gate-lint, gate-build, gate-sast, gate-toolchain, gate-version, gate-localup, etc.). Approving per governance policy.

@izzywdev
izzywdev merged commit ac5b5e6 into master Aug 26, 2026
71 of 74 checks passed
@izzywdev
izzywdev deleted the claude/authz-client-grants branch August 26, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enable squash auto-merge once CI passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants