Add an AppSpecificAuthToken data model for app-specific auth tokens. These will be used for the Docker CLI in place of username+password
This commit is contained in:
parent
53b762a875
commit
524d77f527
50 changed files with 943 additions and 289 deletions
|
@ -353,6 +353,9 @@ def initialize_database():
|
|||
|
||||
LogEntryKind.create(name='change_tag_expiration')
|
||||
|
||||
LogEntryKind.create(name='create_app_specific_token')
|
||||
LogEntryKind.create(name='revoke_app_specific_token')
|
||||
|
||||
ImageStorageLocation.create(name='local_eu')
|
||||
ImageStorageLocation.create(name='local_us')
|
||||
|
||||
|
@ -804,6 +807,11 @@ def populate_database(minimal=False, with_storage=False):
|
|||
model.service_keys.approve_service_key(key.kid, new_user_1, ServiceKeyApprovalType.SUPERUSER,
|
||||
notes='Test service key for local/test registry testing')
|
||||
|
||||
# Add an app specific token.
|
||||
token = model.appspecifictoken.create_token(new_user_1, 'some app')
|
||||
token.token_code = 'test'
|
||||
token.save()
|
||||
|
||||
model.log.log_action('org_create_team', org.username, performer=new_user_1,
|
||||
timestamp=week_ago, metadata={'team': 'readers'})
|
||||
|
||||
|
|
Reference in a new issue