feat(access-api): add authenticated member role management API#70
Merged
Lakes41 merged 3 commits intoJun 29, 2026
Merged
Conversation
Lakes41
approved these changes
Jun 29, 2026
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #42
Add Authenticated Community Role Management Endpoints
Summary
This PR introduces authenticated API endpoints for assigning and removing member roles within a community. The new endpoints provide a secure, validated, and community-scoped mechanism for administrators to manage access rights without requiring direct database modifications.
Problem Statement
The Access API currently evaluates member roles during policy enforcement and access checks, but lacks a public API surface for managing those roles.
As a result:
Solution
This PR adds authenticated role management endpoints that allow authorized community administrators to:
New Endpoints
Assign Role
POST /v1/communities/:communityId/members/:wallet/roles
Assigns a supported role to a member within the specified community.
Validation
Remove Role
DELETE /v1/communities/:communityId/members/:wallet/roles/:role
Removes an existing role assignment from a member.
Validation
Authorization
Role mutations are restricted to authorized community administrators.
Unauthorized requests return:
depending on authentication and permission state.
Validation Rules
Community Validation
Requests targeting unknown communities return:
Wallet Validation
Invalid wallet identifiers return:
Role Validation
Unsupported or malformed roles return:
Duplicate Assignments
Duplicate role assignments are handled safely and do not create duplicate records.
The operation remains idempotent and returns a successful response.
Implementation Details
Routes
Updated:
apps/access-api/src/routes.ts
Services
Extended:
apps/access-api/src/services/memberService.ts
with role assignment and revocation functionality.
Shared Types
Updated:
packages/shared-types/src/index.ts
to expose role mutation request and response types.
SDK
Updated:
packages/sdk-lite/src/index.ts
to support role management operations from client applications.
Testing
Added comprehensive test coverage for:
Role Assignment
Role Removal
Authorization
Validation
Duplicate Handling
Acceptance Criteria