#360 Include raw_config_urls and allowed_clients in /api/1/about response.
Merged 3 years ago by lsedlar. Opened 3 years ago by jkaluza.
jkaluza/odcs store-topleveldir  into  master

file modified
+6 -2
@@ -542,15 +542,19 @@ 

              - ``openidc`` - OpenIDC authorization is required.

              - ``kerberos_or_ssl`` - Kerberos or SSL authorization is required.

              - ``ssl`` - SSL authorization is required.

+         :resjson dict allowed_clients: Allowed clients in the same format as

+             in the ODCS server configuration file.

+         :resjson dict raw_config_urls: Raw config URLs in the same format as

+             in the ODCS server configuration file.

          :statuscode 200: Compose updated and returned.

          """

          json = {'version': version}

-         config_items = ['auth_backend']

+         config_items = ['auth_backend', 'allowed_clients', 'raw_config_urls']

          for item in config_items:

              config_item = getattr(conf, item)

              # All config items have a default, so if doesn't exist it is

              # an error

-             if not config_item:

+             if config_item is None:

                  raise ValueError(

                      'An invalid config item of "%s" was specified' % item)

              json[item] = config_item

file modified
+3 -1
@@ -266,7 +266,9 @@ 

          rv = self.client.get('/api/1/about/')

          data = json.loads(rv.get_data(as_text=True))

          self.assertEqual(

-             data, {'version': version, 'auth_backend': 'noauth'})

+             data,

+             {'version': version, 'auth_backend': 'noauth', 'raw_config_urls': {},

+              'allowed_clients': odcs.server.auth.conf.allowed_clients})

  

      def test_submit_invalid_json(self):

          with self.test_request_context(user='dev'):

I often have to open ansible roles/playbook to check what is the name
of particular raw_config_url key or if particular user/group is allowed
to do particular compose type.

I think this might be included in the /api/1/about response.

Makes sense. :thumbsup:

rebased onto 2d40a0d

3 years ago

Pull-Request has been merged by lsedlar

3 years ago