Add some sort of oauth.
This commit is contained in:
parent
220649e579
commit
25ceb90fc6
13 changed files with 290 additions and 46 deletions
25
auth/scopes.py
Normal file
25
auth/scopes.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
READ_REPO = {
|
||||
'scope': 'repo:read',
|
||||
'description': ('Grants read-only access to all repositories for which the granting user or '
|
||||
' robot has access.')
|
||||
}
|
||||
|
||||
WRITE_REPO = {
|
||||
'scope': 'repo:write',
|
||||
'description': ('Grants read-write access to all repositories for which the granting user or '
|
||||
'robot has access, and is a superset of repo:read.')
|
||||
}
|
||||
|
||||
ADMIN_REPO = {
|
||||
'scope': 'repo:admin',
|
||||
'description': ('Grants administrator access to all repositories for which the granting user or '
|
||||
'robot has access, and is a superset of repo:read and repo:write.')
|
||||
}
|
||||
|
||||
CREATE_REPO = {
|
||||
'scope': 'repo:create',
|
||||
'description': ('Grants create repository access to all namespaces for which the granting user '
|
||||
'or robot is allowed to create repositories.')
|
||||
}
|
||||
|
||||
ALL_SCOPES = {scope['scope']:scope for scope in (READ_REPO, WRITE_REPO, ADMIN_REPO, CREATE_REPO)}
|
Reference in a new issue