Add organization collaborators API endpoint
Adds an API endpoint, `/v1/organization/<orgname>/collaborators`, that lists an organization's "outside collaborators", i.e. users that have direct permissions on one or more repositories belonging to the organization, but who aren't members of any teams in the organization.
This commit is contained in:
parent
32a473d23c
commit
e8429f9194
3 changed files with 76 additions and 1 deletions
|
@ -4,6 +4,7 @@ import pytest
|
|||
from flask_principal import AnonymousIdentity
|
||||
|
||||
from endpoints.api import api
|
||||
from endpoints.api.organization import OrganizationCollaboratorList
|
||||
from endpoints.api.repositorynotification import RepositoryNotification
|
||||
from endpoints.api.permission import RepositoryUserTransitivePermission
|
||||
from endpoints.api.team import OrganizationTeamSyncing
|
||||
|
@ -19,6 +20,7 @@ from endpoints.test.shared import client_with_identity, toggle_feature
|
|||
|
||||
from test.fixtures import *
|
||||
|
||||
ORG_PARAMS = {'orgname': 'buynlarge'}
|
||||
TEAM_PARAMS = {'orgname': 'buynlarge', 'teamname': 'owners'}
|
||||
BUILD_PARAMS = {'build_uuid': 'test-1234'}
|
||||
REPO_PARAMS = {'repository': 'devtable/someapp'}
|
||||
|
@ -48,6 +50,11 @@ TRIGGER_PARAMS = {'repository': 'devtable/simple', 'trigger_uuid': 'someuuid'}
|
|||
(AppToken, 'DELETE', TOKEN_PARAMS, {}, 'reader', 404),
|
||||
(AppToken, 'DELETE', TOKEN_PARAMS, {}, 'devtable', 404),
|
||||
|
||||
(OrganizationCollaboratorList, 'GET', ORG_PARAMS, None, None, 401),
|
||||
(OrganizationCollaboratorList, 'GET', ORG_PARAMS, None, 'freshuser', 403),
|
||||
(OrganizationCollaboratorList, 'GET', ORG_PARAMS, None, 'reader', 403),
|
||||
(OrganizationCollaboratorList, 'GET', ORG_PARAMS, None, 'devtable', 200),
|
||||
|
||||
(OrganizationTeamSyncing, 'POST', TEAM_PARAMS, {}, None, 403),
|
||||
(OrganizationTeamSyncing, 'POST', TEAM_PARAMS, {}, 'freshuser', 403),
|
||||
(OrganizationTeamSyncing, 'POST', TEAM_PARAMS, {}, 'reader', 403),
|
||||
|
|
Reference in a new issue