wxc_sdk.scopes module

utility function to parse scopes from various input forms

wxc_sdk.scopes.parse_scopes(scopes: str) str[source]

parse various ways scopes might be defined.

Examples:

  • https://webexapis.com/v1/authorize?client_id=Ce429631..d4835&response_type=code&redirect_uri=http%3A%2F %2Flocalhost%3A6001%2Fredirect&scope=spark%3Acalls_write%20spark%3Akms%20spark%3Apeople_read%20spark %3Acalls_read%20spark-admin%3Atelephony_config_read&state=set_state_here’

  • ‘scope=spark%3Acalls_write%20spark%3Akms%20spark%3Apeople_read%20spark%3Acalls_read%20spark-admin %3Atelephony_config_read&state=set_state_here’

  • ‘spark%3Acalls_write%20spark%3Akms%20spark%3Apeople_read%20spark%3Acalls_read%20spark-admin %3Atelephony_config_read&state=set_state_here’

  • ‘spark%3Acalls_write%20spark%3Akms%20spark%3Apeople_read%20spark%3Acalls_read%20spark-admin %3Atelephony_config_read’

  • ‘spark:calls_write spark:kms spark:people_read spark:calls_read spark-admin:telephony_config_read’

Parameters

scopes (str) – scopes in one of the forms above

Returns

space separated list of scopes

Return type

str