Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Org member management APIs #51

Merged
merged 3 commits into from
Apr 7, 2025
Merged

Conversation

ChrisPenner
Copy link
Contributor

@ChrisPenner ChrisPenner commented Apr 4, 2025

Overview

Adds APIs for adding/removing org membership.

Being a member of an org gets you the default org permissions for all resources within that org.

You can also be granted explicit permissions to a specific org or project, but that's a different concept.

// GET members
GET /orgs/acme/members 

Response:
{
    "members": [
      {
        "avatarUrl": null,
        "handle": "test",
        "name": null,
        "userId": "U-<UUID>"
      },
      {
        "avatarUrl": "https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?f=y&d=retro",
        "handle": "transcripts",
        "name": "Transcript User",
        "userId": "U-<UUID>"
      }
    ]
  }


// Add new members with POST
POST /orgs/acme/members 
{
  "members": [
    "test"
  ]
}

Response (returns ALL members in the updated org):
{
    "members": [
      {
        "avatarUrl": null,
        "handle": "test",
        "name": null,
        "userId": "U-<UUID>"
      },
      {
        "avatarUrl": "https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?f=y&d=retro",
        "handle": "transcripts",
        "name": "Transcript User",
        "userId": "U-<UUID>"
      }
    ]
  }

// Remove members with DELETE
DELETE /orgs/acme/members 
{
  "members": [
    "test"
  ]
}

Response:
{
    "members": [
      {
        "avatarUrl": "https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?f=y&d=retro",
        "handle": "transcripts",
        "name": "Transcript User",
        "userId": "U-<UUID>"
      }
    ]
  }

Implementation notes

Adds the new APIs for updating org membership

Test coverage

New transcripts

@ChrisPenner ChrisPenner requested a review from hojberg April 7, 2025 17:29
@ChrisPenner ChrisPenner merged commit bfa8680 into main Apr 7, 2025
4 checks passed
@ChrisPenner ChrisPenner deleted the cp/org-member-management-apis branch April 7, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant