Exemplo n.º 1
0
 def test_no_auth_plugin_parameters(self):
     # auth plugin (password / token) may not be present.
     post_data = {
         'identity': {
             'methods': ['password'],
         },
     }
     controllers.validate_issue_token_auth(post_data)
Exemplo n.º 2
0
 def test_no_auth_plugin_parameters(self):
     # auth plugin (password / token) may not be present.
     post_data = {
         'identity': {
             'methods': ['password'],
         },
     }
     controllers.validate_issue_token_auth(post_data)
Exemplo n.º 3
0
 def test_token(self):
     # valid token auth plugin data is supported.
     p = {
         'identity': {
             'methods': ['token'],
             'token': {
                 'id': 'something',
             },
         },
     }
     controllers.validate_issue_token_auth(p)
Exemplo n.º 4
0
 def test_token(self):
     # valid token auth plugin data is supported.
     p = {
         'identity': {
             'methods': ['token'],
             'token': {
                 'id': 'something',
             },
         },
     }
     controllers.validate_issue_token_auth(p)
Exemplo n.º 5
0
 def test_two_methods(self):
     post_data = {
         'identity': {
             'methods': ['password', 'mapped'],
             'password': {
                 'user': {
                     'name': 'admin',
                     'domain': {
                         'name': 'Default',
                     },
                     'password': '******',
                 },
             },
         },
     }
     controllers.validate_issue_token_auth(post_data)
Exemplo n.º 6
0
 def test_two_methods(self):
     post_data = {
         'identity': {
             'methods': ['password', 'mapped'],
             'password': {
                 'user': {
                     'name': 'admin',
                     'domain': {
                         'name': 'Default',
                     },
                     'password': '******',
                 },
             },
         },
     }
     controllers.validate_issue_token_auth(post_data)
Exemplo n.º 7
0
 def test_additional_properties(self):
     # Everything can have extra properties and they're ignored.
     p = {
         'identity': {
             'methods': ['password'],
             'password': {
                 'user': {
                     'id': 'whatever',
                     'extra4': 'whatever4',
                     'domain': {
                         'id': 'whatever',
                         'extra5': 'whatever5',
                     },
                 },
                 'extra3': 'whatever3',
             },
             'token': {
                 'id': 'something',
                 'extra9': 'whatever9',
             },
             'extra4': 'whatever4',
         },
         'scope': {
             'project': {
                 'id': 'something',
                 'domain': {
                     'id': 'something',
                     'extra8': 'whatever8',
                 },
                 'extra7': 'whatever7',
             },
             'domain': {
                 'id': 'something',
                 'extra9': 'whatever9',
             },
             'extra6': 'whatever6',
         },
         'extra2': 'whatever2',
     }
     controllers.validate_issue_token_auth(p)
Exemplo n.º 8
0
 def test_additional_properties(self):
     # Everything can have extra properties and they're ignored.
     p = {
         'identity': {
             'methods': ['password'],
             'password': {
                 'user': {
                     'id': 'whatever',
                     'extra4': 'whatever4',
                     'domain': {
                         'id': 'whatever',
                         'extra5': 'whatever5',
                     },
                 },
                 'extra3': 'whatever3',
             },
             'token': {
                 'id': 'something',
                 'extra9': 'whatever9',
             },
             'extra4': 'whatever4',
         },
         'scope': {
             'project': {
                 'id': 'something',
                 'domain': {
                     'id': 'something',
                     'extra8': 'whatever8',
                 },
                 'extra7': 'whatever7',
             },
             'domain': {
                 'id': 'something',
                 'extra9': 'whatever9',
             },
             'extra6': 'whatever6',
         },
         'extra2': 'whatever2',
     }
     controllers.validate_issue_token_auth(p)
Exemplo n.º 9
0
 def test_project_scoped(self):
     post_data = {
         'identity': {
             'methods': ['password'],
             'password': {
                 'user': {
                     'name': 'admin',
                     'domain': {
                         'name': 'Default',
                     },
                     'password': '******',
                 },
             },
         },
         'scope': {
             'project': {
                 'name': 'demo',
                 'domain': {
                     'name': 'Default',
                 },
             },
         },
     }
     controllers.validate_issue_token_auth(post_data)
Exemplo n.º 10
0
 def test_project_scoped(self):
     post_data = {
         'identity': {
             'methods': ['password'],
             'password': {
                 'user': {
                     'name': 'admin',
                     'domain': {
                         'name': 'Default',
                     },
                     'password': '******',
                 },
             },
         },
         'scope': {
             'project': {
                 'name': 'demo',
                 'domain': {
                     'name': 'Default',
                 },
             },
         },
     }
     controllers.validate_issue_token_auth(post_data)