telemetry.auth.auth_wrapper
Docstring for telemetry.auth.auth_wrapper
This module is a wrapper around the core authentication logic found at telemetry.auth.auth
The wrapper is called directly (entry point at main()), and prints the results of the login call into stdout in json form.
Please note that, much like the core auth module, this module requires the relevant environment variables to be set, namely OIDC_ISSUER, OIDC_CLIENT_ID, and OIDC_CLIENT_SECRET.
1""" 2Docstring for telemetry.auth.auth_wrapper 3 4This module is a wrapper around the core authentication logic found at 5telemetry.auth.auth 6 7The wrapper is called directly (entry point at main()), and prints the 8results of the login call into stdout in json form. 9 10Please note that, much like the core auth module, this module requires 11the relevant environment variables to be set, namely OIDC_ISSUER, 12OIDC_CLIENT_ID, and OIDC_CLIENT_SECRET. 13""" 14 15import json 16 17from telemetry.auth.auth import google_login 18 19 20def main(): 21 sub, name, role = google_login() 22 output = { 23 "name": name, 24 "sub": sub, 25 "role": role.value 26 } 27 print(json.dumps(output)) 28 return 29 30if __name__ == "__main__": 31 main()
def
main():