• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atlanticwave-sdx / sdx-lc / 11842262700

14 Nov 2024 05:20PM UTC coverage: 81.199%. Remained the same
11842262700

push

github

web-flow
Merge pull request #168 from atlanticwave-sdx/fix/issue_166

Missing change from PR 167

1205 of 1484 relevant lines covered (81.2%)

3.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/sdx_lc/controllers/authorization_controller.py
1
from typing import List
×
2

3
"""
4
controller generated to handled auth operation described at:
5
https://connexion.readthedocs.io/en/latest/security.html
6
"""
7

8
from connexion.exceptions import OAuthProblem
×
9

10
TOKEN_DB = {"asdf1234567890": {"uid": 100}}
×
11

12
# def check_api_key(api_key, required_scopes):
13
#    return {'test_key': 'test_value'}
14

15

16
def check_api_key(api_key, required_scopes):
×
17
    info = TOKEN_DB.get(api_key, None)
×
18

19
    if not info:
×
20
        raise OAuthProblem("Invalid api_key")
×
21

22
    return info
×
23

24

25
def get_secret(user) -> str:
×
26
    return "You are {user} and the secret is 'wbevuec'".format(user=user)
×
27

28

29
def check_topology_auth(token):
×
30
    return {"scopes": ["read:topology", "write:topology"], "uid": "test_value"}
×
31

32

33
def validate_scope_topology_auth(required_scopes, token_scopes):
×
34
    return set(required_scopes).issubset(set(token_scopes))
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc