target_audience¶
- igwn_auth_utils.scitokens.target_audience(url, include_any=True)¶
Return the expected
audclaim to authorize a request tourl.- Parameters:
- Returns:
audiences – A
listof audience values (str), either of length 1 ifinclude_any=False, otherwise of length 2.- Return type:
Examples
>>> default_audience( ... "https://datafind.ligo.org:443/LDR/services/data/v1/gwf.json", ... include_any=True, ... ) ["https://datafind.ligo.org", "ANY"] >>> default_audience( ... "segments.ligo.org", ... include_any=False, ... ) ["https://segments.ligo.org"]
Hostnames given without a URL scheme are presumed to be HTTPS:
>>> default_audience("datafind.ligo.org") ["https://datafind.ligo.org"]