Ensure absolute_uri are relative to WEBROOT.
Clean up the auth url to extract the exact Keystone URL
Returns the first endpoint region for first non-identity service.
Extracted from the service catalog.
Fix up the auth url if an invalid or no version prefix was given.
People still give a v2 auth_url even when they specify that they want v3 authentication. Fix the URL to say v3 in this case and add version if it is missing entirely. This should be smarter and use discovery.
Fix up the auth url if an invalid or no version prefix was given.
People still give a v2 auth_url even when they specify that they want v3 authentication. Fix the URL to say v3 in this case and add version if it is missing entirely. This should be smarter and use discovery.
Common function for getting the admin permissions from settings
This format is ‘openstack.roles.xxx’ and ‘xxx’ is a real role name.
Set object including all admin permission. If there is no permission, this will return empty. {
“openstack.roles.foo”, “openstack.roles.bar”, “openstack.roles.admin”
}
Common function for getting the admin roles from settings
Set object including all admin roles. If there is no role, this will return empty. {
“foo”, “bar”, “admin”
}
Common function for getting the region from endpoint.
In Keystone V3, region has been deprecated in favor of region_id.
This method provides a way to get region that works for both Keystone V2 and V3.
Common function for getting the permission froms arg
This format is ‘openstack.roles.xxx’ and ‘xxx’ is a real role name.
Return the keystone endpoint for initiating WebSSO.
Generate the keystone WebSSO endpoint that will redirect the user to the login page of the federated identity provider.
Based on the authentication type selected by the user in the login form, it will construct the keystone WebSSO endpoint.
Parameters: |
|
---|
)
}
The value of websso_auth will be looked up in the WEBSSO_IDP_MAPPING dictionary, if a match is found it will return a IdP specific WebSSO endpoint using the values found in the mapping.
The value in WEBSSO_IDP_MAPPING is expected to be a tuple formatted as (<idp_id>, <protocol_id>). Using the values found, a IdP/protocol specific URL will be constructed:
/auth/OS-FEDERATION/identity_providers/<idp_id> /protocols/<protocol_id>/websso
If no value is found from the WEBSSO_IDP_MAPPING dictionary, it will treat the value as the global WebSSO protocol <protocol_id> and construct the WebSSO URL by:
/auth/OS-FEDERATION/websso/<protocol_id>
Returns: | Keystone WebSSO endpoint. |
---|---|
Return type: | string |
Test if any of subs strings is present in the url path.
Return True if the url is a safe redirection.
The safe redirection means that it doesn’t point to a different host. Always returns False on an empty url.
Timezone-aware checking of the auth token’s expiration timestamp.
Returns True if the token has not yet expired, otherwise False.
Parameters: |
|
---|
Common function for setting the cookie in the response.
Provides a common policy of setting cookies for last used project and region, can be reused in other locations.
This method will set the cookie to expire in 365 days.