1
0
mirror of https://github.com/quay/quay.git synced 2025-07-28 20:22:05 +03:00

api: /v1/user/initialize to create first user (PROJQUAY-1926) (#771)

Add an unauthenticated API endpoint to create the initial user in the database. Usage is primarily intended for deployment automation.
This commit is contained in:
thomasmckay
2021-07-23 12:03:47 -04:00
committed by GitHub
parent fa0e861849
commit 6470248be1
11 changed files with 196 additions and 15 deletions

View File

@ -1265,7 +1265,7 @@ class TestCreateOrganization(ApiTestCase):
# Attempt with auth with invalid scope.
dt_user = model.user.get_user(ADMIN_ACCESS_USER)
token, code = model.oauth.create_access_token_for_testing(dt_user, "deadbeef", "repo:read")
token, code = model.oauth.create_user_access_token(dt_user, "deadbeef", "repo:read")
self.postResponse(
OrganizationList,
data=dict(name="neworg", email="testorg@example.com"),
@ -1274,7 +1274,7 @@ class TestCreateOrganization(ApiTestCase):
)
# Create OAuth token with user:admin scope.
token, code = model.oauth.create_access_token_for_testing(
token, code = model.oauth.create_user_access_token(
dt_user, "deadbeef", "user:admin", access_token="d" * 40
)
data = self.postResponse(