Return hashes and expiration when fetching signed tags

This commit is contained in:
Evan Cordell 2017-04-07 16:12:28 -04:00
parent 1a78722521
commit 217b4a5ab2
5 changed files with 42 additions and 44 deletions

View file

@ -1,4 +1,5 @@
import pytest
from flask_principal import AnonymousIdentity
from endpoints.api import api
from endpoints.api.team import OrganizationTeamSyncing
@ -10,6 +11,7 @@ from test.fixtures import app, appconfig, database_uri, init_db_path, sqlitedb_f
TEAM_PARAMS = {'orgname': 'buynlarge', 'teamname': 'owners'}
BUILD_PARAMS = {'build_uuid': 'test-1234'}
REPO_PARAMS = {'repository': 'devtable/someapp'}
@pytest.mark.parametrize('resource,method,params,body,identity,expected', [
(OrganizationTeamSyncing, 'POST', TEAM_PARAMS, {}, None, 403),
@ -37,10 +39,9 @@ BUILD_PARAMS = {'build_uuid': 'test-1234'}
(SuperUserRepositoryBuildResource, 'GET', BUILD_PARAMS, None, 'reader', 403),
(SuperUserRepositoryBuildResource, 'GET', BUILD_PARAMS, None, 'devtable', 404),
(RepositorySignatures, 'GET', 401, None, None),
(RepositorySignatures, 'GET', 403, 'freshuser', None),
(RepositorySignatures, 'GET', 403, 'reader', None),
(RepositorySignatures, 'GET', 404, 'devtable', None),
(RepositorySignatures, 'GET', REPO_PARAMS, {}, 'freshuser', 403),
(RepositorySignatures, 'GET', REPO_PARAMS, {}, 'reader', 403),
(RepositorySignatures, 'GET', REPO_PARAMS, {}, 'devtable', 200),
])
def test_api_security(resource, method, params, body, identity, expected, client):
with client_with_identity(identity, client) as cl: