Created
April 27, 2018 00:04
-
-
Save Celeo/69d8fc12ed082a2bffae702ddeb8ba73 to your computer and use it in GitHub Desktop.
Preston: scope(s) for operationId
This file contains hidden or 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
def print_scopes_for_op_id(preston, op_id): | |
path = p._get_path_for_op_id(op_id) | |
print(f'Path for operationId "{op_id}" is "{path}"') | |
path_spec = p._get_spec()['paths'][path] | |
for key in path_spec: | |
if path_spec[key].get('security'): | |
print(f'"{path} :: {key}" requires scopes: ' + ', '.join(path_spec[key]['security'][0]['evesso'])) | |
op_id = 'get_characters_character_id_stats' | |
p = Preston() | |
print_scopes_for_op_id(p, op_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ python get_scopes.py