Source code for keycloak.urls_patterns

# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (C) 2017 Marcos Pereira <marcospereira.mpj@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""Keycloak URL patterns."""

# OPENID URLS
[docs]URL_REALM = "realms/{realm-name}"
[docs]URL_WELL_KNOWN_BASE = "realms/{realm-name}/.well-known"
[docs]URL_WELL_KNOWN = URL_WELL_KNOWN_BASE + "/openid-configuration"
[docs]URL_TOKEN = "realms/{realm-name}/protocol/openid-connect/token"
[docs]URL_USERINFO = "realms/{realm-name}/protocol/openid-connect/userinfo"
[docs]URL_LOGOUT = "realms/{realm-name}/protocol/openid-connect/logout"
[docs]URL_CERTS = "realms/{realm-name}/protocol/openid-connect/certs"
[docs]URL_INTROSPECT = "realms/{realm-name}/protocol/openid-connect/token/introspect"
[docs]URL_ENTITLEMENT = "realms/{realm-name}/authz/entitlement/{resource-server-id}"
[docs]URL_AUTH = ( "{authorization-endpoint}?client_id={client-id}&response_type=code&redirect_uri={redirect-uri}" "&scope={scope}&state={state}" )
[docs]URL_DEVICE = "realms/{realm-name}/protocol/openid-connect/auth/device"
[docs]URL_CLIENT_REGISTRATION = URL_REALM + "/clients-registrations/default"
[docs]URL_CLIENT_UPDATE = URL_CLIENT_REGISTRATION + "/{client-id}"
# ADMIN URLS
[docs]URL_ADMIN_USERS = "admin/realms/{realm-name}/users"
[docs]URL_ADMIN_USERS_COUNT = "admin/realms/{realm-name}/users/count"
[docs]URL_ADMIN_USER = "admin/realms/{realm-name}/users/{id}"
[docs]URL_ADMIN_USER_CONSENTS = "admin/realms/{realm-name}/users/{id}/consents"
[docs]URL_ADMIN_SEND_UPDATE_ACCOUNT = "admin/realms/{realm-name}/users/{id}/execute-actions-email"
[docs]URL_ADMIN_SEND_VERIFY_EMAIL = "admin/realms/{realm-name}/users/{id}/send-verify-email"
[docs]URL_ADMIN_RESET_PASSWORD = "admin/realms/{realm-name}/users/{id}/reset-password"
[docs]URL_ADMIN_GET_SESSIONS = "admin/realms/{realm-name}/users/{id}/sessions"
[docs]URL_ADMIN_USER_ALL_ROLES = "admin/realms/{realm-name}/users/{id}/role-mappings"
[docs]URL_ADMIN_USER_CLIENT_ROLES = ( "admin/realms/{realm-name}/users/{id}/role-mappings/clients/{client-id}" )
[docs]URL_ADMIN_USER_REALM_ROLES = "admin/realms/{realm-name}/users/{id}/role-mappings/realm"
[docs]URL_ADMIN_USER_REALM_ROLES_AVAILABLE = ( "admin/realms/{realm-name}/users/{id}/role-mappings/realm/available" )
[docs]URL_ADMIN_USER_REALM_ROLES_COMPOSITE = ( "admin/realms/{realm-name}/users/{id}/role-mappings/realm/composite" )
[docs]URL_ADMIN_GROUPS_REALM_ROLES = "admin/realms/{realm-name}/groups/{id}/role-mappings/realm"
[docs]URL_ADMIN_GROUPS_CLIENT_ROLES = ( "admin/realms/{realm-name}/groups/{id}/role-mappings/clients/{client-id}" )
[docs]URL_ADMIN_USER_CLIENT_ROLES_AVAILABLE = ( "admin/realms/{realm-name}/users/{id}/role-mappings/clients/{client-id}/available" )
[docs]URL_ADMIN_USER_CLIENT_ROLES_COMPOSITE = ( "admin/realms/{realm-name}/users/{id}/role-mappings/clients/{client-id}/composite" )
[docs]URL_ADMIN_USER_GROUP = "admin/realms/{realm-name}/users/{id}/groups/{group-id}"
[docs]URL_ADMIN_USER_GROUPS = "admin/realms/{realm-name}/users/{id}/groups"
[docs]URL_ADMIN_USER_CREDENTIALS = "admin/realms/{realm-name}/users/{id}/credentials"
[docs]URL_ADMIN_USER_CREDENTIAL = "admin/realms/{realm-name}/users/{id}/credentials/{credential_id}"
[docs]URL_ADMIN_USER_LOGOUT = "admin/realms/{realm-name}/users/{id}/logout"
[docs]URL_ADMIN_USER_STORAGE = "admin/realms/{realm-name}/user-storage/{id}/sync"
[docs]URL_ADMIN_SERVER_INFO = "admin/serverinfo"
[docs]URL_ADMIN_GROUPS = "admin/realms/{realm-name}/groups"
[docs]URL_ADMIN_GROUPS_COUNT = "admin/realms/{realm-name}/groups/count"
[docs]URL_ADMIN_GROUP = "admin/realms/{realm-name}/groups/{id}"
[docs]URL_ADMIN_GROUP_BY_PATH = "admin/realms/{realm-name}/group-by-path/{path}"
[docs]URL_ADMIN_GROUP_CHILD = "admin/realms/{realm-name}/groups/{id}/children"
[docs]URL_ADMIN_GROUP_PERMISSIONS = "admin/realms/{realm-name}/groups/{id}/management/permissions"
[docs]URL_ADMIN_GROUP_MEMBERS = "admin/realms/{realm-name}/groups/{id}/members"
[docs]URL_ADMIN_CLIENT_INITIAL_ACCESS = "admin/realms/{realm-name}/clients-initial-access"
[docs]URL_ADMIN_CLIENTS = "admin/realms/{realm-name}/clients"
[docs]URL_ADMIN_CLIENT = URL_ADMIN_CLIENTS + "/{id}"
[docs]URL_ADMIN_CLIENTS_CLIENT_ID = URL_ADMIN_CLIENTS + "?clientId={client-id}"
[docs]URL_ADMIN_CLIENT_ALL_SESSIONS = URL_ADMIN_CLIENT + "/user-sessions"
[docs]URL_ADMIN_CLIENT_SECRETS = URL_ADMIN_CLIENT + "/client-secret"
[docs]URL_ADMIN_CLIENT_ROLES = URL_ADMIN_CLIENT + "/roles"
[docs]URL_ADMIN_CLIENT_ROLE = URL_ADMIN_CLIENT + "/roles/{role-name}"
[docs]URL_ADMIN_CLIENT_ROLES_COMPOSITE_CLIENT_ROLE = URL_ADMIN_CLIENT_ROLE + "/composites"
[docs]URL_ADMIN_CLIENT_ROLE_MEMBERS = URL_ADMIN_CLIENT + "/roles/{role-name}/users"
[docs]URL_ADMIN_CLIENT_ROLE_GROUPS = URL_ADMIN_CLIENT + "/roles/{role-name}/groups"
[docs]URL_ADMIN_CLIENT_MANAGEMENT_PERMISSIONS = URL_ADMIN_CLIENT + "/management/permissions"
[docs]URL_ADMIN_CLIENT_SCOPE_MAPPINGS_REALM_ROLES = URL_ADMIN_CLIENT + "/scope-mappings/realm"
[docs]URL_ADMIN_CLIENT_SCOPE_MAPPINGS_CLIENT_ROLES = ( URL_ADMIN_CLIENT + "/scope-mappings/clients/{client}" )
[docs]URL_ADMIN_CLIENT_OPTIONAL_CLIENT_SCOPES = URL_ADMIN_CLIENT + "/optional-client-scopes"
[docs]URL_ADMIN_CLIENT_OPTIONAL_CLIENT_SCOPE = ( URL_ADMIN_CLIENT_OPTIONAL_CLIENT_SCOPES + "/{client_scope_id}" )
[docs]URL_ADMIN_CLIENT_DEFAULT_CLIENT_SCOPES = URL_ADMIN_CLIENT + "/default-client-scopes"
[docs]URL_ADMIN_CLIENT_DEFAULT_CLIENT_SCOPE = ( URL_ADMIN_CLIENT_DEFAULT_CLIENT_SCOPES + "/{client_scope_id}" )
[docs]URL_ADMIN_CLIENT_AUTHZ = URL_ADMIN_CLIENT + "/authz/resource-server"
[docs]URL_ADMIN_CLIENT_AUTHZ_SETTINGS = URL_ADMIN_CLIENT_AUTHZ + "/settings"
[docs]URL_ADMIN_CLIENT_AUTHZ_RESOURCE = URL_ADMIN_CLIENT_AUTHZ + "/resource/{resource-id}"
[docs]URL_ADMIN_CLIENT_AUTHZ_RESOURCES = URL_ADMIN_CLIENT_AUTHZ + "/resource?max=-1"
[docs]URL_ADMIN_CLIENT_AUTHZ_SCOPES = URL_ADMIN_CLIENT_AUTHZ + "/scope?max=-1"
[docs]URL_ADMIN_CLIENT_AUTHZ_PERMISSIONS = URL_ADMIN_CLIENT_AUTHZ + "/permission?max=-1"
[docs]URL_ADMIN_CLIENT_AUTHZ_POLICIES = URL_ADMIN_CLIENT_AUTHZ + "/policy?max=-1&permission=false"
[docs]URL_ADMIN_CLIENT_AUTHZ_ROLE_BASED_POLICY = URL_ADMIN_CLIENT_AUTHZ + "/policy/role?max=-1"
[docs]URL_ADMIN_CLIENT_AUTHZ_RESOURCE_BASED_PERMISSION = ( URL_ADMIN_CLIENT_AUTHZ + "/permission/resource?max=-1" )
[docs]URL_ADMIN_CLIENT_AUTHZ_POLICY = URL_ADMIN_CLIENT_AUTHZ + "/policy/{policy-id}"
[docs]URL_ADMIN_CLIENT_AUTHZ_POLICY_SCOPES = URL_ADMIN_CLIENT_AUTHZ_POLICY + "/scopes"
[docs]URL_ADMIN_CLIENT_AUTHZ_POLICY_RESOURCES = URL_ADMIN_CLIENT_AUTHZ_POLICY + "/resources"
[docs]URL_ADMIN_CLIENT_AUTHZ_SCOPE_PERMISSION = URL_ADMIN_CLIENT_AUTHZ + "/permission/scope/{scope-id}"
[docs]URL_ADMIN_ADD_CLIENT_AUTHZ_SCOPE_PERMISSION = URL_ADMIN_CLIENT_AUTHZ + "/permission/scope?max=-1"
[docs]URL_ADMIN_CLIENT_AUTHZ_CLIENT_POLICY = URL_ADMIN_CLIENT_AUTHZ + "/policy/client"
[docs]URL_ADMIN_CLIENT_SERVICE_ACCOUNT_USER = URL_ADMIN_CLIENT + "/service-account-user"
[docs]URL_ADMIN_CLIENT_CERTS = URL_ADMIN_CLIENT + "/certificates/{attr}"
[docs]URL_ADMIN_CLIENT_INSTALLATION_PROVIDER = URL_ADMIN_CLIENT + "/installation/providers/{provider-id}"
[docs]URL_ADMIN_CLIENT_PROTOCOL_MAPPERS = URL_ADMIN_CLIENT + "/protocol-mappers/models"
[docs]URL_ADMIN_CLIENT_PROTOCOL_MAPPER = URL_ADMIN_CLIENT_PROTOCOL_MAPPERS + "/{protocol-mapper-id}"
[docs]URL_ADMIN_CLIENT_SCOPES = "admin/realms/{realm-name}/client-scopes"
[docs]URL_ADMIN_CLIENT_SCOPE = URL_ADMIN_CLIENT_SCOPES + "/{scope-id}"
[docs]URL_ADMIN_CLIENT_SCOPES_ADD_MAPPER = URL_ADMIN_CLIENT_SCOPE + "/protocol-mappers/models"
[docs]URL_ADMIN_CLIENT_SCOPES_MAPPERS = URL_ADMIN_CLIENT_SCOPES_ADD_MAPPER + "/{protocol-mapper-id}"
[docs]URL_ADMIN_REALM_ROLES = "admin/realms/{realm-name}/roles"
[docs]URL_ADMIN_REALM_ROLES_MEMBERS = URL_ADMIN_REALM_ROLES + "/{role-name}/users"
[docs]URL_ADMIN_REALM_ROLES_GROUPS = URL_ADMIN_REALM_ROLES + "/{role-name}/groups"
[docs]URL_ADMIN_REALMS = "admin/realms"
[docs]URL_ADMIN_REALM = "admin/realms/{realm-name}"
[docs]URL_ADMIN_IDPS = "admin/realms/{realm-name}/identity-provider/instances"
[docs]URL_ADMIN_IDP_MAPPERS = "admin/realms/{realm-name}/identity-provider/instances/{idp-alias}/mappers"
[docs]URL_ADMIN_IDP_MAPPER_UPDATE = URL_ADMIN_IDP_MAPPERS + "/{mapper-id}"
[docs]URL_ADMIN_IDP = "admin/realms/{realm-name}/identity-provider/instances/{alias}"
[docs]URL_ADMIN_REALM_ROLES_ROLE_BY_ID = URL_ADMIN_REALM + "/roles-by-id/{role-id}"
[docs]URL_ADMIN_REALM_ROLES_ROLE_BY_NAME = "admin/realms/{realm-name}/roles/{role-name}"
[docs]URL_ADMIN_REALM_ROLES_COMPOSITE_REALM_ROLE = ( "admin/realms/{realm-name}/roles/{role-name}/composites" )
[docs]URL_ADMIN_REALM_EXPORT = ( "admin/realms/{realm-name}/partial-export?exportClients={export-clients}&" + "exportGroupsAndRoles={export-groups-and-roles}" )
[docs]URL_ADMIN_REALM_PARTIAL_IMPORT = "admin/realms/{realm-name}/partialImport"
[docs]URL_ADMIN_DEFAULT_DEFAULT_CLIENT_SCOPES = URL_ADMIN_REALM + "/default-default-client-scopes"
[docs]URL_ADMIN_DEFAULT_DEFAULT_CLIENT_SCOPE = URL_ADMIN_DEFAULT_DEFAULT_CLIENT_SCOPES + "/{id}"
[docs]URL_ADMIN_DEFAULT_OPTIONAL_CLIENT_SCOPES = URL_ADMIN_REALM + "/default-optional-client-scopes"
[docs]URL_ADMIN_DEFAULT_OPTIONAL_CLIENT_SCOPE = URL_ADMIN_DEFAULT_OPTIONAL_CLIENT_SCOPES + "/{id}"
[docs]URL_ADMIN_FLOWS = "admin/realms/{realm-name}/authentication/flows"
[docs]URL_ADMIN_FLOW = URL_ADMIN_FLOWS + "/{id}"
[docs]URL_ADMIN_FLOWS_ALIAS = "admin/realms/{realm-name}/authentication/flows/{flow-id}"
[docs]URL_ADMIN_FLOWS_COPY = "admin/realms/{realm-name}/authentication/flows/{flow-alias}/copy"
[docs]URL_ADMIN_FLOWS_EXECUTIONS = ( "admin/realms/{realm-name}/authentication/flows/{flow-alias}/executions" )
[docs]URL_ADMIN_FLOWS_EXECUTION = "admin/realms/{realm-name}/authentication/executions/{id}"
[docs]URL_ADMIN_FLOWS_EXECUTIONS_EXECUTION = ( "admin/realms/{realm-name}/authentication/flows/{flow-alias}/executions/execution" )
[docs]URL_ADMIN_FLOWS_EXECUTIONS_FLOW = ( "admin/realms/{realm-name}/authentication/flows/{flow-alias}/executions/flow" )
[docs]URL_ADMIN_AUTHENTICATOR_PROVIDERS = ( "admin/realms/{realm-name}/authentication/authenticator-providers" )
[docs]URL_ADMIN_AUTHENTICATOR_CONFIG_DESCRIPTION = ( "admin/realms/{realm-name}/authentication/config-description/{provider-id}" )
[docs]URL_ADMIN_AUTHENTICATOR_CONFIG = "admin/realms/{realm-name}/authentication/config/{id}"
[docs]URL_ADMIN_COMPONENTS = "admin/realms/{realm-name}/components"
[docs]URL_ADMIN_COMPONENT = "admin/realms/{realm-name}/components/{component-id}"
[docs]URL_ADMIN_KEYS = "admin/realms/{realm-name}/keys"
[docs]URL_ADMIN_USER_FEDERATED_IDENTITIES = "admin/realms/{realm-name}/users/{id}/federated-identity"
[docs]URL_ADMIN_USER_FEDERATED_IDENTITY = ( "admin/realms/{realm-name}/users/{id}/federated-identity/{provider}" )
[docs]URL_ADMIN_USER_EVENTS = "admin/realms/{realm-name}/events"
[docs]URL_ADMIN_ADMIN_EVENTS = "admin/realms/{realm-name}/admin-events"
[docs]URL_ADMIN_EVENTS_CONFIG = URL_ADMIN_USER_EVENTS + "/config"
[docs]URL_ADMIN_CLIENT_SESSION_STATS = "admin/realms/{realm-name}/client-session-stats"
[docs]URL_ADMIN_GROUPS_CLIENT_ROLES_COMPOSITE = URL_ADMIN_GROUPS_CLIENT_ROLES + "/composite"
[docs]URL_ADMIN_REALM_ROLE_COMPOSITES = "admin/realms/{realm-name}/roles-by-id/{role-id}/composites"
[docs]URL_ADMIN_REALM_ROLE_COMPOSITES_REALM = URL_ADMIN_REALM_ROLE_COMPOSITES + "/realm"
[docs]URL_ADMIN_CLIENT_ROLE_CHILDREN = URL_ADMIN_REALM_ROLE_COMPOSITES + "/clients/{client-id}"
[docs]URL_ADMIN_CLIENT_CERT_UPLOAD = URL_ADMIN_CLIENT_CERTS + "/upload-certificate"
[docs]URL_ADMIN_REQUIRED_ACTIONS = URL_ADMIN_REALM + "/authentication/required-actions"
[docs]URL_ADMIN_REQUIRED_ACTIONS_ALIAS = URL_ADMIN_REQUIRED_ACTIONS + "/{action-alias}"
[docs]URL_ADMIN_ATTACK_DETECTION = "admin/realms/{realm-name}/attack-detection/brute-force/users"
[docs]URL_ADMIN_ATTACK_DETECTION_USER = ( "admin/realms/{realm-name}/attack-detection/brute-force/users/{id}" )
[docs]URL_ADMIN_CLEAR_KEYS_CACHE = URL_ADMIN_REALM + "/clear-keys-cache"
[docs]URL_ADMIN_CLEAR_REALM_CACHE = URL_ADMIN_REALM + "/clear-realm-cache"
[docs]URL_ADMIN_CLEAR_USER_CACHE = URL_ADMIN_REALM + "/clear-user-cache"
# UMA URLS
[docs]URL_UMA_WELL_KNOWN = URL_WELL_KNOWN_BASE + "/uma2-configuration"