Creating message api.
This commit is contained in:
parent
651639bb76
commit
002f533bf8
2 changed files with 13 additions and 3 deletions
|
@ -822,7 +822,7 @@ class SuperUserServiceKeyApproval(ApiResource):
|
|||
|
||||
@resource('/v1/superuser/messages')
|
||||
@show_if(features.SUPER_USERS)
|
||||
class ListMessages(ApiResource):
|
||||
class Messages(ApiResource):
|
||||
""" Resource for getting a list of super user messages """
|
||||
|
||||
schemas = {
|
||||
|
@ -850,10 +850,14 @@ class ListMessages(ApiResource):
|
|||
}
|
||||
|
||||
@nickname('getMessages')
|
||||
@require_scope(scopes.SUPERUSER)
|
||||
def get(self):
|
||||
""" Return a super users messages """
|
||||
messages = []
|
||||
return {
|
||||
'messages': messages,
|
||||
}
|
||||
|
||||
@require_scope(scopes.SUPERUSER)
|
||||
def post(self):
|
||||
""" Create a message """
|
||||
pass
|
||||
|
|
|
@ -65,7 +65,8 @@ from endpoints.api.permission import (RepositoryUserPermission, RepositoryTeamPe
|
|||
RepositoryTeamPermissionList, RepositoryUserPermissionList)
|
||||
from endpoints.api.superuser import (SuperUserLogs, SuperUserList, SuperUserManagement,
|
||||
SuperUserServiceKeyManagement, SuperUserServiceKey,
|
||||
SuperUserServiceKeyApproval, SuperUserTakeOwnership)
|
||||
SuperUserServiceKeyApproval, SuperUserTakeOwnership,
|
||||
Messages)
|
||||
from endpoints.api.secscan import RepositoryImageSecurity
|
||||
from endpoints.api.suconfig import (SuperUserRegistryStatus, SuperUserConfig, SuperUserConfigFile,
|
||||
SuperUserCreateInitialSuperUser)
|
||||
|
@ -4278,6 +4279,11 @@ class TestSuperUserManagement(ApiTestCase):
|
|||
self.assertEquals('freshuser', json['username'])
|
||||
self.assertEquals('foo@bar.com', json['email'])
|
||||
|
||||
def test_set_message(self):
|
||||
self.login(ADMIN_ACCESS_USER)
|
||||
|
||||
# Create a message
|
||||
self.postJsonResponse(Messages)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Reference in a new issue