-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding auth to the CLI * Adding auth to the documentation * '.' are removed from path * add defaults for missing swagger fields. * description and summary required * fixing tests
- Loading branch information
Showing
9 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,7 @@ API documentation | |
|
||
.. automodule:: hca.query | ||
:members: | ||
|
||
.. automodule:: hca.auth | ||
:members: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
Authorization and Authentication system | ||
*************************************** | ||
""" | ||
|
||
from __future__ import absolute_import, division, print_function, unicode_literals | ||
|
||
from ..util import SwaggerClient | ||
|
||
|
||
class AuthClient(SwaggerClient): | ||
""" | ||
Client for Authentication and Authorization System. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from __future__ import absolute_import, division, print_function, unicode_literals | ||
|
||
import sys | ||
|
||
from . import AuthClient | ||
|
||
|
||
def add_commands(subparsers, help_menu=False): | ||
auth_parser = subparsers.add_parser('auth', help="Interact with the HCA authorization and authentication system.") | ||
|
||
def help(args): | ||
auth_parser.print_help() | ||
|
||
if sys.version_info >= (2, 7, 9): # See https://bugs.python.org/issue9351 | ||
auth_parser.set_defaults(entry_point=help) | ||
auth_subparsers = auth_parser.add_subparsers() | ||
auth_cli_client = AuthClient() | ||
auth_cli_client.build_argparse_subparsers(auth_subparsers, help_menu=help_menu) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python | ||
# coding: utf-8 | ||
import os | ||
import sys | ||
import tempfile | ||
|
||
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')) # noqa | ||
sys.path.insert(0, pkg_root) # noqa | ||
|
||
import hca.auth | ||
import unittest | ||
|
||
TemporaryDirectory = tempfile.TemporaryDirectory | ||
|
||
|
||
class TestDssApi(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.client = hca.auth.AuthClient(swagger_url="https://auth.dev.data.humancellatlas.org/swagger.json") | ||
|
||
def test_smoke(self): | ||
self.client.get_well_known_openid_configuration(host="auth.dev.data.humancellatlas.org") | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |