diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 178bae23a0..dd0d20f798 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -145,6 +145,10 @@ jobs: fetch-depth: 0 # Critical for correct image detection in Makefile - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Set up Go 1.20 + uses: actions/setup-go@v2 + with: + go-version: "1.20" - name: Build and push fleet-manager-tools image to quay.io if: github.event_name == 'push' env: diff --git a/.secrets.baseline b/.secrets.baseline index 9b2ff95eec..413fcbb3c8 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -393,73 +393,6 @@ "line_number": 594 } ], - "pkg/client/iam/client_moq.go": [ - { - "type": "Secret Keyword", - "filename": "pkg/client/iam/client_moq.go", - "hashed_secret": "44e17306b837162269a410204daaa5ecee4ec22c", - "is_verified": false, - "line_number": 649 - }, - { - "type": "Secret Keyword", - "filename": "pkg/client/iam/client_moq.go", - "hashed_secret": "4595e0fe3be13544e523e5f6c1145f15007f7b58", - "is_verified": false, - "line_number": 650 - }, - { - "type": "Secret Keyword", - "filename": "pkg/client/iam/client_moq.go", - "hashed_secret": "539fbe365f6c0db26d473d85a736d318c2f565e5", - "is_verified": false, - "line_number": 991 - } - ], - "pkg/client/iam/gocloak_moq.go": [ - { - "type": "Secret Keyword", - "filename": "pkg/client/iam/gocloak_moq.go", - "hashed_secret": "44e17306b837162269a410204daaa5ecee4ec22c", - "is_verified": false, - "line_number": 9711 - }, - { - "type": "Secret Keyword", - "filename": "pkg/client/iam/gocloak_moq.go", - "hashed_secret": "7f0b58c8f07c09a5ed45a784a8e1ea4d3e983d59", - "is_verified": false, - "line_number": 9712 - }, - { - "type": "Secret Keyword", - "filename": "pkg/client/iam/gocloak_moq.go", - "hashed_secret": "9b8b876c2782fa992fab14095267bb8757b9fabc", - "is_verified": false, - "line_number": 13092 - }, - { - "type": "Secret Keyword", - "filename": "pkg/client/iam/gocloak_moq.go", - "hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", - "is_verified": false, - "line_number": 13095 - }, - { - "type": "Secret Keyword", - "filename": "pkg/client/iam/gocloak_moq.go", - "hashed_secret": "eb1b883e199141e362a143c51178ab8f09c87751", - "is_verified": false, - "line_number": 13716 - }, - { - "type": "Secret Keyword", - "filename": "pkg/client/iam/gocloak_moq.go", - "hashed_secret": "1b46ecc8fb47b1b39a420f00f08dbd58e0313188", - "is_verified": false, - "line_number": 14023 - } - ], "pkg/client/redhatsso/api/api/openapi.yaml": [ { "type": "Secret Keyword", @@ -493,70 +426,70 @@ "filename": "templates/service-template.yml", "hashed_secret": "13032f402fed753c2248419ea4f69f99931f6dbc", "is_verified": false, - "line_number": 524 + "line_number": 512 }, { "type": "Base64 High Entropy String", "filename": "templates/service-template.yml", "hashed_secret": "30025f80f6e22cdafb85db387d50f90ea884576a", "is_verified": false, - "line_number": 524 + "line_number": 512 }, { "type": "Base64 High Entropy String", "filename": "templates/service-template.yml", "hashed_secret": "355f24fd038bcaf85617abdcaa64af51ed19bbcf", "is_verified": false, - "line_number": 524 + "line_number": 512 }, { "type": "Base64 High Entropy String", "filename": "templates/service-template.yml", "hashed_secret": "3d8a1dcd2c3c765ce35c9a9552d23273cc4ddace", "is_verified": false, - "line_number": 524 + "line_number": 512 }, { "type": "Base64 High Entropy String", "filename": "templates/service-template.yml", "hashed_secret": "4ac7b0522761eba972467942cd5cd7499dd2c361", "is_verified": false, - "line_number": 524 + "line_number": 512 }, { "type": "Base64 High Entropy String", "filename": "templates/service-template.yml", "hashed_secret": "7639ab2a6bcf2ea30a055a99468c9cd844d4c22a", "is_verified": false, - "line_number": 524 + "line_number": 512 }, { "type": "Base64 High Entropy String", "filename": "templates/service-template.yml", "hashed_secret": "b56360daf4793d2a74991a972b34d95bc00fb2da", "is_verified": false, - "line_number": 524 + "line_number": 512 }, { "type": "Base64 High Entropy String", "filename": "templates/service-template.yml", "hashed_secret": "c9a73ef9ee8ce9f38437227801c70bcc6740d1a1", "is_verified": false, - "line_number": 524 + "line_number": 512 }, { "type": "Base64 High Entropy String", "filename": "templates/service-template.yml", "hashed_secret": "14736999d9940728c5294277831a702f7882dece", "is_verified": false, - "line_number": 561 + "line_number": 549 }, { "type": "Secret Keyword", "filename": "templates/service-template.yml", "hashed_secret": "4e199b4a1c40b497a95fcd1cd896351733849949", "is_verified": false, - "line_number": 708, + "line_number": 696, "is_secret": false } ], @@ -586,5 +519,5 @@ } ] }, - "generated_at": "2024-02-05T19:02:34Z" + "generated_at": "2024-03-07T13:45:14Z" } diff --git a/Makefile b/Makefile index f94c305974..e2da4c4eb3 100644 --- a/Makefile +++ b/Makefile @@ -50,8 +50,6 @@ ACSCS_NAMESPACE ?= acscs ENABLE_OCM_MOCK ?= false OCM_MOCK_MODE ?= emulate-server JWKS_URL ?= "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/certs" -SSO_BASE_URL ?="https://identity.api.stage.openshift.com" -SSO_REALM ?="rhoas" # update your realm here GO := go GOFMT := gofmt @@ -732,17 +730,12 @@ deploy/service: ENABLE_CENTRAL_EXTERNAL_CERTIFICATE ?= "false" deploy/service: ENABLE_CENTRAL_LIFE_SPAN ?= "false" deploy/service: CENTRAL_LIFE_SPAN ?= "48" deploy/service: OCM_URL ?= "https://api.stage.openshift.com" -deploy/service: SSO_BASE_URL ?= "https://identity.api.stage.openshift.com" -deploy/service: SSO_REALM ?= "rhoas" -deploy/service: MAX_LIMIT_FOR_SSO_GET_CLIENTS ?= "100" deploy/service: TOKEN_ISSUER_URL ?= "https://sso.redhat.com/auth/realms/redhat-external" deploy/service: SERVICE_PUBLIC_HOST_URL ?= "https://api.openshift.com" deploy/service: ENABLE_TERMS_ACCEPTANCE ?= "false" deploy/service: ENABLE_DENY_LIST ?= "false" deploy/service: ALLOW_EVALUATOR_INSTANCE ?= "true" deploy/service: QUOTA_TYPE ?= "quota-management-list" -deploy/service: CENTRAL_OPERATOR_OLM_INDEX_IMAGE ?= "quay.io/osd-addons/managed-central:production-82b42db" -deploy/service: FLEETSHARD_OLM_INDEX_IMAGE ?= "quay.io/osd-addons/fleetshard-operator:production-82b42db" deploy/service: OBSERVABILITY_CONFIG_REPO ?= "https://api.github.com/repos/bf2fc6cc711aee1a0c2a/observability-resources-mk/contents" deploy/service: OBSERVABILITY_CONFIG_CHANNEL ?= "resources" deploy/service: OBSERVABILITY_CONFIG_TAG ?= "main" @@ -769,9 +762,6 @@ deploy/service: deploy/envoy deploy/route -p OCM_URL="$(OCM_URL)" \ -p AMS_URL="${AMS_URL}" \ -p JWKS_URL="$(JWKS_URL)" \ - -p SSO_BASE_URL="$(SSO_BASE_URL)" \ - -p SSO_REALM="$(SSO_REALM)" \ - -p MAX_LIMIT_FOR_SSO_GET_CLIENTS="${MAX_LIMIT_FOR_SSO_GET_CLIENTS}" \ -p TOKEN_ISSUER_URL="${TOKEN_ISSUER_URL}" \ -p SERVICE_PUBLIC_HOST_URL="https://$(shell oc get routes/fleet-manager -o jsonpath="{.spec.host}" -n $(NAMESPACE))" \ -p OBSERVATORIUM_RHSSO_GATEWAY="${OBSERVATORIUM_RHSSO_GATEWAY}" \ @@ -784,8 +774,6 @@ deploy/service: deploy/envoy deploy/route -p ENABLE_TERMS_ACCEPTANCE="${ENABLE_TERMS_ACCEPTANCE}" \ -p ALLOW_EVALUATOR_INSTANCE="${ALLOW_EVALUATOR_INSTANCE}" \ -p QUOTA_TYPE="${QUOTA_TYPE}" \ - -p FLEETSHARD_OLM_INDEX_IMAGE="${FLEETSHARD_OLM_INDEX_IMAGE}" \ - -p CENTRAL_OPERATOR_OLM_INDEX_IMAGE="${CENTRAL_OPERATOR_OLM_INDEX_IMAGE}" \ -p DATAPLANE_CLUSTER_SCALING_TYPE="${DATAPLANE_CLUSTER_SCALING_TYPE}" \ -p CENTRAL_REQUEST_EXPIRATION_TIMEOUT="${CENTRAL_REQUEST_EXPIRATION_TIMEOUT}" \ | oc apply -f - -n $(NAMESPACE) diff --git a/dashboards/grafana-dashboard-acs-fleet-manager.configmap.yaml b/dashboards/grafana-dashboard-acs-fleet-manager.configmap.yaml index d21faa3fc1..29472e83da 100644 --- a/dashboards/grafana-dashboard-acs-fleet-manager.configmap.yaml +++ b/dashboards/grafana-dashboard-acs-fleet-manager.configmap.yaml @@ -36,7 +36,7 @@ data: "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": 413, - "iteration": 1664186027385, + "iteration": 1664186027399, "links": [], "liveNow": false, "panels": [ @@ -190,7 +190,7 @@ data: }, "gridPos": { "h": 8, - "w": 24, + "w": 16, "x": 0, "y": 8 }, @@ -237,6 +237,31 @@ data: "title": "Requests rate", "type": "timeseries" }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 8 + }, + "id": 13, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "* The jagged pattern for outbound requests rate\nis expected. Every ~6h, fleet manager sends\na number of requests (one per each organization)\nto AMS to check whether organizations still\nhave entitlement.", + "mode": "markdown" + }, + "pluginVersion": "9.3.8", + "title": "Requests rate: Legend", + "type": "text" + }, { "datasource": { "type": "prometheus", @@ -608,7 +633,7 @@ data: "type": "timeseries" } ], - "schemaVersion": 36, + "schemaVersion": 37, "style": "dark", "tags": [], "templating": { @@ -667,7 +692,7 @@ data: ] }, "time": { - "from": "now-12h", + "from": "now-14d", "to": "now" }, "timepicker": {}, diff --git a/docs/legacy/feature-flags.md b/docs/legacy/feature-flags.md index 699b1a745d..66b099fbaf 100644 --- a/docs/legacy/feature-flags.md +++ b/docs/legacy/feature-flags.md @@ -68,11 +68,8 @@ This lists the feature flags and their sub-configurations to enable/disable and - If this is set to `ams`, quotas will be managed via OCM's accounts management service (AMS). ## IAM -- **sso-debug** [Optional] Enables IAM debug logging. -- **sso-base-url** [Required]: The base URL of the IAM instance. - **redhat-sso-client-id-file** [Required]: The path to the file containing a RedHat SSO account client ID that has access to the ACS service accounts (default: `'secrets/redhatsso-service.clientId'`). - **redhat-sso-client-secret-file** [Required]: The path to the file containing a RedHat SSO account client secret that has access to the ACS service accounts (default: `'secrets/redhatsso-service.clientSecret'`). -- **sso-insecure** [Optional]: Disables IAM TLS verification ## Metrics Server - **enable-metrics-https**: Enables HTTPS for the metrics server. @@ -117,16 +114,6 @@ This lists the feature flags and their sub-configurations to enable/disable and - `providers-config-file` [Required]: The path to the file containing a list of supported cloud providers that the service can provision dataplane clusters to (default: `'config/provider-configuration.yaml'`, example: [provider-configuration.yaml](../config/provider-configuration.yaml)). - `cluster-compute-machine-type` [Optional]: The compute machine type to be used for provisioning a new dataplane cluster (default: `m5.2xlarge`). - `cluster-openshift-version` [Optional]: The OpenShift version to be installed on the dataplane cluster (default: `""`, empty string indicates that the latest stable version will be used). -- **central-operator-cs-namespace**: Central operator catalog source namespace. -- **central-operator-index-image**: Central operator index image name -- **central-operator-namespace**: Central operator namespace -- **central-operator-package**: Central operator package name -- **central-operator-sub-channel**: Central operator subscription channel -- **fleetshard-operator-cs-namespace**: fleetshard operator catalog source namespace -- **fleetshard-operator-index-image**: fleetshard operator index image name -- **fleetshard-operator-namespace**: fleetshard operator namespace -- **fleetshard-operator-package**: fleetshard operator package name -- **fleetshard-operator-sub-channel**: fleetshard operator subscription channel ## Sentry - **enable-sentry**: Enables Sentry error reporting. diff --git a/dp-terraform/helm/Dockerfile b/dp-terraform/helm/Dockerfile index 0a26eb6e0a..61549d64f6 100644 --- a/dp-terraform/helm/Dockerfile +++ b/dp-terraform/helm/Dockerfile @@ -21,7 +21,7 @@ RUN microdnf install gzip tar && \ chmod +x /usr/local/bin/yq && \ rm /tmp/yq_linux_amd64.tar.gz && \ cd rhacs-terraform/charts && for filename in *.tgz; do tar -xf "$filename" && rm -f "$filename"; done && \ - yq -i 'del(.securityContext.runAsUser) | del(.webhook.securityContext.runAsUser) | del(.certController.securityContext.runAsUser)' external-secrets/values.yaml + yq -i 'del(.securityContext.runAsUser)' external-secrets/values.yaml ARG FLEETSHARD_SYNC_IMAGE_TAG=main RUN yq -i ".fleetshardSync.image.tag = strenv(FLEETSHARD_SYNC_IMAGE_TAG)" rhacs-terraform/values.yaml diff --git a/dp-terraform/helm/rhacs-terraform/charts/secured-cluster/templates/secured-cluster-cr.yaml b/dp-terraform/helm/rhacs-terraform/charts/secured-cluster/templates/secured-cluster-cr.yaml index 51af5a2e9b..e3631ffeb5 100644 --- a/dp-terraform/helm/rhacs-terraform/charts/secured-cluster/templates/secured-cluster-cr.yaml +++ b/dp-terraform/helm/rhacs-terraform/charts/secured-cluster/templates/secured-cluster-cr.yaml @@ -76,3 +76,32 @@ spec: {{- if .Values.scanner.db.nodeSelector }} nodeSelector: {{ toYaml .Values.scanner.db.nodeSelector | nindent 8 }} {{- end }} + + scannerV4: + {{- if .Values.scannerV4.scannerComponent }} + scannerComponent: {{ .Values.scannerV4.scannerComponent }} + {{- end }} + indexer: + {{- if .Values.scannerV4.indexer.resources }} + resources: {{ toYaml .Values.scannerV4.indexer.resources | nindent 8 }} + {{- end }} + {{- if .Values.scannerV4.indexer.tolerations }} + tolerations: {{ toYaml .Values.scannerV4.indexer.tolerations | nindent 8 }} + {{- end }} + {{- if .Values.scannerV4.indexer.nodeSelector }} + nodeSelector: {{ toYaml .Values.scannerV4.indexer.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.scannerV4.indexer.scaling }} + scaling: {{ toYaml .Values.scannerV4.indexer.scaling | nindent 8 }} + {{- end }} + + db: + {{- if .Values.scannerV4.db.resources }} + resources: {{ toYaml .Values.scannerV4.db.resources | nindent 8 }} + {{- end }} + {{- if .Values.scannerV4.db.tolerations }} + tolerations: {{ toYaml .Values.scannerV4.db.tolerations | nindent 8 }} + {{- end }} + {{- if .Values.scannerV4.db.nodeSelector }} + nodeSelector: {{ toYaml .Values.scannerV4.db.nodeSelector | nindent 8 }} + {{- end }} diff --git a/dp-terraform/helm/rhacs-terraform/charts/secured-cluster/values.yaml b/dp-terraform/helm/rhacs-terraform/charts/secured-cluster/values.yaml index 1e358fa909..63765831a0 100644 --- a/dp-terraform/helm/rhacs-terraform/charts/secured-cluster/values.yaml +++ b/dp-terraform/helm/rhacs-terraform/charts/secured-cluster/values.yaml @@ -16,10 +16,10 @@ admissionControl: collector: resources: requests: - memory: 200Mi + memory: 350Mi cpu: 10m limits: - memory: 200Mi + memory: 350Mi collection: "CORE_BPF" compliance: resources: @@ -51,6 +51,15 @@ scanner: requests: memory: 100Mi cpu: 100m +scannerV4: + scannerComponent: null + indexer: + tolerations: [] + nodeSelector: {} + scaling: null + db: + tolerations: [] + nodeSelector: {} sensor: resources: requests: diff --git a/dp-terraform/helm/rhacs-terraform/templates/acs-operator.yaml b/dp-terraform/helm/rhacs-terraform/templates/acs-operator.yaml deleted file mode 100644 index 98221cc476..0000000000 --- a/dp-terraform/helm/rhacs-terraform/templates/acs-operator.yaml +++ /dev/null @@ -1,43 +0,0 @@ -## TODO(ROX-16646): drop acs-operator.yaml template -{{- if .Values.acsOperator.enabled }} -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: rhacs-operator - namespace: {{ .Release.Namespace }} ---- -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: rhacs-operator - namespace: {{ .Release.Namespace }} -spec: - channel: {{ .Values.acsOperator.channel }} - installPlanApproval: Manual - name: rhacs-operator - source: {{ .Values.acsOperator.source }} - sourceNamespace: {{ .Values.acsOperator.sourceNamespace }} - startingCSV: rhacs-operator.{{ .Values.acsOperator.version }} - config: - resources: - requests: - cpu: 1 - memory: 200Mi - limits: - cpu: 2 - memory: 1Gi ---- -{{- if .Values.acsOperator.upstream }} -apiVersion: operators.coreos.com/v1alpha1 -kind: CatalogSource -metadata: - name: {{ .Values.acsOperator.source }} - namespace: openshift-marketplace -spec: - displayName: 'RHACS Development' - publisher: 'Red Hat ACS' - sourceType: grpc - image: "{{ .Values.acsOperator.repository }}/stackrox-operator-index:{{ .Values.acsOperator.version }}" ---- -{{- end }} -{{- end }} diff --git a/dp-terraform/helm/rhacs-terraform/values.yaml b/dp-terraform/helm/rhacs-terraform/values.yaml index 614d7f7e72..737bc57901 100644 --- a/dp-terraform/helm/rhacs-terraform/values.yaml +++ b/dp-terraform/helm/rhacs-terraform/values.yaml @@ -64,16 +64,6 @@ fleetshardSync: addonAutoUpgradeEnabled: true addonName: acs-fleetshard -acsOperator: - enabled: false - channel: latest - repository: quay.io/rhacs-eng - source: redhat-operators - sourceNamespace: openshift-marketplace - version: v3.70.0 - # This setting specifies whether to use a upstream operator to test unreleased versions of ACS. - upstream: false - # See available parameters in charts/cloudwatch/values.yaml # - enabled flag is used to completely enable/disable cloudwatch sub-chart cloudwatch: @@ -194,7 +184,37 @@ secured-cluster: nodeSelector: node-role.kubernetes.io/acscs-infra: "" scanner: - scannerComponent: Disabled + scannerComponent: AutoSense + db: + tolerations: + - key: node-role.kubernetes.io/acscs-infra + operator: Exists + effect: NoSchedule + nodeSelector: + node-role.kubernetes.io/acscs-infra: "" + analyzer: + tolerations: + - key: node-role.kubernetes.io/acscs-infra + operator: Exists + effect: NoSchedule + nodeSelector: + node-role.kubernetes.io/acscs-infra: "" + scannerV4: + scannerComponent: AutoSense + db: + tolerations: + - key: node-role.kubernetes.io/acscs-infra + operator: Exists + effect: NoSchedule + nodeSelector: + node-role.kubernetes.io/acscs-infra: "" + indexer: + tolerations: + - key: node-role.kubernetes.io/acscs-infra + operator: Exists + effect: NoSchedule + nodeSelector: + node-role.kubernetes.io/acscs-infra: "" external-secrets: fullnameOverride: rhacs-external-secrets @@ -205,17 +225,9 @@ external-secrets: securityContext: runAsUser: null webhook: - securityContext: - runAsUser: null - image: - repository: quay.io/app-sre/external-secrets - tag: v0.9.5 + create: false certController: - securityContext: - runAsUser: null - image: - repository: quay.io/app-sre/external-secrets - tag: v0.9.5 + create: false tolerations: - key: node-role.kubernetes.io/acscs-infra operator: Exists diff --git a/fleetshard/pkg/central/charts/data/tenant-resources/templates/egress-proxy.yaml b/fleetshard/pkg/central/charts/data/tenant-resources/templates/egress-proxy.yaml index 857d967b00..b244f257fa 100644 --- a/fleetshard/pkg/central/charts/data/tenant-resources/templates/egress-proxy.yaml +++ b/fleetshard/pkg/central/charts/data/tenant-resources/templates/egress-proxy.yaml @@ -109,6 +109,12 @@ spec: - podSelector: matchLabels: app: scanner + - podSelector: + matchLabels: + app: scanner-v4-matcher + - podSelector: + matchLabels: + app: scanner-v4-indexer ports: - port: 3128 protocol: TCP diff --git a/fleetshard/pkg/central/reconciler/proxy.go b/fleetshard/pkg/central/reconciler/proxy.go index e8e4902cfe..7832c5b041 100644 --- a/fleetshard/pkg/central/reconciler/proxy.go +++ b/fleetshard/pkg/central/reconciler/proxy.go @@ -21,9 +21,12 @@ func getProxyEnvVars(namespace string, additionalNoProxyTargets ...url.URL) []co } directServicesAndPorts := map[string][]int{ - "central": {443}, - "scanner": {8080, 8443}, - "scanner-db": {5432}, + "central": {443}, + "scanner": {8080, 8443}, + "scanner-db": {5432}, + "scanner-v4-db": {5432}, + "scanner-v4-indexer": {8443}, + "scanner-v4-matcher": {8443}, } var noProxyTargets []string for svcName, ports := range directServicesAndPorts { diff --git a/fleetshard/pkg/central/reconciler/reconciler_test.go b/fleetshard/pkg/central/reconciler/reconciler_test.go index 8e2a9dec5c..10ca153e5e 100644 --- a/fleetshard/pkg/central/reconciler/reconciler_test.go +++ b/fleetshard/pkg/central/reconciler/reconciler_test.go @@ -2117,11 +2117,11 @@ func TestReconciler_applyProxyConfig(t *testing.T) { }, { Name: "no_proxy", - Value: "central.namespace.svc:443,central.namespace:443,central:443,host:9000,kubernetes.default.svc.cluster.local.:443,scanner-db.namespace.svc:5432,scanner-db.namespace:5432,scanner-db:5432,scanner.namespace.svc:8080,scanner.namespace.svc:8443,scanner.namespace:8080,scanner.namespace:8443,scanner:8080,scanner:8443", + Value: "central.namespace.svc:443,central.namespace:443,central:443,host:9000,kubernetes.default.svc.cluster.local.:443,scanner-db.namespace.svc:5432,scanner-db.namespace:5432,scanner-db:5432,scanner-v4-db.namespace.svc:5432,scanner-v4-db.namespace:5432,scanner-v4-db:5432,scanner-v4-indexer.namespace.svc:8443,scanner-v4-indexer.namespace:8443,scanner-v4-indexer:8443,scanner-v4-matcher.namespace.svc:8443,scanner-v4-matcher.namespace:8443,scanner-v4-matcher:8443,scanner.namespace.svc:8080,scanner.namespace.svc:8443,scanner.namespace:8080,scanner.namespace:8443,scanner:8080,scanner:8443", }, { Name: "NO_PROXY", - Value: "central.namespace.svc:443,central.namespace:443,central:443,host:9000,kubernetes.default.svc.cluster.local.:443,scanner-db.namespace.svc:5432,scanner-db.namespace:5432,scanner-db:5432,scanner.namespace.svc:8080,scanner.namespace.svc:8443,scanner.namespace:8080,scanner.namespace:8443,scanner:8080,scanner:8443", + Value: "central.namespace.svc:443,central.namespace:443,central:443,host:9000,kubernetes.default.svc.cluster.local.:443,scanner-db.namespace.svc:5432,scanner-db.namespace:5432,scanner-db:5432,scanner-v4-db.namespace.svc:5432,scanner-v4-db.namespace:5432,scanner-v4-db:5432,scanner-v4-indexer.namespace.svc:8443,scanner-v4-indexer.namespace:8443,scanner-v4-indexer:8443,scanner-v4-matcher.namespace.svc:8443,scanner-v4-matcher.namespace:8443,scanner-v4-matcher:8443,scanner.namespace.svc:8080,scanner.namespace.svc:8443,scanner.namespace:8080,scanner.namespace:8443,scanner:8080,scanner:8443", }, }) } @@ -2248,10 +2248,10 @@ metadata: Value: "http://egress-proxy.rhacs.svc:3128", }, { Name: "no_proxy", - Value: ":0,central.rhacs.svc:443,central.rhacs:443,central:443,kubernetes.default.svc.cluster.local.:443,scanner-db.rhacs.svc:5432,scanner-db.rhacs:5432,scanner-db:5432,scanner.rhacs.svc:8080,scanner.rhacs.svc:8443,scanner.rhacs:8080,scanner.rhacs:8443,scanner:8080,scanner:8443", + Value: ":0,central.rhacs.svc:443,central.rhacs:443,central:443,kubernetes.default.svc.cluster.local.:443,scanner-db.rhacs.svc:5432,scanner-db.rhacs:5432,scanner-db:5432,scanner-v4-db.rhacs.svc:5432,scanner-v4-db.rhacs:5432,scanner-v4-db:5432,scanner-v4-indexer.rhacs.svc:8443,scanner-v4-indexer.rhacs:8443,scanner-v4-indexer:8443,scanner-v4-matcher.rhacs.svc:8443,scanner-v4-matcher.rhacs:8443,scanner-v4-matcher:8443,scanner.rhacs.svc:8080,scanner.rhacs.svc:8443,scanner.rhacs:8080,scanner.rhacs:8443,scanner:8080,scanner:8443", }, { Name: "NO_PROXY", - Value: ":0,central.rhacs.svc:443,central.rhacs:443,central:443,kubernetes.default.svc.cluster.local.:443,scanner-db.rhacs.svc:5432,scanner-db.rhacs:5432,scanner-db:5432,scanner.rhacs.svc:8080,scanner.rhacs.svc:8443,scanner.rhacs:8080,scanner.rhacs:8443,scanner:8080,scanner:8443", + Value: ":0,central.rhacs.svc:443,central.rhacs:443,central:443,kubernetes.default.svc.cluster.local.:443,scanner-db.rhacs.svc:5432,scanner-db.rhacs:5432,scanner-db:5432,scanner-v4-db.rhacs.svc:5432,scanner-v4-db.rhacs:5432,scanner-v4-db:5432,scanner-v4-indexer.rhacs.svc:8443,scanner-v4-indexer.rhacs:8443,scanner-v4-indexer:8443,scanner-v4-matcher.rhacs.svc:8443,scanner-v4-matcher.rhacs:8443,scanner-v4-matcher:8443,scanner.rhacs.svc:8080,scanner.rhacs.svc:8443,scanner.rhacs:8080,scanner.rhacs:8443,scanner:8080,scanner:8443", }, }, }, diff --git a/go.mod b/go.mod index 8b7f160e21..2ba8580811 100644 --- a/go.mod +++ b/go.mod @@ -4,20 +4,18 @@ go 1.20 require ( github.com/DATA-DOG/go-sqlmock v1.5.1 - github.com/Nerzal/gocloak/v11 v11.2.0 github.com/antihax/optional v1.0.0 - github.com/auth0/go-jwt-middleware/v2 v2.2.0 - github.com/aws/aws-sdk-go v1.50.10 + github.com/auth0/go-jwt-middleware/v2 v2.2.1 + github.com/aws/aws-sdk-go v1.50.34 github.com/bxcodec/faker/v3 v3.8.1 github.com/caarlos0/env/v6 v6.10.1 github.com/containers/image v3.0.2+incompatible github.com/coreos/go-oidc/v3 v3.9.0 github.com/docker/go-healthcheck v0.1.0 - github.com/getsentry/sentry-go v0.26.0 + github.com/getsentry/sentry-go v0.27.0 github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 github.com/go-gormigrate/gormigrate/v2 v2.1.1 github.com/go-logr/logr v1.4.1 - github.com/go-resty/resty/v2 v2.11.0 github.com/goava/di v1.11.1 github.com/gogo/protobuf v1.3.2 github.com/golang-jwt/jwt/v4 v4.5.0 @@ -25,7 +23,7 @@ require ( github.com/golang/protobuf v1.5.3 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 - github.com/gorilla/handlers v1.5.1 + github.com/gorilla/handlers v1.5.2 github.com/gorilla/mux v1.8.1 github.com/hashicorp/go-multierror v1.1.1 github.com/lib/pq v1.10.9 @@ -33,15 +31,15 @@ require ( github.com/olekukonko/tablewriter v0.0.5 github.com/onsi/ginkgo/v2 v2.15.0 github.com/onsi/gomega v1.31.1 - github.com/openshift-online/ocm-sdk-go v0.1.401 + github.com/openshift-online/ocm-sdk-go v0.1.405 github.com/openshift/addon-operator/apis v0.0.0-20231110045543-dd01f2f5c184 github.com/openshift/api v0.0.0-20231117201702-2ea16bbab164 - github.com/operator-framework/api v0.20.0 + github.com/operator-framework/api v0.22.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 github.com/prometheus/client_golang v1.18.0 - github.com/prometheus/client_model v0.5.0 + github.com/prometheus/client_model v0.6.0 github.com/prometheus/common v0.46.0 github.com/redhat-developer/app-services-sdk-core/app-services-sdk-go/serviceaccountmgmt v0.0.0-20230323122535-49460b57cc45 github.com/rs/xid v1.5.0 @@ -56,7 +54,7 @@ require ( github.com/zgalor/weberr v0.8.2 golang.org/x/exp v0.0.0-20240110193028-0dcbfd608b1e golang.org/x/net v0.21.0 - golang.org/x/oauth2 v0.16.0 + golang.org/x/oauth2 v0.17.0 golang.org/x/sync v0.6.0 golang.org/x/sys v0.17.0 gopkg.in/resty.v1 v1.12.0 @@ -64,8 +62,8 @@ require ( gorm.io/driver/postgres v1.5.4 gorm.io/gorm v1.25.6 helm.sh/helm/v3 v3.14.1 - k8s.io/api v0.29.1 - k8s.io/apimachinery v0.29.1 + k8s.io/api v0.29.2 + k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.1 k8s.io/utils v0.0.0-20240102154912-e7106e64919e sigs.k8s.io/controller-runtime v0.17.2 @@ -134,14 +132,12 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.66.0-rhobs1 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/segmentio/analytics-go/v3 v3.3.0 // indirect github.com/segmentio/backo-go v1.0.1 // indirect - github.com/segmentio/ksuid v1.0.4 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect diff --git a/go.sum b/go.sum index 4fb0d896c7..30e10a8e52 100644 --- a/go.sum +++ b/go.sum @@ -70,16 +70,14 @@ github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0 github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/Nerzal/gocloak/v11 v11.2.0 h1:i67+hsEhSaolpJi1YKgwqH4dtSd8IdfHiEluxSEMm/U= -github.com/Nerzal/gocloak/v11 v11.2.0/go.mod h1:vz59u7bBDKWoCdeTpY8i4LELtdwrLrIynAgPvO5ogQA= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/auth0/go-jwt-middleware/v2 v2.2.0 h1:4WTpcHh+VZJOLEnS4E+hh+vP96Jy1tSbJOMnbJ29/KI= -github.com/auth0/go-jwt-middleware/v2 v2.2.0/go.mod h1:BFCz+RF+1szSkrGNJLYn2ng2PtfzBiKR6fynTvS2A/k= -github.com/aws/aws-sdk-go v1.50.10 h1:H3NQvqRUKG+9oysCKTIyylpkqfPA7MiBtzTnu/cIGqE= -github.com/aws/aws-sdk-go v1.50.10/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/auth0/go-jwt-middleware/v2 v2.2.1 h1:pqxEIwlCztD0T9ZygGfOrw4NK/F9iotnCnPJVADKbkE= +github.com/auth0/go-jwt-middleware/v2 v2.2.1/go.mod h1:CSi0tuu0QrALbWdiQZwqFL8SbBhj4e2MJzkvNfjY0Us= +github.com/aws/aws-sdk-go v1.50.34 h1:J1LjHzWNN/yVxQDTr0NIlI5vz9xRPvWiNCjQ4+5wh58= +github.com/aws/aws-sdk-go v1.50.34/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -149,14 +147,13 @@ github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1u0KQro= github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/getsentry/sentry-go v0.26.0 h1:IX3++sF6/4B5JcevhdZfdKIHfyvMmAq/UnqcyT2H6mA= -github.com/getsentry/sentry-go v0.26.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 h1:Mn26/9ZMNWSw9C9ERFA1PUxfmGpolnw2v0bKOREu5ew= github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I= @@ -181,9 +178,6 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= -github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= -github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v2.20.0+incompatible h1:4Xh3bDzO29j4TWNOI+24ubc0vbVFMg2PMnXKxK54/CA= @@ -194,7 +188,6 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -300,8 +293,8 @@ github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/schema v1.2.1 h1:tjDxcmdb+siIqkTNoV+qRH2mjYdr2hHe5MKXbp61ziM= @@ -413,8 +406,8 @@ github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYG github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/openshift-online/ocm-sdk-go v0.1.401 h1:bnQGsiixlqcBuXUEQtK3cOxWWJO6nY6FGdpVhJyfdeY= -github.com/openshift-online/ocm-sdk-go v0.1.401/go.mod h1:tke8vKcE7eHKyRbkJv6qo4ljo919zhx04uyQTcgF5cQ= +github.com/openshift-online/ocm-sdk-go v0.1.405 h1:ozU85KTekcp6Qhsu7zwicjB03k1W0uslRbrkF1ctLSg= +github.com/openshift-online/ocm-sdk-go v0.1.405/go.mod h1:zeh3RU78O6HVpiUhwXRNcF3FmiaSP4SeqoQAzow0vZE= github.com/openshift/addon-operator/apis v0.0.0-20231110045543-dd01f2f5c184 h1:P93o33VcHaOTjOTm6/UojtJdr1qLc2U7vPMBno39rdc= github.com/openshift/addon-operator/apis v0.0.0-20231110045543-dd01f2f5c184/go.mod h1:JS2tbakhIZRgBiULsIUSHGsdz7G/Vylvg1mqI1TlXzs= github.com/openshift/api v0.0.0-20231117201702-2ea16bbab164 h1:0dwIuUDjrKSnq/ujysraljX8Vk/lxDJDVUcUcl9bx9M= @@ -422,10 +415,8 @@ github.com/openshift/api v0.0.0-20231117201702-2ea16bbab164/go.mod h1:qNtV0315F+ github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1 h1:W1N/3nVciqmjPjn2xldHjb0AwwCQzlGxLvX5BCgE8H4= github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1/go.mod h1:ihUJrhBcYAGYQrJu/gP2OMgfVds5f5z5kbeLNBqjHLo= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/operator-framework/api v0.20.0 h1:A2YCRhr+6s0k3pRJacnwjh1Ue8BqjIGuQ2jvPg9XCB4= -github.com/operator-framework/api v0.20.0/go.mod h1:rXPOhrQ6mMeXqCmpDgt1ALoar9ZlHL+Iy5qut9R99a4= +github.com/operator-framework/api v0.22.0 h1:UZSn+iaQih4rCReezOnWTTJkMyawwV5iLnIItaOzytY= +github.com/operator-framework/api v0.22.0/go.mod h1:p/7YDbr+n4fmESfZ47yLAV1SvkfE6NU2aX8KhcfI0GA= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= @@ -440,8 +431,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= @@ -466,8 +457,6 @@ github.com/segmentio/analytics-go/v3 v3.3.0 h1:8VOMaVGBW03pdBrj1CMFfY9o/rnjJC+1w github.com/segmentio/analytics-go/v3 v3.3.0/go.mod h1:p8owAF8X+5o27jmvUognuXxdtqvSGtD0ZrfY2kcS9bE= github.com/segmentio/backo-go v1.0.1 h1:68RQccglxZeyURy93ASB/2kc9QudzgIDexJ927N++y4= github.com/segmentio/backo-go v1.0.1/go.mod h1:9/Rh6yILuLysoQnZ2oNooD2g7aBnvM7r/fNVxRNWfBc= -github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= -github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= github.com/selvatico/go-mocket v1.0.7 h1:jbVa7RkoOCzBanQYiYF+VWgySHZogg25fOIKkM38q5k= github.com/selvatico/go-mocket v1.0.7/go.mod h1:7bSWzuNieCdUlanCVu3w0ppS0LvDtPAZmKBIlhoTcp8= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -577,11 +566,9 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -661,8 +648,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -677,7 +662,6 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -702,8 +686,8 @@ golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= +golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -791,7 +775,6 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -802,7 +785,6 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -820,13 +802,11 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1085,7 +1065,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/go-jose/go-jose.v2 v2.6.1 h1:qEzJlIDmG9q5VO0M/o8tGS65QMHMS1w01TQJB1VPJ4U= +gopkg.in/go-jose/go-jose.v2 v2.6.2 h1:Rl5+9rA0kG3vsO1qhncMPRT5eHICihAMQYJkD7u/i4M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= @@ -1097,7 +1077,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.5.4 h1:Iyrp9Meh3GmbSuyIAGyjkN+n9K+GHX9b9MqsTL4EJCo= @@ -1114,12 +1093,12 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.29.1 h1:DAjwWX/9YT7NQD4INu49ROJuZAAAP/Ijki48GUPzxqw= -k8s.io/api v0.29.1/go.mod h1:7Kl10vBRUXhnQQI8YR/R327zXC8eJ7887/+Ybta+RoQ= +k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A= +k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0= k8s.io/apiextensions-apiserver v0.29.1 h1:S9xOtyk9M3Sk1tIpQMu9wXHm5O2MX6Y1kIpPMimZBZw= k8s.io/apiextensions-apiserver v0.29.1/go.mod h1:zZECpujY5yTW58co8V2EQR4BD6A9pktVgHhvc0uLfeU= -k8s.io/apimachinery v0.29.1 h1:KY4/E6km/wLBguvCZv8cKTeOwwOBqFNjwJIdMkMbbRc= -k8s.io/apimachinery v0.29.1/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= +k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= +k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= k8s.io/client-go v0.29.1 h1:19B/+2NGEwnFLzt0uB5kNJnfTsbV8w6TgQRz9l7ti7A= k8s.io/client-go v0.29.1/go.mod h1:TDG/psL9hdet0TI9mGyHJSgRkW3H9JZk2dNEUS7bRks= k8s.io/component-base v0.29.1 h1:MUimqJPCRnnHsskTTjKD+IC1EHBbRCVyi37IoFBrkYw= diff --git a/internal/dinosaur/pkg/config/dataplane_cluster_config.go b/internal/dinosaur/pkg/config/dataplane_cluster_config.go index 044e719701..223e08fb09 100644 --- a/internal/dinosaur/pkg/config/dataplane_cluster_config.go +++ b/internal/dinosaur/pkg/config/dataplane_cluster_config.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/pkg/errors" - "github.com/stackrox/acs-fleet-manager/pkg/constants" "github.com/stackrox/acs-fleet-manager/pkg/shared" userv1 "github.com/openshift/api/user/v1" @@ -25,19 +24,8 @@ type DataplaneClusterConfig struct { DataPlaneClusterConfigFile string `json:"dataplane_cluster_config_file"` ReadOnlyUserList userv1.OptionalNames ReadOnlyUserListFile string - ClusterConfig *ClusterConfig `json:"clusters_config"` - EnableReadyDataPlaneClustersReconcile bool `json:"enable_ready_dataplane_clusters_reconcile"` - CentralOperatorOLMConfig OperatorInstallationConfig `json:"dinosaur_operator_olm_config"` - FleetshardOperatorOLMConfig OperatorInstallationConfig `json:"fleetshard_operator_olm_config"` -} - -// OperatorInstallationConfig ... -type OperatorInstallationConfig struct { - Namespace string `json:"namespace"` - IndexImage string `json:"index_image"` - CatalogSourceNamespace string `json:"catalog_source_namespace"` - Package string `json:"package"` - SubscriptionChannel string `json:"subscription_channel"` + ClusterConfig *ClusterConfig `json:"clusters_config"` + EnableReadyDataPlaneClustersReconcile bool `json:"enable_ready_dataplane_clusters_reconcile"` } // ManualScaling ... @@ -60,20 +48,6 @@ func NewDataplaneClusterConfig() *DataplaneClusterConfig { DataPlaneClusterScalingType: ManualScaling, ClusterConfig: &ClusterConfig{}, EnableReadyDataPlaneClustersReconcile: true, - CentralOperatorOLMConfig: OperatorInstallationConfig{ - IndexImage: "quay.io/osd-addons/managed-central:production-82b42db", - CatalogSourceNamespace: "openshift-marketplace", - Namespace: constants.CentralOperatorNamespace, - SubscriptionChannel: "alpha", - Package: "managed-central", - }, - FleetshardOperatorOLMConfig: OperatorInstallationConfig{ - IndexImage: "quay.io/osd-addons/fleetshard-operator:production-82b42db", - CatalogSourceNamespace: "openshift-marketplace", - Namespace: constants.FleetShardOperatorNamespace, - SubscriptionChannel: "alpha", - Package: "fleetshard-operator", - }, } } @@ -264,16 +238,6 @@ func (c *DataplaneClusterConfig) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&c.DataPlaneClusterScalingType, "dataplane-cluster-scaling-type", c.DataPlaneClusterScalingType, "Set to use cluster configuration to configure clusters. Its value should be either 'none' for no scaling, 'manual' or 'auto'.") fs.StringVar(&c.ReadOnlyUserListFile, "read-only-user-list-file", c.ReadOnlyUserListFile, "File contains a list of users with read-only permissions to data plane clusters") fs.BoolVar(&c.EnableReadyDataPlaneClustersReconcile, "enable-ready-dataplane-clusters-reconcile", c.EnableReadyDataPlaneClustersReconcile, "Enables reconciliation for data plane clusters in the 'Ready' state") - fs.StringVar(&c.CentralOperatorOLMConfig.CatalogSourceNamespace, "central-operator-cs-namespace", c.CentralOperatorOLMConfig.CatalogSourceNamespace, "Central operator catalog source namespace.") - fs.StringVar(&c.CentralOperatorOLMConfig.IndexImage, "central-operator-index-image", c.CentralOperatorOLMConfig.IndexImage, "Central operator index image") - fs.StringVar(&c.CentralOperatorOLMConfig.Namespace, "central-operator-namespace", c.CentralOperatorOLMConfig.Namespace, "Central operator namespace") - fs.StringVar(&c.CentralOperatorOLMConfig.Package, "central-operator-package", c.CentralOperatorOLMConfig.Package, "Central operator package") - fs.StringVar(&c.CentralOperatorOLMConfig.SubscriptionChannel, "central-operator-sub-channel", c.CentralOperatorOLMConfig.SubscriptionChannel, "Central operator subscription channel") - fs.StringVar(&c.FleetshardOperatorOLMConfig.CatalogSourceNamespace, "fleetshard-operator-cs-namespace", c.FleetshardOperatorOLMConfig.CatalogSourceNamespace, "fleetshard operator catalog source namespace.") - fs.StringVar(&c.FleetshardOperatorOLMConfig.IndexImage, "fleetshard-operator-index-image", c.FleetshardOperatorOLMConfig.IndexImage, "fleetshard operator index image") - fs.StringVar(&c.FleetshardOperatorOLMConfig.Namespace, "fleetshard-operator-namespace", c.FleetshardOperatorOLMConfig.Namespace, "fleetshard operator namespace") - fs.StringVar(&c.FleetshardOperatorOLMConfig.Package, "fleetshard-operator-package", c.FleetshardOperatorOLMConfig.Package, "fleetshard operator package") - fs.StringVar(&c.FleetshardOperatorOLMConfig.SubscriptionChannel, "fleetshard-operator-sub-channel", c.FleetshardOperatorOLMConfig.SubscriptionChannel, "fleetshard operator subscription channel") } // ReadFiles ... diff --git a/internal/dinosaur/pkg/environments/development.go b/internal/dinosaur/pkg/environments/development.go index c3bfde829e..12a7180218 100644 --- a/internal/dinosaur/pkg/environments/development.go +++ b/internal/dinosaur/pkg/environments/development.go @@ -18,7 +18,6 @@ func NewDevelopmentEnvLoader() environments.EnvLoader { "enable-sentry": "false", "enable-deny-list": "true", "enable-instance-limit-control": "false", - "sso-base-url": "https://sso.redhat.com", "enable-central-external-certificate": "false", "cluster-compute-machine-type": "m5.2xlarge", "allow-evaluator-instance": "true", diff --git a/internal/dinosaur/pkg/environments/integration.go b/internal/dinosaur/pkg/environments/integration.go index e0141639dc..530ac8ac17 100644 --- a/internal/dinosaur/pkg/environments/integration.go +++ b/internal/dinosaur/pkg/environments/integration.go @@ -37,7 +37,6 @@ func (b IntegrationEnvLoader) Defaults() map[string]string { "enable-deny-list": "true", "enable-instance-limit-control": "true", "max-allowed-instances": "1", - "sso-base-url": "https://sso.redhat.com", "enable-central-external-certificate": "false", "cluster-compute-machine-type": "m5.xlarge", "allow-evaluator-instance": "true", diff --git a/internal/dinosaur/pkg/environments/production.go b/internal/dinosaur/pkg/environments/production.go index e0f3a8da11..22e6c5ae98 100644 --- a/internal/dinosaur/pkg/environments/production.go +++ b/internal/dinosaur/pkg/environments/production.go @@ -13,7 +13,6 @@ func NewProductionEnvLoader() environments.EnvLoader { "enable-sentry": "true", "enable-deny-list": "true", "max-allowed-instances": "1", - "sso-base-url": "https://sso.redhat.com", "enable-central-external-certificate": "true", "cluster-compute-machine-type": "m5.2xlarge", } diff --git a/internal/dinosaur/pkg/environments/stage.go b/internal/dinosaur/pkg/environments/stage.go index 08f2feed3a..61fc735433 100644 --- a/internal/dinosaur/pkg/environments/stage.go +++ b/internal/dinosaur/pkg/environments/stage.go @@ -10,7 +10,6 @@ func NewStageEnvLoader() environments.EnvLoader { "enable-ocm-mock": "false", "enable-deny-list": "true", "max-allowed-instances": "1", - "sso-base-url": "https://sso.redhat.com", "enable-central-external-certificate": "true", "cluster-compute-machine-type": "m5.2xlarge", "enable-additional-sso-issuers": "true", diff --git a/internal/dinosaur/pkg/routes/route_loader.go b/internal/dinosaur/pkg/routes/route_loader.go index 272734ca7b..4a3d1c6bdb 100644 --- a/internal/dinosaur/pkg/routes/route_loader.go +++ b/internal/dinosaur/pkg/routes/route_loader.go @@ -29,7 +29,6 @@ import ( "github.com/stackrox/acs-fleet-manager/pkg/server" "github.com/stackrox/acs-fleet-manager/pkg/services/account" "github.com/stackrox/acs-fleet-manager/pkg/services/authorization" - "github.com/stackrox/acs-fleet-manager/pkg/services/sso" "github.com/stackrox/acs-fleet-manager/pkg/shared" ) @@ -45,7 +44,6 @@ type options struct { Central services.DinosaurService CloudProviders services.CloudProvidersService Observatorium services.ObservatoriumService - IAM sso.IAMService DataPlaneCluster services.DataPlaneClusterService DataPlaneCentralService services.DataPlaneCentralService AccountService account.AccountService diff --git a/internal/dinosaur/pkg/services/dinosaur.go b/internal/dinosaur/pkg/services/dinosaur.go index 8136818358..51048090ec 100644 --- a/internal/dinosaur/pkg/services/dinosaur.go +++ b/internal/dinosaur/pkg/services/dinosaur.go @@ -837,6 +837,10 @@ func (k *dinosaurService) Restore(ctx context.Context, id string) *errors.Servic "ClientOrigin", "ClientSecret", "CreatedAt", + // reset expired_at to null: it may later be updated by the next run + // of the expiration manager. If there is still no quota, the grace + // period will start over. + "ExpiredAt", } // use a new central request, so that unset field for columnsToReset will automatically be set to the zero value diff --git a/internal/dinosaur/pkg/services/dinosaur_test.go b/internal/dinosaur/pkg/services/dinosaur_test.go index c1d5046e84..ed8524c643 100644 --- a/internal/dinosaur/pkg/services/dinosaur_test.go +++ b/internal/dinosaur/pkg/services/dinosaur_test.go @@ -2,8 +2,10 @@ package services import ( "context" + "database/sql/driver" "reflect" "testing" + "time" mocket "github.com/selvatico/go-mocket" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/dbapi" @@ -203,3 +205,41 @@ func Test_dinosaurService_DeprovisionExpiredDinosaursQuery(t *testing.T) { assert.Nil(t, svcErr) assert.True(t, m.Triggered) } + +func Test_dinosaurService_RestoreExpiredDinosaurs(t *testing.T) { + dbConnectionFactory := db.NewMockConnectionFactory(nil) + + centralService := &dinosaurService{ + connectionFactory: dbConnectionFactory, + dinosaurConfig: &config.CentralConfig{ + CentralLifespan: config.NewCentralLifespanConfig(), + CentralRetentionPeriodDays: 2, + }, + } + + now := time.Now() + yesterday := now.Add(-24 * time.Hour) + + m := mocket.Catcher.Reset().NewMock() + selectQuery := m.WithQuery(`SELECT`). + WithReply([]map[string]interface{}{{ + "id": "test-id", + "deleted_at": yesterday, + "expired_at": yesterday, + }}).OneTime() + + m1 := mocket.Catcher.NewMock() + expiredChecked := false + updateQuery := m1.WithQuery(`UPDATE`).WithCallback( + func(s string, nv []driver.NamedValue) { + expiredAt, _ := (nv[11].Value).(*time.Time) + assert.Nil(t, expiredAt) + assert.Equal(t, "test-id", nv[12].Value) + expiredChecked = true + }) + svcErr := centralService.Restore(context.Background(), "test-id") + assert.Nil(t, svcErr) + assert.True(t, selectQuery.Triggered) + assert.True(t, updateQuery.Triggered) + assert.True(t, expiredChecked) +} diff --git a/internal/dinosaur/pkg/services/telemetry.go b/internal/dinosaur/pkg/services/telemetry.go index 650cc118c4..c4672e8c6b 100644 --- a/internal/dinosaur/pkg/services/telemetry.go +++ b/internal/dinosaur/pkg/services/telemetry.go @@ -117,6 +117,9 @@ func (t *Telemetry) trackCreationRequested(ctx context.Context, tenantID string, // RegisterTenant initializes the tenant group with the associated properties // and issues a following event tracking the central creation request. func (t *Telemetry) RegisterTenant(ctx context.Context, convCentral *dbapi.CentralRequest, isAdmin bool, err error) { + if !t.enabled() { + return + } user, err := t.auth.getUserFromContext(ctx) if err != nil { glog.Error(errors.Wrap(err, "cannot get telemetry user from context claims")) @@ -142,6 +145,9 @@ func (t *Telemetry) RegisterTenant(ctx context.Context, convCentral *dbapi.Centr // UpdateTenant updates tenant group properties. func (t *Telemetry) UpdateTenantProperties(convCentral *dbapi.CentralRequest) { + if !t.enabled() { + return + } props := t.getTenantProperties(convCentral) // Update tenant group properties from the name of fleet-manager backend. t.config.Telemeter().Group(props, diff --git a/internal/dinosaur/pkg/workers/dinosaurmgrs/expiration_date_mgr.go b/internal/dinosaur/pkg/workers/dinosaurmgrs/expiration_date_mgr.go index fd619b092e..75e6810051 100644 --- a/internal/dinosaur/pkg/workers/dinosaurmgrs/expiration_date_mgr.go +++ b/internal/dinosaur/pkg/workers/dinosaurmgrs/expiration_date_mgr.go @@ -13,6 +13,7 @@ import ( "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/services" "github.com/stackrox/acs-fleet-manager/pkg/api" serviceErr "github.com/stackrox/acs-fleet-manager/pkg/errors" + "github.com/stackrox/acs-fleet-manager/pkg/metrics" "github.com/stackrox/acs-fleet-manager/pkg/workers" ) @@ -112,7 +113,13 @@ func (k *ExpirationDateManager) reconcileCentralExpiredAt(centrals dbapi.Central } } } - + expiredInstances := 0 + for _, central := range centrals { + if central.ExpiredAt != nil { + expiredInstances++ + } + } + metrics.UpdateCentralsExpiredMetric(float64(expiredInstances)) return svcErrors } diff --git a/internal/dinosaur/pkg/workers/dinosaurmgrs/ready_dinosaurs_mgr.go b/internal/dinosaur/pkg/workers/dinosaurmgrs/ready_dinosaurs_mgr.go index 243131a9b3..26a1f58aee 100644 --- a/internal/dinosaur/pkg/workers/dinosaurmgrs/ready_dinosaurs_mgr.go +++ b/internal/dinosaur/pkg/workers/dinosaurmgrs/ready_dinosaurs_mgr.go @@ -5,10 +5,8 @@ import ( "github.com/pkg/errors" constants2 "github.com/stackrox/acs-fleet-manager/internal/dinosaur/constants" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/services" - "github.com/stackrox/acs-fleet-manager/pkg/client/iam" "github.com/stackrox/acs-fleet-manager/pkg/logger" "github.com/stackrox/acs-fleet-manager/pkg/metrics" - "github.com/stackrox/acs-fleet-manager/pkg/services/sso" "github.com/stackrox/acs-fleet-manager/pkg/workers" ) @@ -20,12 +18,10 @@ var readyCentralCountCache int32 type ReadyDinosaurManager struct { workers.BaseWorker dinosaurService services.DinosaurService - iamService sso.IAMService - iamConfig *iam.IAMConfig } // NewReadyDinosaurManager creates a new dinosaur manager -func NewReadyDinosaurManager(dinosaurService services.DinosaurService, iamService sso.IAMService, iamConfig *iam.IAMConfig) *ReadyDinosaurManager { +func NewReadyDinosaurManager(dinosaurService services.DinosaurService) *ReadyDinosaurManager { metrics.InitReconcilerMetricsForType(readyCentralWorkerType) return &ReadyDinosaurManager{ BaseWorker: workers.BaseWorker{ @@ -34,8 +30,6 @@ func NewReadyDinosaurManager(dinosaurService services.DinosaurService, iamServic Reconciler: workers.Reconciler{}, }, dinosaurService: dinosaurService, - iamService: iamService, - iamConfig: iamConfig, } } diff --git a/pkg/client/iam/client.go b/pkg/client/iam/client.go deleted file mode 100644 index 74fee26897..0000000000 --- a/pkg/client/iam/client.go +++ /dev/null @@ -1,407 +0,0 @@ -// Package iam ... -package iam - -import ( - "context" - "crypto/tls" - "fmt" - "net/http" - "time" - - "github.com/Nerzal/gocloak/v11" - "github.com/patrickmn/go-cache" - "github.com/pkg/errors" - "github.com/stackrox/acs-fleet-manager/pkg/shared" -) - -const ( - // gocloak access token duration before expiration - tokenLifeDuration = 5 * time.Minute - cacheCleanupInterval = 5 * time.Minute - // OrgKey ... - OrgKey = "rh-org-id" - // UserKey ... - UserKey = "rh-user-id" -) - -var ( - protocol = "openid-connect" - mapper = "oidc-usermodel-attribute-mapper" -) - -// IAMClient ... -// -//go:generate moq -out client_moq.go . IAMClient -type IAMClient interface { - CreateClient(client gocloak.Client, accessToken string) (string, error) - GetToken() (string, error) - GetCachedToken(tokenKey string) (string, error) - DeleteClient(internalClientID string, accessToken string) error - GetClientSecret(internalClientID string, accessToken string) (string, error) - GetClient(clientID string, accessToken string) (*gocloak.Client, error) - IsClientExist(clientID string, accessToken string) (string, error) - GetConfig() *IAMConfig - GetRealmConfig() *IAMRealmConfig - GetClientByID(id string, accessToken string) (*gocloak.Client, error) - ClientConfig(client ClientRepresentation) gocloak.Client - CreateProtocolMapperConfig(string) []gocloak.ProtocolMapperRepresentation - GetClientServiceAccount(accessToken string, internalClient string) (*gocloak.User, error) - UpdateServiceAccountUser(accessToken string, serviceAccountUser gocloak.User) error - // GetClients returns IAM clients using the given method parameters. If max is less than 0, then returns all the clients. - // If it is 0, then default to using the default max allowed service accounts configuration. - GetClients(accessToken string, first int, max int, attribute string) ([]*gocloak.Client, error) - IsSameOrg(client *gocloak.Client, orgID string) bool - IsOwner(client *gocloak.Client, userID string) bool - RegenerateClientSecret(accessToken string, id string) (*gocloak.CredentialRepresentation, error) - GetRealmRole(accessToken string, roleName string) (*gocloak.Role, error) - CreateRealmRole(accessToken string, roleName string) (*gocloak.Role, error) - UserHasRealmRole(accessToken string, userID string, roleName string) (*gocloak.Role, error) - AddRealmRoleToUser(accessToken string, userID string, role gocloak.Role) error -} - -// ClientRepresentation ... -type ClientRepresentation struct { - Name string - ClientID string - ServiceAccountsEnabled bool - Secret *string - StandardFlowEnabled bool - Attributes map[string]string - AuthorizationServicesEnabled bool - ProtocolMappers []gocloak.ProtocolMapperRepresentation - Description string - RedirectURIs *[]string -} - -type iamClient struct { - kcClient gocloak.GoCloak - ctx context.Context - config *IAMConfig - realmConfig *IAMRealmConfig - cache *cache.Cache -} - -var _ IAMClient = &iamClient{} - -// GoCloak an alias for gocloak.GoCloak -// -//go:generate moq -out gocloak_moq.go . GoCloak -type GoCloak = gocloak.GoCloak - -// NewClient ... -func NewClient(config *IAMConfig, realmConfig *IAMRealmConfig) *iamClient { - setTokenEndpoints(config, realmConfig) - client := gocloak.NewClient(config.BaseURL) - client.RestyClient().SetDebug(config.Debug) - client.RestyClient().SetTLSClientConfig(&tls.Config{InsecureSkipVerify: config.InsecureSkipVerify}) - return &iamClient{ - kcClient: client, - ctx: context.Background(), - config: config, - realmConfig: realmConfig, - cache: cache.New(tokenLifeDuration, cacheCleanupInterval), - } -} - -// ClientConfig ... -func (ic *iamClient) ClientConfig(client ClientRepresentation) gocloak.Client { - publicClient := false - directAccess := false - return gocloak.Client{ - Name: &client.Name, - ClientID: &client.ClientID, - ServiceAccountsEnabled: &client.ServiceAccountsEnabled, - StandardFlowEnabled: &client.StandardFlowEnabled, - Attributes: &client.Attributes, - AuthorizationServicesEnabled: &client.AuthorizationServicesEnabled, - ProtocolMappers: &client.ProtocolMappers, - Description: &client.Description, - RedirectURIs: client.RedirectURIs, - Protocol: &protocol, - PublicClient: &publicClient, - DirectAccessGrantsEnabled: &directAccess, - } -} - -// CreateProtocolMapperConfig ... -func (ic *iamClient) CreateProtocolMapperConfig(name string) []gocloak.ProtocolMapperRepresentation { - protocolMapper := []gocloak.ProtocolMapperRepresentation{ - { - Name: &name, - Protocol: &protocol, - ProtocolMapper: &mapper, - Config: &map[string]string{ - "access.token.claim": "true", - "claim.name": name, - "id.token.claim": "true", - "jsonType.label": "String", - "user.attribute": name, - "userinfo.token.claim": "true", - }, - }, - } - return protocolMapper -} - -func setTokenEndpoints(config *IAMConfig, realmConfig *IAMRealmConfig) { - realmConfig.JwksEndpointURI = config.BaseURL + "/auth/realms/" + realmConfig.Realm + "/protocol/openid-connect/certs" - realmConfig.TokenEndpointURI = config.BaseURL + "/auth/realms/" + realmConfig.Realm + "/protocol/openid-connect/token" - realmConfig.ValidIssuerURI = config.BaseURL + "/auth/realms/" + realmConfig.Realm -} - -// CreateClient ... -func (ic *iamClient) CreateClient(client gocloak.Client, accessToken string) (string, error) { - internalClientID, err := ic.kcClient.CreateClient(ic.ctx, accessToken, ic.realmConfig.Realm, client) - if err != nil { - return "", fmt.Errorf("creating client: %w", err) - } - return internalClientID, nil -} - -// GetClient ... -func (ic *iamClient) GetClient(clientID string, accessToken string) (*gocloak.Client, error) { - params := gocloak.GetClientsParams{ - ClientID: &clientID, - } - clients, err := ic.kcClient.GetClients(ic.ctx, accessToken, ic.realmConfig.Realm, params) - if err != nil { - return nil, fmt.Errorf("getting clients: %w", err) - } - for _, client := range clients { - if *client.ClientID == clientID { - return client, nil - } - } - return nil, nil -} - -// GetToken ... -func (ic *iamClient) GetToken() (string, error) { - options := gocloak.TokenOptions{ - ClientID: &ic.realmConfig.ClientID, - GrantType: &ic.realmConfig.GrantType, - ClientSecret: &ic.realmConfig.ClientSecret, - } - cachedTokenKey := fmt.Sprintf("%s%s", ic.realmConfig.ValidIssuerURI, ic.realmConfig.ClientID) - cachedToken, _ := ic.GetCachedToken(cachedTokenKey) - - if cachedToken != "" && !shared.IsJWTTokenExpired(cachedToken) { - return cachedToken, nil - } - tokenResp, err := ic.kcClient.GetToken(ic.ctx, ic.realmConfig.Realm, options) - if err != nil { - return "", errors.Wrap(err, "failed to get new token from gocloak with error") - } - - ic.cache.Set(cachedTokenKey, tokenResp.AccessToken, cacheCleanupInterval) - return tokenResp.AccessToken, nil -} - -// GetCachedToken ... -func (ic *iamClient) GetCachedToken(tokenKey string) (string, error) { - cachedToken, isCached := ic.cache.Get(tokenKey) - ct, _ := cachedToken.(string) - if isCached { - return ct, nil - } - return "", errors.Errorf("failed to retrieve cached token") -} - -// GetClientSecret ... -func (ic *iamClient) GetClientSecret(internalClientID string, accessToken string) (string, error) { - resp, err := ic.kcClient.GetClientSecret(ic.ctx, accessToken, ic.realmConfig.Realm, internalClientID) - if err != nil { - return "", fmt.Errorf("getting client secret: %w", err) - } - if resp.Value == nil { - return "", errors.Errorf("failed to retrieve credentials") - } - return *resp.Value, nil -} - -// DeleteClient ... -func (ic *iamClient) DeleteClient(internalClientID string, accessToken string) error { - err := ic.kcClient.DeleteClient(ic.ctx, accessToken, ic.realmConfig.Realm, internalClientID) - if err != nil { - return fmt.Errorf("deleting client: %w", err) - } - return nil -} - -func (ic *iamClient) getClient(clientID string, accessToken string) ([]*gocloak.Client, error) { - params := gocloak.GetClientsParams{ - ClientID: &clientID, - } - client, err := ic.kcClient.GetClients(ic.ctx, accessToken, ic.realmConfig.Realm, params) - if err != nil { - return nil, fmt.Errorf("getting clients: %w", err) - } - return client, nil -} - -// GetClientByID ... -func (ic *iamClient) GetClientByID(internalID string, accessToken string) (*gocloak.Client, error) { - client, err := ic.kcClient.GetClient(ic.ctx, accessToken, ic.realmConfig.Realm, internalID) - if err != nil { - return nil, fmt.Errorf("getting client by ID: %w", err) - } - return client, nil -} - -// GetConfig ... -func (ic *iamClient) GetConfig() *IAMConfig { - return ic.config -} - -// GetRealmConfig ... -func (ic *iamClient) GetRealmConfig() *IAMRealmConfig { - return ic.realmConfig -} - -// IsClientExist ... -func (ic *iamClient) IsClientExist(clientID string, accessToken string) (string, error) { - if clientID == "" { - return "", errors.New("clientId cannot be empty") - } - clients, err := ic.getClient(clientID, accessToken) - if err != nil { - return "", err - } - for _, client := range clients { - if *client.ClientID == clientID { - return *client.ID, nil - } - } - return "", err -} - -// GetClientServiceAccount ... -func (ic *iamClient) GetClientServiceAccount(accessToken string, internalClient string) (*gocloak.User, error) { - serviceAccountUser, err := ic.kcClient.GetClientServiceAccount(ic.ctx, accessToken, ic.realmConfig.Realm, internalClient) - if err != nil { - return nil, fmt.Errorf("getting client ServiceAccount: %w", err) - - } - return serviceAccountUser, nil -} - -// UpdateServiceAccountUser ... -func (ic *iamClient) UpdateServiceAccountUser(accessToken string, serviceAccountUser gocloak.User) error { - err := ic.kcClient.UpdateUser(ic.ctx, accessToken, ic.realmConfig.Realm, serviceAccountUser) - if err != nil { - return fmt.Errorf("updating service account user: %w", err) - } - return nil -} - -// GetClients ... -func (ic *iamClient) GetClients(accessToken string, first int, max int, attribute string) ([]*gocloak.Client, error) { - params := gocloak.GetClientsParams{ - First: &first, - SearchableAttributes: &attribute, - } - - if max == 0 { - max = ic.config.MaxLimitForGetClients - } - - if max > 0 { - params.Max = &max - } - - clients, err := ic.kcClient.GetClients(ic.ctx, accessToken, ic.realmConfig.Realm, params) - if err != nil { - return nil, fmt.Errorf("getting clients: %w", err) - } - return clients, nil -} - -// IsSameOrg ... -func (ic *iamClient) IsSameOrg(client *gocloak.Client, orgID string) bool { - if orgID == "" { - return false - } - attributes := *client.Attributes - return attributes[OrgKey] == orgID -} - -// IsOwner ... -func (ic *iamClient) IsOwner(client *gocloak.Client, userID string) bool { - if userID == "" { - return false - } - attributes := *client.Attributes - if rhUserID, found := attributes[UserKey]; found { - return rhUserID == userID - } - return false -} - -// RegenerateClientSecret ... -func (ic *iamClient) RegenerateClientSecret(accessToken string, id string) (*gocloak.CredentialRepresentation, error) { - credRep, err := ic.kcClient.RegenerateClientSecret(ic.ctx, accessToken, ic.realmConfig.Realm, id) - if err != nil { - return nil, fmt.Errorf("regenerating client secrets: %w", err) - } - return credRep, nil -} - -// GetRealmRole ... -func (ic *iamClient) GetRealmRole(accessToken string, roleName string) (*gocloak.Role, error) { - r, err := ic.kcClient.GetRealmRole(ic.ctx, accessToken, ic.realmConfig.Realm, roleName) - if err != nil { - if isNotFoundError(err) { - return nil, nil - } - return nil, fmt.Errorf("getting realm role: %w", err) - } - return r, nil -} - -// CreateRealmRole ... -func (ic *iamClient) CreateRealmRole(accessToken string, roleName string) (*gocloak.Role, error) { - r := &gocloak.Role{ - Name: &roleName, - } - _, err := ic.kcClient.CreateRealmRole(ic.ctx, accessToken, ic.realmConfig.Realm, *r) - if err != nil { - return nil, fmt.Errorf("creating realm role: %w", err) - } - // for some reason, the internal id of the role is not returned by iamClient.CreateRealmRole, so we have to get the role again to get the full details - r, err = ic.kcClient.GetRealmRole(ic.ctx, accessToken, ic.realmConfig.Realm, roleName) - if err != nil { - return nil, fmt.Errorf("getting realm role: %w", err) - } - return r, nil -} - -// UserHasRealmRole ... -func (ic *iamClient) UserHasRealmRole(accessToken string, userID string, roleName string) (*gocloak.Role, error) { - roles, err := ic.kcClient.GetRealmRolesByUserID(ic.ctx, accessToken, ic.realmConfig.Realm, userID) - if err != nil { - return nil, fmt.Errorf("getting realm roles by UserID: %w", err) - } - for _, r := range roles { - if *r.Name == roleName { - return r, nil - } - } - return nil, nil -} - -// AddRealmRoleToUser ... -func (ic *iamClient) AddRealmRoleToUser(accessToken string, userID string, role gocloak.Role) error { - roles := []gocloak.Role{role} - err := ic.kcClient.AddRealmRoleToUser(ic.ctx, accessToken, ic.realmConfig.Realm, userID, roles) - if err != nil { - return fmt.Errorf("adding realm to user: %w", err) - } - return nil -} - -func isNotFoundError(err error) bool { - if e, ok := err.(*gocloak.APIError); ok { - return e.Code == http.StatusNotFound - } - return false -} diff --git a/pkg/client/iam/client_moq.go b/pkg/client/iam/client_moq.go deleted file mode 100644 index 0289688841..0000000000 --- a/pkg/client/iam/client_moq.go +++ /dev/null @@ -1,1098 +0,0 @@ -// Code generated by moq; DO NOT EDIT. -// github.com/matryer/moq - -package iam - -import ( - "github.com/Nerzal/gocloak/v11" - "sync" -) - -// Ensure, that IAMClientMock does implement IAMClient. -// If this is not the case, regenerate this file with moq. -var _ IAMClient = &IAMClientMock{} - -// IAMClientMock is a mock implementation of IAMClient. -// -// func TestSomethingThatUsesIAMClient(t *testing.T) { -// -// // make and configure a mocked IAMClient -// mockedIAMClient := &IAMClientMock{ -// AddRealmRoleToUserFunc: func(accessToken string, userID string, role gocloak.Role) error { -// panic("mock out the AddRealmRoleToUser method") -// }, -// ClientConfigFunc: func(client ClientRepresentation) gocloak.Client { -// panic("mock out the ClientConfig method") -// }, -// CreateClientFunc: func(client gocloak.Client, accessToken string) (string, error) { -// panic("mock out the CreateClient method") -// }, -// CreateProtocolMapperConfigFunc: func(s string) []gocloak.ProtocolMapperRepresentation { -// panic("mock out the CreateProtocolMapperConfig method") -// }, -// CreateRealmRoleFunc: func(accessToken string, roleName string) (*gocloak.Role, error) { -// panic("mock out the CreateRealmRole method") -// }, -// DeleteClientFunc: func(internalClientID string, accessToken string) error { -// panic("mock out the DeleteClient method") -// }, -// GetCachedTokenFunc: func(tokenKey string) (string, error) { -// panic("mock out the GetCachedToken method") -// }, -// GetClientFunc: func(clientID string, accessToken string) (*gocloak.Client, error) { -// panic("mock out the GetClient method") -// }, -// GetClientByIDFunc: func(id string, accessToken string) (*gocloak.Client, error) { -// panic("mock out the GetClientByID method") -// }, -// GetClientSecretFunc: func(internalClientID string, accessToken string) (string, error) { -// panic("mock out the GetClientSecret method") -// }, -// GetClientServiceAccountFunc: func(accessToken string, internalClient string) (*gocloak.User, error) { -// panic("mock out the GetClientServiceAccount method") -// }, -// GetClientsFunc: func(accessToken string, first int, max int, attribute string) ([]*gocloak.Client, error) { -// panic("mock out the GetClients method") -// }, -// GetConfigFunc: func() *IAMConfig { -// panic("mock out the GetConfig method") -// }, -// GetRealmConfigFunc: func() *IAMRealmConfig { -// panic("mock out the GetRealmConfig method") -// }, -// GetRealmRoleFunc: func(accessToken string, roleName string) (*gocloak.Role, error) { -// panic("mock out the GetRealmRole method") -// }, -// GetTokenFunc: func() (string, error) { -// panic("mock out the GetToken method") -// }, -// IsClientExistFunc: func(clientID string, accessToken string) (string, error) { -// panic("mock out the IsClientExist method") -// }, -// IsOwnerFunc: func(client *gocloak.Client, userID string) bool { -// panic("mock out the IsOwner method") -// }, -// IsSameOrgFunc: func(client *gocloak.Client, orgID string) bool { -// panic("mock out the IsSameOrg method") -// }, -// RegenerateClientSecretFunc: func(accessToken string, id string) (*gocloak.CredentialRepresentation, error) { -// panic("mock out the RegenerateClientSecret method") -// }, -// UpdateServiceAccountUserFunc: func(accessToken string, serviceAccountUser gocloak.User) error { -// panic("mock out the UpdateServiceAccountUser method") -// }, -// UserHasRealmRoleFunc: func(accessToken string, userID string, roleName string) (*gocloak.Role, error) { -// panic("mock out the UserHasRealmRole method") -// }, -// } -// -// // use mockedIAMClient in code that requires IAMClient -// // and then make assertions. -// -// } -type IAMClientMock struct { - // AddRealmRoleToUserFunc mocks the AddRealmRoleToUser method. - AddRealmRoleToUserFunc func(accessToken string, userID string, role gocloak.Role) error - - // ClientConfigFunc mocks the ClientConfig method. - ClientConfigFunc func(client ClientRepresentation) gocloak.Client - - // CreateClientFunc mocks the CreateClient method. - CreateClientFunc func(client gocloak.Client, accessToken string) (string, error) - - // CreateProtocolMapperConfigFunc mocks the CreateProtocolMapperConfig method. - CreateProtocolMapperConfigFunc func(s string) []gocloak.ProtocolMapperRepresentation - - // CreateRealmRoleFunc mocks the CreateRealmRole method. - CreateRealmRoleFunc func(accessToken string, roleName string) (*gocloak.Role, error) - - // DeleteClientFunc mocks the DeleteClient method. - DeleteClientFunc func(internalClientID string, accessToken string) error - - // GetCachedTokenFunc mocks the GetCachedToken method. - GetCachedTokenFunc func(tokenKey string) (string, error) - - // GetClientFunc mocks the GetClient method. - GetClientFunc func(clientID string, accessToken string) (*gocloak.Client, error) - - // GetClientByIDFunc mocks the GetClientByID method. - GetClientByIDFunc func(id string, accessToken string) (*gocloak.Client, error) - - // GetClientSecretFunc mocks the GetClientSecret method. - GetClientSecretFunc func(internalClientID string, accessToken string) (string, error) - - // GetClientServiceAccountFunc mocks the GetClientServiceAccount method. - GetClientServiceAccountFunc func(accessToken string, internalClient string) (*gocloak.User, error) - - // GetClientsFunc mocks the GetClients method. - GetClientsFunc func(accessToken string, first int, max int, attribute string) ([]*gocloak.Client, error) - - // GetConfigFunc mocks the GetConfig method. - GetConfigFunc func() *IAMConfig - - // GetRealmConfigFunc mocks the GetRealmConfig method. - GetRealmConfigFunc func() *IAMRealmConfig - - // GetRealmRoleFunc mocks the GetRealmRole method. - GetRealmRoleFunc func(accessToken string, roleName string) (*gocloak.Role, error) - - // GetTokenFunc mocks the GetToken method. - GetTokenFunc func() (string, error) - - // IsClientExistFunc mocks the IsClientExist method. - IsClientExistFunc func(clientID string, accessToken string) (string, error) - - // IsOwnerFunc mocks the IsOwner method. - IsOwnerFunc func(client *gocloak.Client, userID string) bool - - // IsSameOrgFunc mocks the IsSameOrg method. - IsSameOrgFunc func(client *gocloak.Client, orgID string) bool - - // RegenerateClientSecretFunc mocks the RegenerateClientSecret method. - RegenerateClientSecretFunc func(accessToken string, id string) (*gocloak.CredentialRepresentation, error) - - // UpdateServiceAccountUserFunc mocks the UpdateServiceAccountUser method. - UpdateServiceAccountUserFunc func(accessToken string, serviceAccountUser gocloak.User) error - - // UserHasRealmRoleFunc mocks the UserHasRealmRole method. - UserHasRealmRoleFunc func(accessToken string, userID string, roleName string) (*gocloak.Role, error) - - // calls tracks calls to the methods. - calls struct { - // AddRealmRoleToUser holds details about calls to the AddRealmRoleToUser method. - AddRealmRoleToUser []struct { - // AccessToken is the accessToken argument value. - AccessToken string - // UserID is the userID argument value. - UserID string - // Role is the role argument value. - Role gocloak.Role - } - // ClientConfig holds details about calls to the ClientConfig method. - ClientConfig []struct { - // Client is the client argument value. - Client ClientRepresentation - } - // CreateClient holds details about calls to the CreateClient method. - CreateClient []struct { - // Client is the client argument value. - Client gocloak.Client - // AccessToken is the accessToken argument value. - AccessToken string - } - // CreateProtocolMapperConfig holds details about calls to the CreateProtocolMapperConfig method. - CreateProtocolMapperConfig []struct { - // S is the s argument value. - S string - } - // CreateRealmRole holds details about calls to the CreateRealmRole method. - CreateRealmRole []struct { - // AccessToken is the accessToken argument value. - AccessToken string - // RoleName is the roleName argument value. - RoleName string - } - // DeleteClient holds details about calls to the DeleteClient method. - DeleteClient []struct { - // InternalClientID is the internalClientID argument value. - InternalClientID string - // AccessToken is the accessToken argument value. - AccessToken string - } - // GetCachedToken holds details about calls to the GetCachedToken method. - GetCachedToken []struct { - // TokenKey is the tokenKey argument value. - TokenKey string - } - // GetClient holds details about calls to the GetClient method. - GetClient []struct { - // ClientID is the clientID argument value. - ClientID string - // AccessToken is the accessToken argument value. - AccessToken string - } - // GetClientByID holds details about calls to the GetClientByID method. - GetClientByID []struct { - // ID is the id argument value. - ID string - // AccessToken is the accessToken argument value. - AccessToken string - } - // GetClientSecret holds details about calls to the GetClientSecret method. - GetClientSecret []struct { - // InternalClientID is the internalClientID argument value. - InternalClientID string - // AccessToken is the accessToken argument value. - AccessToken string - } - // GetClientServiceAccount holds details about calls to the GetClientServiceAccount method. - GetClientServiceAccount []struct { - // AccessToken is the accessToken argument value. - AccessToken string - // InternalClient is the internalClient argument value. - InternalClient string - } - // GetClients holds details about calls to the GetClients method. - GetClients []struct { - // AccessToken is the accessToken argument value. - AccessToken string - // First is the first argument value. - First int - // Max is the max argument value. - Max int - // Attribute is the attribute argument value. - Attribute string - } - // GetConfig holds details about calls to the GetConfig method. - GetConfig []struct { - } - // GetRealmConfig holds details about calls to the GetRealmConfig method. - GetRealmConfig []struct { - } - // GetRealmRole holds details about calls to the GetRealmRole method. - GetRealmRole []struct { - // AccessToken is the accessToken argument value. - AccessToken string - // RoleName is the roleName argument value. - RoleName string - } - // GetToken holds details about calls to the GetToken method. - GetToken []struct { - } - // IsClientExist holds details about calls to the IsClientExist method. - IsClientExist []struct { - // ClientID is the clientID argument value. - ClientID string - // AccessToken is the accessToken argument value. - AccessToken string - } - // IsOwner holds details about calls to the IsOwner method. - IsOwner []struct { - // Client is the client argument value. - Client *gocloak.Client - // UserID is the userID argument value. - UserID string - } - // IsSameOrg holds details about calls to the IsSameOrg method. - IsSameOrg []struct { - // Client is the client argument value. - Client *gocloak.Client - // OrgID is the orgID argument value. - OrgID string - } - // RegenerateClientSecret holds details about calls to the RegenerateClientSecret method. - RegenerateClientSecret []struct { - // AccessToken is the accessToken argument value. - AccessToken string - // ID is the id argument value. - ID string - } - // UpdateServiceAccountUser holds details about calls to the UpdateServiceAccountUser method. - UpdateServiceAccountUser []struct { - // AccessToken is the accessToken argument value. - AccessToken string - // ServiceAccountUser is the serviceAccountUser argument value. - ServiceAccountUser gocloak.User - } - // UserHasRealmRole holds details about calls to the UserHasRealmRole method. - UserHasRealmRole []struct { - // AccessToken is the accessToken argument value. - AccessToken string - // UserID is the userID argument value. - UserID string - // RoleName is the roleName argument value. - RoleName string - } - } - lockAddRealmRoleToUser sync.RWMutex - lockClientConfig sync.RWMutex - lockCreateClient sync.RWMutex - lockCreateProtocolMapperConfig sync.RWMutex - lockCreateRealmRole sync.RWMutex - lockDeleteClient sync.RWMutex - lockGetCachedToken sync.RWMutex - lockGetClient sync.RWMutex - lockGetClientByID sync.RWMutex - lockGetClientSecret sync.RWMutex - lockGetClientServiceAccount sync.RWMutex - lockGetClients sync.RWMutex - lockGetConfig sync.RWMutex - lockGetRealmConfig sync.RWMutex - lockGetRealmRole sync.RWMutex - lockGetToken sync.RWMutex - lockIsClientExist sync.RWMutex - lockIsOwner sync.RWMutex - lockIsSameOrg sync.RWMutex - lockRegenerateClientSecret sync.RWMutex - lockUpdateServiceAccountUser sync.RWMutex - lockUserHasRealmRole sync.RWMutex -} - -// AddRealmRoleToUser calls AddRealmRoleToUserFunc. -func (mock *IAMClientMock) AddRealmRoleToUser(accessToken string, userID string, role gocloak.Role) error { - if mock.AddRealmRoleToUserFunc == nil { - panic("IAMClientMock.AddRealmRoleToUserFunc: method is nil but IAMClient.AddRealmRoleToUser was just called") - } - callInfo := struct { - AccessToken string - UserID string - Role gocloak.Role - }{ - AccessToken: accessToken, - UserID: userID, - Role: role, - } - mock.lockAddRealmRoleToUser.Lock() - mock.calls.AddRealmRoleToUser = append(mock.calls.AddRealmRoleToUser, callInfo) - mock.lockAddRealmRoleToUser.Unlock() - return mock.AddRealmRoleToUserFunc(accessToken, userID, role) -} - -// AddRealmRoleToUserCalls gets all the calls that were made to AddRealmRoleToUser. -// Check the length with: -// -// len(mockedIAMClient.AddRealmRoleToUserCalls()) -func (mock *IAMClientMock) AddRealmRoleToUserCalls() []struct { - AccessToken string - UserID string - Role gocloak.Role -} { - var calls []struct { - AccessToken string - UserID string - Role gocloak.Role - } - mock.lockAddRealmRoleToUser.RLock() - calls = mock.calls.AddRealmRoleToUser - mock.lockAddRealmRoleToUser.RUnlock() - return calls -} - -// ClientConfig calls ClientConfigFunc. -func (mock *IAMClientMock) ClientConfig(client ClientRepresentation) gocloak.Client { - if mock.ClientConfigFunc == nil { - panic("IAMClientMock.ClientConfigFunc: method is nil but IAMClient.ClientConfig was just called") - } - callInfo := struct { - Client ClientRepresentation - }{ - Client: client, - } - mock.lockClientConfig.Lock() - mock.calls.ClientConfig = append(mock.calls.ClientConfig, callInfo) - mock.lockClientConfig.Unlock() - return mock.ClientConfigFunc(client) -} - -// ClientConfigCalls gets all the calls that were made to ClientConfig. -// Check the length with: -// -// len(mockedIAMClient.ClientConfigCalls()) -func (mock *IAMClientMock) ClientConfigCalls() []struct { - Client ClientRepresentation -} { - var calls []struct { - Client ClientRepresentation - } - mock.lockClientConfig.RLock() - calls = mock.calls.ClientConfig - mock.lockClientConfig.RUnlock() - return calls -} - -// CreateClient calls CreateClientFunc. -func (mock *IAMClientMock) CreateClient(client gocloak.Client, accessToken string) (string, error) { - if mock.CreateClientFunc == nil { - panic("IAMClientMock.CreateClientFunc: method is nil but IAMClient.CreateClient was just called") - } - callInfo := struct { - Client gocloak.Client - AccessToken string - }{ - Client: client, - AccessToken: accessToken, - } - mock.lockCreateClient.Lock() - mock.calls.CreateClient = append(mock.calls.CreateClient, callInfo) - mock.lockCreateClient.Unlock() - return mock.CreateClientFunc(client, accessToken) -} - -// CreateClientCalls gets all the calls that were made to CreateClient. -// Check the length with: -// -// len(mockedIAMClient.CreateClientCalls()) -func (mock *IAMClientMock) CreateClientCalls() []struct { - Client gocloak.Client - AccessToken string -} { - var calls []struct { - Client gocloak.Client - AccessToken string - } - mock.lockCreateClient.RLock() - calls = mock.calls.CreateClient - mock.lockCreateClient.RUnlock() - return calls -} - -// CreateProtocolMapperConfig calls CreateProtocolMapperConfigFunc. -func (mock *IAMClientMock) CreateProtocolMapperConfig(s string) []gocloak.ProtocolMapperRepresentation { - if mock.CreateProtocolMapperConfigFunc == nil { - panic("IAMClientMock.CreateProtocolMapperConfigFunc: method is nil but IAMClient.CreateProtocolMapperConfig was just called") - } - callInfo := struct { - S string - }{ - S: s, - } - mock.lockCreateProtocolMapperConfig.Lock() - mock.calls.CreateProtocolMapperConfig = append(mock.calls.CreateProtocolMapperConfig, callInfo) - mock.lockCreateProtocolMapperConfig.Unlock() - return mock.CreateProtocolMapperConfigFunc(s) -} - -// CreateProtocolMapperConfigCalls gets all the calls that were made to CreateProtocolMapperConfig. -// Check the length with: -// -// len(mockedIAMClient.CreateProtocolMapperConfigCalls()) -func (mock *IAMClientMock) CreateProtocolMapperConfigCalls() []struct { - S string -} { - var calls []struct { - S string - } - mock.lockCreateProtocolMapperConfig.RLock() - calls = mock.calls.CreateProtocolMapperConfig - mock.lockCreateProtocolMapperConfig.RUnlock() - return calls -} - -// CreateRealmRole calls CreateRealmRoleFunc. -func (mock *IAMClientMock) CreateRealmRole(accessToken string, roleName string) (*gocloak.Role, error) { - if mock.CreateRealmRoleFunc == nil { - panic("IAMClientMock.CreateRealmRoleFunc: method is nil but IAMClient.CreateRealmRole was just called") - } - callInfo := struct { - AccessToken string - RoleName string - }{ - AccessToken: accessToken, - RoleName: roleName, - } - mock.lockCreateRealmRole.Lock() - mock.calls.CreateRealmRole = append(mock.calls.CreateRealmRole, callInfo) - mock.lockCreateRealmRole.Unlock() - return mock.CreateRealmRoleFunc(accessToken, roleName) -} - -// CreateRealmRoleCalls gets all the calls that were made to CreateRealmRole. -// Check the length with: -// -// len(mockedIAMClient.CreateRealmRoleCalls()) -func (mock *IAMClientMock) CreateRealmRoleCalls() []struct { - AccessToken string - RoleName string -} { - var calls []struct { - AccessToken string - RoleName string - } - mock.lockCreateRealmRole.RLock() - calls = mock.calls.CreateRealmRole - mock.lockCreateRealmRole.RUnlock() - return calls -} - -// DeleteClient calls DeleteClientFunc. -func (mock *IAMClientMock) DeleteClient(internalClientID string, accessToken string) error { - if mock.DeleteClientFunc == nil { - panic("IAMClientMock.DeleteClientFunc: method is nil but IAMClient.DeleteClient was just called") - } - callInfo := struct { - InternalClientID string - AccessToken string - }{ - InternalClientID: internalClientID, - AccessToken: accessToken, - } - mock.lockDeleteClient.Lock() - mock.calls.DeleteClient = append(mock.calls.DeleteClient, callInfo) - mock.lockDeleteClient.Unlock() - return mock.DeleteClientFunc(internalClientID, accessToken) -} - -// DeleteClientCalls gets all the calls that were made to DeleteClient. -// Check the length with: -// -// len(mockedIAMClient.DeleteClientCalls()) -func (mock *IAMClientMock) DeleteClientCalls() []struct { - InternalClientID string - AccessToken string -} { - var calls []struct { - InternalClientID string - AccessToken string - } - mock.lockDeleteClient.RLock() - calls = mock.calls.DeleteClient - mock.lockDeleteClient.RUnlock() - return calls -} - -// GetCachedToken calls GetCachedTokenFunc. -func (mock *IAMClientMock) GetCachedToken(tokenKey string) (string, error) { - if mock.GetCachedTokenFunc == nil { - panic("IAMClientMock.GetCachedTokenFunc: method is nil but IAMClient.GetCachedToken was just called") - } - callInfo := struct { - TokenKey string - }{ - TokenKey: tokenKey, - } - mock.lockGetCachedToken.Lock() - mock.calls.GetCachedToken = append(mock.calls.GetCachedToken, callInfo) - mock.lockGetCachedToken.Unlock() - return mock.GetCachedTokenFunc(tokenKey) -} - -// GetCachedTokenCalls gets all the calls that were made to GetCachedToken. -// Check the length with: -// -// len(mockedIAMClient.GetCachedTokenCalls()) -func (mock *IAMClientMock) GetCachedTokenCalls() []struct { - TokenKey string -} { - var calls []struct { - TokenKey string - } - mock.lockGetCachedToken.RLock() - calls = mock.calls.GetCachedToken - mock.lockGetCachedToken.RUnlock() - return calls -} - -// GetClient calls GetClientFunc. -func (mock *IAMClientMock) GetClient(clientID string, accessToken string) (*gocloak.Client, error) { - if mock.GetClientFunc == nil { - panic("IAMClientMock.GetClientFunc: method is nil but IAMClient.GetClient was just called") - } - callInfo := struct { - ClientID string - AccessToken string - }{ - ClientID: clientID, - AccessToken: accessToken, - } - mock.lockGetClient.Lock() - mock.calls.GetClient = append(mock.calls.GetClient, callInfo) - mock.lockGetClient.Unlock() - return mock.GetClientFunc(clientID, accessToken) -} - -// GetClientCalls gets all the calls that were made to GetClient. -// Check the length with: -// -// len(mockedIAMClient.GetClientCalls()) -func (mock *IAMClientMock) GetClientCalls() []struct { - ClientID string - AccessToken string -} { - var calls []struct { - ClientID string - AccessToken string - } - mock.lockGetClient.RLock() - calls = mock.calls.GetClient - mock.lockGetClient.RUnlock() - return calls -} - -// GetClientByID calls GetClientByIDFunc. -func (mock *IAMClientMock) GetClientByID(id string, accessToken string) (*gocloak.Client, error) { - if mock.GetClientByIDFunc == nil { - panic("IAMClientMock.GetClientByIDFunc: method is nil but IAMClient.GetClientByID was just called") - } - callInfo := struct { - ID string - AccessToken string - }{ - ID: id, - AccessToken: accessToken, - } - mock.lockGetClientByID.Lock() - mock.calls.GetClientByID = append(mock.calls.GetClientByID, callInfo) - mock.lockGetClientByID.Unlock() - return mock.GetClientByIDFunc(id, accessToken) -} - -// GetClientByIDCalls gets all the calls that were made to GetClientByID. -// Check the length with: -// -// len(mockedIAMClient.GetClientByIDCalls()) -func (mock *IAMClientMock) GetClientByIDCalls() []struct { - ID string - AccessToken string -} { - var calls []struct { - ID string - AccessToken string - } - mock.lockGetClientByID.RLock() - calls = mock.calls.GetClientByID - mock.lockGetClientByID.RUnlock() - return calls -} - -// GetClientSecret calls GetClientSecretFunc. -func (mock *IAMClientMock) GetClientSecret(internalClientID string, accessToken string) (string, error) { - if mock.GetClientSecretFunc == nil { - panic("IAMClientMock.GetClientSecretFunc: method is nil but IAMClient.GetClientSecret was just called") - } - callInfo := struct { - InternalClientID string - AccessToken string - }{ - InternalClientID: internalClientID, - AccessToken: accessToken, - } - mock.lockGetClientSecret.Lock() - mock.calls.GetClientSecret = append(mock.calls.GetClientSecret, callInfo) - mock.lockGetClientSecret.Unlock() - return mock.GetClientSecretFunc(internalClientID, accessToken) -} - -// GetClientSecretCalls gets all the calls that were made to GetClientSecret. -// Check the length with: -// -// len(mockedIAMClient.GetClientSecretCalls()) -func (mock *IAMClientMock) GetClientSecretCalls() []struct { - InternalClientID string - AccessToken string -} { - var calls []struct { - InternalClientID string - AccessToken string - } - mock.lockGetClientSecret.RLock() - calls = mock.calls.GetClientSecret - mock.lockGetClientSecret.RUnlock() - return calls -} - -// GetClientServiceAccount calls GetClientServiceAccountFunc. -func (mock *IAMClientMock) GetClientServiceAccount(accessToken string, internalClient string) (*gocloak.User, error) { - if mock.GetClientServiceAccountFunc == nil { - panic("IAMClientMock.GetClientServiceAccountFunc: method is nil but IAMClient.GetClientServiceAccount was just called") - } - callInfo := struct { - AccessToken string - InternalClient string - }{ - AccessToken: accessToken, - InternalClient: internalClient, - } - mock.lockGetClientServiceAccount.Lock() - mock.calls.GetClientServiceAccount = append(mock.calls.GetClientServiceAccount, callInfo) - mock.lockGetClientServiceAccount.Unlock() - return mock.GetClientServiceAccountFunc(accessToken, internalClient) -} - -// GetClientServiceAccountCalls gets all the calls that were made to GetClientServiceAccount. -// Check the length with: -// -// len(mockedIAMClient.GetClientServiceAccountCalls()) -func (mock *IAMClientMock) GetClientServiceAccountCalls() []struct { - AccessToken string - InternalClient string -} { - var calls []struct { - AccessToken string - InternalClient string - } - mock.lockGetClientServiceAccount.RLock() - calls = mock.calls.GetClientServiceAccount - mock.lockGetClientServiceAccount.RUnlock() - return calls -} - -// GetClients calls GetClientsFunc. -func (mock *IAMClientMock) GetClients(accessToken string, first int, max int, attribute string) ([]*gocloak.Client, error) { - if mock.GetClientsFunc == nil { - panic("IAMClientMock.GetClientsFunc: method is nil but IAMClient.GetClients was just called") - } - callInfo := struct { - AccessToken string - First int - Max int - Attribute string - }{ - AccessToken: accessToken, - First: first, - Max: max, - Attribute: attribute, - } - mock.lockGetClients.Lock() - mock.calls.GetClients = append(mock.calls.GetClients, callInfo) - mock.lockGetClients.Unlock() - return mock.GetClientsFunc(accessToken, first, max, attribute) -} - -// GetClientsCalls gets all the calls that were made to GetClients. -// Check the length with: -// -// len(mockedIAMClient.GetClientsCalls()) -func (mock *IAMClientMock) GetClientsCalls() []struct { - AccessToken string - First int - Max int - Attribute string -} { - var calls []struct { - AccessToken string - First int - Max int - Attribute string - } - mock.lockGetClients.RLock() - calls = mock.calls.GetClients - mock.lockGetClients.RUnlock() - return calls -} - -// GetConfig calls GetConfigFunc. -func (mock *IAMClientMock) GetConfig() *IAMConfig { - if mock.GetConfigFunc == nil { - panic("IAMClientMock.GetConfigFunc: method is nil but IAMClient.GetConfig was just called") - } - callInfo := struct { - }{} - mock.lockGetConfig.Lock() - mock.calls.GetConfig = append(mock.calls.GetConfig, callInfo) - mock.lockGetConfig.Unlock() - return mock.GetConfigFunc() -} - -// GetConfigCalls gets all the calls that were made to GetConfig. -// Check the length with: -// -// len(mockedIAMClient.GetConfigCalls()) -func (mock *IAMClientMock) GetConfigCalls() []struct { -} { - var calls []struct { - } - mock.lockGetConfig.RLock() - calls = mock.calls.GetConfig - mock.lockGetConfig.RUnlock() - return calls -} - -// GetRealmConfig calls GetRealmConfigFunc. -func (mock *IAMClientMock) GetRealmConfig() *IAMRealmConfig { - if mock.GetRealmConfigFunc == nil { - panic("IAMClientMock.GetRealmConfigFunc: method is nil but IAMClient.GetRealmConfig was just called") - } - callInfo := struct { - }{} - mock.lockGetRealmConfig.Lock() - mock.calls.GetRealmConfig = append(mock.calls.GetRealmConfig, callInfo) - mock.lockGetRealmConfig.Unlock() - return mock.GetRealmConfigFunc() -} - -// GetRealmConfigCalls gets all the calls that were made to GetRealmConfig. -// Check the length with: -// -// len(mockedIAMClient.GetRealmConfigCalls()) -func (mock *IAMClientMock) GetRealmConfigCalls() []struct { -} { - var calls []struct { - } - mock.lockGetRealmConfig.RLock() - calls = mock.calls.GetRealmConfig - mock.lockGetRealmConfig.RUnlock() - return calls -} - -// GetRealmRole calls GetRealmRoleFunc. -func (mock *IAMClientMock) GetRealmRole(accessToken string, roleName string) (*gocloak.Role, error) { - if mock.GetRealmRoleFunc == nil { - panic("IAMClientMock.GetRealmRoleFunc: method is nil but IAMClient.GetRealmRole was just called") - } - callInfo := struct { - AccessToken string - RoleName string - }{ - AccessToken: accessToken, - RoleName: roleName, - } - mock.lockGetRealmRole.Lock() - mock.calls.GetRealmRole = append(mock.calls.GetRealmRole, callInfo) - mock.lockGetRealmRole.Unlock() - return mock.GetRealmRoleFunc(accessToken, roleName) -} - -// GetRealmRoleCalls gets all the calls that were made to GetRealmRole. -// Check the length with: -// -// len(mockedIAMClient.GetRealmRoleCalls()) -func (mock *IAMClientMock) GetRealmRoleCalls() []struct { - AccessToken string - RoleName string -} { - var calls []struct { - AccessToken string - RoleName string - } - mock.lockGetRealmRole.RLock() - calls = mock.calls.GetRealmRole - mock.lockGetRealmRole.RUnlock() - return calls -} - -// GetToken calls GetTokenFunc. -func (mock *IAMClientMock) GetToken() (string, error) { - if mock.GetTokenFunc == nil { - panic("IAMClientMock.GetTokenFunc: method is nil but IAMClient.GetToken was just called") - } - callInfo := struct { - }{} - mock.lockGetToken.Lock() - mock.calls.GetToken = append(mock.calls.GetToken, callInfo) - mock.lockGetToken.Unlock() - return mock.GetTokenFunc() -} - -// GetTokenCalls gets all the calls that were made to GetToken. -// Check the length with: -// -// len(mockedIAMClient.GetTokenCalls()) -func (mock *IAMClientMock) GetTokenCalls() []struct { -} { - var calls []struct { - } - mock.lockGetToken.RLock() - calls = mock.calls.GetToken - mock.lockGetToken.RUnlock() - return calls -} - -// IsClientExist calls IsClientExistFunc. -func (mock *IAMClientMock) IsClientExist(clientID string, accessToken string) (string, error) { - if mock.IsClientExistFunc == nil { - panic("IAMClientMock.IsClientExistFunc: method is nil but IAMClient.IsClientExist was just called") - } - callInfo := struct { - ClientID string - AccessToken string - }{ - ClientID: clientID, - AccessToken: accessToken, - } - mock.lockIsClientExist.Lock() - mock.calls.IsClientExist = append(mock.calls.IsClientExist, callInfo) - mock.lockIsClientExist.Unlock() - return mock.IsClientExistFunc(clientID, accessToken) -} - -// IsClientExistCalls gets all the calls that were made to IsClientExist. -// Check the length with: -// -// len(mockedIAMClient.IsClientExistCalls()) -func (mock *IAMClientMock) IsClientExistCalls() []struct { - ClientID string - AccessToken string -} { - var calls []struct { - ClientID string - AccessToken string - } - mock.lockIsClientExist.RLock() - calls = mock.calls.IsClientExist - mock.lockIsClientExist.RUnlock() - return calls -} - -// IsOwner calls IsOwnerFunc. -func (mock *IAMClientMock) IsOwner(client *gocloak.Client, userID string) bool { - if mock.IsOwnerFunc == nil { - panic("IAMClientMock.IsOwnerFunc: method is nil but IAMClient.IsOwner was just called") - } - callInfo := struct { - Client *gocloak.Client - UserID string - }{ - Client: client, - UserID: userID, - } - mock.lockIsOwner.Lock() - mock.calls.IsOwner = append(mock.calls.IsOwner, callInfo) - mock.lockIsOwner.Unlock() - return mock.IsOwnerFunc(client, userID) -} - -// IsOwnerCalls gets all the calls that were made to IsOwner. -// Check the length with: -// -// len(mockedIAMClient.IsOwnerCalls()) -func (mock *IAMClientMock) IsOwnerCalls() []struct { - Client *gocloak.Client - UserID string -} { - var calls []struct { - Client *gocloak.Client - UserID string - } - mock.lockIsOwner.RLock() - calls = mock.calls.IsOwner - mock.lockIsOwner.RUnlock() - return calls -} - -// IsSameOrg calls IsSameOrgFunc. -func (mock *IAMClientMock) IsSameOrg(client *gocloak.Client, orgID string) bool { - if mock.IsSameOrgFunc == nil { - panic("IAMClientMock.IsSameOrgFunc: method is nil but IAMClient.IsSameOrg was just called") - } - callInfo := struct { - Client *gocloak.Client - OrgID string - }{ - Client: client, - OrgID: orgID, - } - mock.lockIsSameOrg.Lock() - mock.calls.IsSameOrg = append(mock.calls.IsSameOrg, callInfo) - mock.lockIsSameOrg.Unlock() - return mock.IsSameOrgFunc(client, orgID) -} - -// IsSameOrgCalls gets all the calls that were made to IsSameOrg. -// Check the length with: -// -// len(mockedIAMClient.IsSameOrgCalls()) -func (mock *IAMClientMock) IsSameOrgCalls() []struct { - Client *gocloak.Client - OrgID string -} { - var calls []struct { - Client *gocloak.Client - OrgID string - } - mock.lockIsSameOrg.RLock() - calls = mock.calls.IsSameOrg - mock.lockIsSameOrg.RUnlock() - return calls -} - -// RegenerateClientSecret calls RegenerateClientSecretFunc. -func (mock *IAMClientMock) RegenerateClientSecret(accessToken string, id string) (*gocloak.CredentialRepresentation, error) { - if mock.RegenerateClientSecretFunc == nil { - panic("IAMClientMock.RegenerateClientSecretFunc: method is nil but IAMClient.RegenerateClientSecret was just called") - } - callInfo := struct { - AccessToken string - ID string - }{ - AccessToken: accessToken, - ID: id, - } - mock.lockRegenerateClientSecret.Lock() - mock.calls.RegenerateClientSecret = append(mock.calls.RegenerateClientSecret, callInfo) - mock.lockRegenerateClientSecret.Unlock() - return mock.RegenerateClientSecretFunc(accessToken, id) -} - -// RegenerateClientSecretCalls gets all the calls that were made to RegenerateClientSecret. -// Check the length with: -// -// len(mockedIAMClient.RegenerateClientSecretCalls()) -func (mock *IAMClientMock) RegenerateClientSecretCalls() []struct { - AccessToken string - ID string -} { - var calls []struct { - AccessToken string - ID string - } - mock.lockRegenerateClientSecret.RLock() - calls = mock.calls.RegenerateClientSecret - mock.lockRegenerateClientSecret.RUnlock() - return calls -} - -// UpdateServiceAccountUser calls UpdateServiceAccountUserFunc. -func (mock *IAMClientMock) UpdateServiceAccountUser(accessToken string, serviceAccountUser gocloak.User) error { - if mock.UpdateServiceAccountUserFunc == nil { - panic("IAMClientMock.UpdateServiceAccountUserFunc: method is nil but IAMClient.UpdateServiceAccountUser was just called") - } - callInfo := struct { - AccessToken string - ServiceAccountUser gocloak.User - }{ - AccessToken: accessToken, - ServiceAccountUser: serviceAccountUser, - } - mock.lockUpdateServiceAccountUser.Lock() - mock.calls.UpdateServiceAccountUser = append(mock.calls.UpdateServiceAccountUser, callInfo) - mock.lockUpdateServiceAccountUser.Unlock() - return mock.UpdateServiceAccountUserFunc(accessToken, serviceAccountUser) -} - -// UpdateServiceAccountUserCalls gets all the calls that were made to UpdateServiceAccountUser. -// Check the length with: -// -// len(mockedIAMClient.UpdateServiceAccountUserCalls()) -func (mock *IAMClientMock) UpdateServiceAccountUserCalls() []struct { - AccessToken string - ServiceAccountUser gocloak.User -} { - var calls []struct { - AccessToken string - ServiceAccountUser gocloak.User - } - mock.lockUpdateServiceAccountUser.RLock() - calls = mock.calls.UpdateServiceAccountUser - mock.lockUpdateServiceAccountUser.RUnlock() - return calls -} - -// UserHasRealmRole calls UserHasRealmRoleFunc. -func (mock *IAMClientMock) UserHasRealmRole(accessToken string, userID string, roleName string) (*gocloak.Role, error) { - if mock.UserHasRealmRoleFunc == nil { - panic("IAMClientMock.UserHasRealmRoleFunc: method is nil but IAMClient.UserHasRealmRole was just called") - } - callInfo := struct { - AccessToken string - UserID string - RoleName string - }{ - AccessToken: accessToken, - UserID: userID, - RoleName: roleName, - } - mock.lockUserHasRealmRole.Lock() - mock.calls.UserHasRealmRole = append(mock.calls.UserHasRealmRole, callInfo) - mock.lockUserHasRealmRole.Unlock() - return mock.UserHasRealmRoleFunc(accessToken, userID, roleName) -} - -// UserHasRealmRoleCalls gets all the calls that were made to UserHasRealmRole. -// Check the length with: -// -// len(mockedIAMClient.UserHasRealmRoleCalls()) -func (mock *IAMClientMock) UserHasRealmRoleCalls() []struct { - AccessToken string - UserID string - RoleName string -} { - var calls []struct { - AccessToken string - UserID string - RoleName string - } - mock.lockUserHasRealmRole.RLock() - calls = mock.calls.UserHasRealmRole - mock.lockUserHasRealmRole.RUnlock() - return calls -} diff --git a/pkg/client/iam/client_test.go b/pkg/client/iam/client_test.go deleted file mode 100644 index 1881acfc4d..0000000000 --- a/pkg/client/iam/client_test.go +++ /dev/null @@ -1,355 +0,0 @@ -package iam - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/pkg/errors" - "github.com/stackrox/acs-fleet-manager/pkg/auth" - - "github.com/Nerzal/gocloak/v11" - "github.com/golang-jwt/jwt/v4" - "github.com/onsi/gomega" - "github.com/patrickmn/go-cache" -) - -const ( - accessToken = "accessToken" - clientID = "123" - validIssuerURI = "testIssuerURI" - jwtKeyFile = "test/support/jwt_private_key.pem" - jwtCAFile = "test/support/jwt_ca.pem" - issuerURL = "" -) - -func Test_kcClient_GetToken(t *testing.T) { - authHelper, err := auth.NewAuthHelper(jwtKeyFile, jwtCAFile, issuerURL) - if err != nil { - t.Fatal(err) - } - - acc, err := authHelper.NewAccount("username", "test-user", "", "org-id-0") - if err != nil { - t.Fatal(err) - } - - type fields struct { - goCloakClient gocloak.GoCloak - ctx context.Context - config *IAMConfig - realmConfig *IAMRealmConfig - cache *cache.Cache - } - - var goCloakToken gocloak.JWT - cachedTK := fmt.Sprintf("%s%s", validIssuerURI, clientID) - grantType := "grantType" - Realm := "realmUno" - JwksEndpointURI := "JwksEndpointURI" - TokenEndpointURI := "TokenEndpointURI" - tokenClaimType := "" - claimsExpiredEXP := jwt.MapClaims{ - "typ": tokenClaimType, - "iat": time.Now().Unix(), - "exp": time.Now().Add(time.Minute * time.Duration(-5)).Unix(), - } - jwtTokenExpired, _ := authHelper.CreateSignedJWT(acc, claimsExpiredEXP) - tests := []struct { - name string - fields fields - want string - wantErr bool - setupFn func(f *fields) - wantNewToken bool - }{ - { - name: "failed to get token", - fields: fields{ - realmConfig: &IAMRealmConfig{ - ClientID: clientID, - GrantType: grantType, - ValidIssuerURI: validIssuerURI, - TokenEndpointURI: TokenEndpointURI, - JwksEndpointURI: JwksEndpointURI, - Realm: Realm, - }, - goCloakClient: &GoCloakMock{ - GetTokenFunc: func(ctx context.Context, realm string, options gocloak.TokenOptions) (*gocloak.JWT, error) { - return nil, errors.Errorf("failed to get token") - }, - }, - cache: cache.New(tokenLifeDuration, cacheCleanupInterval), - }, - wantErr: true, - }, - { - name: "successfully get new access token when no token is in cache", - fields: fields{ - realmConfig: &IAMRealmConfig{ - ClientID: clientID, - GrantType: grantType, - ValidIssuerURI: validIssuerURI, - TokenEndpointURI: TokenEndpointURI, - JwksEndpointURI: JwksEndpointURI, - Realm: Realm, - }, - goCloakClient: &GoCloakMock{ - GetTokenFunc: func(ctx context.Context, realm string, options gocloak.TokenOptions) (*gocloak.JWT, error) { - goCloakToken.AccessToken = accessToken - return &goCloakToken, nil - }, - }, - cache: cache.New(tokenLifeDuration, cacheCleanupInterval), - }, - wantErr: false, - want: accessToken, - }, - { - name: "successfully create new token when token retrieved from cache is expired", - setupFn: func(f *fields) { - f.cache.Set(cachedTK, jwtTokenExpired, tokenLifeDuration) - }, - fields: fields{ - realmConfig: &IAMRealmConfig{ - ClientID: clientID, - GrantType: grantType, - ValidIssuerURI: validIssuerURI, - TokenEndpointURI: TokenEndpointURI, - JwksEndpointURI: JwksEndpointURI, - Realm: Realm, - }, - cache: cache.New(tokenLifeDuration, cacheCleanupInterval), - goCloakClient: &GoCloakMock{ - GetTokenFunc: func(ctx context.Context, realm string, options gocloak.TokenOptions) (*gocloak.JWT, error) { - goCloakToken.AccessToken = accessToken - return &goCloakToken, nil - }, - }, - }, - wantErr: false, - want: accessToken, - wantNewToken: true, - }, - } - for _, tt := range tests { - gomega.RegisterTestingT(t) - t.Run(tt.name, func(t *testing.T) { - if tt.setupFn != nil { - tt.setupFn(&tt.fields) - } - ic := &iamClient{ - kcClient: tt.fields.goCloakClient, - ctx: tt.fields.ctx, - config: tt.fields.config, - realmConfig: tt.fields.realmConfig, - cache: tt.fields.cache, - } - cachedToken, err := ic.GetToken() - - gomega.Expect(err != nil).To(gomega.Equal(tt.wantErr)) - if cachedToken != "" && tt.wantNewToken { - gomega.Expect(goCloakToken.AccessToken).To(gomega.Equal(tt.want)) - } - }) - } -} - -func Test_kcClient_IsClientExist(t *testing.T) { - type fields struct { - goCloakClient gocloak.GoCloak - realmConfig *IAMRealmConfig - } - - type args struct { - requestClientID string - accessToken string - } - - grantType := "grantType" - Realm := "realmUno" - JwksEndpointURI := "JwksEndpointURI" - TokenEndpointURI := "TokenEndpointURI" - otherClientID := "456" - correctClientID := "123" - correctInternalID := "correctID" - otherInternalID := "otherID" - - tests := []struct { - name string - fields fields - args args - want string - wantErr bool - }{ - { - name: "error when no client exists with request clientId", - fields: fields{ - goCloakClient: &GoCloakMock{ - GetClientsFunc: func(ctx context.Context, accessToken, realm string, params gocloak.GetClientsParams) ([]*gocloak.Client, error) { - return nil, errors.Errorf("no client exists with requested clientId") - }, - }, - realmConfig: &IAMRealmConfig{ - ClientID: clientID, - GrantType: grantType, - ValidIssuerURI: validIssuerURI, - TokenEndpointURI: TokenEndpointURI, - JwksEndpointURI: JwksEndpointURI, - Realm: Realm, - }, - }, - args: args{ - requestClientID: otherClientID, - }, - wantErr: true, - want: "", - }, - { - name: "success when correct internal ID is returned", - fields: fields{ - goCloakClient: &GoCloakMock{ - GetClientsFunc: func(ctx context.Context, accessToken, realm string, params gocloak.GetClientsParams) ([]*gocloak.Client, error) { - return []*gocloak.Client{ - { - ClientID: &otherClientID, - ID: &otherInternalID, - }, - { - ClientID: &correctClientID, - ID: &correctInternalID, - }, - }, nil - }, - }, - realmConfig: &IAMRealmConfig{ - ClientID: clientID, - GrantType: grantType, - ValidIssuerURI: validIssuerURI, - TokenEndpointURI: TokenEndpointURI, - JwksEndpointURI: JwksEndpointURI, - Realm: Realm, - }, - }, - args: args{ - requestClientID: correctClientID, - }, - wantErr: false, - want: correctInternalID, - }, - } - for _, tt := range tests { - gomega.RegisterTestingT(t) - t.Run(tt.name, func(t *testing.T) { - ic := &iamClient{ - kcClient: tt.fields.goCloakClient, - realmConfig: tt.fields.realmConfig, - } - internalID, err := ic.IsClientExist(tt.args.requestClientID, tt.args.accessToken) - - gomega.Expect(err != nil).To(gomega.Equal(tt.wantErr)) - gomega.Expect(internalID).To(gomega.Equal(tt.want)) - - }) - } -} - -func Test_kcClient_GetClient(t *testing.T) { - type fields struct { - goCloakClient gocloak.GoCloak - realmConfig *IAMRealmConfig - } - - type args struct { - requestClientID string - accessToken string - } - - grantType := "grantType" - Realm := "realmUno" - JwksEndpointURI := "JwksEndpointURI" - TokenEndpointURI := "TokenEndpointURI" - otherClientID := "456" - correctClientID := "123" - correctInternalID := "correctID" - otherInternalID := "otherID" - - tests := []struct { - name string - fields fields - args args - want string - wantErr bool - }{ - { - name: "error when no client exists with request clientId", - fields: fields{ - goCloakClient: &GoCloakMock{ - GetClientsFunc: func(ctx context.Context, accessToken, realm string, params gocloak.GetClientsParams) ([]*gocloak.Client, error) { - return nil, errors.Errorf("no client exists with requested clientId") - }, - }, - realmConfig: &IAMRealmConfig{ - ClientID: clientID, - GrantType: grantType, - ValidIssuerURI: validIssuerURI, - TokenEndpointURI: TokenEndpointURI, - JwksEndpointURI: JwksEndpointURI, - Realm: Realm, - }, - }, - args: args{ - requestClientID: otherClientID, - }, - wantErr: true, - }, - { - name: "success when correct internal ID is returned", - fields: fields{ - goCloakClient: &GoCloakMock{ - GetClientsFunc: func(ctx context.Context, accessToken, realm string, params gocloak.GetClientsParams) ([]*gocloak.Client, error) { - return []*gocloak.Client{ - { - ClientID: &otherClientID, - ID: &otherInternalID, - }, - { - ClientID: &correctClientID, - ID: &correctInternalID, - }, - }, nil - }, - }, - realmConfig: &IAMRealmConfig{ - ClientID: clientID, - GrantType: grantType, - ValidIssuerURI: validIssuerURI, - TokenEndpointURI: TokenEndpointURI, - JwksEndpointURI: JwksEndpointURI, - Realm: Realm, - }, - }, - args: args{ - requestClientID: "123", - }, - wantErr: false, - want: correctInternalID, - }, - } - for _, tt := range tests { - gomega.RegisterTestingT(t) - t.Run(tt.name, func(t *testing.T) { - ic := &iamClient{ - kcClient: tt.fields.goCloakClient, - realmConfig: tt.fields.realmConfig, - } - client, err := ic.GetClient(tt.args.requestClientID, tt.args.accessToken) - - gomega.Expect(err != nil).To(gomega.Equal(tt.wantErr)) - if client != nil { - gomega.Expect(*client.ID).To(gomega.Equal(tt.want)) - } - }) - } -} diff --git a/pkg/client/iam/config.go b/pkg/client/iam/config.go index 840bafbc0f..1dc7bf279b 100644 --- a/pkg/client/iam/config.go +++ b/pkg/client/iam/config.go @@ -18,18 +18,11 @@ import ( // IAMConfig ... type IAMConfig struct { - BaseURL string `json:"base_url"` - SsoBaseURL string `json:"sso_base_url"` - InternalSsoBaseURL string `json:"internal_sso_base_url"` - Debug bool `json:"debug"` - InsecureSkipVerify bool `json:"insecure-skip-verify"` - RedhatSSORealm *IAMRealmConfig `json:"redhat_sso_config"` - InternalSSORealm *IAMRealmConfig `json:"internal_sso_config"` - MaxAllowedServiceAccounts int `json:"max_allowed_service_accounts"` - MaxLimitForGetClients int `json:"max_limit_for_get_clients"` - ServiceAccounttLimitCheckSkipOrgIDListFile string `json:"-"` - ServiceAccounttLimitCheckSkipOrgIDList []string `json:"-"` - AdditionalSSOIssuers *AdditionalSSOIssuers `json:"-"` + SsoBaseURL string `json:"sso_base_url"` + InternalSsoBaseURL string `json:"internal_sso_base_url"` + RedhatSSORealm *IAMRealmConfig `json:"redhat_sso_config"` + InternalSSORealm *IAMRealmConfig `json:"internal_sso_config"` + AdditionalSSOIssuers *AdditionalSSOIssuers `json:"-"` } // AdditionalSSOIssuers ... @@ -101,10 +94,7 @@ func (c *IAMRealmConfig) validateConfiguration() error { // NewIAMConfig ... func NewIAMConfig() *IAMConfig { kc := &IAMConfig{ - SsoBaseURL: "https://sso.redhat.com", - Debug: false, - InsecureSkipVerify: false, - MaxLimitForGetClients: 100, + SsoBaseURL: "https://sso.redhat.com", RedhatSSORealm: &IAMRealmConfig{ APIEndpointURI: "/auth/realms/redhat-external", Realm: "redhat-external", @@ -116,25 +106,17 @@ func NewIAMConfig() *IAMConfig { APIEndpointURI: "/auth/realms/EmployeeIDP", Realm: "EmployeeIDP", }, - InternalSsoBaseURL: "https://auth.redhat.com", - MaxAllowedServiceAccounts: 50, - ServiceAccounttLimitCheckSkipOrgIDListFile: "config/service-account-limits-check-skip-org-id-list.yaml", - AdditionalSSOIssuers: &AdditionalSSOIssuers{}, + InternalSsoBaseURL: "https://auth.redhat.com", + AdditionalSSOIssuers: &AdditionalSSOIssuers{}, } return kc } // AddFlags ... func (ic *IAMConfig) AddFlags(fs *pflag.FlagSet) { - fs.StringVar(&ic.BaseURL, "sso-base-url", ic.BaseURL, "The base URL of the sso, integration by default") - fs.BoolVar(&ic.Debug, "sso-debug", ic.Debug, "Debug flag for IAM API") - fs.BoolVar(&ic.InsecureSkipVerify, "sso-insecure", ic.InsecureSkipVerify, "Disable tls verification with sso") - fs.IntVar(&ic.MaxAllowedServiceAccounts, "max-allowed-service-accounts", ic.MaxAllowedServiceAccounts, "Max allowed service accounts per org") - fs.IntVar(&ic.MaxLimitForGetClients, "max-limit-for-sso-get-clients", ic.MaxLimitForGetClients, "Max limits for SSO get clients") fs.StringVar(&ic.RedhatSSORealm.ClientIDFile, "redhat-sso-client-id-file", ic.RedhatSSORealm.ClientIDFile, "File containing IAM privileged account client-id that has access to the OSD Cluster IDP realm") fs.StringVar(&ic.RedhatSSORealm.ClientSecretFile, "redhat-sso-client-secret-file", ic.RedhatSSORealm.ClientSecretFile, "File containing IAM privileged account client-secret that has access to the OSD Cluster IDP realm") fs.StringVar(&ic.SsoBaseURL, "redhat-sso-base-url", ic.SsoBaseURL, "The base URL of the SSO, integration by default") - fs.StringVar(&ic.ServiceAccounttLimitCheckSkipOrgIDListFile, "service-account-limits-check-skip-org-id-list-file", ic.ServiceAccounttLimitCheckSkipOrgIDListFile, "File containing a list of Org IDs for which service account limits check will be skipped") fs.BoolVar(&ic.AdditionalSSOIssuers.Enabled, "enable-additional-sso-issuers", ic.AdditionalSSOIssuers.Enabled, "Enable additional SSO issuer URIs for verifying tokens") fs.StringVar(&ic.AdditionalSSOIssuers.File, "additional-sso-issuers-file", ic.AdditionalSSOIssuers.File, "File containing a list of SSO issuer URIs to include for verifying tokens") fs.StringVar(&ic.InternalSsoBaseURL, "internal-sso-base-url", ic.InternalSsoBaseURL, "The base URL of the internal SSO, production by default") @@ -151,16 +133,6 @@ func (ic *IAMConfig) ReadFiles() error { return fmt.Errorf("reading Red Hat SSO Real Client secret file %q: %w", ic.RedhatSSORealm.ClientSecretFile, err) } - // Read the service account limits check skip org ID yaml file - err = shared.ReadYamlFile(ic.ServiceAccounttLimitCheckSkipOrgIDListFile, &ic.ServiceAccounttLimitCheckSkipOrgIDList) - if err != nil { - if errors.Is(err, fs.ErrNotExist) { - glog.V(10).Infof("Specified service account limits skip org IDs file %q does not exist. Proceeding as if no service account org ID skip list was provided", ic.ServiceAccounttLimitCheckSkipOrgIDListFile) - } else { - return fmt.Errorf("reading the service account limits check skip org ID yaml file %q: %w", ic.ServiceAccounttLimitCheckSkipOrgIDListFile, err) - } - } - ic.RedhatSSORealm.setDefaultURIs(ic.SsoBaseURL) ic.InternalSSORealm.setDefaultURIs(ic.InternalSsoBaseURL) if err := ic.RedhatSSORealm.validateConfiguration(); err != nil { diff --git a/pkg/client/iam/gocloak_moq.go b/pkg/client/iam/gocloak_moq.go deleted file mode 100644 index bd4f203d7e..0000000000 --- a/pkg/client/iam/gocloak_moq.go +++ /dev/null @@ -1,15174 +0,0 @@ -// Code generated by moq; DO NOT EDIT. -// github.com/matryer/moq - -package iam - -import ( - "context" - "github.com/Nerzal/gocloak/v11" - "github.com/go-resty/resty/v2" - "github.com/golang-jwt/jwt/v4" - "io" - "sync" -) - -// Ensure, that GoCloakMock does implement GoCloak. -// If this is not the case, regenerate this file with moq. -var _ GoCloak = &GoCloakMock{} - -// GoCloakMock is a mock implementation of GoCloak. -// -// func TestSomethingThatUsesGoCloak(t *testing.T) { -// -// // make and configure a mocked GoCloak -// mockedGoCloak := &GoCloakMock{ -// AddClientRoleCompositeFunc: func(ctx context.Context, token string, realm string, roleID string, roles []gocloak.Role) error { -// panic("mock out the AddClientRoleComposite method") -// }, -// AddClientRoleToGroupFunc: func(ctx context.Context, token string, realm string, idOfClient string, groupID string, roles []gocloak.Role) error { -// panic("mock out the AddClientRoleToGroup method") -// }, -// AddClientRoleToUserFunc: func(ctx context.Context, token string, realm string, idOfClient string, userID string, roles []gocloak.Role) error { -// panic("mock out the AddClientRoleToUser method") -// }, -// AddDefaultGroupFunc: func(ctx context.Context, accessToken string, realm string, groupID string) error { -// panic("mock out the AddDefaultGroup method") -// }, -// AddDefaultScopeToClientFunc: func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error { -// panic("mock out the AddDefaultScopeToClient method") -// }, -// AddOptionalScopeToClientFunc: func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error { -// panic("mock out the AddOptionalScopeToClient method") -// }, -// AddRealmRoleCompositeFunc: func(ctx context.Context, token string, realm string, roleName string, roles []gocloak.Role) error { -// panic("mock out the AddRealmRoleComposite method") -// }, -// AddRealmRoleToGroupFunc: func(ctx context.Context, token string, realm string, groupID string, roles []gocloak.Role) error { -// panic("mock out the AddRealmRoleToGroup method") -// }, -// AddRealmRoleToUserFunc: func(ctx context.Context, token string, realm string, userID string, roles []gocloak.Role) error { -// panic("mock out the AddRealmRoleToUser method") -// }, -// AddUserToGroupFunc: func(ctx context.Context, token string, realm string, userID string, groupID string) error { -// panic("mock out the AddUserToGroup method") -// }, -// ClearKeysCacheFunc: func(ctx context.Context, token string, realm string) error { -// panic("mock out the ClearKeysCache method") -// }, -// ClearRealmCacheFunc: func(ctx context.Context, token string, realm string) error { -// panic("mock out the ClearRealmCache method") -// }, -// ClearUserCacheFunc: func(ctx context.Context, token string, realm string) error { -// panic("mock out the ClearUserCache method") -// }, -// CreateAuthenticationExecutionFunc: func(ctx context.Context, token string, realm string, flow string, execution gocloak.CreateAuthenticationExecutionRepresentation) error { -// panic("mock out the CreateAuthenticationExecution method") -// }, -// CreateAuthenticationExecutionFlowFunc: func(ctx context.Context, token string, realm string, flow string, execution gocloak.CreateAuthenticationExecutionFlowRepresentation) error { -// panic("mock out the CreateAuthenticationExecutionFlow method") -// }, -// CreateAuthenticationFlowFunc: func(ctx context.Context, token string, realm string, flow gocloak.AuthenticationFlowRepresentation) error { -// panic("mock out the CreateAuthenticationFlow method") -// }, -// CreateChildGroupFunc: func(ctx context.Context, token string, realm string, groupID string, group gocloak.Group) (string, error) { -// panic("mock out the CreateChildGroup method") -// }, -// CreateClientFunc: func(ctx context.Context, accessToken string, realm string, newClient gocloak.Client) (string, error) { -// panic("mock out the CreateClient method") -// }, -// CreateClientProtocolMapperFunc: func(ctx context.Context, token string, realm string, idOfClient string, mapper gocloak.ProtocolMapperRepresentation) (string, error) { -// panic("mock out the CreateClientProtocolMapper method") -// }, -// CreateClientRepresentationFunc: func(ctx context.Context, realm string) (*gocloak.Client, error) { -// panic("mock out the CreateClientRepresentation method") -// }, -// CreateClientRoleFunc: func(ctx context.Context, accessToken string, realm string, idOfClient string, role gocloak.Role) (string, error) { -// panic("mock out the CreateClientRole method") -// }, -// CreateClientScopeFunc: func(ctx context.Context, accessToken string, realm string, scope gocloak.ClientScope) (string, error) { -// panic("mock out the CreateClientScope method") -// }, -// CreateClientScopeMappingsClientRolesFunc: func(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string, roles []gocloak.Role) error { -// panic("mock out the CreateClientScopeMappingsClientRoles method") -// }, -// CreateClientScopeMappingsRealmRolesFunc: func(ctx context.Context, token string, realm string, idOfClient string, roles []gocloak.Role) error { -// panic("mock out the CreateClientScopeMappingsRealmRoles method") -// }, -// CreateClientScopeProtocolMapperFunc: func(ctx context.Context, accessToken string, realm string, scopeID string, protocolMapper gocloak.ProtocolMappers) (string, error) { -// panic("mock out the CreateClientScopeProtocolMapper method") -// }, -// CreateClientScopesScopeMappingsClientRolesFunc: func(ctx context.Context, token string, realm string, idOfClientScope string, idOfClient string, roles []gocloak.Role) error { -// panic("mock out the CreateClientScopesScopeMappingsClientRoles method") -// }, -// CreateClientScopesScopeMappingsRealmRolesFunc: func(ctx context.Context, token string, realm string, idOfClientScope string, roles []gocloak.Role) error { -// panic("mock out the CreateClientScopesScopeMappingsRealmRoles method") -// }, -// CreateComponentFunc: func(ctx context.Context, accessToken string, realm string, component gocloak.Component) (string, error) { -// panic("mock out the CreateComponent method") -// }, -// CreateGroupFunc: func(ctx context.Context, accessToken string, realm string, group gocloak.Group) (string, error) { -// panic("mock out the CreateGroup method") -// }, -// CreateIdentityProviderFunc: func(ctx context.Context, token string, realm string, providerRep gocloak.IdentityProviderRepresentation) (string, error) { -// panic("mock out the CreateIdentityProvider method") -// }, -// CreateIdentityProviderMapperFunc: func(ctx context.Context, token string, realm string, alias string, mapper gocloak.IdentityProviderMapper) (string, error) { -// panic("mock out the CreateIdentityProviderMapper method") -// }, -// CreatePermissionFunc: func(ctx context.Context, token string, realm string, idOfClient string, permission gocloak.PermissionRepresentation) (*gocloak.PermissionRepresentation, error) { -// panic("mock out the CreatePermission method") -// }, -// CreatePermissionTicketFunc: func(ctx context.Context, token string, realm string, permissions []gocloak.CreatePermissionTicketParams) (*gocloak.PermissionTicketResponseRepresentation, error) { -// panic("mock out the CreatePermissionTicket method") -// }, -// CreatePolicyFunc: func(ctx context.Context, token string, realm string, idOfClient string, policy gocloak.PolicyRepresentation) (*gocloak.PolicyRepresentation, error) { -// panic("mock out the CreatePolicy method") -// }, -// CreateRealmFunc: func(ctx context.Context, token string, realm gocloak.RealmRepresentation) (string, error) { -// panic("mock out the CreateRealm method") -// }, -// CreateRealmRoleFunc: func(ctx context.Context, token string, realm string, role gocloak.Role) (string, error) { -// panic("mock out the CreateRealmRole method") -// }, -// CreateResourceFunc: func(ctx context.Context, token string, realm string, idOfClient string, resource gocloak.ResourceRepresentation) (*gocloak.ResourceRepresentation, error) { -// panic("mock out the CreateResource method") -// }, -// CreateResourceClientFunc: func(ctx context.Context, token string, realm string, resource gocloak.ResourceRepresentation) (*gocloak.ResourceRepresentation, error) { -// panic("mock out the CreateResourceClient method") -// }, -// CreateResourcePolicyFunc: func(ctx context.Context, token string, realm string, resourceID string, policy gocloak.ResourcePolicyRepresentation) (*gocloak.ResourcePolicyRepresentation, error) { -// panic("mock out the CreateResourcePolicy method") -// }, -// CreateScopeFunc: func(ctx context.Context, token string, realm string, idOfClient string, scope gocloak.ScopeRepresentation) (*gocloak.ScopeRepresentation, error) { -// panic("mock out the CreateScope method") -// }, -// CreateUserFunc: func(ctx context.Context, token string, realm string, user gocloak.User) (string, error) { -// panic("mock out the CreateUser method") -// }, -// CreateUserFederatedIdentityFunc: func(ctx context.Context, token string, realm string, userID string, providerID string, federatedIdentityRep gocloak.FederatedIdentityRepresentation) error { -// panic("mock out the CreateUserFederatedIdentity method") -// }, -// DecodeAccessTokenFunc: func(ctx context.Context, accessToken string, realm string) (*jwt.Token, *jwt.MapClaims, error) { -// panic("mock out the DecodeAccessToken method") -// }, -// DecodeAccessTokenCustomClaimsFunc: func(ctx context.Context, accessToken string, realm string, claims jwt.Claims) (*jwt.Token, error) { -// panic("mock out the DecodeAccessTokenCustomClaims method") -// }, -// DeleteAuthenticationExecutionFunc: func(ctx context.Context, token string, realm string, executionID string) error { -// panic("mock out the DeleteAuthenticationExecution method") -// }, -// DeleteAuthenticationFlowFunc: func(ctx context.Context, token string, realm string, flowID string) error { -// panic("mock out the DeleteAuthenticationFlow method") -// }, -// DeleteClientFunc: func(ctx context.Context, accessToken string, realm string, idOfClient string) error { -// panic("mock out the DeleteClient method") -// }, -// DeleteClientProtocolMapperFunc: func(ctx context.Context, token string, realm string, idOfClient string, mapperID string) error { -// panic("mock out the DeleteClientProtocolMapper method") -// }, -// DeleteClientRepresentationFunc: func(ctx context.Context, accessToken string, realm string, clientID string) error { -// panic("mock out the DeleteClientRepresentation method") -// }, -// DeleteClientRoleFunc: func(ctx context.Context, accessToken string, realm string, idOfClient string, roleName string) error { -// panic("mock out the DeleteClientRole method") -// }, -// DeleteClientRoleCompositeFunc: func(ctx context.Context, token string, realm string, roleID string, roles []gocloak.Role) error { -// panic("mock out the DeleteClientRoleComposite method") -// }, -// DeleteClientRoleFromGroupFunc: func(ctx context.Context, token string, realm string, idOfClient string, groupID string, roles []gocloak.Role) error { -// panic("mock out the DeleteClientRoleFromGroup method") -// }, -// DeleteClientRoleFromUserFunc: func(ctx context.Context, token string, realm string, idOfClient string, userID string, roles []gocloak.Role) error { -// panic("mock out the DeleteClientRoleFromUser method") -// }, -// DeleteClientScopeFunc: func(ctx context.Context, accessToken string, realm string, scopeID string) error { -// panic("mock out the DeleteClientScope method") -// }, -// DeleteClientScopeMappingsClientRolesFunc: func(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string, roles []gocloak.Role) error { -// panic("mock out the DeleteClientScopeMappingsClientRoles method") -// }, -// DeleteClientScopeMappingsRealmRolesFunc: func(ctx context.Context, token string, realm string, idOfClient string, roles []gocloak.Role) error { -// panic("mock out the DeleteClientScopeMappingsRealmRoles method") -// }, -// DeleteClientScopeProtocolMapperFunc: func(ctx context.Context, accessToken string, realm string, scopeID string, protocolMapperID string) error { -// panic("mock out the DeleteClientScopeProtocolMapper method") -// }, -// DeleteClientScopesScopeMappingsClientRolesFunc: func(ctx context.Context, token string, realm string, idOfClientScope string, ifOfClient string, roles []gocloak.Role) error { -// panic("mock out the DeleteClientScopesScopeMappingsClientRoles method") -// }, -// DeleteClientScopesScopeMappingsRealmRolesFunc: func(ctx context.Context, token string, realm string, idOfClientScope string, roles []gocloak.Role) error { -// panic("mock out the DeleteClientScopesScopeMappingsRealmRoles method") -// }, -// DeleteComponentFunc: func(ctx context.Context, accessToken string, realm string, componentID string) error { -// panic("mock out the DeleteComponent method") -// }, -// DeleteCredentialsFunc: func(ctx context.Context, token string, realm string, UserID string, CredentialID string) error { -// panic("mock out the DeleteCredentials method") -// }, -// DeleteGroupFunc: func(ctx context.Context, accessToken string, realm string, groupID string) error { -// panic("mock out the DeleteGroup method") -// }, -// DeleteIdentityProviderFunc: func(ctx context.Context, token string, realm string, alias string) error { -// panic("mock out the DeleteIdentityProvider method") -// }, -// DeleteIdentityProviderMapperFunc: func(ctx context.Context, token string, realm string, alias string, mapperID string) error { -// panic("mock out the DeleteIdentityProviderMapper method") -// }, -// DeletePermissionFunc: func(ctx context.Context, token string, realm string, idOfClient string, permissionID string) error { -// panic("mock out the DeletePermission method") -// }, -// DeletePolicyFunc: func(ctx context.Context, token string, realm string, idOfClient string, policyID string) error { -// panic("mock out the DeletePolicy method") -// }, -// DeleteRealmFunc: func(ctx context.Context, token string, realm string) error { -// panic("mock out the DeleteRealm method") -// }, -// DeleteRealmRoleFunc: func(ctx context.Context, token string, realm string, roleName string) error { -// panic("mock out the DeleteRealmRole method") -// }, -// DeleteRealmRoleCompositeFunc: func(ctx context.Context, token string, realm string, roleName string, roles []gocloak.Role) error { -// panic("mock out the DeleteRealmRoleComposite method") -// }, -// DeleteRealmRoleFromGroupFunc: func(ctx context.Context, token string, realm string, groupID string, roles []gocloak.Role) error { -// panic("mock out the DeleteRealmRoleFromGroup method") -// }, -// DeleteRealmRoleFromUserFunc: func(ctx context.Context, token string, realm string, userID string, roles []gocloak.Role) error { -// panic("mock out the DeleteRealmRoleFromUser method") -// }, -// DeleteResourceFunc: func(ctx context.Context, token string, realm string, idOfClient string, resourceID string) error { -// panic("mock out the DeleteResource method") -// }, -// DeleteResourceClientFunc: func(ctx context.Context, token string, realm string, resourceID string) error { -// panic("mock out the DeleteResourceClient method") -// }, -// DeleteResourcePolicyFunc: func(ctx context.Context, token string, realm string, permissionID string) error { -// panic("mock out the DeleteResourcePolicy method") -// }, -// DeleteScopeFunc: func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error { -// panic("mock out the DeleteScope method") -// }, -// DeleteUserFunc: func(ctx context.Context, accessToken string, realm string, userID string) error { -// panic("mock out the DeleteUser method") -// }, -// DeleteUserFederatedIdentityFunc: func(ctx context.Context, token string, realm string, userID string, providerID string) error { -// panic("mock out the DeleteUserFederatedIdentity method") -// }, -// DeleteUserFromGroupFunc: func(ctx context.Context, token string, realm string, userID string, groupID string) error { -// panic("mock out the DeleteUserFromGroup method") -// }, -// DeleteUserPermissionFunc: func(ctx context.Context, token string, realm string, ticketID string) error { -// panic("mock out the DeleteUserPermission method") -// }, -// DisableAllCredentialsByTypeFunc: func(ctx context.Context, token string, realm string, userID string, types []string) error { -// panic("mock out the DisableAllCredentialsByType method") -// }, -// ExecuteActionsEmailFunc: func(ctx context.Context, token string, realm string, params gocloak.ExecuteActionsEmail) error { -// panic("mock out the ExecuteActionsEmail method") -// }, -// ExportIDPPublicBrokerConfigFunc: func(ctx context.Context, token string, realm string, alias string) (*string, error) { -// panic("mock out the ExportIDPPublicBrokerConfig method") -// }, -// GetAdapterConfigurationFunc: func(ctx context.Context, accessToken string, realm string, clientID string) (*gocloak.AdapterConfiguration, error) { -// panic("mock out the GetAdapterConfiguration method") -// }, -// GetAuthenticationExecutionsFunc: func(ctx context.Context, token string, realm string, flow string) ([]*gocloak.ModifyAuthenticationExecutionRepresentation, error) { -// panic("mock out the GetAuthenticationExecutions method") -// }, -// GetAuthenticationFlowsFunc: func(ctx context.Context, token string, realm string) ([]*gocloak.AuthenticationFlowRepresentation, error) { -// panic("mock out the GetAuthenticationFlows method") -// }, -// GetAuthorizationPolicyAssociatedPoliciesFunc: func(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PolicyRepresentation, error) { -// panic("mock out the GetAuthorizationPolicyAssociatedPolicies method") -// }, -// GetAuthorizationPolicyResourcesFunc: func(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PolicyResourceRepresentation, error) { -// panic("mock out the GetAuthorizationPolicyResources method") -// }, -// GetAuthorizationPolicyScopesFunc: func(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PolicyScopeRepresentation, error) { -// panic("mock out the GetAuthorizationPolicyScopes method") -// }, -// GetAvailableClientRolesByGroupIDFunc: func(ctx context.Context, token string, realm string, idOfClient string, groupID string) ([]*gocloak.Role, error) { -// panic("mock out the GetAvailableClientRolesByGroupID method") -// }, -// GetAvailableClientRolesByUserIDFunc: func(ctx context.Context, token string, realm string, idOfClient string, userID string) ([]*gocloak.Role, error) { -// panic("mock out the GetAvailableClientRolesByUserID method") -// }, -// GetAvailableRealmRolesByGroupIDFunc: func(ctx context.Context, token string, realm string, groupID string) ([]*gocloak.Role, error) { -// panic("mock out the GetAvailableRealmRolesByGroupID method") -// }, -// GetAvailableRealmRolesByUserIDFunc: func(ctx context.Context, token string, realm string, userID string) ([]*gocloak.Role, error) { -// panic("mock out the GetAvailableRealmRolesByUserID method") -// }, -// GetCertsFunc: func(ctx context.Context, realm string) (*gocloak.CertResponse, error) { -// panic("mock out the GetCerts method") -// }, -// GetClientFunc: func(ctx context.Context, accessToken string, realm string, idOfClient string) (*gocloak.Client, error) { -// panic("mock out the GetClient method") -// }, -// GetClientOfflineSessionsFunc: func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.UserSessionRepresentation, error) { -// panic("mock out the GetClientOfflineSessions method") -// }, -// GetClientRepresentationFunc: func(ctx context.Context, accessToken string, realm string, clientID string) (*gocloak.Client, error) { -// panic("mock out the GetClientRepresentation method") -// }, -// GetClientRoleFunc: func(ctx context.Context, token string, realm string, idOfClient string, roleName string) (*gocloak.Role, error) { -// panic("mock out the GetClientRole method") -// }, -// GetClientRoleByIDFunc: func(ctx context.Context, accessToken string, realm string, roleID string) (*gocloak.Role, error) { -// panic("mock out the GetClientRoleByID method") -// }, -// GetClientRolesFunc: func(ctx context.Context, accessToken string, realm string, idOfClient string, params gocloak.GetRoleParams) ([]*gocloak.Role, error) { -// panic("mock out the GetClientRoles method") -// }, -// GetClientRolesByGroupIDFunc: func(ctx context.Context, token string, realm string, idOfClient string, groupID string) ([]*gocloak.Role, error) { -// panic("mock out the GetClientRolesByGroupID method") -// }, -// GetClientRolesByUserIDFunc: func(ctx context.Context, token string, realm string, idOfClient string, userID string) ([]*gocloak.Role, error) { -// panic("mock out the GetClientRolesByUserID method") -// }, -// GetClientScopeFunc: func(ctx context.Context, token string, realm string, scopeID string) (*gocloak.ClientScope, error) { -// panic("mock out the GetClientScope method") -// }, -// GetClientScopeMappingsFunc: func(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.MappingsRepresentation, error) { -// panic("mock out the GetClientScopeMappings method") -// }, -// GetClientScopeMappingsClientRolesFunc: func(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string) ([]*gocloak.Role, error) { -// panic("mock out the GetClientScopeMappingsClientRoles method") -// }, -// GetClientScopeMappingsClientRolesAvailableFunc: func(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string) ([]*gocloak.Role, error) { -// panic("mock out the GetClientScopeMappingsClientRolesAvailable method") -// }, -// GetClientScopeMappingsRealmRolesFunc: func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.Role, error) { -// panic("mock out the GetClientScopeMappingsRealmRoles method") -// }, -// GetClientScopeMappingsRealmRolesAvailableFunc: func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.Role, error) { -// panic("mock out the GetClientScopeMappingsRealmRolesAvailable method") -// }, -// GetClientScopeProtocolMapperFunc: func(ctx context.Context, token string, realm string, scopeID string, protocolMapperID string) (*gocloak.ProtocolMappers, error) { -// panic("mock out the GetClientScopeProtocolMapper method") -// }, -// GetClientScopeProtocolMappersFunc: func(ctx context.Context, token string, realm string, scopeID string) ([]*gocloak.ProtocolMappers, error) { -// panic("mock out the GetClientScopeProtocolMappers method") -// }, -// GetClientScopesFunc: func(ctx context.Context, token string, realm string) ([]*gocloak.ClientScope, error) { -// panic("mock out the GetClientScopes method") -// }, -// GetClientScopesScopeMappingsClientRolesFunc: func(ctx context.Context, token string, realm string, idOfClientScope string, idOfClient string) ([]*gocloak.Role, error) { -// panic("mock out the GetClientScopesScopeMappingsClientRoles method") -// }, -// GetClientScopesScopeMappingsClientRolesAvailableFunc: func(ctx context.Context, token string, realm string, idOfClientScope string, idOfClient string) ([]*gocloak.Role, error) { -// panic("mock out the GetClientScopesScopeMappingsClientRolesAvailable method") -// }, -// GetClientScopesScopeMappingsRealmRolesFunc: func(ctx context.Context, token string, realm string, idOfClientScope string) ([]*gocloak.Role, error) { -// panic("mock out the GetClientScopesScopeMappingsRealmRoles method") -// }, -// GetClientScopesScopeMappingsRealmRolesAvailableFunc: func(ctx context.Context, token string, realm string, idOfClientScope string) ([]*gocloak.Role, error) { -// panic("mock out the GetClientScopesScopeMappingsRealmRolesAvailable method") -// }, -// GetClientSecretFunc: func(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.CredentialRepresentation, error) { -// panic("mock out the GetClientSecret method") -// }, -// GetClientServiceAccountFunc: func(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.User, error) { -// panic("mock out the GetClientServiceAccount method") -// }, -// GetClientUserSessionsFunc: func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.UserSessionRepresentation, error) { -// panic("mock out the GetClientUserSessions method") -// }, -// GetClientsFunc: func(ctx context.Context, accessToken string, realm string, params gocloak.GetClientsParams) ([]*gocloak.Client, error) { -// panic("mock out the GetClients method") -// }, -// GetClientsDefaultScopesFunc: func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.ClientScope, error) { -// panic("mock out the GetClientsDefaultScopes method") -// }, -// GetClientsOptionalScopesFunc: func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.ClientScope, error) { -// panic("mock out the GetClientsOptionalScopes method") -// }, -// GetComponentsFunc: func(ctx context.Context, accessToken string, realm string) ([]*gocloak.Component, error) { -// panic("mock out the GetComponents method") -// }, -// GetCompositeClientRolesByGroupIDFunc: func(ctx context.Context, token string, realm string, idOfClient string, groupID string) ([]*gocloak.Role, error) { -// panic("mock out the GetCompositeClientRolesByGroupID method") -// }, -// GetCompositeClientRolesByRoleIDFunc: func(ctx context.Context, token string, realm string, idOfClient string, roleID string) ([]*gocloak.Role, error) { -// panic("mock out the GetCompositeClientRolesByRoleID method") -// }, -// GetCompositeClientRolesByUserIDFunc: func(ctx context.Context, token string, realm string, idOfClient string, userID string) ([]*gocloak.Role, error) { -// panic("mock out the GetCompositeClientRolesByUserID method") -// }, -// GetCompositeRealmRolesFunc: func(ctx context.Context, token string, realm string, roleName string) ([]*gocloak.Role, error) { -// panic("mock out the GetCompositeRealmRoles method") -// }, -// GetCompositeRealmRolesByGroupIDFunc: func(ctx context.Context, token string, realm string, groupID string) ([]*gocloak.Role, error) { -// panic("mock out the GetCompositeRealmRolesByGroupID method") -// }, -// GetCompositeRealmRolesByRoleIDFunc: func(ctx context.Context, token string, realm string, roleID string) ([]*gocloak.Role, error) { -// panic("mock out the GetCompositeRealmRolesByRoleID method") -// }, -// GetCompositeRealmRolesByUserIDFunc: func(ctx context.Context, token string, realm string, userID string) ([]*gocloak.Role, error) { -// panic("mock out the GetCompositeRealmRolesByUserID method") -// }, -// GetConfiguredUserStorageCredentialTypesFunc: func(ctx context.Context, token string, realm string, userID string) ([]string, error) { -// panic("mock out the GetConfiguredUserStorageCredentialTypes method") -// }, -// GetCredentialRegistratorsFunc: func(ctx context.Context, token string, realm string) ([]string, error) { -// panic("mock out the GetCredentialRegistrators method") -// }, -// GetCredentialsFunc: func(ctx context.Context, token string, realm string, UserID string) ([]*gocloak.CredentialRepresentation, error) { -// panic("mock out the GetCredentials method") -// }, -// GetDefaultDefaultClientScopesFunc: func(ctx context.Context, token string, realm string) ([]*gocloak.ClientScope, error) { -// panic("mock out the GetDefaultDefaultClientScopes method") -// }, -// GetDefaultGroupsFunc: func(ctx context.Context, accessToken string, realm string) ([]*gocloak.Group, error) { -// panic("mock out the GetDefaultGroups method") -// }, -// GetDefaultOptionalClientScopesFunc: func(ctx context.Context, token string, realm string) ([]*gocloak.ClientScope, error) { -// panic("mock out the GetDefaultOptionalClientScopes method") -// }, -// GetDependentPermissionsFunc: func(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PermissionRepresentation, error) { -// panic("mock out the GetDependentPermissions method") -// }, -// GetEventsFunc: func(ctx context.Context, token string, realm string, params gocloak.GetEventsParams) ([]*gocloak.EventRepresentation, error) { -// panic("mock out the GetEvents method") -// }, -// GetGroupFunc: func(ctx context.Context, accessToken string, realm string, groupID string) (*gocloak.Group, error) { -// panic("mock out the GetGroup method") -// }, -// GetGroupMembersFunc: func(ctx context.Context, accessToken string, realm string, groupID string, params gocloak.GetGroupsParams) ([]*gocloak.User, error) { -// panic("mock out the GetGroupMembers method") -// }, -// GetGroupsFunc: func(ctx context.Context, accessToken string, realm string, params gocloak.GetGroupsParams) ([]*gocloak.Group, error) { -// panic("mock out the GetGroups method") -// }, -// GetGroupsByRoleFunc: func(ctx context.Context, accessToken string, realm string, roleName string) ([]*gocloak.Group, error) { -// panic("mock out the GetGroupsByRole method") -// }, -// GetGroupsCountFunc: func(ctx context.Context, token string, realm string, params gocloak.GetGroupsParams) (int, error) { -// panic("mock out the GetGroupsCount method") -// }, -// GetIdentityProviderFunc: func(ctx context.Context, token string, realm string, alias string) (*gocloak.IdentityProviderRepresentation, error) { -// panic("mock out the GetIdentityProvider method") -// }, -// GetIdentityProviderMapperByIDFunc: func(ctx context.Context, token string, realm string, alias string, mapperID string) (*gocloak.IdentityProviderMapper, error) { -// panic("mock out the GetIdentityProviderMapperByID method") -// }, -// GetIdentityProviderMappersFunc: func(ctx context.Context, token string, realm string, alias string) ([]*gocloak.IdentityProviderMapper, error) { -// panic("mock out the GetIdentityProviderMappers method") -// }, -// GetIdentityProvidersFunc: func(ctx context.Context, token string, realm string) ([]*gocloak.IdentityProviderRepresentation, error) { -// panic("mock out the GetIdentityProviders method") -// }, -// GetIssuerFunc: func(ctx context.Context, realm string) (*gocloak.IssuerResponse, error) { -// panic("mock out the GetIssuer method") -// }, -// GetKeyStoreConfigFunc: func(ctx context.Context, accessToken string, realm string) (*gocloak.KeyStoreConfig, error) { -// panic("mock out the GetKeyStoreConfig method") -// }, -// GetPermissionFunc: func(ctx context.Context, token string, realm string, idOfClient string, permissionID string) (*gocloak.PermissionRepresentation, error) { -// panic("mock out the GetPermission method") -// }, -// GetPermissionResourcesFunc: func(ctx context.Context, token string, realm string, idOfClient string, permissionID string) ([]*gocloak.PermissionResource, error) { -// panic("mock out the GetPermissionResources method") -// }, -// GetPermissionScopesFunc: func(ctx context.Context, token string, realm string, idOfClient string, permissionID string) ([]*gocloak.PermissionScope, error) { -// panic("mock out the GetPermissionScopes method") -// }, -// GetPermissionsFunc: func(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetPermissionParams) ([]*gocloak.PermissionRepresentation, error) { -// panic("mock out the GetPermissions method") -// }, -// GetPoliciesFunc: func(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetPolicyParams) ([]*gocloak.PolicyRepresentation, error) { -// panic("mock out the GetPolicies method") -// }, -// GetPolicyFunc: func(ctx context.Context, token string, realm string, idOfClient string, policyID string) (*gocloak.PolicyRepresentation, error) { -// panic("mock out the GetPolicy method") -// }, -// GetRawUserInfoFunc: func(ctx context.Context, accessToken string, realm string) (map[string]interface{}, error) { -// panic("mock out the GetRawUserInfo method") -// }, -// GetRealmFunc: func(ctx context.Context, token string, realm string) (*gocloak.RealmRepresentation, error) { -// panic("mock out the GetRealm method") -// }, -// GetRealmRoleFunc: func(ctx context.Context, token string, realm string, roleName string) (*gocloak.Role, error) { -// panic("mock out the GetRealmRole method") -// }, -// GetRealmRoleByIDFunc: func(ctx context.Context, token string, realm string, roleID string) (*gocloak.Role, error) { -// panic("mock out the GetRealmRoleByID method") -// }, -// GetRealmRolesFunc: func(ctx context.Context, accessToken string, realm string, params gocloak.GetRoleParams) ([]*gocloak.Role, error) { -// panic("mock out the GetRealmRoles method") -// }, -// GetRealmRolesByGroupIDFunc: func(ctx context.Context, accessToken string, realm string, groupID string) ([]*gocloak.Role, error) { -// panic("mock out the GetRealmRolesByGroupID method") -// }, -// GetRealmRolesByUserIDFunc: func(ctx context.Context, accessToken string, realm string, userID string) ([]*gocloak.Role, error) { -// panic("mock out the GetRealmRolesByUserID method") -// }, -// GetRealmsFunc: func(ctx context.Context, token string) ([]*gocloak.RealmRepresentation, error) { -// panic("mock out the GetRealms method") -// }, -// GetRequestingPartyPermissionDecisionFunc: func(ctx context.Context, token string, realm string, options gocloak.RequestingPartyTokenOptions) (*gocloak.RequestingPartyPermissionDecision, error) { -// panic("mock out the GetRequestingPartyPermissionDecision method") -// }, -// GetRequestingPartyPermissionsFunc: func(ctx context.Context, token string, realm string, options gocloak.RequestingPartyTokenOptions) (*[]gocloak.RequestingPartyPermission, error) { -// panic("mock out the GetRequestingPartyPermissions method") -// }, -// GetRequestingPartyTokenFunc: func(ctx context.Context, token string, realm string, options gocloak.RequestingPartyTokenOptions) (*gocloak.JWT, error) { -// panic("mock out the GetRequestingPartyToken method") -// }, -// GetResourceFunc: func(ctx context.Context, token string, realm string, idOfClient string, resourceID string) (*gocloak.ResourceRepresentation, error) { -// panic("mock out the GetResource method") -// }, -// GetResourceClientFunc: func(ctx context.Context, token string, realm string, resourceID string) (*gocloak.ResourceRepresentation, error) { -// panic("mock out the GetResourceClient method") -// }, -// GetResourcePoliciesFunc: func(ctx context.Context, token string, realm string, params gocloak.GetResourcePoliciesParams) ([]*gocloak.ResourcePolicyRepresentation, error) { -// panic("mock out the GetResourcePolicies method") -// }, -// GetResourcePolicyFunc: func(ctx context.Context, token string, realm string, permissionID string) (*gocloak.ResourcePolicyRepresentation, error) { -// panic("mock out the GetResourcePolicy method") -// }, -// GetResourcesFunc: func(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetResourceParams) ([]*gocloak.ResourceRepresentation, error) { -// panic("mock out the GetResources method") -// }, -// GetResourcesClientFunc: func(ctx context.Context, token string, realm string, params gocloak.GetResourceParams) ([]*gocloak.ResourceRepresentation, error) { -// panic("mock out the GetResourcesClient method") -// }, -// GetRoleMappingByGroupIDFunc: func(ctx context.Context, accessToken string, realm string, groupID string) (*gocloak.MappingsRepresentation, error) { -// panic("mock out the GetRoleMappingByGroupID method") -// }, -// GetRoleMappingByUserIDFunc: func(ctx context.Context, accessToken string, realm string, userID string) (*gocloak.MappingsRepresentation, error) { -// panic("mock out the GetRoleMappingByUserID method") -// }, -// GetScopeFunc: func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) (*gocloak.ScopeRepresentation, error) { -// panic("mock out the GetScope method") -// }, -// GetScopesFunc: func(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetScopeParams) ([]*gocloak.ScopeRepresentation, error) { -// panic("mock out the GetScopes method") -// }, -// GetServerInfoFunc: func(ctx context.Context, accessToken string) (*gocloak.ServerInfoRepesentation, error) { -// panic("mock out the GetServerInfo method") -// }, -// GetTokenFunc: func(ctx context.Context, realm string, options gocloak.TokenOptions) (*gocloak.JWT, error) { -// panic("mock out the GetToken method") -// }, -// GetUserByIDFunc: func(ctx context.Context, accessToken string, realm string, userID string) (*gocloak.User, error) { -// panic("mock out the GetUserByID method") -// }, -// GetUserCountFunc: func(ctx context.Context, accessToken string, realm string, params gocloak.GetUsersParams) (int, error) { -// panic("mock out the GetUserCount method") -// }, -// GetUserFederatedIdentitiesFunc: func(ctx context.Context, token string, realm string, userID string) ([]*gocloak.FederatedIdentityRepresentation, error) { -// panic("mock out the GetUserFederatedIdentities method") -// }, -// GetUserGroupsFunc: func(ctx context.Context, accessToken string, realm string, userID string, params gocloak.GetGroupsParams) ([]*gocloak.Group, error) { -// panic("mock out the GetUserGroups method") -// }, -// GetUserInfoFunc: func(ctx context.Context, accessToken string, realm string) (*gocloak.UserInfo, error) { -// panic("mock out the GetUserInfo method") -// }, -// GetUserOfflineSessionsForClientFunc: func(ctx context.Context, token string, realm string, userID string, idOfClient string) ([]*gocloak.UserSessionRepresentation, error) { -// panic("mock out the GetUserOfflineSessionsForClient method") -// }, -// GetUserPermissionsFunc: func(ctx context.Context, token string, realm string, params gocloak.GetUserPermissionParams) ([]*gocloak.PermissionGrantResponseRepresentation, error) { -// panic("mock out the GetUserPermissions method") -// }, -// GetUserSessionsFunc: func(ctx context.Context, token string, realm string, userID string) ([]*gocloak.UserSessionRepresentation, error) { -// panic("mock out the GetUserSessions method") -// }, -// GetUsersFunc: func(ctx context.Context, accessToken string, realm string, params gocloak.GetUsersParams) ([]*gocloak.User, error) { -// panic("mock out the GetUsers method") -// }, -// GetUsersByClientRoleNameFunc: func(ctx context.Context, token string, realm string, idOfClient string, roleName string, params gocloak.GetUsersByRoleParams) ([]*gocloak.User, error) { -// panic("mock out the GetUsersByClientRoleName method") -// }, -// GetUsersByRoleNameFunc: func(ctx context.Context, token string, realm string, roleName string) ([]*gocloak.User, error) { -// panic("mock out the GetUsersByRoleName method") -// }, -// GrantUserPermissionFunc: func(ctx context.Context, token string, realm string, permission gocloak.PermissionGrantParams) (*gocloak.PermissionGrantResponseRepresentation, error) { -// panic("mock out the GrantUserPermission method") -// }, -// ImportIdentityProviderConfigFunc: func(ctx context.Context, token string, realm string, fromURL string, providerID string) (map[string]string, error) { -// panic("mock out the ImportIdentityProviderConfig method") -// }, -// ImportIdentityProviderConfigFromFileFunc: func(ctx context.Context, token string, realm string, providerID string, fileName string, fileBody io.Reader) (map[string]string, error) { -// panic("mock out the ImportIdentityProviderConfigFromFile method") -// }, -// LoginFunc: func(ctx context.Context, clientID string, clientSecret string, realm string, username string, password string) (*gocloak.JWT, error) { -// panic("mock out the Login method") -// }, -// LoginAdminFunc: func(ctx context.Context, username string, password string, realm string) (*gocloak.JWT, error) { -// panic("mock out the LoginAdmin method") -// }, -// LoginClientFunc: func(ctx context.Context, clientID string, clientSecret string, realm string) (*gocloak.JWT, error) { -// panic("mock out the LoginClient method") -// }, -// LoginClientSignedJWTFunc: func(ctx context.Context, idOfClient string, realm string, key interface{}, signedMethod jwt.SigningMethod, expiresAt *jwt.NumericDate) (*gocloak.JWT, error) { -// panic("mock out the LoginClientSignedJWT method") -// }, -// LoginClientTokenExchangeFunc: func(ctx context.Context, clientID string, token string, clientSecret string, realm string, targetClient string, userID string) (*gocloak.JWT, error) { -// panic("mock out the LoginClientTokenExchange method") -// }, -// LoginOtpFunc: func(ctx context.Context, clientID string, clientSecret string, realm string, username string, password string, totp string) (*gocloak.JWT, error) { -// panic("mock out the LoginOtp method") -// }, -// LogoutFunc: func(ctx context.Context, clientID string, clientSecret string, realm string, refreshToken string) error { -// panic("mock out the Logout method") -// }, -// LogoutAllSessionsFunc: func(ctx context.Context, accessToken string, realm string, userID string) error { -// panic("mock out the LogoutAllSessions method") -// }, -// LogoutPublicClientFunc: func(ctx context.Context, idOfClient string, realm string, accessToken string, refreshToken string) error { -// panic("mock out the LogoutPublicClient method") -// }, -// LogoutUserSessionFunc: func(ctx context.Context, accessToken string, realm string, session string) error { -// panic("mock out the LogoutUserSession method") -// }, -// MoveCredentialBehindFunc: func(ctx context.Context, token string, realm string, userID string, credentialID string, newPreviousCredentialID string) error { -// panic("mock out the MoveCredentialBehind method") -// }, -// MoveCredentialToFirstFunc: func(ctx context.Context, token string, realm string, userID string, credentialID string) error { -// panic("mock out the MoveCredentialToFirst method") -// }, -// RefreshTokenFunc: func(ctx context.Context, refreshToken string, clientID string, clientSecret string, realm string) (*gocloak.JWT, error) { -// panic("mock out the RefreshToken method") -// }, -// RegenerateClientSecretFunc: func(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.CredentialRepresentation, error) { -// panic("mock out the RegenerateClientSecret method") -// }, -// RemoveDefaultGroupFunc: func(ctx context.Context, accessToken string, realm string, groupID string) error { -// panic("mock out the RemoveDefaultGroup method") -// }, -// RemoveDefaultScopeFromClientFunc: func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error { -// panic("mock out the RemoveDefaultScopeFromClient method") -// }, -// RemoveOptionalScopeFromClientFunc: func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error { -// panic("mock out the RemoveOptionalScopeFromClient method") -// }, -// RestyClientFunc: func() *resty.Client { -// panic("mock out the RestyClient method") -// }, -// RetrospectTokenFunc: func(ctx context.Context, accessToken string, clientID string, clientSecret string, realm string) (*gocloak.RetrospecTokenResult, error) { -// panic("mock out the RetrospectToken method") -// }, -// RevokeUserConsentsFunc: func(ctx context.Context, accessToken string, realm string, userID string, clientID string) error { -// panic("mock out the RevokeUserConsents method") -// }, -// SetPasswordFunc: func(ctx context.Context, token string, userID string, realm string, password string, temporary bool) error { -// panic("mock out the SetPassword method") -// }, -// SetRestyClientFunc: func(restyClient *resty.Client) { -// panic("mock out the SetRestyClient method") -// }, -// UpdateAuthenticationExecutionFunc: func(ctx context.Context, token string, realm string, flow string, execution gocloak.ModifyAuthenticationExecutionRepresentation) error { -// panic("mock out the UpdateAuthenticationExecution method") -// }, -// UpdateClientFunc: func(ctx context.Context, accessToken string, realm string, updatedClient gocloak.Client) error { -// panic("mock out the UpdateClient method") -// }, -// UpdateClientProtocolMapperFunc: func(ctx context.Context, token string, realm string, idOfClient string, mapperID string, mapper gocloak.ProtocolMapperRepresentation) error { -// panic("mock out the UpdateClientProtocolMapper method") -// }, -// UpdateClientRepresentationFunc: func(ctx context.Context, accessToken string, realm string, updatedClient gocloak.Client) (*gocloak.Client, error) { -// panic("mock out the UpdateClientRepresentation method") -// }, -// UpdateClientScopeFunc: func(ctx context.Context, accessToken string, realm string, scope gocloak.ClientScope) error { -// panic("mock out the UpdateClientScope method") -// }, -// UpdateClientScopeProtocolMapperFunc: func(ctx context.Context, accessToken string, realm string, scopeID string, protocolMapper gocloak.ProtocolMappers) error { -// panic("mock out the UpdateClientScopeProtocolMapper method") -// }, -// UpdateCredentialUserLabelFunc: func(ctx context.Context, token string, realm string, userID string, credentialID string, userLabel string) error { -// panic("mock out the UpdateCredentialUserLabel method") -// }, -// UpdateGroupFunc: func(ctx context.Context, accessToken string, realm string, updatedGroup gocloak.Group) error { -// panic("mock out the UpdateGroup method") -// }, -// UpdateIdentityProviderFunc: func(ctx context.Context, token string, realm string, alias string, providerRep gocloak.IdentityProviderRepresentation) error { -// panic("mock out the UpdateIdentityProvider method") -// }, -// UpdateIdentityProviderMapperFunc: func(ctx context.Context, token string, realm string, alias string, mapper gocloak.IdentityProviderMapper) error { -// panic("mock out the UpdateIdentityProviderMapper method") -// }, -// UpdatePermissionFunc: func(ctx context.Context, token string, realm string, idOfClient string, permission gocloak.PermissionRepresentation) error { -// panic("mock out the UpdatePermission method") -// }, -// UpdatePolicyFunc: func(ctx context.Context, token string, realm string, idOfClient string, policy gocloak.PolicyRepresentation) error { -// panic("mock out the UpdatePolicy method") -// }, -// UpdateRealmFunc: func(ctx context.Context, token string, realm gocloak.RealmRepresentation) error { -// panic("mock out the UpdateRealm method") -// }, -// UpdateRealmRoleFunc: func(ctx context.Context, token string, realm string, roleName string, role gocloak.Role) error { -// panic("mock out the UpdateRealmRole method") -// }, -// UpdateRealmRoleByIDFunc: func(ctx context.Context, token string, realm string, roleID string, role gocloak.Role) error { -// panic("mock out the UpdateRealmRoleByID method") -// }, -// UpdateRequiredActionFunc: func(ctx context.Context, token string, realm string, requiredAction gocloak.RequiredActionProviderRepresentation) error { -// panic("mock out the UpdateRequiredAction method") -// }, -// UpdateResourceFunc: func(ctx context.Context, token string, realm string, idOfClient string, resource gocloak.ResourceRepresentation) error { -// panic("mock out the UpdateResource method") -// }, -// UpdateResourceClientFunc: func(ctx context.Context, token string, realm string, resource gocloak.ResourceRepresentation) error { -// panic("mock out the UpdateResourceClient method") -// }, -// UpdateResourcePolicyFunc: func(ctx context.Context, token string, realm string, permissionID string, policy gocloak.ResourcePolicyRepresentation) error { -// panic("mock out the UpdateResourcePolicy method") -// }, -// UpdateRoleFunc: func(ctx context.Context, accessToken string, realm string, idOfClient string, role gocloak.Role) error { -// panic("mock out the UpdateRole method") -// }, -// UpdateScopeFunc: func(ctx context.Context, token string, realm string, idOfClient string, resource gocloak.ScopeRepresentation) error { -// panic("mock out the UpdateScope method") -// }, -// UpdateUserFunc: func(ctx context.Context, accessToken string, realm string, user gocloak.User) error { -// panic("mock out the UpdateUser method") -// }, -// UpdateUserPermissionFunc: func(ctx context.Context, token string, realm string, permission gocloak.PermissionGrantParams) (*gocloak.PermissionGrantResponseRepresentation, error) { -// panic("mock out the UpdateUserPermission method") -// }, -// } -// -// // use mockedGoCloak in code that requires GoCloak -// // and then make assertions. -// -// } -type GoCloakMock struct { - // AddClientRoleCompositeFunc mocks the AddClientRoleComposite method. - AddClientRoleCompositeFunc func(ctx context.Context, token string, realm string, roleID string, roles []gocloak.Role) error - - // AddClientRoleToGroupFunc mocks the AddClientRoleToGroup method. - AddClientRoleToGroupFunc func(ctx context.Context, token string, realm string, idOfClient string, groupID string, roles []gocloak.Role) error - - // AddClientRoleToUserFunc mocks the AddClientRoleToUser method. - AddClientRoleToUserFunc func(ctx context.Context, token string, realm string, idOfClient string, userID string, roles []gocloak.Role) error - - // AddDefaultGroupFunc mocks the AddDefaultGroup method. - AddDefaultGroupFunc func(ctx context.Context, accessToken string, realm string, groupID string) error - - // AddDefaultScopeToClientFunc mocks the AddDefaultScopeToClient method. - AddDefaultScopeToClientFunc func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error - - // AddOptionalScopeToClientFunc mocks the AddOptionalScopeToClient method. - AddOptionalScopeToClientFunc func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error - - // AddRealmRoleCompositeFunc mocks the AddRealmRoleComposite method. - AddRealmRoleCompositeFunc func(ctx context.Context, token string, realm string, roleName string, roles []gocloak.Role) error - - // AddRealmRoleToGroupFunc mocks the AddRealmRoleToGroup method. - AddRealmRoleToGroupFunc func(ctx context.Context, token string, realm string, groupID string, roles []gocloak.Role) error - - // AddRealmRoleToUserFunc mocks the AddRealmRoleToUser method. - AddRealmRoleToUserFunc func(ctx context.Context, token string, realm string, userID string, roles []gocloak.Role) error - - // AddUserToGroupFunc mocks the AddUserToGroup method. - AddUserToGroupFunc func(ctx context.Context, token string, realm string, userID string, groupID string) error - - // ClearKeysCacheFunc mocks the ClearKeysCache method. - ClearKeysCacheFunc func(ctx context.Context, token string, realm string) error - - // ClearRealmCacheFunc mocks the ClearRealmCache method. - ClearRealmCacheFunc func(ctx context.Context, token string, realm string) error - - // ClearUserCacheFunc mocks the ClearUserCache method. - ClearUserCacheFunc func(ctx context.Context, token string, realm string) error - - // CreateAuthenticationExecutionFunc mocks the CreateAuthenticationExecution method. - CreateAuthenticationExecutionFunc func(ctx context.Context, token string, realm string, flow string, execution gocloak.CreateAuthenticationExecutionRepresentation) error - - // CreateAuthenticationExecutionFlowFunc mocks the CreateAuthenticationExecutionFlow method. - CreateAuthenticationExecutionFlowFunc func(ctx context.Context, token string, realm string, flow string, execution gocloak.CreateAuthenticationExecutionFlowRepresentation) error - - // CreateAuthenticationFlowFunc mocks the CreateAuthenticationFlow method. - CreateAuthenticationFlowFunc func(ctx context.Context, token string, realm string, flow gocloak.AuthenticationFlowRepresentation) error - - // CreateChildGroupFunc mocks the CreateChildGroup method. - CreateChildGroupFunc func(ctx context.Context, token string, realm string, groupID string, group gocloak.Group) (string, error) - - // CreateClientFunc mocks the CreateClient method. - CreateClientFunc func(ctx context.Context, accessToken string, realm string, newClient gocloak.Client) (string, error) - - // CreateClientProtocolMapperFunc mocks the CreateClientProtocolMapper method. - CreateClientProtocolMapperFunc func(ctx context.Context, token string, realm string, idOfClient string, mapper gocloak.ProtocolMapperRepresentation) (string, error) - - // CreateClientRepresentationFunc mocks the CreateClientRepresentation method. - CreateClientRepresentationFunc func(ctx context.Context, realm string) (*gocloak.Client, error) - - // CreateClientRoleFunc mocks the CreateClientRole method. - CreateClientRoleFunc func(ctx context.Context, accessToken string, realm string, idOfClient string, role gocloak.Role) (string, error) - - // CreateClientScopeFunc mocks the CreateClientScope method. - CreateClientScopeFunc func(ctx context.Context, accessToken string, realm string, scope gocloak.ClientScope) (string, error) - - // CreateClientScopeMappingsClientRolesFunc mocks the CreateClientScopeMappingsClientRoles method. - CreateClientScopeMappingsClientRolesFunc func(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string, roles []gocloak.Role) error - - // CreateClientScopeMappingsRealmRolesFunc mocks the CreateClientScopeMappingsRealmRoles method. - CreateClientScopeMappingsRealmRolesFunc func(ctx context.Context, token string, realm string, idOfClient string, roles []gocloak.Role) error - - // CreateClientScopeProtocolMapperFunc mocks the CreateClientScopeProtocolMapper method. - CreateClientScopeProtocolMapperFunc func(ctx context.Context, accessToken string, realm string, scopeID string, protocolMapper gocloak.ProtocolMappers) (string, error) - - // CreateClientScopesScopeMappingsClientRolesFunc mocks the CreateClientScopesScopeMappingsClientRoles method. - CreateClientScopesScopeMappingsClientRolesFunc func(ctx context.Context, token string, realm string, idOfClientScope string, idOfClient string, roles []gocloak.Role) error - - // CreateClientScopesScopeMappingsRealmRolesFunc mocks the CreateClientScopesScopeMappingsRealmRoles method. - CreateClientScopesScopeMappingsRealmRolesFunc func(ctx context.Context, token string, realm string, idOfClientScope string, roles []gocloak.Role) error - - // CreateComponentFunc mocks the CreateComponent method. - CreateComponentFunc func(ctx context.Context, accessToken string, realm string, component gocloak.Component) (string, error) - - // CreateGroupFunc mocks the CreateGroup method. - CreateGroupFunc func(ctx context.Context, accessToken string, realm string, group gocloak.Group) (string, error) - - // CreateIdentityProviderFunc mocks the CreateIdentityProvider method. - CreateIdentityProviderFunc func(ctx context.Context, token string, realm string, providerRep gocloak.IdentityProviderRepresentation) (string, error) - - // CreateIdentityProviderMapperFunc mocks the CreateIdentityProviderMapper method. - CreateIdentityProviderMapperFunc func(ctx context.Context, token string, realm string, alias string, mapper gocloak.IdentityProviderMapper) (string, error) - - // CreatePermissionFunc mocks the CreatePermission method. - CreatePermissionFunc func(ctx context.Context, token string, realm string, idOfClient string, permission gocloak.PermissionRepresentation) (*gocloak.PermissionRepresentation, error) - - // CreatePermissionTicketFunc mocks the CreatePermissionTicket method. - CreatePermissionTicketFunc func(ctx context.Context, token string, realm string, permissions []gocloak.CreatePermissionTicketParams) (*gocloak.PermissionTicketResponseRepresentation, error) - - // CreatePolicyFunc mocks the CreatePolicy method. - CreatePolicyFunc func(ctx context.Context, token string, realm string, idOfClient string, policy gocloak.PolicyRepresentation) (*gocloak.PolicyRepresentation, error) - - // CreateRealmFunc mocks the CreateRealm method. - CreateRealmFunc func(ctx context.Context, token string, realm gocloak.RealmRepresentation) (string, error) - - // CreateRealmRoleFunc mocks the CreateRealmRole method. - CreateRealmRoleFunc func(ctx context.Context, token string, realm string, role gocloak.Role) (string, error) - - // CreateResourceFunc mocks the CreateResource method. - CreateResourceFunc func(ctx context.Context, token string, realm string, idOfClient string, resource gocloak.ResourceRepresentation) (*gocloak.ResourceRepresentation, error) - - // CreateResourceClientFunc mocks the CreateResourceClient method. - CreateResourceClientFunc func(ctx context.Context, token string, realm string, resource gocloak.ResourceRepresentation) (*gocloak.ResourceRepresentation, error) - - // CreateResourcePolicyFunc mocks the CreateResourcePolicy method. - CreateResourcePolicyFunc func(ctx context.Context, token string, realm string, resourceID string, policy gocloak.ResourcePolicyRepresentation) (*gocloak.ResourcePolicyRepresentation, error) - - // CreateScopeFunc mocks the CreateScope method. - CreateScopeFunc func(ctx context.Context, token string, realm string, idOfClient string, scope gocloak.ScopeRepresentation) (*gocloak.ScopeRepresentation, error) - - // CreateUserFunc mocks the CreateUser method. - CreateUserFunc func(ctx context.Context, token string, realm string, user gocloak.User) (string, error) - - // CreateUserFederatedIdentityFunc mocks the CreateUserFederatedIdentity method. - CreateUserFederatedIdentityFunc func(ctx context.Context, token string, realm string, userID string, providerID string, federatedIdentityRep gocloak.FederatedIdentityRepresentation) error - - // DecodeAccessTokenFunc mocks the DecodeAccessToken method. - DecodeAccessTokenFunc func(ctx context.Context, accessToken string, realm string) (*jwt.Token, *jwt.MapClaims, error) - - // DecodeAccessTokenCustomClaimsFunc mocks the DecodeAccessTokenCustomClaims method. - DecodeAccessTokenCustomClaimsFunc func(ctx context.Context, accessToken string, realm string, claims jwt.Claims) (*jwt.Token, error) - - // DeleteAuthenticationExecutionFunc mocks the DeleteAuthenticationExecution method. - DeleteAuthenticationExecutionFunc func(ctx context.Context, token string, realm string, executionID string) error - - // DeleteAuthenticationFlowFunc mocks the DeleteAuthenticationFlow method. - DeleteAuthenticationFlowFunc func(ctx context.Context, token string, realm string, flowID string) error - - // DeleteClientFunc mocks the DeleteClient method. - DeleteClientFunc func(ctx context.Context, accessToken string, realm string, idOfClient string) error - - // DeleteClientProtocolMapperFunc mocks the DeleteClientProtocolMapper method. - DeleteClientProtocolMapperFunc func(ctx context.Context, token string, realm string, idOfClient string, mapperID string) error - - // DeleteClientRepresentationFunc mocks the DeleteClientRepresentation method. - DeleteClientRepresentationFunc func(ctx context.Context, accessToken string, realm string, clientID string) error - - // DeleteClientRoleFunc mocks the DeleteClientRole method. - DeleteClientRoleFunc func(ctx context.Context, accessToken string, realm string, idOfClient string, roleName string) error - - // DeleteClientRoleCompositeFunc mocks the DeleteClientRoleComposite method. - DeleteClientRoleCompositeFunc func(ctx context.Context, token string, realm string, roleID string, roles []gocloak.Role) error - - // DeleteClientRoleFromGroupFunc mocks the DeleteClientRoleFromGroup method. - DeleteClientRoleFromGroupFunc func(ctx context.Context, token string, realm string, idOfClient string, groupID string, roles []gocloak.Role) error - - // DeleteClientRoleFromUserFunc mocks the DeleteClientRoleFromUser method. - DeleteClientRoleFromUserFunc func(ctx context.Context, token string, realm string, idOfClient string, userID string, roles []gocloak.Role) error - - // DeleteClientScopeFunc mocks the DeleteClientScope method. - DeleteClientScopeFunc func(ctx context.Context, accessToken string, realm string, scopeID string) error - - // DeleteClientScopeMappingsClientRolesFunc mocks the DeleteClientScopeMappingsClientRoles method. - DeleteClientScopeMappingsClientRolesFunc func(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string, roles []gocloak.Role) error - - // DeleteClientScopeMappingsRealmRolesFunc mocks the DeleteClientScopeMappingsRealmRoles method. - DeleteClientScopeMappingsRealmRolesFunc func(ctx context.Context, token string, realm string, idOfClient string, roles []gocloak.Role) error - - // DeleteClientScopeProtocolMapperFunc mocks the DeleteClientScopeProtocolMapper method. - DeleteClientScopeProtocolMapperFunc func(ctx context.Context, accessToken string, realm string, scopeID string, protocolMapperID string) error - - // DeleteClientScopesScopeMappingsClientRolesFunc mocks the DeleteClientScopesScopeMappingsClientRoles method. - DeleteClientScopesScopeMappingsClientRolesFunc func(ctx context.Context, token string, realm string, idOfClientScope string, ifOfClient string, roles []gocloak.Role) error - - // DeleteClientScopesScopeMappingsRealmRolesFunc mocks the DeleteClientScopesScopeMappingsRealmRoles method. - DeleteClientScopesScopeMappingsRealmRolesFunc func(ctx context.Context, token string, realm string, idOfClientScope string, roles []gocloak.Role) error - - // DeleteComponentFunc mocks the DeleteComponent method. - DeleteComponentFunc func(ctx context.Context, accessToken string, realm string, componentID string) error - - // DeleteCredentialsFunc mocks the DeleteCredentials method. - DeleteCredentialsFunc func(ctx context.Context, token string, realm string, UserID string, CredentialID string) error - - // DeleteGroupFunc mocks the DeleteGroup method. - DeleteGroupFunc func(ctx context.Context, accessToken string, realm string, groupID string) error - - // DeleteIdentityProviderFunc mocks the DeleteIdentityProvider method. - DeleteIdentityProviderFunc func(ctx context.Context, token string, realm string, alias string) error - - // DeleteIdentityProviderMapperFunc mocks the DeleteIdentityProviderMapper method. - DeleteIdentityProviderMapperFunc func(ctx context.Context, token string, realm string, alias string, mapperID string) error - - // DeletePermissionFunc mocks the DeletePermission method. - DeletePermissionFunc func(ctx context.Context, token string, realm string, idOfClient string, permissionID string) error - - // DeletePolicyFunc mocks the DeletePolicy method. - DeletePolicyFunc func(ctx context.Context, token string, realm string, idOfClient string, policyID string) error - - // DeleteRealmFunc mocks the DeleteRealm method. - DeleteRealmFunc func(ctx context.Context, token string, realm string) error - - // DeleteRealmRoleFunc mocks the DeleteRealmRole method. - DeleteRealmRoleFunc func(ctx context.Context, token string, realm string, roleName string) error - - // DeleteRealmRoleCompositeFunc mocks the DeleteRealmRoleComposite method. - DeleteRealmRoleCompositeFunc func(ctx context.Context, token string, realm string, roleName string, roles []gocloak.Role) error - - // DeleteRealmRoleFromGroupFunc mocks the DeleteRealmRoleFromGroup method. - DeleteRealmRoleFromGroupFunc func(ctx context.Context, token string, realm string, groupID string, roles []gocloak.Role) error - - // DeleteRealmRoleFromUserFunc mocks the DeleteRealmRoleFromUser method. - DeleteRealmRoleFromUserFunc func(ctx context.Context, token string, realm string, userID string, roles []gocloak.Role) error - - // DeleteResourceFunc mocks the DeleteResource method. - DeleteResourceFunc func(ctx context.Context, token string, realm string, idOfClient string, resourceID string) error - - // DeleteResourceClientFunc mocks the DeleteResourceClient method. - DeleteResourceClientFunc func(ctx context.Context, token string, realm string, resourceID string) error - - // DeleteResourcePolicyFunc mocks the DeleteResourcePolicy method. - DeleteResourcePolicyFunc func(ctx context.Context, token string, realm string, permissionID string) error - - // DeleteScopeFunc mocks the DeleteScope method. - DeleteScopeFunc func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error - - // DeleteUserFunc mocks the DeleteUser method. - DeleteUserFunc func(ctx context.Context, accessToken string, realm string, userID string) error - - // DeleteUserFederatedIdentityFunc mocks the DeleteUserFederatedIdentity method. - DeleteUserFederatedIdentityFunc func(ctx context.Context, token string, realm string, userID string, providerID string) error - - // DeleteUserFromGroupFunc mocks the DeleteUserFromGroup method. - DeleteUserFromGroupFunc func(ctx context.Context, token string, realm string, userID string, groupID string) error - - // DeleteUserPermissionFunc mocks the DeleteUserPermission method. - DeleteUserPermissionFunc func(ctx context.Context, token string, realm string, ticketID string) error - - // DisableAllCredentialsByTypeFunc mocks the DisableAllCredentialsByType method. - DisableAllCredentialsByTypeFunc func(ctx context.Context, token string, realm string, userID string, types []string) error - - // ExecuteActionsEmailFunc mocks the ExecuteActionsEmail method. - ExecuteActionsEmailFunc func(ctx context.Context, token string, realm string, params gocloak.ExecuteActionsEmail) error - - // ExportIDPPublicBrokerConfigFunc mocks the ExportIDPPublicBrokerConfig method. - ExportIDPPublicBrokerConfigFunc func(ctx context.Context, token string, realm string, alias string) (*string, error) - - // GetAdapterConfigurationFunc mocks the GetAdapterConfiguration method. - GetAdapterConfigurationFunc func(ctx context.Context, accessToken string, realm string, clientID string) (*gocloak.AdapterConfiguration, error) - - // GetAuthenticationExecutionsFunc mocks the GetAuthenticationExecutions method. - GetAuthenticationExecutionsFunc func(ctx context.Context, token string, realm string, flow string) ([]*gocloak.ModifyAuthenticationExecutionRepresentation, error) - - // GetAuthenticationFlowsFunc mocks the GetAuthenticationFlows method. - GetAuthenticationFlowsFunc func(ctx context.Context, token string, realm string) ([]*gocloak.AuthenticationFlowRepresentation, error) - - // GetAuthorizationPolicyAssociatedPoliciesFunc mocks the GetAuthorizationPolicyAssociatedPolicies method. - GetAuthorizationPolicyAssociatedPoliciesFunc func(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PolicyRepresentation, error) - - // GetAuthorizationPolicyResourcesFunc mocks the GetAuthorizationPolicyResources method. - GetAuthorizationPolicyResourcesFunc func(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PolicyResourceRepresentation, error) - - // GetAuthorizationPolicyScopesFunc mocks the GetAuthorizationPolicyScopes method. - GetAuthorizationPolicyScopesFunc func(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PolicyScopeRepresentation, error) - - // GetAvailableClientRolesByGroupIDFunc mocks the GetAvailableClientRolesByGroupID method. - GetAvailableClientRolesByGroupIDFunc func(ctx context.Context, token string, realm string, idOfClient string, groupID string) ([]*gocloak.Role, error) - - // GetAvailableClientRolesByUserIDFunc mocks the GetAvailableClientRolesByUserID method. - GetAvailableClientRolesByUserIDFunc func(ctx context.Context, token string, realm string, idOfClient string, userID string) ([]*gocloak.Role, error) - - // GetAvailableRealmRolesByGroupIDFunc mocks the GetAvailableRealmRolesByGroupID method. - GetAvailableRealmRolesByGroupIDFunc func(ctx context.Context, token string, realm string, groupID string) ([]*gocloak.Role, error) - - // GetAvailableRealmRolesByUserIDFunc mocks the GetAvailableRealmRolesByUserID method. - GetAvailableRealmRolesByUserIDFunc func(ctx context.Context, token string, realm string, userID string) ([]*gocloak.Role, error) - - // GetCertsFunc mocks the GetCerts method. - GetCertsFunc func(ctx context.Context, realm string) (*gocloak.CertResponse, error) - - // GetClientFunc mocks the GetClient method. - GetClientFunc func(ctx context.Context, accessToken string, realm string, idOfClient string) (*gocloak.Client, error) - - // GetClientOfflineSessionsFunc mocks the GetClientOfflineSessions method. - GetClientOfflineSessionsFunc func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.UserSessionRepresentation, error) - - // GetClientRepresentationFunc mocks the GetClientRepresentation method. - GetClientRepresentationFunc func(ctx context.Context, accessToken string, realm string, clientID string) (*gocloak.Client, error) - - // GetClientRoleFunc mocks the GetClientRole method. - GetClientRoleFunc func(ctx context.Context, token string, realm string, idOfClient string, roleName string) (*gocloak.Role, error) - - // GetClientRoleByIDFunc mocks the GetClientRoleByID method. - GetClientRoleByIDFunc func(ctx context.Context, accessToken string, realm string, roleID string) (*gocloak.Role, error) - - // GetClientRolesFunc mocks the GetClientRoles method. - GetClientRolesFunc func(ctx context.Context, accessToken string, realm string, idOfClient string, params gocloak.GetRoleParams) ([]*gocloak.Role, error) - - // GetClientRolesByGroupIDFunc mocks the GetClientRolesByGroupID method. - GetClientRolesByGroupIDFunc func(ctx context.Context, token string, realm string, idOfClient string, groupID string) ([]*gocloak.Role, error) - - // GetClientRolesByUserIDFunc mocks the GetClientRolesByUserID method. - GetClientRolesByUserIDFunc func(ctx context.Context, token string, realm string, idOfClient string, userID string) ([]*gocloak.Role, error) - - // GetClientScopeFunc mocks the GetClientScope method. - GetClientScopeFunc func(ctx context.Context, token string, realm string, scopeID string) (*gocloak.ClientScope, error) - - // GetClientScopeMappingsFunc mocks the GetClientScopeMappings method. - GetClientScopeMappingsFunc func(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.MappingsRepresentation, error) - - // GetClientScopeMappingsClientRolesFunc mocks the GetClientScopeMappingsClientRoles method. - GetClientScopeMappingsClientRolesFunc func(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string) ([]*gocloak.Role, error) - - // GetClientScopeMappingsClientRolesAvailableFunc mocks the GetClientScopeMappingsClientRolesAvailable method. - GetClientScopeMappingsClientRolesAvailableFunc func(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string) ([]*gocloak.Role, error) - - // GetClientScopeMappingsRealmRolesFunc mocks the GetClientScopeMappingsRealmRoles method. - GetClientScopeMappingsRealmRolesFunc func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.Role, error) - - // GetClientScopeMappingsRealmRolesAvailableFunc mocks the GetClientScopeMappingsRealmRolesAvailable method. - GetClientScopeMappingsRealmRolesAvailableFunc func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.Role, error) - - // GetClientScopeProtocolMapperFunc mocks the GetClientScopeProtocolMapper method. - GetClientScopeProtocolMapperFunc func(ctx context.Context, token string, realm string, scopeID string, protocolMapperID string) (*gocloak.ProtocolMappers, error) - - // GetClientScopeProtocolMappersFunc mocks the GetClientScopeProtocolMappers method. - GetClientScopeProtocolMappersFunc func(ctx context.Context, token string, realm string, scopeID string) ([]*gocloak.ProtocolMappers, error) - - // GetClientScopesFunc mocks the GetClientScopes method. - GetClientScopesFunc func(ctx context.Context, token string, realm string) ([]*gocloak.ClientScope, error) - - // GetClientScopesScopeMappingsClientRolesFunc mocks the GetClientScopesScopeMappingsClientRoles method. - GetClientScopesScopeMappingsClientRolesFunc func(ctx context.Context, token string, realm string, idOfClientScope string, idOfClient string) ([]*gocloak.Role, error) - - // GetClientScopesScopeMappingsClientRolesAvailableFunc mocks the GetClientScopesScopeMappingsClientRolesAvailable method. - GetClientScopesScopeMappingsClientRolesAvailableFunc func(ctx context.Context, token string, realm string, idOfClientScope string, idOfClient string) ([]*gocloak.Role, error) - - // GetClientScopesScopeMappingsRealmRolesFunc mocks the GetClientScopesScopeMappingsRealmRoles method. - GetClientScopesScopeMappingsRealmRolesFunc func(ctx context.Context, token string, realm string, idOfClientScope string) ([]*gocloak.Role, error) - - // GetClientScopesScopeMappingsRealmRolesAvailableFunc mocks the GetClientScopesScopeMappingsRealmRolesAvailable method. - GetClientScopesScopeMappingsRealmRolesAvailableFunc func(ctx context.Context, token string, realm string, idOfClientScope string) ([]*gocloak.Role, error) - - // GetClientSecretFunc mocks the GetClientSecret method. - GetClientSecretFunc func(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.CredentialRepresentation, error) - - // GetClientServiceAccountFunc mocks the GetClientServiceAccount method. - GetClientServiceAccountFunc func(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.User, error) - - // GetClientUserSessionsFunc mocks the GetClientUserSessions method. - GetClientUserSessionsFunc func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.UserSessionRepresentation, error) - - // GetClientsFunc mocks the GetClients method. - GetClientsFunc func(ctx context.Context, accessToken string, realm string, params gocloak.GetClientsParams) ([]*gocloak.Client, error) - - // GetClientsDefaultScopesFunc mocks the GetClientsDefaultScopes method. - GetClientsDefaultScopesFunc func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.ClientScope, error) - - // GetClientsOptionalScopesFunc mocks the GetClientsOptionalScopes method. - GetClientsOptionalScopesFunc func(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.ClientScope, error) - - // GetComponentsFunc mocks the GetComponents method. - GetComponentsFunc func(ctx context.Context, accessToken string, realm string) ([]*gocloak.Component, error) - - // GetCompositeClientRolesByGroupIDFunc mocks the GetCompositeClientRolesByGroupID method. - GetCompositeClientRolesByGroupIDFunc func(ctx context.Context, token string, realm string, idOfClient string, groupID string) ([]*gocloak.Role, error) - - // GetCompositeClientRolesByRoleIDFunc mocks the GetCompositeClientRolesByRoleID method. - GetCompositeClientRolesByRoleIDFunc func(ctx context.Context, token string, realm string, idOfClient string, roleID string) ([]*gocloak.Role, error) - - // GetCompositeClientRolesByUserIDFunc mocks the GetCompositeClientRolesByUserID method. - GetCompositeClientRolesByUserIDFunc func(ctx context.Context, token string, realm string, idOfClient string, userID string) ([]*gocloak.Role, error) - - // GetCompositeRealmRolesFunc mocks the GetCompositeRealmRoles method. - GetCompositeRealmRolesFunc func(ctx context.Context, token string, realm string, roleName string) ([]*gocloak.Role, error) - - // GetCompositeRealmRolesByGroupIDFunc mocks the GetCompositeRealmRolesByGroupID method. - GetCompositeRealmRolesByGroupIDFunc func(ctx context.Context, token string, realm string, groupID string) ([]*gocloak.Role, error) - - // GetCompositeRealmRolesByRoleIDFunc mocks the GetCompositeRealmRolesByRoleID method. - GetCompositeRealmRolesByRoleIDFunc func(ctx context.Context, token string, realm string, roleID string) ([]*gocloak.Role, error) - - // GetCompositeRealmRolesByUserIDFunc mocks the GetCompositeRealmRolesByUserID method. - GetCompositeRealmRolesByUserIDFunc func(ctx context.Context, token string, realm string, userID string) ([]*gocloak.Role, error) - - // GetConfiguredUserStorageCredentialTypesFunc mocks the GetConfiguredUserStorageCredentialTypes method. - GetConfiguredUserStorageCredentialTypesFunc func(ctx context.Context, token string, realm string, userID string) ([]string, error) - - // GetCredentialRegistratorsFunc mocks the GetCredentialRegistrators method. - GetCredentialRegistratorsFunc func(ctx context.Context, token string, realm string) ([]string, error) - - // GetCredentialsFunc mocks the GetCredentials method. - GetCredentialsFunc func(ctx context.Context, token string, realm string, UserID string) ([]*gocloak.CredentialRepresentation, error) - - // GetDefaultDefaultClientScopesFunc mocks the GetDefaultDefaultClientScopes method. - GetDefaultDefaultClientScopesFunc func(ctx context.Context, token string, realm string) ([]*gocloak.ClientScope, error) - - // GetDefaultGroupsFunc mocks the GetDefaultGroups method. - GetDefaultGroupsFunc func(ctx context.Context, accessToken string, realm string) ([]*gocloak.Group, error) - - // GetDefaultOptionalClientScopesFunc mocks the GetDefaultOptionalClientScopes method. - GetDefaultOptionalClientScopesFunc func(ctx context.Context, token string, realm string) ([]*gocloak.ClientScope, error) - - // GetDependentPermissionsFunc mocks the GetDependentPermissions method. - GetDependentPermissionsFunc func(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PermissionRepresentation, error) - - // GetEventsFunc mocks the GetEvents method. - GetEventsFunc func(ctx context.Context, token string, realm string, params gocloak.GetEventsParams) ([]*gocloak.EventRepresentation, error) - - // GetGroupFunc mocks the GetGroup method. - GetGroupFunc func(ctx context.Context, accessToken string, realm string, groupID string) (*gocloak.Group, error) - - // GetGroupMembersFunc mocks the GetGroupMembers method. - GetGroupMembersFunc func(ctx context.Context, accessToken string, realm string, groupID string, params gocloak.GetGroupsParams) ([]*gocloak.User, error) - - // GetGroupsFunc mocks the GetGroups method. - GetGroupsFunc func(ctx context.Context, accessToken string, realm string, params gocloak.GetGroupsParams) ([]*gocloak.Group, error) - - // GetGroupsByRoleFunc mocks the GetGroupsByRole method. - GetGroupsByRoleFunc func(ctx context.Context, accessToken string, realm string, roleName string) ([]*gocloak.Group, error) - - // GetGroupsCountFunc mocks the GetGroupsCount method. - GetGroupsCountFunc func(ctx context.Context, token string, realm string, params gocloak.GetGroupsParams) (int, error) - - // GetIdentityProviderFunc mocks the GetIdentityProvider method. - GetIdentityProviderFunc func(ctx context.Context, token string, realm string, alias string) (*gocloak.IdentityProviderRepresentation, error) - - // GetIdentityProviderMapperByIDFunc mocks the GetIdentityProviderMapperByID method. - GetIdentityProviderMapperByIDFunc func(ctx context.Context, token string, realm string, alias string, mapperID string) (*gocloak.IdentityProviderMapper, error) - - // GetIdentityProviderMappersFunc mocks the GetIdentityProviderMappers method. - GetIdentityProviderMappersFunc func(ctx context.Context, token string, realm string, alias string) ([]*gocloak.IdentityProviderMapper, error) - - // GetIdentityProvidersFunc mocks the GetIdentityProviders method. - GetIdentityProvidersFunc func(ctx context.Context, token string, realm string) ([]*gocloak.IdentityProviderRepresentation, error) - - // GetIssuerFunc mocks the GetIssuer method. - GetIssuerFunc func(ctx context.Context, realm string) (*gocloak.IssuerResponse, error) - - // GetKeyStoreConfigFunc mocks the GetKeyStoreConfig method. - GetKeyStoreConfigFunc func(ctx context.Context, accessToken string, realm string) (*gocloak.KeyStoreConfig, error) - - // GetPermissionFunc mocks the GetPermission method. - GetPermissionFunc func(ctx context.Context, token string, realm string, idOfClient string, permissionID string) (*gocloak.PermissionRepresentation, error) - - // GetPermissionResourcesFunc mocks the GetPermissionResources method. - GetPermissionResourcesFunc func(ctx context.Context, token string, realm string, idOfClient string, permissionID string) ([]*gocloak.PermissionResource, error) - - // GetPermissionScopesFunc mocks the GetPermissionScopes method. - GetPermissionScopesFunc func(ctx context.Context, token string, realm string, idOfClient string, permissionID string) ([]*gocloak.PermissionScope, error) - - // GetPermissionsFunc mocks the GetPermissions method. - GetPermissionsFunc func(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetPermissionParams) ([]*gocloak.PermissionRepresentation, error) - - // GetPoliciesFunc mocks the GetPolicies method. - GetPoliciesFunc func(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetPolicyParams) ([]*gocloak.PolicyRepresentation, error) - - // GetPolicyFunc mocks the GetPolicy method. - GetPolicyFunc func(ctx context.Context, token string, realm string, idOfClient string, policyID string) (*gocloak.PolicyRepresentation, error) - - // GetRawUserInfoFunc mocks the GetRawUserInfo method. - GetRawUserInfoFunc func(ctx context.Context, accessToken string, realm string) (map[string]interface{}, error) - - // GetRealmFunc mocks the GetRealm method. - GetRealmFunc func(ctx context.Context, token string, realm string) (*gocloak.RealmRepresentation, error) - - // GetRealmRoleFunc mocks the GetRealmRole method. - GetRealmRoleFunc func(ctx context.Context, token string, realm string, roleName string) (*gocloak.Role, error) - - // GetRealmRoleByIDFunc mocks the GetRealmRoleByID method. - GetRealmRoleByIDFunc func(ctx context.Context, token string, realm string, roleID string) (*gocloak.Role, error) - - // GetRealmRolesFunc mocks the GetRealmRoles method. - GetRealmRolesFunc func(ctx context.Context, accessToken string, realm string, params gocloak.GetRoleParams) ([]*gocloak.Role, error) - - // GetRealmRolesByGroupIDFunc mocks the GetRealmRolesByGroupID method. - GetRealmRolesByGroupIDFunc func(ctx context.Context, accessToken string, realm string, groupID string) ([]*gocloak.Role, error) - - // GetRealmRolesByUserIDFunc mocks the GetRealmRolesByUserID method. - GetRealmRolesByUserIDFunc func(ctx context.Context, accessToken string, realm string, userID string) ([]*gocloak.Role, error) - - // GetRealmsFunc mocks the GetRealms method. - GetRealmsFunc func(ctx context.Context, token string) ([]*gocloak.RealmRepresentation, error) - - // GetRequestingPartyPermissionDecisionFunc mocks the GetRequestingPartyPermissionDecision method. - GetRequestingPartyPermissionDecisionFunc func(ctx context.Context, token string, realm string, options gocloak.RequestingPartyTokenOptions) (*gocloak.RequestingPartyPermissionDecision, error) - - // GetRequestingPartyPermissionsFunc mocks the GetRequestingPartyPermissions method. - GetRequestingPartyPermissionsFunc func(ctx context.Context, token string, realm string, options gocloak.RequestingPartyTokenOptions) (*[]gocloak.RequestingPartyPermission, error) - - // GetRequestingPartyTokenFunc mocks the GetRequestingPartyToken method. - GetRequestingPartyTokenFunc func(ctx context.Context, token string, realm string, options gocloak.RequestingPartyTokenOptions) (*gocloak.JWT, error) - - // GetResourceFunc mocks the GetResource method. - GetResourceFunc func(ctx context.Context, token string, realm string, idOfClient string, resourceID string) (*gocloak.ResourceRepresentation, error) - - // GetResourceClientFunc mocks the GetResourceClient method. - GetResourceClientFunc func(ctx context.Context, token string, realm string, resourceID string) (*gocloak.ResourceRepresentation, error) - - // GetResourcePoliciesFunc mocks the GetResourcePolicies method. - GetResourcePoliciesFunc func(ctx context.Context, token string, realm string, params gocloak.GetResourcePoliciesParams) ([]*gocloak.ResourcePolicyRepresentation, error) - - // GetResourcePolicyFunc mocks the GetResourcePolicy method. - GetResourcePolicyFunc func(ctx context.Context, token string, realm string, permissionID string) (*gocloak.ResourcePolicyRepresentation, error) - - // GetResourcesFunc mocks the GetResources method. - GetResourcesFunc func(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetResourceParams) ([]*gocloak.ResourceRepresentation, error) - - // GetResourcesClientFunc mocks the GetResourcesClient method. - GetResourcesClientFunc func(ctx context.Context, token string, realm string, params gocloak.GetResourceParams) ([]*gocloak.ResourceRepresentation, error) - - // GetRoleMappingByGroupIDFunc mocks the GetRoleMappingByGroupID method. - GetRoleMappingByGroupIDFunc func(ctx context.Context, accessToken string, realm string, groupID string) (*gocloak.MappingsRepresentation, error) - - // GetRoleMappingByUserIDFunc mocks the GetRoleMappingByUserID method. - GetRoleMappingByUserIDFunc func(ctx context.Context, accessToken string, realm string, userID string) (*gocloak.MappingsRepresentation, error) - - // GetScopeFunc mocks the GetScope method. - GetScopeFunc func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) (*gocloak.ScopeRepresentation, error) - - // GetScopesFunc mocks the GetScopes method. - GetScopesFunc func(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetScopeParams) ([]*gocloak.ScopeRepresentation, error) - - // GetServerInfoFunc mocks the GetServerInfo method. - GetServerInfoFunc func(ctx context.Context, accessToken string) (*gocloak.ServerInfoRepesentation, error) - - // GetTokenFunc mocks the GetToken method. - GetTokenFunc func(ctx context.Context, realm string, options gocloak.TokenOptions) (*gocloak.JWT, error) - - // GetUserByIDFunc mocks the GetUserByID method. - GetUserByIDFunc func(ctx context.Context, accessToken string, realm string, userID string) (*gocloak.User, error) - - // GetUserCountFunc mocks the GetUserCount method. - GetUserCountFunc func(ctx context.Context, accessToken string, realm string, params gocloak.GetUsersParams) (int, error) - - // GetUserFederatedIdentitiesFunc mocks the GetUserFederatedIdentities method. - GetUserFederatedIdentitiesFunc func(ctx context.Context, token string, realm string, userID string) ([]*gocloak.FederatedIdentityRepresentation, error) - - // GetUserGroupsFunc mocks the GetUserGroups method. - GetUserGroupsFunc func(ctx context.Context, accessToken string, realm string, userID string, params gocloak.GetGroupsParams) ([]*gocloak.Group, error) - - // GetUserInfoFunc mocks the GetUserInfo method. - GetUserInfoFunc func(ctx context.Context, accessToken string, realm string) (*gocloak.UserInfo, error) - - // GetUserOfflineSessionsForClientFunc mocks the GetUserOfflineSessionsForClient method. - GetUserOfflineSessionsForClientFunc func(ctx context.Context, token string, realm string, userID string, idOfClient string) ([]*gocloak.UserSessionRepresentation, error) - - // GetUserPermissionsFunc mocks the GetUserPermissions method. - GetUserPermissionsFunc func(ctx context.Context, token string, realm string, params gocloak.GetUserPermissionParams) ([]*gocloak.PermissionGrantResponseRepresentation, error) - - // GetUserSessionsFunc mocks the GetUserSessions method. - GetUserSessionsFunc func(ctx context.Context, token string, realm string, userID string) ([]*gocloak.UserSessionRepresentation, error) - - // GetUsersFunc mocks the GetUsers method. - GetUsersFunc func(ctx context.Context, accessToken string, realm string, params gocloak.GetUsersParams) ([]*gocloak.User, error) - - // GetUsersByClientRoleNameFunc mocks the GetUsersByClientRoleName method. - GetUsersByClientRoleNameFunc func(ctx context.Context, token string, realm string, idOfClient string, roleName string, params gocloak.GetUsersByRoleParams) ([]*gocloak.User, error) - - // GetUsersByRoleNameFunc mocks the GetUsersByRoleName method. - GetUsersByRoleNameFunc func(ctx context.Context, token string, realm string, roleName string) ([]*gocloak.User, error) - - // GrantUserPermissionFunc mocks the GrantUserPermission method. - GrantUserPermissionFunc func(ctx context.Context, token string, realm string, permission gocloak.PermissionGrantParams) (*gocloak.PermissionGrantResponseRepresentation, error) - - // ImportIdentityProviderConfigFunc mocks the ImportIdentityProviderConfig method. - ImportIdentityProviderConfigFunc func(ctx context.Context, token string, realm string, fromURL string, providerID string) (map[string]string, error) - - // ImportIdentityProviderConfigFromFileFunc mocks the ImportIdentityProviderConfigFromFile method. - ImportIdentityProviderConfigFromFileFunc func(ctx context.Context, token string, realm string, providerID string, fileName string, fileBody io.Reader) (map[string]string, error) - - // LoginFunc mocks the Login method. - LoginFunc func(ctx context.Context, clientID string, clientSecret string, realm string, username string, password string) (*gocloak.JWT, error) - - // LoginAdminFunc mocks the LoginAdmin method. - LoginAdminFunc func(ctx context.Context, username string, password string, realm string) (*gocloak.JWT, error) - - // LoginClientFunc mocks the LoginClient method. - LoginClientFunc func(ctx context.Context, clientID string, clientSecret string, realm string) (*gocloak.JWT, error) - - // LoginClientSignedJWTFunc mocks the LoginClientSignedJWT method. - LoginClientSignedJWTFunc func(ctx context.Context, idOfClient string, realm string, key interface{}, signedMethod jwt.SigningMethod, expiresAt *jwt.NumericDate) (*gocloak.JWT, error) - - // LoginClientTokenExchangeFunc mocks the LoginClientTokenExchange method. - LoginClientTokenExchangeFunc func(ctx context.Context, clientID string, token string, clientSecret string, realm string, targetClient string, userID string) (*gocloak.JWT, error) - - // LoginOtpFunc mocks the LoginOtp method. - LoginOtpFunc func(ctx context.Context, clientID string, clientSecret string, realm string, username string, password string, totp string) (*gocloak.JWT, error) - - // LogoutFunc mocks the Logout method. - LogoutFunc func(ctx context.Context, clientID string, clientSecret string, realm string, refreshToken string) error - - // LogoutAllSessionsFunc mocks the LogoutAllSessions method. - LogoutAllSessionsFunc func(ctx context.Context, accessToken string, realm string, userID string) error - - // LogoutPublicClientFunc mocks the LogoutPublicClient method. - LogoutPublicClientFunc func(ctx context.Context, idOfClient string, realm string, accessToken string, refreshToken string) error - - // LogoutUserSessionFunc mocks the LogoutUserSession method. - LogoutUserSessionFunc func(ctx context.Context, accessToken string, realm string, session string) error - - // MoveCredentialBehindFunc mocks the MoveCredentialBehind method. - MoveCredentialBehindFunc func(ctx context.Context, token string, realm string, userID string, credentialID string, newPreviousCredentialID string) error - - // MoveCredentialToFirstFunc mocks the MoveCredentialToFirst method. - MoveCredentialToFirstFunc func(ctx context.Context, token string, realm string, userID string, credentialID string) error - - // RefreshTokenFunc mocks the RefreshToken method. - RefreshTokenFunc func(ctx context.Context, refreshToken string, clientID string, clientSecret string, realm string) (*gocloak.JWT, error) - - // RegenerateClientSecretFunc mocks the RegenerateClientSecret method. - RegenerateClientSecretFunc func(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.CredentialRepresentation, error) - - // RemoveDefaultGroupFunc mocks the RemoveDefaultGroup method. - RemoveDefaultGroupFunc func(ctx context.Context, accessToken string, realm string, groupID string) error - - // RemoveDefaultScopeFromClientFunc mocks the RemoveDefaultScopeFromClient method. - RemoveDefaultScopeFromClientFunc func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error - - // RemoveOptionalScopeFromClientFunc mocks the RemoveOptionalScopeFromClient method. - RemoveOptionalScopeFromClientFunc func(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error - - // RestyClientFunc mocks the RestyClient method. - RestyClientFunc func() *resty.Client - - // RetrospectTokenFunc mocks the RetrospectToken method. - RetrospectTokenFunc func(ctx context.Context, accessToken string, clientID string, clientSecret string, realm string) (*gocloak.RetrospecTokenResult, error) - - // RevokeUserConsentsFunc mocks the RevokeUserConsents method. - RevokeUserConsentsFunc func(ctx context.Context, accessToken string, realm string, userID string, clientID string) error - - // SetPasswordFunc mocks the SetPassword method. - SetPasswordFunc func(ctx context.Context, token string, userID string, realm string, password string, temporary bool) error - - // SetRestyClientFunc mocks the SetRestyClient method. - SetRestyClientFunc func(restyClient *resty.Client) - - // UpdateAuthenticationExecutionFunc mocks the UpdateAuthenticationExecution method. - UpdateAuthenticationExecutionFunc func(ctx context.Context, token string, realm string, flow string, execution gocloak.ModifyAuthenticationExecutionRepresentation) error - - // UpdateClientFunc mocks the UpdateClient method. - UpdateClientFunc func(ctx context.Context, accessToken string, realm string, updatedClient gocloak.Client) error - - // UpdateClientProtocolMapperFunc mocks the UpdateClientProtocolMapper method. - UpdateClientProtocolMapperFunc func(ctx context.Context, token string, realm string, idOfClient string, mapperID string, mapper gocloak.ProtocolMapperRepresentation) error - - // UpdateClientRepresentationFunc mocks the UpdateClientRepresentation method. - UpdateClientRepresentationFunc func(ctx context.Context, accessToken string, realm string, updatedClient gocloak.Client) (*gocloak.Client, error) - - // UpdateClientScopeFunc mocks the UpdateClientScope method. - UpdateClientScopeFunc func(ctx context.Context, accessToken string, realm string, scope gocloak.ClientScope) error - - // UpdateClientScopeProtocolMapperFunc mocks the UpdateClientScopeProtocolMapper method. - UpdateClientScopeProtocolMapperFunc func(ctx context.Context, accessToken string, realm string, scopeID string, protocolMapper gocloak.ProtocolMappers) error - - // UpdateCredentialUserLabelFunc mocks the UpdateCredentialUserLabel method. - UpdateCredentialUserLabelFunc func(ctx context.Context, token string, realm string, userID string, credentialID string, userLabel string) error - - // UpdateGroupFunc mocks the UpdateGroup method. - UpdateGroupFunc func(ctx context.Context, accessToken string, realm string, updatedGroup gocloak.Group) error - - // UpdateIdentityProviderFunc mocks the UpdateIdentityProvider method. - UpdateIdentityProviderFunc func(ctx context.Context, token string, realm string, alias string, providerRep gocloak.IdentityProviderRepresentation) error - - // UpdateIdentityProviderMapperFunc mocks the UpdateIdentityProviderMapper method. - UpdateIdentityProviderMapperFunc func(ctx context.Context, token string, realm string, alias string, mapper gocloak.IdentityProviderMapper) error - - // UpdatePermissionFunc mocks the UpdatePermission method. - UpdatePermissionFunc func(ctx context.Context, token string, realm string, idOfClient string, permission gocloak.PermissionRepresentation) error - - // UpdatePolicyFunc mocks the UpdatePolicy method. - UpdatePolicyFunc func(ctx context.Context, token string, realm string, idOfClient string, policy gocloak.PolicyRepresentation) error - - // UpdateRealmFunc mocks the UpdateRealm method. - UpdateRealmFunc func(ctx context.Context, token string, realm gocloak.RealmRepresentation) error - - // UpdateRealmRoleFunc mocks the UpdateRealmRole method. - UpdateRealmRoleFunc func(ctx context.Context, token string, realm string, roleName string, role gocloak.Role) error - - // UpdateRealmRoleByIDFunc mocks the UpdateRealmRoleByID method. - UpdateRealmRoleByIDFunc func(ctx context.Context, token string, realm string, roleID string, role gocloak.Role) error - - // UpdateRequiredActionFunc mocks the UpdateRequiredAction method. - UpdateRequiredActionFunc func(ctx context.Context, token string, realm string, requiredAction gocloak.RequiredActionProviderRepresentation) error - - // UpdateResourceFunc mocks the UpdateResource method. - UpdateResourceFunc func(ctx context.Context, token string, realm string, idOfClient string, resource gocloak.ResourceRepresentation) error - - // UpdateResourceClientFunc mocks the UpdateResourceClient method. - UpdateResourceClientFunc func(ctx context.Context, token string, realm string, resource gocloak.ResourceRepresentation) error - - // UpdateResourcePolicyFunc mocks the UpdateResourcePolicy method. - UpdateResourcePolicyFunc func(ctx context.Context, token string, realm string, permissionID string, policy gocloak.ResourcePolicyRepresentation) error - - // UpdateRoleFunc mocks the UpdateRole method. - UpdateRoleFunc func(ctx context.Context, accessToken string, realm string, idOfClient string, role gocloak.Role) error - - // UpdateScopeFunc mocks the UpdateScope method. - UpdateScopeFunc func(ctx context.Context, token string, realm string, idOfClient string, resource gocloak.ScopeRepresentation) error - - // UpdateUserFunc mocks the UpdateUser method. - UpdateUserFunc func(ctx context.Context, accessToken string, realm string, user gocloak.User) error - - // UpdateUserPermissionFunc mocks the UpdateUserPermission method. - UpdateUserPermissionFunc func(ctx context.Context, token string, realm string, permission gocloak.PermissionGrantParams) (*gocloak.PermissionGrantResponseRepresentation, error) - - // calls tracks calls to the methods. - calls struct { - // AddClientRoleComposite holds details about calls to the AddClientRoleComposite method. - AddClientRoleComposite []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleID is the roleID argument value. - RoleID string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // AddClientRoleToGroup holds details about calls to the AddClientRoleToGroup method. - AddClientRoleToGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // GroupID is the groupID argument value. - GroupID string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // AddClientRoleToUser holds details about calls to the AddClientRoleToUser method. - AddClientRoleToUser []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // UserID is the userID argument value. - UserID string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // AddDefaultGroup holds details about calls to the AddDefaultGroup method. - AddDefaultGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - } - // AddDefaultScopeToClient holds details about calls to the AddDefaultScopeToClient method. - AddDefaultScopeToClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // ScopeID is the scopeID argument value. - ScopeID string - } - // AddOptionalScopeToClient holds details about calls to the AddOptionalScopeToClient method. - AddOptionalScopeToClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // ScopeID is the scopeID argument value. - ScopeID string - } - // AddRealmRoleComposite holds details about calls to the AddRealmRoleComposite method. - AddRealmRoleComposite []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleName is the roleName argument value. - RoleName string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // AddRealmRoleToGroup holds details about calls to the AddRealmRoleToGroup method. - AddRealmRoleToGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // AddRealmRoleToUser holds details about calls to the AddRealmRoleToUser method. - AddRealmRoleToUser []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // AddUserToGroup holds details about calls to the AddUserToGroup method. - AddUserToGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // GroupID is the groupID argument value. - GroupID string - } - // ClearKeysCache holds details about calls to the ClearKeysCache method. - ClearKeysCache []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // ClearRealmCache holds details about calls to the ClearRealmCache method. - ClearRealmCache []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // ClearUserCache holds details about calls to the ClearUserCache method. - ClearUserCache []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // CreateAuthenticationExecution holds details about calls to the CreateAuthenticationExecution method. - CreateAuthenticationExecution []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Flow is the flow argument value. - Flow string - // Execution is the execution argument value. - Execution gocloak.CreateAuthenticationExecutionRepresentation - } - // CreateAuthenticationExecutionFlow holds details about calls to the CreateAuthenticationExecutionFlow method. - CreateAuthenticationExecutionFlow []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Flow is the flow argument value. - Flow string - // Execution is the execution argument value. - Execution gocloak.CreateAuthenticationExecutionFlowRepresentation - } - // CreateAuthenticationFlow holds details about calls to the CreateAuthenticationFlow method. - CreateAuthenticationFlow []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Flow is the flow argument value. - Flow gocloak.AuthenticationFlowRepresentation - } - // CreateChildGroup holds details about calls to the CreateChildGroup method. - CreateChildGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - // Group is the group argument value. - Group gocloak.Group - } - // CreateClient holds details about calls to the CreateClient method. - CreateClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // NewClient is the newClient argument value. - NewClient gocloak.Client - } - // CreateClientProtocolMapper holds details about calls to the CreateClientProtocolMapper method. - CreateClientProtocolMapper []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Mapper is the mapper argument value. - Mapper gocloak.ProtocolMapperRepresentation - } - // CreateClientRepresentation holds details about calls to the CreateClientRepresentation method. - CreateClientRepresentation []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Realm is the realm argument value. - Realm string - } - // CreateClientRole holds details about calls to the CreateClientRole method. - CreateClientRole []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Role is the role argument value. - Role gocloak.Role - } - // CreateClientScope holds details about calls to the CreateClientScope method. - CreateClientScope []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Scope is the scope argument value. - Scope gocloak.ClientScope - } - // CreateClientScopeMappingsClientRoles holds details about calls to the CreateClientScopeMappingsClientRoles method. - CreateClientScopeMappingsClientRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // IdOfSelectedClient is the idOfSelectedClient argument value. - IdOfSelectedClient string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // CreateClientScopeMappingsRealmRoles holds details about calls to the CreateClientScopeMappingsRealmRoles method. - CreateClientScopeMappingsRealmRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // CreateClientScopeProtocolMapper holds details about calls to the CreateClientScopeProtocolMapper method. - CreateClientScopeProtocolMapper []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // ScopeID is the scopeID argument value. - ScopeID string - // ProtocolMapper is the protocolMapper argument value. - ProtocolMapper gocloak.ProtocolMappers - } - // CreateClientScopesScopeMappingsClientRoles holds details about calls to the CreateClientScopesScopeMappingsClientRoles method. - CreateClientScopesScopeMappingsClientRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClientScope is the idOfClientScope argument value. - IdOfClientScope string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // CreateClientScopesScopeMappingsRealmRoles holds details about calls to the CreateClientScopesScopeMappingsRealmRoles method. - CreateClientScopesScopeMappingsRealmRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClientScope is the idOfClientScope argument value. - IdOfClientScope string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // CreateComponent holds details about calls to the CreateComponent method. - CreateComponent []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Component is the component argument value. - Component gocloak.Component - } - // CreateGroup holds details about calls to the CreateGroup method. - CreateGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Group is the group argument value. - Group gocloak.Group - } - // CreateIdentityProvider holds details about calls to the CreateIdentityProvider method. - CreateIdentityProvider []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // ProviderRep is the providerRep argument value. - ProviderRep gocloak.IdentityProviderRepresentation - } - // CreateIdentityProviderMapper holds details about calls to the CreateIdentityProviderMapper method. - CreateIdentityProviderMapper []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Alias is the alias argument value. - Alias string - // Mapper is the mapper argument value. - Mapper gocloak.IdentityProviderMapper - } - // CreatePermission holds details about calls to the CreatePermission method. - CreatePermission []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Permission is the permission argument value. - Permission gocloak.PermissionRepresentation - } - // CreatePermissionTicket holds details about calls to the CreatePermissionTicket method. - CreatePermissionTicket []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Permissions is the permissions argument value. - Permissions []gocloak.CreatePermissionTicketParams - } - // CreatePolicy holds details about calls to the CreatePolicy method. - CreatePolicy []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Policy is the policy argument value. - Policy gocloak.PolicyRepresentation - } - // CreateRealm holds details about calls to the CreateRealm method. - CreateRealm []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm gocloak.RealmRepresentation - } - // CreateRealmRole holds details about calls to the CreateRealmRole method. - CreateRealmRole []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Role is the role argument value. - Role gocloak.Role - } - // CreateResource holds details about calls to the CreateResource method. - CreateResource []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Resource is the resource argument value. - Resource gocloak.ResourceRepresentation - } - // CreateResourceClient holds details about calls to the CreateResourceClient method. - CreateResourceClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Resource is the resource argument value. - Resource gocloak.ResourceRepresentation - } - // CreateResourcePolicy holds details about calls to the CreateResourcePolicy method. - CreateResourcePolicy []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // ResourceID is the resourceID argument value. - ResourceID string - // Policy is the policy argument value. - Policy gocloak.ResourcePolicyRepresentation - } - // CreateScope holds details about calls to the CreateScope method. - CreateScope []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Scope is the scope argument value. - Scope gocloak.ScopeRepresentation - } - // CreateUser holds details about calls to the CreateUser method. - CreateUser []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // User is the user argument value. - User gocloak.User - } - // CreateUserFederatedIdentity holds details about calls to the CreateUserFederatedIdentity method. - CreateUserFederatedIdentity []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // ProviderID is the providerID argument value. - ProviderID string - // FederatedIdentityRep is the federatedIdentityRep argument value. - FederatedIdentityRep gocloak.FederatedIdentityRepresentation - } - // DecodeAccessToken holds details about calls to the DecodeAccessToken method. - DecodeAccessToken []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - } - // DecodeAccessTokenCustomClaims holds details about calls to the DecodeAccessTokenCustomClaims method. - DecodeAccessTokenCustomClaims []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Claims is the claims argument value. - Claims jwt.Claims - } - // DeleteAuthenticationExecution holds details about calls to the DeleteAuthenticationExecution method. - DeleteAuthenticationExecution []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // ExecutionID is the executionID argument value. - ExecutionID string - } - // DeleteAuthenticationFlow holds details about calls to the DeleteAuthenticationFlow method. - DeleteAuthenticationFlow []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // FlowID is the flowID argument value. - FlowID string - } - // DeleteClient holds details about calls to the DeleteClient method. - DeleteClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // DeleteClientProtocolMapper holds details about calls to the DeleteClientProtocolMapper method. - DeleteClientProtocolMapper []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // MapperID is the mapperID argument value. - MapperID string - } - // DeleteClientRepresentation holds details about calls to the DeleteClientRepresentation method. - DeleteClientRepresentation []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // ClientID is the clientID argument value. - ClientID string - } - // DeleteClientRole holds details about calls to the DeleteClientRole method. - DeleteClientRole []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // RoleName is the roleName argument value. - RoleName string - } - // DeleteClientRoleComposite holds details about calls to the DeleteClientRoleComposite method. - DeleteClientRoleComposite []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleID is the roleID argument value. - RoleID string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // DeleteClientRoleFromGroup holds details about calls to the DeleteClientRoleFromGroup method. - DeleteClientRoleFromGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // GroupID is the groupID argument value. - GroupID string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // DeleteClientRoleFromUser holds details about calls to the DeleteClientRoleFromUser method. - DeleteClientRoleFromUser []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // UserID is the userID argument value. - UserID string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // DeleteClientScope holds details about calls to the DeleteClientScope method. - DeleteClientScope []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // ScopeID is the scopeID argument value. - ScopeID string - } - // DeleteClientScopeMappingsClientRoles holds details about calls to the DeleteClientScopeMappingsClientRoles method. - DeleteClientScopeMappingsClientRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // IdOfSelectedClient is the idOfSelectedClient argument value. - IdOfSelectedClient string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // DeleteClientScopeMappingsRealmRoles holds details about calls to the DeleteClientScopeMappingsRealmRoles method. - DeleteClientScopeMappingsRealmRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // DeleteClientScopeProtocolMapper holds details about calls to the DeleteClientScopeProtocolMapper method. - DeleteClientScopeProtocolMapper []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // ScopeID is the scopeID argument value. - ScopeID string - // ProtocolMapperID is the protocolMapperID argument value. - ProtocolMapperID string - } - // DeleteClientScopesScopeMappingsClientRoles holds details about calls to the DeleteClientScopesScopeMappingsClientRoles method. - DeleteClientScopesScopeMappingsClientRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClientScope is the idOfClientScope argument value. - IdOfClientScope string - // IfOfClient is the ifOfClient argument value. - IfOfClient string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // DeleteClientScopesScopeMappingsRealmRoles holds details about calls to the DeleteClientScopesScopeMappingsRealmRoles method. - DeleteClientScopesScopeMappingsRealmRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClientScope is the idOfClientScope argument value. - IdOfClientScope string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // DeleteComponent holds details about calls to the DeleteComponent method. - DeleteComponent []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // ComponentID is the componentID argument value. - ComponentID string - } - // DeleteCredentials holds details about calls to the DeleteCredentials method. - DeleteCredentials []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the UserID argument value. - UserID string - // CredentialID is the CredentialID argument value. - CredentialID string - } - // DeleteGroup holds details about calls to the DeleteGroup method. - DeleteGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - } - // DeleteIdentityProvider holds details about calls to the DeleteIdentityProvider method. - DeleteIdentityProvider []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Alias is the alias argument value. - Alias string - } - // DeleteIdentityProviderMapper holds details about calls to the DeleteIdentityProviderMapper method. - DeleteIdentityProviderMapper []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Alias is the alias argument value. - Alias string - // MapperID is the mapperID argument value. - MapperID string - } - // DeletePermission holds details about calls to the DeletePermission method. - DeletePermission []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // PermissionID is the permissionID argument value. - PermissionID string - } - // DeletePolicy holds details about calls to the DeletePolicy method. - DeletePolicy []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // PolicyID is the policyID argument value. - PolicyID string - } - // DeleteRealm holds details about calls to the DeleteRealm method. - DeleteRealm []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // DeleteRealmRole holds details about calls to the DeleteRealmRole method. - DeleteRealmRole []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleName is the roleName argument value. - RoleName string - } - // DeleteRealmRoleComposite holds details about calls to the DeleteRealmRoleComposite method. - DeleteRealmRoleComposite []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleName is the roleName argument value. - RoleName string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // DeleteRealmRoleFromGroup holds details about calls to the DeleteRealmRoleFromGroup method. - DeleteRealmRoleFromGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // DeleteRealmRoleFromUser holds details about calls to the DeleteRealmRoleFromUser method. - DeleteRealmRoleFromUser []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // Roles is the roles argument value. - Roles []gocloak.Role - } - // DeleteResource holds details about calls to the DeleteResource method. - DeleteResource []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // ResourceID is the resourceID argument value. - ResourceID string - } - // DeleteResourceClient holds details about calls to the DeleteResourceClient method. - DeleteResourceClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // ResourceID is the resourceID argument value. - ResourceID string - } - // DeleteResourcePolicy holds details about calls to the DeleteResourcePolicy method. - DeleteResourcePolicy []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // PermissionID is the permissionID argument value. - PermissionID string - } - // DeleteScope holds details about calls to the DeleteScope method. - DeleteScope []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // ScopeID is the scopeID argument value. - ScopeID string - } - // DeleteUser holds details about calls to the DeleteUser method. - DeleteUser []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - } - // DeleteUserFederatedIdentity holds details about calls to the DeleteUserFederatedIdentity method. - DeleteUserFederatedIdentity []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // ProviderID is the providerID argument value. - ProviderID string - } - // DeleteUserFromGroup holds details about calls to the DeleteUserFromGroup method. - DeleteUserFromGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // GroupID is the groupID argument value. - GroupID string - } - // DeleteUserPermission holds details about calls to the DeleteUserPermission method. - DeleteUserPermission []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // TicketID is the ticketID argument value. - TicketID string - } - // DisableAllCredentialsByType holds details about calls to the DisableAllCredentialsByType method. - DisableAllCredentialsByType []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // Types is the types argument value. - Types []string - } - // ExecuteActionsEmail holds details about calls to the ExecuteActionsEmail method. - ExecuteActionsEmail []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.ExecuteActionsEmail - } - // ExportIDPPublicBrokerConfig holds details about calls to the ExportIDPPublicBrokerConfig method. - ExportIDPPublicBrokerConfig []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Alias is the alias argument value. - Alias string - } - // GetAdapterConfiguration holds details about calls to the GetAdapterConfiguration method. - GetAdapterConfiguration []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // ClientID is the clientID argument value. - ClientID string - } - // GetAuthenticationExecutions holds details about calls to the GetAuthenticationExecutions method. - GetAuthenticationExecutions []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Flow is the flow argument value. - Flow string - } - // GetAuthenticationFlows holds details about calls to the GetAuthenticationFlows method. - GetAuthenticationFlows []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // GetAuthorizationPolicyAssociatedPolicies holds details about calls to the GetAuthorizationPolicyAssociatedPolicies method. - GetAuthorizationPolicyAssociatedPolicies []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // PolicyID is the policyID argument value. - PolicyID string - } - // GetAuthorizationPolicyResources holds details about calls to the GetAuthorizationPolicyResources method. - GetAuthorizationPolicyResources []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // PolicyID is the policyID argument value. - PolicyID string - } - // GetAuthorizationPolicyScopes holds details about calls to the GetAuthorizationPolicyScopes method. - GetAuthorizationPolicyScopes []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // PolicyID is the policyID argument value. - PolicyID string - } - // GetAvailableClientRolesByGroupID holds details about calls to the GetAvailableClientRolesByGroupID method. - GetAvailableClientRolesByGroupID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // GroupID is the groupID argument value. - GroupID string - } - // GetAvailableClientRolesByUserID holds details about calls to the GetAvailableClientRolesByUserID method. - GetAvailableClientRolesByUserID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // UserID is the userID argument value. - UserID string - } - // GetAvailableRealmRolesByGroupID holds details about calls to the GetAvailableRealmRolesByGroupID method. - GetAvailableRealmRolesByGroupID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - } - // GetAvailableRealmRolesByUserID holds details about calls to the GetAvailableRealmRolesByUserID method. - GetAvailableRealmRolesByUserID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - } - // GetCerts holds details about calls to the GetCerts method. - GetCerts []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Realm is the realm argument value. - Realm string - } - // GetClient holds details about calls to the GetClient method. - GetClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClientOfflineSessions holds details about calls to the GetClientOfflineSessions method. - GetClientOfflineSessions []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClientRepresentation holds details about calls to the GetClientRepresentation method. - GetClientRepresentation []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // ClientID is the clientID argument value. - ClientID string - } - // GetClientRole holds details about calls to the GetClientRole method. - GetClientRole []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // RoleName is the roleName argument value. - RoleName string - } - // GetClientRoleByID holds details about calls to the GetClientRoleByID method. - GetClientRoleByID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // RoleID is the roleID argument value. - RoleID string - } - // GetClientRoles holds details about calls to the GetClientRoles method. - GetClientRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Params is the params argument value. - Params gocloak.GetRoleParams - } - // GetClientRolesByGroupID holds details about calls to the GetClientRolesByGroupID method. - GetClientRolesByGroupID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // GroupID is the groupID argument value. - GroupID string - } - // GetClientRolesByUserID holds details about calls to the GetClientRolesByUserID method. - GetClientRolesByUserID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // UserID is the userID argument value. - UserID string - } - // GetClientScope holds details about calls to the GetClientScope method. - GetClientScope []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // ScopeID is the scopeID argument value. - ScopeID string - } - // GetClientScopeMappings holds details about calls to the GetClientScopeMappings method. - GetClientScopeMappings []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClientScopeMappingsClientRoles holds details about calls to the GetClientScopeMappingsClientRoles method. - GetClientScopeMappingsClientRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // IdOfSelectedClient is the idOfSelectedClient argument value. - IdOfSelectedClient string - } - // GetClientScopeMappingsClientRolesAvailable holds details about calls to the GetClientScopeMappingsClientRolesAvailable method. - GetClientScopeMappingsClientRolesAvailable []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // IdOfSelectedClient is the idOfSelectedClient argument value. - IdOfSelectedClient string - } - // GetClientScopeMappingsRealmRoles holds details about calls to the GetClientScopeMappingsRealmRoles method. - GetClientScopeMappingsRealmRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClientScopeMappingsRealmRolesAvailable holds details about calls to the GetClientScopeMappingsRealmRolesAvailable method. - GetClientScopeMappingsRealmRolesAvailable []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClientScopeProtocolMapper holds details about calls to the GetClientScopeProtocolMapper method. - GetClientScopeProtocolMapper []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // ScopeID is the scopeID argument value. - ScopeID string - // ProtocolMapperID is the protocolMapperID argument value. - ProtocolMapperID string - } - // GetClientScopeProtocolMappers holds details about calls to the GetClientScopeProtocolMappers method. - GetClientScopeProtocolMappers []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // ScopeID is the scopeID argument value. - ScopeID string - } - // GetClientScopes holds details about calls to the GetClientScopes method. - GetClientScopes []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // GetClientScopesScopeMappingsClientRoles holds details about calls to the GetClientScopesScopeMappingsClientRoles method. - GetClientScopesScopeMappingsClientRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClientScope is the idOfClientScope argument value. - IdOfClientScope string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClientScopesScopeMappingsClientRolesAvailable holds details about calls to the GetClientScopesScopeMappingsClientRolesAvailable method. - GetClientScopesScopeMappingsClientRolesAvailable []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClientScope is the idOfClientScope argument value. - IdOfClientScope string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClientScopesScopeMappingsRealmRoles holds details about calls to the GetClientScopesScopeMappingsRealmRoles method. - GetClientScopesScopeMappingsRealmRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClientScope is the idOfClientScope argument value. - IdOfClientScope string - } - // GetClientScopesScopeMappingsRealmRolesAvailable holds details about calls to the GetClientScopesScopeMappingsRealmRolesAvailable method. - GetClientScopesScopeMappingsRealmRolesAvailable []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClientScope is the idOfClientScope argument value. - IdOfClientScope string - } - // GetClientSecret holds details about calls to the GetClientSecret method. - GetClientSecret []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClientServiceAccount holds details about calls to the GetClientServiceAccount method. - GetClientServiceAccount []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClientUserSessions holds details about calls to the GetClientUserSessions method. - GetClientUserSessions []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClients holds details about calls to the GetClients method. - GetClients []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.GetClientsParams - } - // GetClientsDefaultScopes holds details about calls to the GetClientsDefaultScopes method. - GetClientsDefaultScopes []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetClientsOptionalScopes holds details about calls to the GetClientsOptionalScopes method. - GetClientsOptionalScopes []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetComponents holds details about calls to the GetComponents method. - GetComponents []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - } - // GetCompositeClientRolesByGroupID holds details about calls to the GetCompositeClientRolesByGroupID method. - GetCompositeClientRolesByGroupID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // GroupID is the groupID argument value. - GroupID string - } - // GetCompositeClientRolesByRoleID holds details about calls to the GetCompositeClientRolesByRoleID method. - GetCompositeClientRolesByRoleID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // RoleID is the roleID argument value. - RoleID string - } - // GetCompositeClientRolesByUserID holds details about calls to the GetCompositeClientRolesByUserID method. - GetCompositeClientRolesByUserID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // UserID is the userID argument value. - UserID string - } - // GetCompositeRealmRoles holds details about calls to the GetCompositeRealmRoles method. - GetCompositeRealmRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleName is the roleName argument value. - RoleName string - } - // GetCompositeRealmRolesByGroupID holds details about calls to the GetCompositeRealmRolesByGroupID method. - GetCompositeRealmRolesByGroupID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - } - // GetCompositeRealmRolesByRoleID holds details about calls to the GetCompositeRealmRolesByRoleID method. - GetCompositeRealmRolesByRoleID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleID is the roleID argument value. - RoleID string - } - // GetCompositeRealmRolesByUserID holds details about calls to the GetCompositeRealmRolesByUserID method. - GetCompositeRealmRolesByUserID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - } - // GetConfiguredUserStorageCredentialTypes holds details about calls to the GetConfiguredUserStorageCredentialTypes method. - GetConfiguredUserStorageCredentialTypes []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - } - // GetCredentialRegistrators holds details about calls to the GetCredentialRegistrators method. - GetCredentialRegistrators []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // GetCredentials holds details about calls to the GetCredentials method. - GetCredentials []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the UserID argument value. - UserID string - } - // GetDefaultDefaultClientScopes holds details about calls to the GetDefaultDefaultClientScopes method. - GetDefaultDefaultClientScopes []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // GetDefaultGroups holds details about calls to the GetDefaultGroups method. - GetDefaultGroups []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - } - // GetDefaultOptionalClientScopes holds details about calls to the GetDefaultOptionalClientScopes method. - GetDefaultOptionalClientScopes []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // GetDependentPermissions holds details about calls to the GetDependentPermissions method. - GetDependentPermissions []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // PolicyID is the policyID argument value. - PolicyID string - } - // GetEvents holds details about calls to the GetEvents method. - GetEvents []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.GetEventsParams - } - // GetGroup holds details about calls to the GetGroup method. - GetGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - } - // GetGroupMembers holds details about calls to the GetGroupMembers method. - GetGroupMembers []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - // Params is the params argument value. - Params gocloak.GetGroupsParams - } - // GetGroups holds details about calls to the GetGroups method. - GetGroups []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.GetGroupsParams - } - // GetGroupsByRole holds details about calls to the GetGroupsByRole method. - GetGroupsByRole []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // RoleName is the roleName argument value. - RoleName string - } - // GetGroupsCount holds details about calls to the GetGroupsCount method. - GetGroupsCount []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.GetGroupsParams - } - // GetIdentityProvider holds details about calls to the GetIdentityProvider method. - GetIdentityProvider []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Alias is the alias argument value. - Alias string - } - // GetIdentityProviderMapperByID holds details about calls to the GetIdentityProviderMapperByID method. - GetIdentityProviderMapperByID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Alias is the alias argument value. - Alias string - // MapperID is the mapperID argument value. - MapperID string - } - // GetIdentityProviderMappers holds details about calls to the GetIdentityProviderMappers method. - GetIdentityProviderMappers []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Alias is the alias argument value. - Alias string - } - // GetIdentityProviders holds details about calls to the GetIdentityProviders method. - GetIdentityProviders []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // GetIssuer holds details about calls to the GetIssuer method. - GetIssuer []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Realm is the realm argument value. - Realm string - } - // GetKeyStoreConfig holds details about calls to the GetKeyStoreConfig method. - GetKeyStoreConfig []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - } - // GetPermission holds details about calls to the GetPermission method. - GetPermission []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // PermissionID is the permissionID argument value. - PermissionID string - } - // GetPermissionResources holds details about calls to the GetPermissionResources method. - GetPermissionResources []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // PermissionID is the permissionID argument value. - PermissionID string - } - // GetPermissionScopes holds details about calls to the GetPermissionScopes method. - GetPermissionScopes []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // PermissionID is the permissionID argument value. - PermissionID string - } - // GetPermissions holds details about calls to the GetPermissions method. - GetPermissions []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Params is the params argument value. - Params gocloak.GetPermissionParams - } - // GetPolicies holds details about calls to the GetPolicies method. - GetPolicies []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Params is the params argument value. - Params gocloak.GetPolicyParams - } - // GetPolicy holds details about calls to the GetPolicy method. - GetPolicy []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // PolicyID is the policyID argument value. - PolicyID string - } - // GetRawUserInfo holds details about calls to the GetRawUserInfo method. - GetRawUserInfo []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - } - // GetRealm holds details about calls to the GetRealm method. - GetRealm []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - } - // GetRealmRole holds details about calls to the GetRealmRole method. - GetRealmRole []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleName is the roleName argument value. - RoleName string - } - // GetRealmRoleByID holds details about calls to the GetRealmRoleByID method. - GetRealmRoleByID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleID is the roleID argument value. - RoleID string - } - // GetRealmRoles holds details about calls to the GetRealmRoles method. - GetRealmRoles []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.GetRoleParams - } - // GetRealmRolesByGroupID holds details about calls to the GetRealmRolesByGroupID method. - GetRealmRolesByGroupID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - } - // GetRealmRolesByUserID holds details about calls to the GetRealmRolesByUserID method. - GetRealmRolesByUserID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - } - // GetRealms holds details about calls to the GetRealms method. - GetRealms []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - } - // GetRequestingPartyPermissionDecision holds details about calls to the GetRequestingPartyPermissionDecision method. - GetRequestingPartyPermissionDecision []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Options is the options argument value. - Options gocloak.RequestingPartyTokenOptions - } - // GetRequestingPartyPermissions holds details about calls to the GetRequestingPartyPermissions method. - GetRequestingPartyPermissions []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Options is the options argument value. - Options gocloak.RequestingPartyTokenOptions - } - // GetRequestingPartyToken holds details about calls to the GetRequestingPartyToken method. - GetRequestingPartyToken []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Options is the options argument value. - Options gocloak.RequestingPartyTokenOptions - } - // GetResource holds details about calls to the GetResource method. - GetResource []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // ResourceID is the resourceID argument value. - ResourceID string - } - // GetResourceClient holds details about calls to the GetResourceClient method. - GetResourceClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // ResourceID is the resourceID argument value. - ResourceID string - } - // GetResourcePolicies holds details about calls to the GetResourcePolicies method. - GetResourcePolicies []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.GetResourcePoliciesParams - } - // GetResourcePolicy holds details about calls to the GetResourcePolicy method. - GetResourcePolicy []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // PermissionID is the permissionID argument value. - PermissionID string - } - // GetResources holds details about calls to the GetResources method. - GetResources []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Params is the params argument value. - Params gocloak.GetResourceParams - } - // GetResourcesClient holds details about calls to the GetResourcesClient method. - GetResourcesClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.GetResourceParams - } - // GetRoleMappingByGroupID holds details about calls to the GetRoleMappingByGroupID method. - GetRoleMappingByGroupID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - } - // GetRoleMappingByUserID holds details about calls to the GetRoleMappingByUserID method. - GetRoleMappingByUserID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - } - // GetScope holds details about calls to the GetScope method. - GetScope []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // ScopeID is the scopeID argument value. - ScopeID string - } - // GetScopes holds details about calls to the GetScopes method. - GetScopes []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Params is the params argument value. - Params gocloak.GetScopeParams - } - // GetServerInfo holds details about calls to the GetServerInfo method. - GetServerInfo []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - } - // GetToken holds details about calls to the GetToken method. - GetToken []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Realm is the realm argument value. - Realm string - // Options is the options argument value. - Options gocloak.TokenOptions - } - // GetUserByID holds details about calls to the GetUserByID method. - GetUserByID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - } - // GetUserCount holds details about calls to the GetUserCount method. - GetUserCount []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.GetUsersParams - } - // GetUserFederatedIdentities holds details about calls to the GetUserFederatedIdentities method. - GetUserFederatedIdentities []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - } - // GetUserGroups holds details about calls to the GetUserGroups method. - GetUserGroups []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // Params is the params argument value. - Params gocloak.GetGroupsParams - } - // GetUserInfo holds details about calls to the GetUserInfo method. - GetUserInfo []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - } - // GetUserOfflineSessionsForClient holds details about calls to the GetUserOfflineSessionsForClient method. - GetUserOfflineSessionsForClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // GetUserPermissions holds details about calls to the GetUserPermissions method. - GetUserPermissions []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.GetUserPermissionParams - } - // GetUserSessions holds details about calls to the GetUserSessions method. - GetUserSessions []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - } - // GetUsers holds details about calls to the GetUsers method. - GetUsers []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Params is the params argument value. - Params gocloak.GetUsersParams - } - // GetUsersByClientRoleName holds details about calls to the GetUsersByClientRoleName method. - GetUsersByClientRoleName []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // RoleName is the roleName argument value. - RoleName string - // Params is the params argument value. - Params gocloak.GetUsersByRoleParams - } - // GetUsersByRoleName holds details about calls to the GetUsersByRoleName method. - GetUsersByRoleName []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleName is the roleName argument value. - RoleName string - } - // GrantUserPermission holds details about calls to the GrantUserPermission method. - GrantUserPermission []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Permission is the permission argument value. - Permission gocloak.PermissionGrantParams - } - // ImportIdentityProviderConfig holds details about calls to the ImportIdentityProviderConfig method. - ImportIdentityProviderConfig []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // FromURL is the fromURL argument value. - FromURL string - // ProviderID is the providerID argument value. - ProviderID string - } - // ImportIdentityProviderConfigFromFile holds details about calls to the ImportIdentityProviderConfigFromFile method. - ImportIdentityProviderConfigFromFile []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // ProviderID is the providerID argument value. - ProviderID string - // FileName is the fileName argument value. - FileName string - // FileBody is the fileBody argument value. - FileBody io.Reader - } - // Login holds details about calls to the Login method. - Login []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // ClientID is the clientID argument value. - ClientID string - // ClientSecret is the clientSecret argument value. - ClientSecret string - // Realm is the realm argument value. - Realm string - // Username is the username argument value. - Username string - // Password is the password argument value. - Password string - } - // LoginAdmin holds details about calls to the LoginAdmin method. - LoginAdmin []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Username is the username argument value. - Username string - // Password is the password argument value. - Password string - // Realm is the realm argument value. - Realm string - } - // LoginClient holds details about calls to the LoginClient method. - LoginClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // ClientID is the clientID argument value. - ClientID string - // ClientSecret is the clientSecret argument value. - ClientSecret string - // Realm is the realm argument value. - Realm string - } - // LoginClientSignedJWT holds details about calls to the LoginClientSignedJWT method. - LoginClientSignedJWT []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Realm is the realm argument value. - Realm string - // Key is the key argument value. - Key interface{} - // SignedMethod is the signedMethod argument value. - SignedMethod jwt.SigningMethod - // ExpiresAt is the expiresAt argument value. - ExpiresAt *jwt.NumericDate - } - // LoginClientTokenExchange holds details about calls to the LoginClientTokenExchange method. - LoginClientTokenExchange []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // ClientID is the clientID argument value. - ClientID string - // Token is the token argument value. - Token string - // ClientSecret is the clientSecret argument value. - ClientSecret string - // Realm is the realm argument value. - Realm string - // TargetClient is the targetClient argument value. - TargetClient string - // UserID is the userID argument value. - UserID string - } - // LoginOtp holds details about calls to the LoginOtp method. - LoginOtp []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // ClientID is the clientID argument value. - ClientID string - // ClientSecret is the clientSecret argument value. - ClientSecret string - // Realm is the realm argument value. - Realm string - // Username is the username argument value. - Username string - // Password is the password argument value. - Password string - // Totp is the totp argument value. - Totp string - } - // Logout holds details about calls to the Logout method. - Logout []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // ClientID is the clientID argument value. - ClientID string - // ClientSecret is the clientSecret argument value. - ClientSecret string - // Realm is the realm argument value. - Realm string - // RefreshToken is the refreshToken argument value. - RefreshToken string - } - // LogoutAllSessions holds details about calls to the LogoutAllSessions method. - LogoutAllSessions []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - } - // LogoutPublicClient holds details about calls to the LogoutPublicClient method. - LogoutPublicClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Realm is the realm argument value. - Realm string - // AccessToken is the accessToken argument value. - AccessToken string - // RefreshToken is the refreshToken argument value. - RefreshToken string - } - // LogoutUserSession holds details about calls to the LogoutUserSession method. - LogoutUserSession []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Session is the session argument value. - Session string - } - // MoveCredentialBehind holds details about calls to the MoveCredentialBehind method. - MoveCredentialBehind []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // CredentialID is the credentialID argument value. - CredentialID string - // NewPreviousCredentialID is the newPreviousCredentialID argument value. - NewPreviousCredentialID string - } - // MoveCredentialToFirst holds details about calls to the MoveCredentialToFirst method. - MoveCredentialToFirst []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // CredentialID is the credentialID argument value. - CredentialID string - } - // RefreshToken holds details about calls to the RefreshToken method. - RefreshToken []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // RefreshToken is the refreshToken argument value. - RefreshToken string - // ClientID is the clientID argument value. - ClientID string - // ClientSecret is the clientSecret argument value. - ClientSecret string - // Realm is the realm argument value. - Realm string - } - // RegenerateClientSecret holds details about calls to the RegenerateClientSecret method. - RegenerateClientSecret []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - } - // RemoveDefaultGroup holds details about calls to the RemoveDefaultGroup method. - RemoveDefaultGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // GroupID is the groupID argument value. - GroupID string - } - // RemoveDefaultScopeFromClient holds details about calls to the RemoveDefaultScopeFromClient method. - RemoveDefaultScopeFromClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // ScopeID is the scopeID argument value. - ScopeID string - } - // RemoveOptionalScopeFromClient holds details about calls to the RemoveOptionalScopeFromClient method. - RemoveOptionalScopeFromClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // ScopeID is the scopeID argument value. - ScopeID string - } - // RestyClient holds details about calls to the RestyClient method. - RestyClient []struct { - } - // RetrospectToken holds details about calls to the RetrospectToken method. - RetrospectToken []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // ClientID is the clientID argument value. - ClientID string - // ClientSecret is the clientSecret argument value. - ClientSecret string - // Realm is the realm argument value. - Realm string - } - // RevokeUserConsents holds details about calls to the RevokeUserConsents method. - RevokeUserConsents []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // ClientID is the clientID argument value. - ClientID string - } - // SetPassword holds details about calls to the SetPassword method. - SetPassword []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // UserID is the userID argument value. - UserID string - // Realm is the realm argument value. - Realm string - // Password is the password argument value. - Password string - // Temporary is the temporary argument value. - Temporary bool - } - // SetRestyClient holds details about calls to the SetRestyClient method. - SetRestyClient []struct { - // RestyClient is the restyClient argument value. - RestyClient *resty.Client - } - // UpdateAuthenticationExecution holds details about calls to the UpdateAuthenticationExecution method. - UpdateAuthenticationExecution []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Flow is the flow argument value. - Flow string - // Execution is the execution argument value. - Execution gocloak.ModifyAuthenticationExecutionRepresentation - } - // UpdateClient holds details about calls to the UpdateClient method. - UpdateClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // UpdatedClient is the updatedClient argument value. - UpdatedClient gocloak.Client - } - // UpdateClientProtocolMapper holds details about calls to the UpdateClientProtocolMapper method. - UpdateClientProtocolMapper []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // MapperID is the mapperID argument value. - MapperID string - // Mapper is the mapper argument value. - Mapper gocloak.ProtocolMapperRepresentation - } - // UpdateClientRepresentation holds details about calls to the UpdateClientRepresentation method. - UpdateClientRepresentation []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // UpdatedClient is the updatedClient argument value. - UpdatedClient gocloak.Client - } - // UpdateClientScope holds details about calls to the UpdateClientScope method. - UpdateClientScope []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // Scope is the scope argument value. - Scope gocloak.ClientScope - } - // UpdateClientScopeProtocolMapper holds details about calls to the UpdateClientScopeProtocolMapper method. - UpdateClientScopeProtocolMapper []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // ScopeID is the scopeID argument value. - ScopeID string - // ProtocolMapper is the protocolMapper argument value. - ProtocolMapper gocloak.ProtocolMappers - } - // UpdateCredentialUserLabel holds details about calls to the UpdateCredentialUserLabel method. - UpdateCredentialUserLabel []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // UserID is the userID argument value. - UserID string - // CredentialID is the credentialID argument value. - CredentialID string - // UserLabel is the userLabel argument value. - UserLabel string - } - // UpdateGroup holds details about calls to the UpdateGroup method. - UpdateGroup []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // UpdatedGroup is the updatedGroup argument value. - UpdatedGroup gocloak.Group - } - // UpdateIdentityProvider holds details about calls to the UpdateIdentityProvider method. - UpdateIdentityProvider []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Alias is the alias argument value. - Alias string - // ProviderRep is the providerRep argument value. - ProviderRep gocloak.IdentityProviderRepresentation - } - // UpdateIdentityProviderMapper holds details about calls to the UpdateIdentityProviderMapper method. - UpdateIdentityProviderMapper []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Alias is the alias argument value. - Alias string - // Mapper is the mapper argument value. - Mapper gocloak.IdentityProviderMapper - } - // UpdatePermission holds details about calls to the UpdatePermission method. - UpdatePermission []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Permission is the permission argument value. - Permission gocloak.PermissionRepresentation - } - // UpdatePolicy holds details about calls to the UpdatePolicy method. - UpdatePolicy []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Policy is the policy argument value. - Policy gocloak.PolicyRepresentation - } - // UpdateRealm holds details about calls to the UpdateRealm method. - UpdateRealm []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm gocloak.RealmRepresentation - } - // UpdateRealmRole holds details about calls to the UpdateRealmRole method. - UpdateRealmRole []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleName is the roleName argument value. - RoleName string - // Role is the role argument value. - Role gocloak.Role - } - // UpdateRealmRoleByID holds details about calls to the UpdateRealmRoleByID method. - UpdateRealmRoleByID []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RoleID is the roleID argument value. - RoleID string - // Role is the role argument value. - Role gocloak.Role - } - // UpdateRequiredAction holds details about calls to the UpdateRequiredAction method. - UpdateRequiredAction []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // RequiredAction is the requiredAction argument value. - RequiredAction gocloak.RequiredActionProviderRepresentation - } - // UpdateResource holds details about calls to the UpdateResource method. - UpdateResource []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Resource is the resource argument value. - Resource gocloak.ResourceRepresentation - } - // UpdateResourceClient holds details about calls to the UpdateResourceClient method. - UpdateResourceClient []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Resource is the resource argument value. - Resource gocloak.ResourceRepresentation - } - // UpdateResourcePolicy holds details about calls to the UpdateResourcePolicy method. - UpdateResourcePolicy []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // PermissionID is the permissionID argument value. - PermissionID string - // Policy is the policy argument value. - Policy gocloak.ResourcePolicyRepresentation - } - // UpdateRole holds details about calls to the UpdateRole method. - UpdateRole []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Role is the role argument value. - Role gocloak.Role - } - // UpdateScope holds details about calls to the UpdateScope method. - UpdateScope []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // IdOfClient is the idOfClient argument value. - IdOfClient string - // Resource is the resource argument value. - Resource gocloak.ScopeRepresentation - } - // UpdateUser holds details about calls to the UpdateUser method. - UpdateUser []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // AccessToken is the accessToken argument value. - AccessToken string - // Realm is the realm argument value. - Realm string - // User is the user argument value. - User gocloak.User - } - // UpdateUserPermission holds details about calls to the UpdateUserPermission method. - UpdateUserPermission []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // Token is the token argument value. - Token string - // Realm is the realm argument value. - Realm string - // Permission is the permission argument value. - Permission gocloak.PermissionGrantParams - } - } - lockAddClientRoleComposite sync.RWMutex - lockAddClientRoleToGroup sync.RWMutex - lockAddClientRoleToUser sync.RWMutex - lockAddDefaultGroup sync.RWMutex - lockAddDefaultScopeToClient sync.RWMutex - lockAddOptionalScopeToClient sync.RWMutex - lockAddRealmRoleComposite sync.RWMutex - lockAddRealmRoleToGroup sync.RWMutex - lockAddRealmRoleToUser sync.RWMutex - lockAddUserToGroup sync.RWMutex - lockClearKeysCache sync.RWMutex - lockClearRealmCache sync.RWMutex - lockClearUserCache sync.RWMutex - lockCreateAuthenticationExecution sync.RWMutex - lockCreateAuthenticationExecutionFlow sync.RWMutex - lockCreateAuthenticationFlow sync.RWMutex - lockCreateChildGroup sync.RWMutex - lockCreateClient sync.RWMutex - lockCreateClientProtocolMapper sync.RWMutex - lockCreateClientRepresentation sync.RWMutex - lockCreateClientRole sync.RWMutex - lockCreateClientScope sync.RWMutex - lockCreateClientScopeMappingsClientRoles sync.RWMutex - lockCreateClientScopeMappingsRealmRoles sync.RWMutex - lockCreateClientScopeProtocolMapper sync.RWMutex - lockCreateClientScopesScopeMappingsClientRoles sync.RWMutex - lockCreateClientScopesScopeMappingsRealmRoles sync.RWMutex - lockCreateComponent sync.RWMutex - lockCreateGroup sync.RWMutex - lockCreateIdentityProvider sync.RWMutex - lockCreateIdentityProviderMapper sync.RWMutex - lockCreatePermission sync.RWMutex - lockCreatePermissionTicket sync.RWMutex - lockCreatePolicy sync.RWMutex - lockCreateRealm sync.RWMutex - lockCreateRealmRole sync.RWMutex - lockCreateResource sync.RWMutex - lockCreateResourceClient sync.RWMutex - lockCreateResourcePolicy sync.RWMutex - lockCreateScope sync.RWMutex - lockCreateUser sync.RWMutex - lockCreateUserFederatedIdentity sync.RWMutex - lockDecodeAccessToken sync.RWMutex - lockDecodeAccessTokenCustomClaims sync.RWMutex - lockDeleteAuthenticationExecution sync.RWMutex - lockDeleteAuthenticationFlow sync.RWMutex - lockDeleteClient sync.RWMutex - lockDeleteClientProtocolMapper sync.RWMutex - lockDeleteClientRepresentation sync.RWMutex - lockDeleteClientRole sync.RWMutex - lockDeleteClientRoleComposite sync.RWMutex - lockDeleteClientRoleFromGroup sync.RWMutex - lockDeleteClientRoleFromUser sync.RWMutex - lockDeleteClientScope sync.RWMutex - lockDeleteClientScopeMappingsClientRoles sync.RWMutex - lockDeleteClientScopeMappingsRealmRoles sync.RWMutex - lockDeleteClientScopeProtocolMapper sync.RWMutex - lockDeleteClientScopesScopeMappingsClientRoles sync.RWMutex - lockDeleteClientScopesScopeMappingsRealmRoles sync.RWMutex - lockDeleteComponent sync.RWMutex - lockDeleteCredentials sync.RWMutex - lockDeleteGroup sync.RWMutex - lockDeleteIdentityProvider sync.RWMutex - lockDeleteIdentityProviderMapper sync.RWMutex - lockDeletePermission sync.RWMutex - lockDeletePolicy sync.RWMutex - lockDeleteRealm sync.RWMutex - lockDeleteRealmRole sync.RWMutex - lockDeleteRealmRoleComposite sync.RWMutex - lockDeleteRealmRoleFromGroup sync.RWMutex - lockDeleteRealmRoleFromUser sync.RWMutex - lockDeleteResource sync.RWMutex - lockDeleteResourceClient sync.RWMutex - lockDeleteResourcePolicy sync.RWMutex - lockDeleteScope sync.RWMutex - lockDeleteUser sync.RWMutex - lockDeleteUserFederatedIdentity sync.RWMutex - lockDeleteUserFromGroup sync.RWMutex - lockDeleteUserPermission sync.RWMutex - lockDisableAllCredentialsByType sync.RWMutex - lockExecuteActionsEmail sync.RWMutex - lockExportIDPPublicBrokerConfig sync.RWMutex - lockGetAdapterConfiguration sync.RWMutex - lockGetAuthenticationExecutions sync.RWMutex - lockGetAuthenticationFlows sync.RWMutex - lockGetAuthorizationPolicyAssociatedPolicies sync.RWMutex - lockGetAuthorizationPolicyResources sync.RWMutex - lockGetAuthorizationPolicyScopes sync.RWMutex - lockGetAvailableClientRolesByGroupID sync.RWMutex - lockGetAvailableClientRolesByUserID sync.RWMutex - lockGetAvailableRealmRolesByGroupID sync.RWMutex - lockGetAvailableRealmRolesByUserID sync.RWMutex - lockGetCerts sync.RWMutex - lockGetClient sync.RWMutex - lockGetClientOfflineSessions sync.RWMutex - lockGetClientRepresentation sync.RWMutex - lockGetClientRole sync.RWMutex - lockGetClientRoleByID sync.RWMutex - lockGetClientRoles sync.RWMutex - lockGetClientRolesByGroupID sync.RWMutex - lockGetClientRolesByUserID sync.RWMutex - lockGetClientScope sync.RWMutex - lockGetClientScopeMappings sync.RWMutex - lockGetClientScopeMappingsClientRoles sync.RWMutex - lockGetClientScopeMappingsClientRolesAvailable sync.RWMutex - lockGetClientScopeMappingsRealmRoles sync.RWMutex - lockGetClientScopeMappingsRealmRolesAvailable sync.RWMutex - lockGetClientScopeProtocolMapper sync.RWMutex - lockGetClientScopeProtocolMappers sync.RWMutex - lockGetClientScopes sync.RWMutex - lockGetClientScopesScopeMappingsClientRoles sync.RWMutex - lockGetClientScopesScopeMappingsClientRolesAvailable sync.RWMutex - lockGetClientScopesScopeMappingsRealmRoles sync.RWMutex - lockGetClientScopesScopeMappingsRealmRolesAvailable sync.RWMutex - lockGetClientSecret sync.RWMutex - lockGetClientServiceAccount sync.RWMutex - lockGetClientUserSessions sync.RWMutex - lockGetClients sync.RWMutex - lockGetClientsDefaultScopes sync.RWMutex - lockGetClientsOptionalScopes sync.RWMutex - lockGetComponents sync.RWMutex - lockGetCompositeClientRolesByGroupID sync.RWMutex - lockGetCompositeClientRolesByRoleID sync.RWMutex - lockGetCompositeClientRolesByUserID sync.RWMutex - lockGetCompositeRealmRoles sync.RWMutex - lockGetCompositeRealmRolesByGroupID sync.RWMutex - lockGetCompositeRealmRolesByRoleID sync.RWMutex - lockGetCompositeRealmRolesByUserID sync.RWMutex - lockGetConfiguredUserStorageCredentialTypes sync.RWMutex - lockGetCredentialRegistrators sync.RWMutex - lockGetCredentials sync.RWMutex - lockGetDefaultDefaultClientScopes sync.RWMutex - lockGetDefaultGroups sync.RWMutex - lockGetDefaultOptionalClientScopes sync.RWMutex - lockGetDependentPermissions sync.RWMutex - lockGetEvents sync.RWMutex - lockGetGroup sync.RWMutex - lockGetGroupMembers sync.RWMutex - lockGetGroups sync.RWMutex - lockGetGroupsByRole sync.RWMutex - lockGetGroupsCount sync.RWMutex - lockGetIdentityProvider sync.RWMutex - lockGetIdentityProviderMapperByID sync.RWMutex - lockGetIdentityProviderMappers sync.RWMutex - lockGetIdentityProviders sync.RWMutex - lockGetIssuer sync.RWMutex - lockGetKeyStoreConfig sync.RWMutex - lockGetPermission sync.RWMutex - lockGetPermissionResources sync.RWMutex - lockGetPermissionScopes sync.RWMutex - lockGetPermissions sync.RWMutex - lockGetPolicies sync.RWMutex - lockGetPolicy sync.RWMutex - lockGetRawUserInfo sync.RWMutex - lockGetRealm sync.RWMutex - lockGetRealmRole sync.RWMutex - lockGetRealmRoleByID sync.RWMutex - lockGetRealmRoles sync.RWMutex - lockGetRealmRolesByGroupID sync.RWMutex - lockGetRealmRolesByUserID sync.RWMutex - lockGetRealms sync.RWMutex - lockGetRequestingPartyPermissionDecision sync.RWMutex - lockGetRequestingPartyPermissions sync.RWMutex - lockGetRequestingPartyToken sync.RWMutex - lockGetResource sync.RWMutex - lockGetResourceClient sync.RWMutex - lockGetResourcePolicies sync.RWMutex - lockGetResourcePolicy sync.RWMutex - lockGetResources sync.RWMutex - lockGetResourcesClient sync.RWMutex - lockGetRoleMappingByGroupID sync.RWMutex - lockGetRoleMappingByUserID sync.RWMutex - lockGetScope sync.RWMutex - lockGetScopes sync.RWMutex - lockGetServerInfo sync.RWMutex - lockGetToken sync.RWMutex - lockGetUserByID sync.RWMutex - lockGetUserCount sync.RWMutex - lockGetUserFederatedIdentities sync.RWMutex - lockGetUserGroups sync.RWMutex - lockGetUserInfo sync.RWMutex - lockGetUserOfflineSessionsForClient sync.RWMutex - lockGetUserPermissions sync.RWMutex - lockGetUserSessions sync.RWMutex - lockGetUsers sync.RWMutex - lockGetUsersByClientRoleName sync.RWMutex - lockGetUsersByRoleName sync.RWMutex - lockGrantUserPermission sync.RWMutex - lockImportIdentityProviderConfig sync.RWMutex - lockImportIdentityProviderConfigFromFile sync.RWMutex - lockLogin sync.RWMutex - lockLoginAdmin sync.RWMutex - lockLoginClient sync.RWMutex - lockLoginClientSignedJWT sync.RWMutex - lockLoginClientTokenExchange sync.RWMutex - lockLoginOtp sync.RWMutex - lockLogout sync.RWMutex - lockLogoutAllSessions sync.RWMutex - lockLogoutPublicClient sync.RWMutex - lockLogoutUserSession sync.RWMutex - lockMoveCredentialBehind sync.RWMutex - lockMoveCredentialToFirst sync.RWMutex - lockRefreshToken sync.RWMutex - lockRegenerateClientSecret sync.RWMutex - lockRemoveDefaultGroup sync.RWMutex - lockRemoveDefaultScopeFromClient sync.RWMutex - lockRemoveOptionalScopeFromClient sync.RWMutex - lockRestyClient sync.RWMutex - lockRetrospectToken sync.RWMutex - lockRevokeUserConsents sync.RWMutex - lockSetPassword sync.RWMutex - lockSetRestyClient sync.RWMutex - lockUpdateAuthenticationExecution sync.RWMutex - lockUpdateClient sync.RWMutex - lockUpdateClientProtocolMapper sync.RWMutex - lockUpdateClientRepresentation sync.RWMutex - lockUpdateClientScope sync.RWMutex - lockUpdateClientScopeProtocolMapper sync.RWMutex - lockUpdateCredentialUserLabel sync.RWMutex - lockUpdateGroup sync.RWMutex - lockUpdateIdentityProvider sync.RWMutex - lockUpdateIdentityProviderMapper sync.RWMutex - lockUpdatePermission sync.RWMutex - lockUpdatePolicy sync.RWMutex - lockUpdateRealm sync.RWMutex - lockUpdateRealmRole sync.RWMutex - lockUpdateRealmRoleByID sync.RWMutex - lockUpdateRequiredAction sync.RWMutex - lockUpdateResource sync.RWMutex - lockUpdateResourceClient sync.RWMutex - lockUpdateResourcePolicy sync.RWMutex - lockUpdateRole sync.RWMutex - lockUpdateScope sync.RWMutex - lockUpdateUser sync.RWMutex - lockUpdateUserPermission sync.RWMutex -} - -// AddClientRoleComposite calls AddClientRoleCompositeFunc. -func (mock *GoCloakMock) AddClientRoleComposite(ctx context.Context, token string, realm string, roleID string, roles []gocloak.Role) error { - if mock.AddClientRoleCompositeFunc == nil { - panic("GoCloakMock.AddClientRoleCompositeFunc: method is nil but GoCloak.AddClientRoleComposite was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleID string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleID: roleID, - Roles: roles, - } - mock.lockAddClientRoleComposite.Lock() - mock.calls.AddClientRoleComposite = append(mock.calls.AddClientRoleComposite, callInfo) - mock.lockAddClientRoleComposite.Unlock() - return mock.AddClientRoleCompositeFunc(ctx, token, realm, roleID, roles) -} - -// AddClientRoleCompositeCalls gets all the calls that were made to AddClientRoleComposite. -// Check the length with: -// -// len(mockedGoCloak.AddClientRoleCompositeCalls()) -func (mock *GoCloakMock) AddClientRoleCompositeCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleID string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleID string - Roles []gocloak.Role - } - mock.lockAddClientRoleComposite.RLock() - calls = mock.calls.AddClientRoleComposite - mock.lockAddClientRoleComposite.RUnlock() - return calls -} - -// AddClientRoleToGroup calls AddClientRoleToGroupFunc. -func (mock *GoCloakMock) AddClientRoleToGroup(ctx context.Context, token string, realm string, idOfClient string, groupID string, roles []gocloak.Role) error { - if mock.AddClientRoleToGroupFunc == nil { - panic("GoCloakMock.AddClientRoleToGroupFunc: method is nil but GoCloak.AddClientRoleToGroup was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - GroupID: groupID, - Roles: roles, - } - mock.lockAddClientRoleToGroup.Lock() - mock.calls.AddClientRoleToGroup = append(mock.calls.AddClientRoleToGroup, callInfo) - mock.lockAddClientRoleToGroup.Unlock() - return mock.AddClientRoleToGroupFunc(ctx, token, realm, idOfClient, groupID, roles) -} - -// AddClientRoleToGroupCalls gets all the calls that were made to AddClientRoleToGroup. -// Check the length with: -// -// len(mockedGoCloak.AddClientRoleToGroupCalls()) -func (mock *GoCloakMock) AddClientRoleToGroupCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - Roles []gocloak.Role - } - mock.lockAddClientRoleToGroup.RLock() - calls = mock.calls.AddClientRoleToGroup - mock.lockAddClientRoleToGroup.RUnlock() - return calls -} - -// AddClientRoleToUser calls AddClientRoleToUserFunc. -func (mock *GoCloakMock) AddClientRoleToUser(ctx context.Context, token string, realm string, idOfClient string, userID string, roles []gocloak.Role) error { - if mock.AddClientRoleToUserFunc == nil { - panic("GoCloakMock.AddClientRoleToUserFunc: method is nil but GoCloak.AddClientRoleToUser was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - UserID: userID, - Roles: roles, - } - mock.lockAddClientRoleToUser.Lock() - mock.calls.AddClientRoleToUser = append(mock.calls.AddClientRoleToUser, callInfo) - mock.lockAddClientRoleToUser.Unlock() - return mock.AddClientRoleToUserFunc(ctx, token, realm, idOfClient, userID, roles) -} - -// AddClientRoleToUserCalls gets all the calls that were made to AddClientRoleToUser. -// Check the length with: -// -// len(mockedGoCloak.AddClientRoleToUserCalls()) -func (mock *GoCloakMock) AddClientRoleToUserCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - Roles []gocloak.Role - } - mock.lockAddClientRoleToUser.RLock() - calls = mock.calls.AddClientRoleToUser - mock.lockAddClientRoleToUser.RUnlock() - return calls -} - -// AddDefaultGroup calls AddDefaultGroupFunc. -func (mock *GoCloakMock) AddDefaultGroup(ctx context.Context, accessToken string, realm string, groupID string) error { - if mock.AddDefaultGroupFunc == nil { - panic("GoCloakMock.AddDefaultGroupFunc: method is nil but GoCloak.AddDefaultGroup was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - GroupID: groupID, - } - mock.lockAddDefaultGroup.Lock() - mock.calls.AddDefaultGroup = append(mock.calls.AddDefaultGroup, callInfo) - mock.lockAddDefaultGroup.Unlock() - return mock.AddDefaultGroupFunc(ctx, accessToken, realm, groupID) -} - -// AddDefaultGroupCalls gets all the calls that were made to AddDefaultGroup. -// Check the length with: -// -// len(mockedGoCloak.AddDefaultGroupCalls()) -func (mock *GoCloakMock) AddDefaultGroupCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - } - mock.lockAddDefaultGroup.RLock() - calls = mock.calls.AddDefaultGroup - mock.lockAddDefaultGroup.RUnlock() - return calls -} - -// AddDefaultScopeToClient calls AddDefaultScopeToClientFunc. -func (mock *GoCloakMock) AddDefaultScopeToClient(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error { - if mock.AddDefaultScopeToClientFunc == nil { - panic("GoCloakMock.AddDefaultScopeToClientFunc: method is nil but GoCloak.AddDefaultScopeToClient was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - ScopeID: scopeID, - } - mock.lockAddDefaultScopeToClient.Lock() - mock.calls.AddDefaultScopeToClient = append(mock.calls.AddDefaultScopeToClient, callInfo) - mock.lockAddDefaultScopeToClient.Unlock() - return mock.AddDefaultScopeToClientFunc(ctx, token, realm, idOfClient, scopeID) -} - -// AddDefaultScopeToClientCalls gets all the calls that were made to AddDefaultScopeToClient. -// Check the length with: -// -// len(mockedGoCloak.AddDefaultScopeToClientCalls()) -func (mock *GoCloakMock) AddDefaultScopeToClientCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - } - mock.lockAddDefaultScopeToClient.RLock() - calls = mock.calls.AddDefaultScopeToClient - mock.lockAddDefaultScopeToClient.RUnlock() - return calls -} - -// AddOptionalScopeToClient calls AddOptionalScopeToClientFunc. -func (mock *GoCloakMock) AddOptionalScopeToClient(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error { - if mock.AddOptionalScopeToClientFunc == nil { - panic("GoCloakMock.AddOptionalScopeToClientFunc: method is nil but GoCloak.AddOptionalScopeToClient was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - ScopeID: scopeID, - } - mock.lockAddOptionalScopeToClient.Lock() - mock.calls.AddOptionalScopeToClient = append(mock.calls.AddOptionalScopeToClient, callInfo) - mock.lockAddOptionalScopeToClient.Unlock() - return mock.AddOptionalScopeToClientFunc(ctx, token, realm, idOfClient, scopeID) -} - -// AddOptionalScopeToClientCalls gets all the calls that were made to AddOptionalScopeToClient. -// Check the length with: -// -// len(mockedGoCloak.AddOptionalScopeToClientCalls()) -func (mock *GoCloakMock) AddOptionalScopeToClientCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - } - mock.lockAddOptionalScopeToClient.RLock() - calls = mock.calls.AddOptionalScopeToClient - mock.lockAddOptionalScopeToClient.RUnlock() - return calls -} - -// AddRealmRoleComposite calls AddRealmRoleCompositeFunc. -func (mock *GoCloakMock) AddRealmRoleComposite(ctx context.Context, token string, realm string, roleName string, roles []gocloak.Role) error { - if mock.AddRealmRoleCompositeFunc == nil { - panic("GoCloakMock.AddRealmRoleCompositeFunc: method is nil but GoCloak.AddRealmRoleComposite was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleName string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleName: roleName, - Roles: roles, - } - mock.lockAddRealmRoleComposite.Lock() - mock.calls.AddRealmRoleComposite = append(mock.calls.AddRealmRoleComposite, callInfo) - mock.lockAddRealmRoleComposite.Unlock() - return mock.AddRealmRoleCompositeFunc(ctx, token, realm, roleName, roles) -} - -// AddRealmRoleCompositeCalls gets all the calls that were made to AddRealmRoleComposite. -// Check the length with: -// -// len(mockedGoCloak.AddRealmRoleCompositeCalls()) -func (mock *GoCloakMock) AddRealmRoleCompositeCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleName string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleName string - Roles []gocloak.Role - } - mock.lockAddRealmRoleComposite.RLock() - calls = mock.calls.AddRealmRoleComposite - mock.lockAddRealmRoleComposite.RUnlock() - return calls -} - -// AddRealmRoleToGroup calls AddRealmRoleToGroupFunc. -func (mock *GoCloakMock) AddRealmRoleToGroup(ctx context.Context, token string, realm string, groupID string, roles []gocloak.Role) error { - if mock.AddRealmRoleToGroupFunc == nil { - panic("GoCloakMock.AddRealmRoleToGroupFunc: method is nil but GoCloak.AddRealmRoleToGroup was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - GroupID string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - GroupID: groupID, - Roles: roles, - } - mock.lockAddRealmRoleToGroup.Lock() - mock.calls.AddRealmRoleToGroup = append(mock.calls.AddRealmRoleToGroup, callInfo) - mock.lockAddRealmRoleToGroup.Unlock() - return mock.AddRealmRoleToGroupFunc(ctx, token, realm, groupID, roles) -} - -// AddRealmRoleToGroupCalls gets all the calls that were made to AddRealmRoleToGroup. -// Check the length with: -// -// len(mockedGoCloak.AddRealmRoleToGroupCalls()) -func (mock *GoCloakMock) AddRealmRoleToGroupCalls() []struct { - Ctx context.Context - Token string - Realm string - GroupID string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - GroupID string - Roles []gocloak.Role - } - mock.lockAddRealmRoleToGroup.RLock() - calls = mock.calls.AddRealmRoleToGroup - mock.lockAddRealmRoleToGroup.RUnlock() - return calls -} - -// AddRealmRoleToUser calls AddRealmRoleToUserFunc. -func (mock *GoCloakMock) AddRealmRoleToUser(ctx context.Context, token string, realm string, userID string, roles []gocloak.Role) error { - if mock.AddRealmRoleToUserFunc == nil { - panic("GoCloakMock.AddRealmRoleToUserFunc: method is nil but GoCloak.AddRealmRoleToUser was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - Roles: roles, - } - mock.lockAddRealmRoleToUser.Lock() - mock.calls.AddRealmRoleToUser = append(mock.calls.AddRealmRoleToUser, callInfo) - mock.lockAddRealmRoleToUser.Unlock() - return mock.AddRealmRoleToUserFunc(ctx, token, realm, userID, roles) -} - -// AddRealmRoleToUserCalls gets all the calls that were made to AddRealmRoleToUser. -// Check the length with: -// -// len(mockedGoCloak.AddRealmRoleToUserCalls()) -func (mock *GoCloakMock) AddRealmRoleToUserCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - Roles []gocloak.Role - } - mock.lockAddRealmRoleToUser.RLock() - calls = mock.calls.AddRealmRoleToUser - mock.lockAddRealmRoleToUser.RUnlock() - return calls -} - -// AddUserToGroup calls AddUserToGroupFunc. -func (mock *GoCloakMock) AddUserToGroup(ctx context.Context, token string, realm string, userID string, groupID string) error { - if mock.AddUserToGroupFunc == nil { - panic("GoCloakMock.AddUserToGroupFunc: method is nil but GoCloak.AddUserToGroup was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - GroupID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - GroupID: groupID, - } - mock.lockAddUserToGroup.Lock() - mock.calls.AddUserToGroup = append(mock.calls.AddUserToGroup, callInfo) - mock.lockAddUserToGroup.Unlock() - return mock.AddUserToGroupFunc(ctx, token, realm, userID, groupID) -} - -// AddUserToGroupCalls gets all the calls that were made to AddUserToGroup. -// Check the length with: -// -// len(mockedGoCloak.AddUserToGroupCalls()) -func (mock *GoCloakMock) AddUserToGroupCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - GroupID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - GroupID string - } - mock.lockAddUserToGroup.RLock() - calls = mock.calls.AddUserToGroup - mock.lockAddUserToGroup.RUnlock() - return calls -} - -// ClearKeysCache calls ClearKeysCacheFunc. -func (mock *GoCloakMock) ClearKeysCache(ctx context.Context, token string, realm string) error { - if mock.ClearKeysCacheFunc == nil { - panic("GoCloakMock.ClearKeysCacheFunc: method is nil but GoCloak.ClearKeysCache was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockClearKeysCache.Lock() - mock.calls.ClearKeysCache = append(mock.calls.ClearKeysCache, callInfo) - mock.lockClearKeysCache.Unlock() - return mock.ClearKeysCacheFunc(ctx, token, realm) -} - -// ClearKeysCacheCalls gets all the calls that were made to ClearKeysCache. -// Check the length with: -// -// len(mockedGoCloak.ClearKeysCacheCalls()) -func (mock *GoCloakMock) ClearKeysCacheCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockClearKeysCache.RLock() - calls = mock.calls.ClearKeysCache - mock.lockClearKeysCache.RUnlock() - return calls -} - -// ClearRealmCache calls ClearRealmCacheFunc. -func (mock *GoCloakMock) ClearRealmCache(ctx context.Context, token string, realm string) error { - if mock.ClearRealmCacheFunc == nil { - panic("GoCloakMock.ClearRealmCacheFunc: method is nil but GoCloak.ClearRealmCache was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockClearRealmCache.Lock() - mock.calls.ClearRealmCache = append(mock.calls.ClearRealmCache, callInfo) - mock.lockClearRealmCache.Unlock() - return mock.ClearRealmCacheFunc(ctx, token, realm) -} - -// ClearRealmCacheCalls gets all the calls that were made to ClearRealmCache. -// Check the length with: -// -// len(mockedGoCloak.ClearRealmCacheCalls()) -func (mock *GoCloakMock) ClearRealmCacheCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockClearRealmCache.RLock() - calls = mock.calls.ClearRealmCache - mock.lockClearRealmCache.RUnlock() - return calls -} - -// ClearUserCache calls ClearUserCacheFunc. -func (mock *GoCloakMock) ClearUserCache(ctx context.Context, token string, realm string) error { - if mock.ClearUserCacheFunc == nil { - panic("GoCloakMock.ClearUserCacheFunc: method is nil but GoCloak.ClearUserCache was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockClearUserCache.Lock() - mock.calls.ClearUserCache = append(mock.calls.ClearUserCache, callInfo) - mock.lockClearUserCache.Unlock() - return mock.ClearUserCacheFunc(ctx, token, realm) -} - -// ClearUserCacheCalls gets all the calls that were made to ClearUserCache. -// Check the length with: -// -// len(mockedGoCloak.ClearUserCacheCalls()) -func (mock *GoCloakMock) ClearUserCacheCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockClearUserCache.RLock() - calls = mock.calls.ClearUserCache - mock.lockClearUserCache.RUnlock() - return calls -} - -// CreateAuthenticationExecution calls CreateAuthenticationExecutionFunc. -func (mock *GoCloakMock) CreateAuthenticationExecution(ctx context.Context, token string, realm string, flow string, execution gocloak.CreateAuthenticationExecutionRepresentation) error { - if mock.CreateAuthenticationExecutionFunc == nil { - panic("GoCloakMock.CreateAuthenticationExecutionFunc: method is nil but GoCloak.CreateAuthenticationExecution was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Flow string - Execution gocloak.CreateAuthenticationExecutionRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Flow: flow, - Execution: execution, - } - mock.lockCreateAuthenticationExecution.Lock() - mock.calls.CreateAuthenticationExecution = append(mock.calls.CreateAuthenticationExecution, callInfo) - mock.lockCreateAuthenticationExecution.Unlock() - return mock.CreateAuthenticationExecutionFunc(ctx, token, realm, flow, execution) -} - -// CreateAuthenticationExecutionCalls gets all the calls that were made to CreateAuthenticationExecution. -// Check the length with: -// -// len(mockedGoCloak.CreateAuthenticationExecutionCalls()) -func (mock *GoCloakMock) CreateAuthenticationExecutionCalls() []struct { - Ctx context.Context - Token string - Realm string - Flow string - Execution gocloak.CreateAuthenticationExecutionRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Flow string - Execution gocloak.CreateAuthenticationExecutionRepresentation - } - mock.lockCreateAuthenticationExecution.RLock() - calls = mock.calls.CreateAuthenticationExecution - mock.lockCreateAuthenticationExecution.RUnlock() - return calls -} - -// CreateAuthenticationExecutionFlow calls CreateAuthenticationExecutionFlowFunc. -func (mock *GoCloakMock) CreateAuthenticationExecutionFlow(ctx context.Context, token string, realm string, flow string, execution gocloak.CreateAuthenticationExecutionFlowRepresentation) error { - if mock.CreateAuthenticationExecutionFlowFunc == nil { - panic("GoCloakMock.CreateAuthenticationExecutionFlowFunc: method is nil but GoCloak.CreateAuthenticationExecutionFlow was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Flow string - Execution gocloak.CreateAuthenticationExecutionFlowRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Flow: flow, - Execution: execution, - } - mock.lockCreateAuthenticationExecutionFlow.Lock() - mock.calls.CreateAuthenticationExecutionFlow = append(mock.calls.CreateAuthenticationExecutionFlow, callInfo) - mock.lockCreateAuthenticationExecutionFlow.Unlock() - return mock.CreateAuthenticationExecutionFlowFunc(ctx, token, realm, flow, execution) -} - -// CreateAuthenticationExecutionFlowCalls gets all the calls that were made to CreateAuthenticationExecutionFlow. -// Check the length with: -// -// len(mockedGoCloak.CreateAuthenticationExecutionFlowCalls()) -func (mock *GoCloakMock) CreateAuthenticationExecutionFlowCalls() []struct { - Ctx context.Context - Token string - Realm string - Flow string - Execution gocloak.CreateAuthenticationExecutionFlowRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Flow string - Execution gocloak.CreateAuthenticationExecutionFlowRepresentation - } - mock.lockCreateAuthenticationExecutionFlow.RLock() - calls = mock.calls.CreateAuthenticationExecutionFlow - mock.lockCreateAuthenticationExecutionFlow.RUnlock() - return calls -} - -// CreateAuthenticationFlow calls CreateAuthenticationFlowFunc. -func (mock *GoCloakMock) CreateAuthenticationFlow(ctx context.Context, token string, realm string, flow gocloak.AuthenticationFlowRepresentation) error { - if mock.CreateAuthenticationFlowFunc == nil { - panic("GoCloakMock.CreateAuthenticationFlowFunc: method is nil but GoCloak.CreateAuthenticationFlow was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Flow gocloak.AuthenticationFlowRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Flow: flow, - } - mock.lockCreateAuthenticationFlow.Lock() - mock.calls.CreateAuthenticationFlow = append(mock.calls.CreateAuthenticationFlow, callInfo) - mock.lockCreateAuthenticationFlow.Unlock() - return mock.CreateAuthenticationFlowFunc(ctx, token, realm, flow) -} - -// CreateAuthenticationFlowCalls gets all the calls that were made to CreateAuthenticationFlow. -// Check the length with: -// -// len(mockedGoCloak.CreateAuthenticationFlowCalls()) -func (mock *GoCloakMock) CreateAuthenticationFlowCalls() []struct { - Ctx context.Context - Token string - Realm string - Flow gocloak.AuthenticationFlowRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Flow gocloak.AuthenticationFlowRepresentation - } - mock.lockCreateAuthenticationFlow.RLock() - calls = mock.calls.CreateAuthenticationFlow - mock.lockCreateAuthenticationFlow.RUnlock() - return calls -} - -// CreateChildGroup calls CreateChildGroupFunc. -func (mock *GoCloakMock) CreateChildGroup(ctx context.Context, token string, realm string, groupID string, group gocloak.Group) (string, error) { - if mock.CreateChildGroupFunc == nil { - panic("GoCloakMock.CreateChildGroupFunc: method is nil but GoCloak.CreateChildGroup was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - GroupID string - Group gocloak.Group - }{ - Ctx: ctx, - Token: token, - Realm: realm, - GroupID: groupID, - Group: group, - } - mock.lockCreateChildGroup.Lock() - mock.calls.CreateChildGroup = append(mock.calls.CreateChildGroup, callInfo) - mock.lockCreateChildGroup.Unlock() - return mock.CreateChildGroupFunc(ctx, token, realm, groupID, group) -} - -// CreateChildGroupCalls gets all the calls that were made to CreateChildGroup. -// Check the length with: -// -// len(mockedGoCloak.CreateChildGroupCalls()) -func (mock *GoCloakMock) CreateChildGroupCalls() []struct { - Ctx context.Context - Token string - Realm string - GroupID string - Group gocloak.Group -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - GroupID string - Group gocloak.Group - } - mock.lockCreateChildGroup.RLock() - calls = mock.calls.CreateChildGroup - mock.lockCreateChildGroup.RUnlock() - return calls -} - -// CreateClient calls CreateClientFunc. -func (mock *GoCloakMock) CreateClient(ctx context.Context, accessToken string, realm string, newClient gocloak.Client) (string, error) { - if mock.CreateClientFunc == nil { - panic("GoCloakMock.CreateClientFunc: method is nil but GoCloak.CreateClient was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - NewClient gocloak.Client - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - NewClient: newClient, - } - mock.lockCreateClient.Lock() - mock.calls.CreateClient = append(mock.calls.CreateClient, callInfo) - mock.lockCreateClient.Unlock() - return mock.CreateClientFunc(ctx, accessToken, realm, newClient) -} - -// CreateClientCalls gets all the calls that were made to CreateClient. -// Check the length with: -// -// len(mockedGoCloak.CreateClientCalls()) -func (mock *GoCloakMock) CreateClientCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - NewClient gocloak.Client -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - NewClient gocloak.Client - } - mock.lockCreateClient.RLock() - calls = mock.calls.CreateClient - mock.lockCreateClient.RUnlock() - return calls -} - -// CreateClientProtocolMapper calls CreateClientProtocolMapperFunc. -func (mock *GoCloakMock) CreateClientProtocolMapper(ctx context.Context, token string, realm string, idOfClient string, mapper gocloak.ProtocolMapperRepresentation) (string, error) { - if mock.CreateClientProtocolMapperFunc == nil { - panic("GoCloakMock.CreateClientProtocolMapperFunc: method is nil but GoCloak.CreateClientProtocolMapper was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Mapper gocloak.ProtocolMapperRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Mapper: mapper, - } - mock.lockCreateClientProtocolMapper.Lock() - mock.calls.CreateClientProtocolMapper = append(mock.calls.CreateClientProtocolMapper, callInfo) - mock.lockCreateClientProtocolMapper.Unlock() - return mock.CreateClientProtocolMapperFunc(ctx, token, realm, idOfClient, mapper) -} - -// CreateClientProtocolMapperCalls gets all the calls that were made to CreateClientProtocolMapper. -// Check the length with: -// -// len(mockedGoCloak.CreateClientProtocolMapperCalls()) -func (mock *GoCloakMock) CreateClientProtocolMapperCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Mapper gocloak.ProtocolMapperRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Mapper gocloak.ProtocolMapperRepresentation - } - mock.lockCreateClientProtocolMapper.RLock() - calls = mock.calls.CreateClientProtocolMapper - mock.lockCreateClientProtocolMapper.RUnlock() - return calls -} - -// CreateClientRepresentation calls CreateClientRepresentationFunc. -func (mock *GoCloakMock) CreateClientRepresentation(ctx context.Context, realm string) (*gocloak.Client, error) { - if mock.CreateClientRepresentationFunc == nil { - panic("GoCloakMock.CreateClientRepresentationFunc: method is nil but GoCloak.CreateClientRepresentation was just called") - } - callInfo := struct { - Ctx context.Context - Realm string - }{ - Ctx: ctx, - Realm: realm, - } - mock.lockCreateClientRepresentation.Lock() - mock.calls.CreateClientRepresentation = append(mock.calls.CreateClientRepresentation, callInfo) - mock.lockCreateClientRepresentation.Unlock() - return mock.CreateClientRepresentationFunc(ctx, realm) -} - -// CreateClientRepresentationCalls gets all the calls that were made to CreateClientRepresentation. -// Check the length with: -// -// len(mockedGoCloak.CreateClientRepresentationCalls()) -func (mock *GoCloakMock) CreateClientRepresentationCalls() []struct { - Ctx context.Context - Realm string -} { - var calls []struct { - Ctx context.Context - Realm string - } - mock.lockCreateClientRepresentation.RLock() - calls = mock.calls.CreateClientRepresentation - mock.lockCreateClientRepresentation.RUnlock() - return calls -} - -// CreateClientRole calls CreateClientRoleFunc. -func (mock *GoCloakMock) CreateClientRole(ctx context.Context, accessToken string, realm string, idOfClient string, role gocloak.Role) (string, error) { - if mock.CreateClientRoleFunc == nil { - panic("GoCloakMock.CreateClientRoleFunc: method is nil but GoCloak.CreateClientRole was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - Role gocloak.Role - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - IdOfClient: idOfClient, - Role: role, - } - mock.lockCreateClientRole.Lock() - mock.calls.CreateClientRole = append(mock.calls.CreateClientRole, callInfo) - mock.lockCreateClientRole.Unlock() - return mock.CreateClientRoleFunc(ctx, accessToken, realm, idOfClient, role) -} - -// CreateClientRoleCalls gets all the calls that were made to CreateClientRole. -// Check the length with: -// -// len(mockedGoCloak.CreateClientRoleCalls()) -func (mock *GoCloakMock) CreateClientRoleCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - Role gocloak.Role -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - Role gocloak.Role - } - mock.lockCreateClientRole.RLock() - calls = mock.calls.CreateClientRole - mock.lockCreateClientRole.RUnlock() - return calls -} - -// CreateClientScope calls CreateClientScopeFunc. -func (mock *GoCloakMock) CreateClientScope(ctx context.Context, accessToken string, realm string, scope gocloak.ClientScope) (string, error) { - if mock.CreateClientScopeFunc == nil { - panic("GoCloakMock.CreateClientScopeFunc: method is nil but GoCloak.CreateClientScope was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Scope gocloak.ClientScope - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Scope: scope, - } - mock.lockCreateClientScope.Lock() - mock.calls.CreateClientScope = append(mock.calls.CreateClientScope, callInfo) - mock.lockCreateClientScope.Unlock() - return mock.CreateClientScopeFunc(ctx, accessToken, realm, scope) -} - -// CreateClientScopeCalls gets all the calls that were made to CreateClientScope. -// Check the length with: -// -// len(mockedGoCloak.CreateClientScopeCalls()) -func (mock *GoCloakMock) CreateClientScopeCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Scope gocloak.ClientScope -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Scope gocloak.ClientScope - } - mock.lockCreateClientScope.RLock() - calls = mock.calls.CreateClientScope - mock.lockCreateClientScope.RUnlock() - return calls -} - -// CreateClientScopeMappingsClientRoles calls CreateClientScopeMappingsClientRolesFunc. -func (mock *GoCloakMock) CreateClientScopeMappingsClientRoles(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string, roles []gocloak.Role) error { - if mock.CreateClientScopeMappingsClientRolesFunc == nil { - panic("GoCloakMock.CreateClientScopeMappingsClientRolesFunc: method is nil but GoCloak.CreateClientScopeMappingsClientRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - IdOfSelectedClient: idOfSelectedClient, - Roles: roles, - } - mock.lockCreateClientScopeMappingsClientRoles.Lock() - mock.calls.CreateClientScopeMappingsClientRoles = append(mock.calls.CreateClientScopeMappingsClientRoles, callInfo) - mock.lockCreateClientScopeMappingsClientRoles.Unlock() - return mock.CreateClientScopeMappingsClientRolesFunc(ctx, token, realm, idOfClient, idOfSelectedClient, roles) -} - -// CreateClientScopeMappingsClientRolesCalls gets all the calls that were made to CreateClientScopeMappingsClientRoles. -// Check the length with: -// -// len(mockedGoCloak.CreateClientScopeMappingsClientRolesCalls()) -func (mock *GoCloakMock) CreateClientScopeMappingsClientRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string - Roles []gocloak.Role - } - mock.lockCreateClientScopeMappingsClientRoles.RLock() - calls = mock.calls.CreateClientScopeMappingsClientRoles - mock.lockCreateClientScopeMappingsClientRoles.RUnlock() - return calls -} - -// CreateClientScopeMappingsRealmRoles calls CreateClientScopeMappingsRealmRolesFunc. -func (mock *GoCloakMock) CreateClientScopeMappingsRealmRoles(ctx context.Context, token string, realm string, idOfClient string, roles []gocloak.Role) error { - if mock.CreateClientScopeMappingsRealmRolesFunc == nil { - panic("GoCloakMock.CreateClientScopeMappingsRealmRolesFunc: method is nil but GoCloak.CreateClientScopeMappingsRealmRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Roles: roles, - } - mock.lockCreateClientScopeMappingsRealmRoles.Lock() - mock.calls.CreateClientScopeMappingsRealmRoles = append(mock.calls.CreateClientScopeMappingsRealmRoles, callInfo) - mock.lockCreateClientScopeMappingsRealmRoles.Unlock() - return mock.CreateClientScopeMappingsRealmRolesFunc(ctx, token, realm, idOfClient, roles) -} - -// CreateClientScopeMappingsRealmRolesCalls gets all the calls that were made to CreateClientScopeMappingsRealmRoles. -// Check the length with: -// -// len(mockedGoCloak.CreateClientScopeMappingsRealmRolesCalls()) -func (mock *GoCloakMock) CreateClientScopeMappingsRealmRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Roles []gocloak.Role - } - mock.lockCreateClientScopeMappingsRealmRoles.RLock() - calls = mock.calls.CreateClientScopeMappingsRealmRoles - mock.lockCreateClientScopeMappingsRealmRoles.RUnlock() - return calls -} - -// CreateClientScopeProtocolMapper calls CreateClientScopeProtocolMapperFunc. -func (mock *GoCloakMock) CreateClientScopeProtocolMapper(ctx context.Context, accessToken string, realm string, scopeID string, protocolMapper gocloak.ProtocolMappers) (string, error) { - if mock.CreateClientScopeProtocolMapperFunc == nil { - panic("GoCloakMock.CreateClientScopeProtocolMapperFunc: method is nil but GoCloak.CreateClientScopeProtocolMapper was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - ProtocolMapper gocloak.ProtocolMappers - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - ScopeID: scopeID, - ProtocolMapper: protocolMapper, - } - mock.lockCreateClientScopeProtocolMapper.Lock() - mock.calls.CreateClientScopeProtocolMapper = append(mock.calls.CreateClientScopeProtocolMapper, callInfo) - mock.lockCreateClientScopeProtocolMapper.Unlock() - return mock.CreateClientScopeProtocolMapperFunc(ctx, accessToken, realm, scopeID, protocolMapper) -} - -// CreateClientScopeProtocolMapperCalls gets all the calls that were made to CreateClientScopeProtocolMapper. -// Check the length with: -// -// len(mockedGoCloak.CreateClientScopeProtocolMapperCalls()) -func (mock *GoCloakMock) CreateClientScopeProtocolMapperCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - ProtocolMapper gocloak.ProtocolMappers -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - ProtocolMapper gocloak.ProtocolMappers - } - mock.lockCreateClientScopeProtocolMapper.RLock() - calls = mock.calls.CreateClientScopeProtocolMapper - mock.lockCreateClientScopeProtocolMapper.RUnlock() - return calls -} - -// CreateClientScopesScopeMappingsClientRoles calls CreateClientScopesScopeMappingsClientRolesFunc. -func (mock *GoCloakMock) CreateClientScopesScopeMappingsClientRoles(ctx context.Context, token string, realm string, idOfClientScope string, idOfClient string, roles []gocloak.Role) error { - if mock.CreateClientScopesScopeMappingsClientRolesFunc == nil { - panic("GoCloakMock.CreateClientScopesScopeMappingsClientRolesFunc: method is nil but GoCloak.CreateClientScopesScopeMappingsClientRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IdOfClient string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClientScope: idOfClientScope, - IdOfClient: idOfClient, - Roles: roles, - } - mock.lockCreateClientScopesScopeMappingsClientRoles.Lock() - mock.calls.CreateClientScopesScopeMappingsClientRoles = append(mock.calls.CreateClientScopesScopeMappingsClientRoles, callInfo) - mock.lockCreateClientScopesScopeMappingsClientRoles.Unlock() - return mock.CreateClientScopesScopeMappingsClientRolesFunc(ctx, token, realm, idOfClientScope, idOfClient, roles) -} - -// CreateClientScopesScopeMappingsClientRolesCalls gets all the calls that were made to CreateClientScopesScopeMappingsClientRoles. -// Check the length with: -// -// len(mockedGoCloak.CreateClientScopesScopeMappingsClientRolesCalls()) -func (mock *GoCloakMock) CreateClientScopesScopeMappingsClientRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IdOfClient string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IdOfClient string - Roles []gocloak.Role - } - mock.lockCreateClientScopesScopeMappingsClientRoles.RLock() - calls = mock.calls.CreateClientScopesScopeMappingsClientRoles - mock.lockCreateClientScopesScopeMappingsClientRoles.RUnlock() - return calls -} - -// CreateClientScopesScopeMappingsRealmRoles calls CreateClientScopesScopeMappingsRealmRolesFunc. -func (mock *GoCloakMock) CreateClientScopesScopeMappingsRealmRoles(ctx context.Context, token string, realm string, idOfClientScope string, roles []gocloak.Role) error { - if mock.CreateClientScopesScopeMappingsRealmRolesFunc == nil { - panic("GoCloakMock.CreateClientScopesScopeMappingsRealmRolesFunc: method is nil but GoCloak.CreateClientScopesScopeMappingsRealmRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClientScope: idOfClientScope, - Roles: roles, - } - mock.lockCreateClientScopesScopeMappingsRealmRoles.Lock() - mock.calls.CreateClientScopesScopeMappingsRealmRoles = append(mock.calls.CreateClientScopesScopeMappingsRealmRoles, callInfo) - mock.lockCreateClientScopesScopeMappingsRealmRoles.Unlock() - return mock.CreateClientScopesScopeMappingsRealmRolesFunc(ctx, token, realm, idOfClientScope, roles) -} - -// CreateClientScopesScopeMappingsRealmRolesCalls gets all the calls that were made to CreateClientScopesScopeMappingsRealmRoles. -// Check the length with: -// -// len(mockedGoCloak.CreateClientScopesScopeMappingsRealmRolesCalls()) -func (mock *GoCloakMock) CreateClientScopesScopeMappingsRealmRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - Roles []gocloak.Role - } - mock.lockCreateClientScopesScopeMappingsRealmRoles.RLock() - calls = mock.calls.CreateClientScopesScopeMappingsRealmRoles - mock.lockCreateClientScopesScopeMappingsRealmRoles.RUnlock() - return calls -} - -// CreateComponent calls CreateComponentFunc. -func (mock *GoCloakMock) CreateComponent(ctx context.Context, accessToken string, realm string, component gocloak.Component) (string, error) { - if mock.CreateComponentFunc == nil { - panic("GoCloakMock.CreateComponentFunc: method is nil but GoCloak.CreateComponent was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Component gocloak.Component - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Component: component, - } - mock.lockCreateComponent.Lock() - mock.calls.CreateComponent = append(mock.calls.CreateComponent, callInfo) - mock.lockCreateComponent.Unlock() - return mock.CreateComponentFunc(ctx, accessToken, realm, component) -} - -// CreateComponentCalls gets all the calls that were made to CreateComponent. -// Check the length with: -// -// len(mockedGoCloak.CreateComponentCalls()) -func (mock *GoCloakMock) CreateComponentCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Component gocloak.Component -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Component gocloak.Component - } - mock.lockCreateComponent.RLock() - calls = mock.calls.CreateComponent - mock.lockCreateComponent.RUnlock() - return calls -} - -// CreateGroup calls CreateGroupFunc. -func (mock *GoCloakMock) CreateGroup(ctx context.Context, accessToken string, realm string, group gocloak.Group) (string, error) { - if mock.CreateGroupFunc == nil { - panic("GoCloakMock.CreateGroupFunc: method is nil but GoCloak.CreateGroup was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Group gocloak.Group - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Group: group, - } - mock.lockCreateGroup.Lock() - mock.calls.CreateGroup = append(mock.calls.CreateGroup, callInfo) - mock.lockCreateGroup.Unlock() - return mock.CreateGroupFunc(ctx, accessToken, realm, group) -} - -// CreateGroupCalls gets all the calls that were made to CreateGroup. -// Check the length with: -// -// len(mockedGoCloak.CreateGroupCalls()) -func (mock *GoCloakMock) CreateGroupCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Group gocloak.Group -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Group gocloak.Group - } - mock.lockCreateGroup.RLock() - calls = mock.calls.CreateGroup - mock.lockCreateGroup.RUnlock() - return calls -} - -// CreateIdentityProvider calls CreateIdentityProviderFunc. -func (mock *GoCloakMock) CreateIdentityProvider(ctx context.Context, token string, realm string, providerRep gocloak.IdentityProviderRepresentation) (string, error) { - if mock.CreateIdentityProviderFunc == nil { - panic("GoCloakMock.CreateIdentityProviderFunc: method is nil but GoCloak.CreateIdentityProvider was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - ProviderRep gocloak.IdentityProviderRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - ProviderRep: providerRep, - } - mock.lockCreateIdentityProvider.Lock() - mock.calls.CreateIdentityProvider = append(mock.calls.CreateIdentityProvider, callInfo) - mock.lockCreateIdentityProvider.Unlock() - return mock.CreateIdentityProviderFunc(ctx, token, realm, providerRep) -} - -// CreateIdentityProviderCalls gets all the calls that were made to CreateIdentityProvider. -// Check the length with: -// -// len(mockedGoCloak.CreateIdentityProviderCalls()) -func (mock *GoCloakMock) CreateIdentityProviderCalls() []struct { - Ctx context.Context - Token string - Realm string - ProviderRep gocloak.IdentityProviderRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - ProviderRep gocloak.IdentityProviderRepresentation - } - mock.lockCreateIdentityProvider.RLock() - calls = mock.calls.CreateIdentityProvider - mock.lockCreateIdentityProvider.RUnlock() - return calls -} - -// CreateIdentityProviderMapper calls CreateIdentityProviderMapperFunc. -func (mock *GoCloakMock) CreateIdentityProviderMapper(ctx context.Context, token string, realm string, alias string, mapper gocloak.IdentityProviderMapper) (string, error) { - if mock.CreateIdentityProviderMapperFunc == nil { - panic("GoCloakMock.CreateIdentityProviderMapperFunc: method is nil but GoCloak.CreateIdentityProviderMapper was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Alias string - Mapper gocloak.IdentityProviderMapper - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Alias: alias, - Mapper: mapper, - } - mock.lockCreateIdentityProviderMapper.Lock() - mock.calls.CreateIdentityProviderMapper = append(mock.calls.CreateIdentityProviderMapper, callInfo) - mock.lockCreateIdentityProviderMapper.Unlock() - return mock.CreateIdentityProviderMapperFunc(ctx, token, realm, alias, mapper) -} - -// CreateIdentityProviderMapperCalls gets all the calls that were made to CreateIdentityProviderMapper. -// Check the length with: -// -// len(mockedGoCloak.CreateIdentityProviderMapperCalls()) -func (mock *GoCloakMock) CreateIdentityProviderMapperCalls() []struct { - Ctx context.Context - Token string - Realm string - Alias string - Mapper gocloak.IdentityProviderMapper -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Alias string - Mapper gocloak.IdentityProviderMapper - } - mock.lockCreateIdentityProviderMapper.RLock() - calls = mock.calls.CreateIdentityProviderMapper - mock.lockCreateIdentityProviderMapper.RUnlock() - return calls -} - -// CreatePermission calls CreatePermissionFunc. -func (mock *GoCloakMock) CreatePermission(ctx context.Context, token string, realm string, idOfClient string, permission gocloak.PermissionRepresentation) (*gocloak.PermissionRepresentation, error) { - if mock.CreatePermissionFunc == nil { - panic("GoCloakMock.CreatePermissionFunc: method is nil but GoCloak.CreatePermission was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Permission gocloak.PermissionRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Permission: permission, - } - mock.lockCreatePermission.Lock() - mock.calls.CreatePermission = append(mock.calls.CreatePermission, callInfo) - mock.lockCreatePermission.Unlock() - return mock.CreatePermissionFunc(ctx, token, realm, idOfClient, permission) -} - -// CreatePermissionCalls gets all the calls that were made to CreatePermission. -// Check the length with: -// -// len(mockedGoCloak.CreatePermissionCalls()) -func (mock *GoCloakMock) CreatePermissionCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Permission gocloak.PermissionRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Permission gocloak.PermissionRepresentation - } - mock.lockCreatePermission.RLock() - calls = mock.calls.CreatePermission - mock.lockCreatePermission.RUnlock() - return calls -} - -// CreatePermissionTicket calls CreatePermissionTicketFunc. -func (mock *GoCloakMock) CreatePermissionTicket(ctx context.Context, token string, realm string, permissions []gocloak.CreatePermissionTicketParams) (*gocloak.PermissionTicketResponseRepresentation, error) { - if mock.CreatePermissionTicketFunc == nil { - panic("GoCloakMock.CreatePermissionTicketFunc: method is nil but GoCloak.CreatePermissionTicket was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Permissions []gocloak.CreatePermissionTicketParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Permissions: permissions, - } - mock.lockCreatePermissionTicket.Lock() - mock.calls.CreatePermissionTicket = append(mock.calls.CreatePermissionTicket, callInfo) - mock.lockCreatePermissionTicket.Unlock() - return mock.CreatePermissionTicketFunc(ctx, token, realm, permissions) -} - -// CreatePermissionTicketCalls gets all the calls that were made to CreatePermissionTicket. -// Check the length with: -// -// len(mockedGoCloak.CreatePermissionTicketCalls()) -func (mock *GoCloakMock) CreatePermissionTicketCalls() []struct { - Ctx context.Context - Token string - Realm string - Permissions []gocloak.CreatePermissionTicketParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Permissions []gocloak.CreatePermissionTicketParams - } - mock.lockCreatePermissionTicket.RLock() - calls = mock.calls.CreatePermissionTicket - mock.lockCreatePermissionTicket.RUnlock() - return calls -} - -// CreatePolicy calls CreatePolicyFunc. -func (mock *GoCloakMock) CreatePolicy(ctx context.Context, token string, realm string, idOfClient string, policy gocloak.PolicyRepresentation) (*gocloak.PolicyRepresentation, error) { - if mock.CreatePolicyFunc == nil { - panic("GoCloakMock.CreatePolicyFunc: method is nil but GoCloak.CreatePolicy was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Policy gocloak.PolicyRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Policy: policy, - } - mock.lockCreatePolicy.Lock() - mock.calls.CreatePolicy = append(mock.calls.CreatePolicy, callInfo) - mock.lockCreatePolicy.Unlock() - return mock.CreatePolicyFunc(ctx, token, realm, idOfClient, policy) -} - -// CreatePolicyCalls gets all the calls that were made to CreatePolicy. -// Check the length with: -// -// len(mockedGoCloak.CreatePolicyCalls()) -func (mock *GoCloakMock) CreatePolicyCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Policy gocloak.PolicyRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Policy gocloak.PolicyRepresentation - } - mock.lockCreatePolicy.RLock() - calls = mock.calls.CreatePolicy - mock.lockCreatePolicy.RUnlock() - return calls -} - -// CreateRealm calls CreateRealmFunc. -func (mock *GoCloakMock) CreateRealm(ctx context.Context, token string, realm gocloak.RealmRepresentation) (string, error) { - if mock.CreateRealmFunc == nil { - panic("GoCloakMock.CreateRealmFunc: method is nil but GoCloak.CreateRealm was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm gocloak.RealmRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockCreateRealm.Lock() - mock.calls.CreateRealm = append(mock.calls.CreateRealm, callInfo) - mock.lockCreateRealm.Unlock() - return mock.CreateRealmFunc(ctx, token, realm) -} - -// CreateRealmCalls gets all the calls that were made to CreateRealm. -// Check the length with: -// -// len(mockedGoCloak.CreateRealmCalls()) -func (mock *GoCloakMock) CreateRealmCalls() []struct { - Ctx context.Context - Token string - Realm gocloak.RealmRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm gocloak.RealmRepresentation - } - mock.lockCreateRealm.RLock() - calls = mock.calls.CreateRealm - mock.lockCreateRealm.RUnlock() - return calls -} - -// CreateRealmRole calls CreateRealmRoleFunc. -func (mock *GoCloakMock) CreateRealmRole(ctx context.Context, token string, realm string, role gocloak.Role) (string, error) { - if mock.CreateRealmRoleFunc == nil { - panic("GoCloakMock.CreateRealmRoleFunc: method is nil but GoCloak.CreateRealmRole was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Role gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Role: role, - } - mock.lockCreateRealmRole.Lock() - mock.calls.CreateRealmRole = append(mock.calls.CreateRealmRole, callInfo) - mock.lockCreateRealmRole.Unlock() - return mock.CreateRealmRoleFunc(ctx, token, realm, role) -} - -// CreateRealmRoleCalls gets all the calls that were made to CreateRealmRole. -// Check the length with: -// -// len(mockedGoCloak.CreateRealmRoleCalls()) -func (mock *GoCloakMock) CreateRealmRoleCalls() []struct { - Ctx context.Context - Token string - Realm string - Role gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Role gocloak.Role - } - mock.lockCreateRealmRole.RLock() - calls = mock.calls.CreateRealmRole - mock.lockCreateRealmRole.RUnlock() - return calls -} - -// CreateResource calls CreateResourceFunc. -func (mock *GoCloakMock) CreateResource(ctx context.Context, token string, realm string, idOfClient string, resource gocloak.ResourceRepresentation) (*gocloak.ResourceRepresentation, error) { - if mock.CreateResourceFunc == nil { - panic("GoCloakMock.CreateResourceFunc: method is nil but GoCloak.CreateResource was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Resource gocloak.ResourceRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Resource: resource, - } - mock.lockCreateResource.Lock() - mock.calls.CreateResource = append(mock.calls.CreateResource, callInfo) - mock.lockCreateResource.Unlock() - return mock.CreateResourceFunc(ctx, token, realm, idOfClient, resource) -} - -// CreateResourceCalls gets all the calls that were made to CreateResource. -// Check the length with: -// -// len(mockedGoCloak.CreateResourceCalls()) -func (mock *GoCloakMock) CreateResourceCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Resource gocloak.ResourceRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Resource gocloak.ResourceRepresentation - } - mock.lockCreateResource.RLock() - calls = mock.calls.CreateResource - mock.lockCreateResource.RUnlock() - return calls -} - -// CreateResourceClient calls CreateResourceClientFunc. -func (mock *GoCloakMock) CreateResourceClient(ctx context.Context, token string, realm string, resource gocloak.ResourceRepresentation) (*gocloak.ResourceRepresentation, error) { - if mock.CreateResourceClientFunc == nil { - panic("GoCloakMock.CreateResourceClientFunc: method is nil but GoCloak.CreateResourceClient was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Resource gocloak.ResourceRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Resource: resource, - } - mock.lockCreateResourceClient.Lock() - mock.calls.CreateResourceClient = append(mock.calls.CreateResourceClient, callInfo) - mock.lockCreateResourceClient.Unlock() - return mock.CreateResourceClientFunc(ctx, token, realm, resource) -} - -// CreateResourceClientCalls gets all the calls that were made to CreateResourceClient. -// Check the length with: -// -// len(mockedGoCloak.CreateResourceClientCalls()) -func (mock *GoCloakMock) CreateResourceClientCalls() []struct { - Ctx context.Context - Token string - Realm string - Resource gocloak.ResourceRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Resource gocloak.ResourceRepresentation - } - mock.lockCreateResourceClient.RLock() - calls = mock.calls.CreateResourceClient - mock.lockCreateResourceClient.RUnlock() - return calls -} - -// CreateResourcePolicy calls CreateResourcePolicyFunc. -func (mock *GoCloakMock) CreateResourcePolicy(ctx context.Context, token string, realm string, resourceID string, policy gocloak.ResourcePolicyRepresentation) (*gocloak.ResourcePolicyRepresentation, error) { - if mock.CreateResourcePolicyFunc == nil { - panic("GoCloakMock.CreateResourcePolicyFunc: method is nil but GoCloak.CreateResourcePolicy was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - ResourceID string - Policy gocloak.ResourcePolicyRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - ResourceID: resourceID, - Policy: policy, - } - mock.lockCreateResourcePolicy.Lock() - mock.calls.CreateResourcePolicy = append(mock.calls.CreateResourcePolicy, callInfo) - mock.lockCreateResourcePolicy.Unlock() - return mock.CreateResourcePolicyFunc(ctx, token, realm, resourceID, policy) -} - -// CreateResourcePolicyCalls gets all the calls that were made to CreateResourcePolicy. -// Check the length with: -// -// len(mockedGoCloak.CreateResourcePolicyCalls()) -func (mock *GoCloakMock) CreateResourcePolicyCalls() []struct { - Ctx context.Context - Token string - Realm string - ResourceID string - Policy gocloak.ResourcePolicyRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - ResourceID string - Policy gocloak.ResourcePolicyRepresentation - } - mock.lockCreateResourcePolicy.RLock() - calls = mock.calls.CreateResourcePolicy - mock.lockCreateResourcePolicy.RUnlock() - return calls -} - -// CreateScope calls CreateScopeFunc. -func (mock *GoCloakMock) CreateScope(ctx context.Context, token string, realm string, idOfClient string, scope gocloak.ScopeRepresentation) (*gocloak.ScopeRepresentation, error) { - if mock.CreateScopeFunc == nil { - panic("GoCloakMock.CreateScopeFunc: method is nil but GoCloak.CreateScope was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Scope gocloak.ScopeRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Scope: scope, - } - mock.lockCreateScope.Lock() - mock.calls.CreateScope = append(mock.calls.CreateScope, callInfo) - mock.lockCreateScope.Unlock() - return mock.CreateScopeFunc(ctx, token, realm, idOfClient, scope) -} - -// CreateScopeCalls gets all the calls that were made to CreateScope. -// Check the length with: -// -// len(mockedGoCloak.CreateScopeCalls()) -func (mock *GoCloakMock) CreateScopeCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Scope gocloak.ScopeRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Scope gocloak.ScopeRepresentation - } - mock.lockCreateScope.RLock() - calls = mock.calls.CreateScope - mock.lockCreateScope.RUnlock() - return calls -} - -// CreateUser calls CreateUserFunc. -func (mock *GoCloakMock) CreateUser(ctx context.Context, token string, realm string, user gocloak.User) (string, error) { - if mock.CreateUserFunc == nil { - panic("GoCloakMock.CreateUserFunc: method is nil but GoCloak.CreateUser was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - User gocloak.User - }{ - Ctx: ctx, - Token: token, - Realm: realm, - User: user, - } - mock.lockCreateUser.Lock() - mock.calls.CreateUser = append(mock.calls.CreateUser, callInfo) - mock.lockCreateUser.Unlock() - return mock.CreateUserFunc(ctx, token, realm, user) -} - -// CreateUserCalls gets all the calls that were made to CreateUser. -// Check the length with: -// -// len(mockedGoCloak.CreateUserCalls()) -func (mock *GoCloakMock) CreateUserCalls() []struct { - Ctx context.Context - Token string - Realm string - User gocloak.User -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - User gocloak.User - } - mock.lockCreateUser.RLock() - calls = mock.calls.CreateUser - mock.lockCreateUser.RUnlock() - return calls -} - -// CreateUserFederatedIdentity calls CreateUserFederatedIdentityFunc. -func (mock *GoCloakMock) CreateUserFederatedIdentity(ctx context.Context, token string, realm string, userID string, providerID string, federatedIdentityRep gocloak.FederatedIdentityRepresentation) error { - if mock.CreateUserFederatedIdentityFunc == nil { - panic("GoCloakMock.CreateUserFederatedIdentityFunc: method is nil but GoCloak.CreateUserFederatedIdentity was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - ProviderID string - FederatedIdentityRep gocloak.FederatedIdentityRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - ProviderID: providerID, - FederatedIdentityRep: federatedIdentityRep, - } - mock.lockCreateUserFederatedIdentity.Lock() - mock.calls.CreateUserFederatedIdentity = append(mock.calls.CreateUserFederatedIdentity, callInfo) - mock.lockCreateUserFederatedIdentity.Unlock() - return mock.CreateUserFederatedIdentityFunc(ctx, token, realm, userID, providerID, federatedIdentityRep) -} - -// CreateUserFederatedIdentityCalls gets all the calls that were made to CreateUserFederatedIdentity. -// Check the length with: -// -// len(mockedGoCloak.CreateUserFederatedIdentityCalls()) -func (mock *GoCloakMock) CreateUserFederatedIdentityCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - ProviderID string - FederatedIdentityRep gocloak.FederatedIdentityRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - ProviderID string - FederatedIdentityRep gocloak.FederatedIdentityRepresentation - } - mock.lockCreateUserFederatedIdentity.RLock() - calls = mock.calls.CreateUserFederatedIdentity - mock.lockCreateUserFederatedIdentity.RUnlock() - return calls -} - -// DecodeAccessToken calls DecodeAccessTokenFunc. -func (mock *GoCloakMock) DecodeAccessToken(ctx context.Context, accessToken string, realm string) (*jwt.Token, *jwt.MapClaims, error) { - if mock.DecodeAccessTokenFunc == nil { - panic("GoCloakMock.DecodeAccessTokenFunc: method is nil but GoCloak.DecodeAccessToken was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - } - mock.lockDecodeAccessToken.Lock() - mock.calls.DecodeAccessToken = append(mock.calls.DecodeAccessToken, callInfo) - mock.lockDecodeAccessToken.Unlock() - return mock.DecodeAccessTokenFunc(ctx, accessToken, realm) -} - -// DecodeAccessTokenCalls gets all the calls that were made to DecodeAccessToken. -// Check the length with: -// -// len(mockedGoCloak.DecodeAccessTokenCalls()) -func (mock *GoCloakMock) DecodeAccessTokenCalls() []struct { - Ctx context.Context - AccessToken string - Realm string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - } - mock.lockDecodeAccessToken.RLock() - calls = mock.calls.DecodeAccessToken - mock.lockDecodeAccessToken.RUnlock() - return calls -} - -// DecodeAccessTokenCustomClaims calls DecodeAccessTokenCustomClaimsFunc. -func (mock *GoCloakMock) DecodeAccessTokenCustomClaims(ctx context.Context, accessToken string, realm string, claims jwt.Claims) (*jwt.Token, error) { - if mock.DecodeAccessTokenCustomClaimsFunc == nil { - panic("GoCloakMock.DecodeAccessTokenCustomClaimsFunc: method is nil but GoCloak.DecodeAccessTokenCustomClaims was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Claims jwt.Claims - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Claims: claims, - } - mock.lockDecodeAccessTokenCustomClaims.Lock() - mock.calls.DecodeAccessTokenCustomClaims = append(mock.calls.DecodeAccessTokenCustomClaims, callInfo) - mock.lockDecodeAccessTokenCustomClaims.Unlock() - return mock.DecodeAccessTokenCustomClaimsFunc(ctx, accessToken, realm, claims) -} - -// DecodeAccessTokenCustomClaimsCalls gets all the calls that were made to DecodeAccessTokenCustomClaims. -// Check the length with: -// -// len(mockedGoCloak.DecodeAccessTokenCustomClaimsCalls()) -func (mock *GoCloakMock) DecodeAccessTokenCustomClaimsCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Claims jwt.Claims -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Claims jwt.Claims - } - mock.lockDecodeAccessTokenCustomClaims.RLock() - calls = mock.calls.DecodeAccessTokenCustomClaims - mock.lockDecodeAccessTokenCustomClaims.RUnlock() - return calls -} - -// DeleteAuthenticationExecution calls DeleteAuthenticationExecutionFunc. -func (mock *GoCloakMock) DeleteAuthenticationExecution(ctx context.Context, token string, realm string, executionID string) error { - if mock.DeleteAuthenticationExecutionFunc == nil { - panic("GoCloakMock.DeleteAuthenticationExecutionFunc: method is nil but GoCloak.DeleteAuthenticationExecution was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - ExecutionID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - ExecutionID: executionID, - } - mock.lockDeleteAuthenticationExecution.Lock() - mock.calls.DeleteAuthenticationExecution = append(mock.calls.DeleteAuthenticationExecution, callInfo) - mock.lockDeleteAuthenticationExecution.Unlock() - return mock.DeleteAuthenticationExecutionFunc(ctx, token, realm, executionID) -} - -// DeleteAuthenticationExecutionCalls gets all the calls that were made to DeleteAuthenticationExecution. -// Check the length with: -// -// len(mockedGoCloak.DeleteAuthenticationExecutionCalls()) -func (mock *GoCloakMock) DeleteAuthenticationExecutionCalls() []struct { - Ctx context.Context - Token string - Realm string - ExecutionID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - ExecutionID string - } - mock.lockDeleteAuthenticationExecution.RLock() - calls = mock.calls.DeleteAuthenticationExecution - mock.lockDeleteAuthenticationExecution.RUnlock() - return calls -} - -// DeleteAuthenticationFlow calls DeleteAuthenticationFlowFunc. -func (mock *GoCloakMock) DeleteAuthenticationFlow(ctx context.Context, token string, realm string, flowID string) error { - if mock.DeleteAuthenticationFlowFunc == nil { - panic("GoCloakMock.DeleteAuthenticationFlowFunc: method is nil but GoCloak.DeleteAuthenticationFlow was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - FlowID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - FlowID: flowID, - } - mock.lockDeleteAuthenticationFlow.Lock() - mock.calls.DeleteAuthenticationFlow = append(mock.calls.DeleteAuthenticationFlow, callInfo) - mock.lockDeleteAuthenticationFlow.Unlock() - return mock.DeleteAuthenticationFlowFunc(ctx, token, realm, flowID) -} - -// DeleteAuthenticationFlowCalls gets all the calls that were made to DeleteAuthenticationFlow. -// Check the length with: -// -// len(mockedGoCloak.DeleteAuthenticationFlowCalls()) -func (mock *GoCloakMock) DeleteAuthenticationFlowCalls() []struct { - Ctx context.Context - Token string - Realm string - FlowID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - FlowID string - } - mock.lockDeleteAuthenticationFlow.RLock() - calls = mock.calls.DeleteAuthenticationFlow - mock.lockDeleteAuthenticationFlow.RUnlock() - return calls -} - -// DeleteClient calls DeleteClientFunc. -func (mock *GoCloakMock) DeleteClient(ctx context.Context, accessToken string, realm string, idOfClient string) error { - if mock.DeleteClientFunc == nil { - panic("GoCloakMock.DeleteClientFunc: method is nil but GoCloak.DeleteClient was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockDeleteClient.Lock() - mock.calls.DeleteClient = append(mock.calls.DeleteClient, callInfo) - mock.lockDeleteClient.Unlock() - return mock.DeleteClientFunc(ctx, accessToken, realm, idOfClient) -} - -// DeleteClientCalls gets all the calls that were made to DeleteClient. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientCalls()) -func (mock *GoCloakMock) DeleteClientCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - } - mock.lockDeleteClient.RLock() - calls = mock.calls.DeleteClient - mock.lockDeleteClient.RUnlock() - return calls -} - -// DeleteClientProtocolMapper calls DeleteClientProtocolMapperFunc. -func (mock *GoCloakMock) DeleteClientProtocolMapper(ctx context.Context, token string, realm string, idOfClient string, mapperID string) error { - if mock.DeleteClientProtocolMapperFunc == nil { - panic("GoCloakMock.DeleteClientProtocolMapperFunc: method is nil but GoCloak.DeleteClientProtocolMapper was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - MapperID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - MapperID: mapperID, - } - mock.lockDeleteClientProtocolMapper.Lock() - mock.calls.DeleteClientProtocolMapper = append(mock.calls.DeleteClientProtocolMapper, callInfo) - mock.lockDeleteClientProtocolMapper.Unlock() - return mock.DeleteClientProtocolMapperFunc(ctx, token, realm, idOfClient, mapperID) -} - -// DeleteClientProtocolMapperCalls gets all the calls that were made to DeleteClientProtocolMapper. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientProtocolMapperCalls()) -func (mock *GoCloakMock) DeleteClientProtocolMapperCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - MapperID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - MapperID string - } - mock.lockDeleteClientProtocolMapper.RLock() - calls = mock.calls.DeleteClientProtocolMapper - mock.lockDeleteClientProtocolMapper.RUnlock() - return calls -} - -// DeleteClientRepresentation calls DeleteClientRepresentationFunc. -func (mock *GoCloakMock) DeleteClientRepresentation(ctx context.Context, accessToken string, realm string, clientID string) error { - if mock.DeleteClientRepresentationFunc == nil { - panic("GoCloakMock.DeleteClientRepresentationFunc: method is nil but GoCloak.DeleteClientRepresentation was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - ClientID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - ClientID: clientID, - } - mock.lockDeleteClientRepresentation.Lock() - mock.calls.DeleteClientRepresentation = append(mock.calls.DeleteClientRepresentation, callInfo) - mock.lockDeleteClientRepresentation.Unlock() - return mock.DeleteClientRepresentationFunc(ctx, accessToken, realm, clientID) -} - -// DeleteClientRepresentationCalls gets all the calls that were made to DeleteClientRepresentation. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientRepresentationCalls()) -func (mock *GoCloakMock) DeleteClientRepresentationCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - ClientID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - ClientID string - } - mock.lockDeleteClientRepresentation.RLock() - calls = mock.calls.DeleteClientRepresentation - mock.lockDeleteClientRepresentation.RUnlock() - return calls -} - -// DeleteClientRole calls DeleteClientRoleFunc. -func (mock *GoCloakMock) DeleteClientRole(ctx context.Context, accessToken string, realm string, idOfClient string, roleName string) error { - if mock.DeleteClientRoleFunc == nil { - panic("GoCloakMock.DeleteClientRoleFunc: method is nil but GoCloak.DeleteClientRole was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - RoleName string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - IdOfClient: idOfClient, - RoleName: roleName, - } - mock.lockDeleteClientRole.Lock() - mock.calls.DeleteClientRole = append(mock.calls.DeleteClientRole, callInfo) - mock.lockDeleteClientRole.Unlock() - return mock.DeleteClientRoleFunc(ctx, accessToken, realm, idOfClient, roleName) -} - -// DeleteClientRoleCalls gets all the calls that were made to DeleteClientRole. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientRoleCalls()) -func (mock *GoCloakMock) DeleteClientRoleCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - RoleName string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - RoleName string - } - mock.lockDeleteClientRole.RLock() - calls = mock.calls.DeleteClientRole - mock.lockDeleteClientRole.RUnlock() - return calls -} - -// DeleteClientRoleComposite calls DeleteClientRoleCompositeFunc. -func (mock *GoCloakMock) DeleteClientRoleComposite(ctx context.Context, token string, realm string, roleID string, roles []gocloak.Role) error { - if mock.DeleteClientRoleCompositeFunc == nil { - panic("GoCloakMock.DeleteClientRoleCompositeFunc: method is nil but GoCloak.DeleteClientRoleComposite was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleID string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleID: roleID, - Roles: roles, - } - mock.lockDeleteClientRoleComposite.Lock() - mock.calls.DeleteClientRoleComposite = append(mock.calls.DeleteClientRoleComposite, callInfo) - mock.lockDeleteClientRoleComposite.Unlock() - return mock.DeleteClientRoleCompositeFunc(ctx, token, realm, roleID, roles) -} - -// DeleteClientRoleCompositeCalls gets all the calls that were made to DeleteClientRoleComposite. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientRoleCompositeCalls()) -func (mock *GoCloakMock) DeleteClientRoleCompositeCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleID string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleID string - Roles []gocloak.Role - } - mock.lockDeleteClientRoleComposite.RLock() - calls = mock.calls.DeleteClientRoleComposite - mock.lockDeleteClientRoleComposite.RUnlock() - return calls -} - -// DeleteClientRoleFromGroup calls DeleteClientRoleFromGroupFunc. -func (mock *GoCloakMock) DeleteClientRoleFromGroup(ctx context.Context, token string, realm string, idOfClient string, groupID string, roles []gocloak.Role) error { - if mock.DeleteClientRoleFromGroupFunc == nil { - panic("GoCloakMock.DeleteClientRoleFromGroupFunc: method is nil but GoCloak.DeleteClientRoleFromGroup was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - GroupID: groupID, - Roles: roles, - } - mock.lockDeleteClientRoleFromGroup.Lock() - mock.calls.DeleteClientRoleFromGroup = append(mock.calls.DeleteClientRoleFromGroup, callInfo) - mock.lockDeleteClientRoleFromGroup.Unlock() - return mock.DeleteClientRoleFromGroupFunc(ctx, token, realm, idOfClient, groupID, roles) -} - -// DeleteClientRoleFromGroupCalls gets all the calls that were made to DeleteClientRoleFromGroup. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientRoleFromGroupCalls()) -func (mock *GoCloakMock) DeleteClientRoleFromGroupCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - Roles []gocloak.Role - } - mock.lockDeleteClientRoleFromGroup.RLock() - calls = mock.calls.DeleteClientRoleFromGroup - mock.lockDeleteClientRoleFromGroup.RUnlock() - return calls -} - -// DeleteClientRoleFromUser calls DeleteClientRoleFromUserFunc. -func (mock *GoCloakMock) DeleteClientRoleFromUser(ctx context.Context, token string, realm string, idOfClient string, userID string, roles []gocloak.Role) error { - if mock.DeleteClientRoleFromUserFunc == nil { - panic("GoCloakMock.DeleteClientRoleFromUserFunc: method is nil but GoCloak.DeleteClientRoleFromUser was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - UserID: userID, - Roles: roles, - } - mock.lockDeleteClientRoleFromUser.Lock() - mock.calls.DeleteClientRoleFromUser = append(mock.calls.DeleteClientRoleFromUser, callInfo) - mock.lockDeleteClientRoleFromUser.Unlock() - return mock.DeleteClientRoleFromUserFunc(ctx, token, realm, idOfClient, userID, roles) -} - -// DeleteClientRoleFromUserCalls gets all the calls that were made to DeleteClientRoleFromUser. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientRoleFromUserCalls()) -func (mock *GoCloakMock) DeleteClientRoleFromUserCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - Roles []gocloak.Role - } - mock.lockDeleteClientRoleFromUser.RLock() - calls = mock.calls.DeleteClientRoleFromUser - mock.lockDeleteClientRoleFromUser.RUnlock() - return calls -} - -// DeleteClientScope calls DeleteClientScopeFunc. -func (mock *GoCloakMock) DeleteClientScope(ctx context.Context, accessToken string, realm string, scopeID string) error { - if mock.DeleteClientScopeFunc == nil { - panic("GoCloakMock.DeleteClientScopeFunc: method is nil but GoCloak.DeleteClientScope was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - ScopeID: scopeID, - } - mock.lockDeleteClientScope.Lock() - mock.calls.DeleteClientScope = append(mock.calls.DeleteClientScope, callInfo) - mock.lockDeleteClientScope.Unlock() - return mock.DeleteClientScopeFunc(ctx, accessToken, realm, scopeID) -} - -// DeleteClientScopeCalls gets all the calls that were made to DeleteClientScope. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientScopeCalls()) -func (mock *GoCloakMock) DeleteClientScopeCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - } - mock.lockDeleteClientScope.RLock() - calls = mock.calls.DeleteClientScope - mock.lockDeleteClientScope.RUnlock() - return calls -} - -// DeleteClientScopeMappingsClientRoles calls DeleteClientScopeMappingsClientRolesFunc. -func (mock *GoCloakMock) DeleteClientScopeMappingsClientRoles(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string, roles []gocloak.Role) error { - if mock.DeleteClientScopeMappingsClientRolesFunc == nil { - panic("GoCloakMock.DeleteClientScopeMappingsClientRolesFunc: method is nil but GoCloak.DeleteClientScopeMappingsClientRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - IdOfSelectedClient: idOfSelectedClient, - Roles: roles, - } - mock.lockDeleteClientScopeMappingsClientRoles.Lock() - mock.calls.DeleteClientScopeMappingsClientRoles = append(mock.calls.DeleteClientScopeMappingsClientRoles, callInfo) - mock.lockDeleteClientScopeMappingsClientRoles.Unlock() - return mock.DeleteClientScopeMappingsClientRolesFunc(ctx, token, realm, idOfClient, idOfSelectedClient, roles) -} - -// DeleteClientScopeMappingsClientRolesCalls gets all the calls that were made to DeleteClientScopeMappingsClientRoles. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientScopeMappingsClientRolesCalls()) -func (mock *GoCloakMock) DeleteClientScopeMappingsClientRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string - Roles []gocloak.Role - } - mock.lockDeleteClientScopeMappingsClientRoles.RLock() - calls = mock.calls.DeleteClientScopeMappingsClientRoles - mock.lockDeleteClientScopeMappingsClientRoles.RUnlock() - return calls -} - -// DeleteClientScopeMappingsRealmRoles calls DeleteClientScopeMappingsRealmRolesFunc. -func (mock *GoCloakMock) DeleteClientScopeMappingsRealmRoles(ctx context.Context, token string, realm string, idOfClient string, roles []gocloak.Role) error { - if mock.DeleteClientScopeMappingsRealmRolesFunc == nil { - panic("GoCloakMock.DeleteClientScopeMappingsRealmRolesFunc: method is nil but GoCloak.DeleteClientScopeMappingsRealmRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Roles: roles, - } - mock.lockDeleteClientScopeMappingsRealmRoles.Lock() - mock.calls.DeleteClientScopeMappingsRealmRoles = append(mock.calls.DeleteClientScopeMappingsRealmRoles, callInfo) - mock.lockDeleteClientScopeMappingsRealmRoles.Unlock() - return mock.DeleteClientScopeMappingsRealmRolesFunc(ctx, token, realm, idOfClient, roles) -} - -// DeleteClientScopeMappingsRealmRolesCalls gets all the calls that were made to DeleteClientScopeMappingsRealmRoles. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientScopeMappingsRealmRolesCalls()) -func (mock *GoCloakMock) DeleteClientScopeMappingsRealmRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Roles []gocloak.Role - } - mock.lockDeleteClientScopeMappingsRealmRoles.RLock() - calls = mock.calls.DeleteClientScopeMappingsRealmRoles - mock.lockDeleteClientScopeMappingsRealmRoles.RUnlock() - return calls -} - -// DeleteClientScopeProtocolMapper calls DeleteClientScopeProtocolMapperFunc. -func (mock *GoCloakMock) DeleteClientScopeProtocolMapper(ctx context.Context, accessToken string, realm string, scopeID string, protocolMapperID string) error { - if mock.DeleteClientScopeProtocolMapperFunc == nil { - panic("GoCloakMock.DeleteClientScopeProtocolMapperFunc: method is nil but GoCloak.DeleteClientScopeProtocolMapper was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - ProtocolMapperID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - ScopeID: scopeID, - ProtocolMapperID: protocolMapperID, - } - mock.lockDeleteClientScopeProtocolMapper.Lock() - mock.calls.DeleteClientScopeProtocolMapper = append(mock.calls.DeleteClientScopeProtocolMapper, callInfo) - mock.lockDeleteClientScopeProtocolMapper.Unlock() - return mock.DeleteClientScopeProtocolMapperFunc(ctx, accessToken, realm, scopeID, protocolMapperID) -} - -// DeleteClientScopeProtocolMapperCalls gets all the calls that were made to DeleteClientScopeProtocolMapper. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientScopeProtocolMapperCalls()) -func (mock *GoCloakMock) DeleteClientScopeProtocolMapperCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - ProtocolMapperID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - ProtocolMapperID string - } - mock.lockDeleteClientScopeProtocolMapper.RLock() - calls = mock.calls.DeleteClientScopeProtocolMapper - mock.lockDeleteClientScopeProtocolMapper.RUnlock() - return calls -} - -// DeleteClientScopesScopeMappingsClientRoles calls DeleteClientScopesScopeMappingsClientRolesFunc. -func (mock *GoCloakMock) DeleteClientScopesScopeMappingsClientRoles(ctx context.Context, token string, realm string, idOfClientScope string, ifOfClient string, roles []gocloak.Role) error { - if mock.DeleteClientScopesScopeMappingsClientRolesFunc == nil { - panic("GoCloakMock.DeleteClientScopesScopeMappingsClientRolesFunc: method is nil but GoCloak.DeleteClientScopesScopeMappingsClientRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IfOfClient string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClientScope: idOfClientScope, - IfOfClient: ifOfClient, - Roles: roles, - } - mock.lockDeleteClientScopesScopeMappingsClientRoles.Lock() - mock.calls.DeleteClientScopesScopeMappingsClientRoles = append(mock.calls.DeleteClientScopesScopeMappingsClientRoles, callInfo) - mock.lockDeleteClientScopesScopeMappingsClientRoles.Unlock() - return mock.DeleteClientScopesScopeMappingsClientRolesFunc(ctx, token, realm, idOfClientScope, ifOfClient, roles) -} - -// DeleteClientScopesScopeMappingsClientRolesCalls gets all the calls that were made to DeleteClientScopesScopeMappingsClientRoles. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientScopesScopeMappingsClientRolesCalls()) -func (mock *GoCloakMock) DeleteClientScopesScopeMappingsClientRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IfOfClient string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IfOfClient string - Roles []gocloak.Role - } - mock.lockDeleteClientScopesScopeMappingsClientRoles.RLock() - calls = mock.calls.DeleteClientScopesScopeMappingsClientRoles - mock.lockDeleteClientScopesScopeMappingsClientRoles.RUnlock() - return calls -} - -// DeleteClientScopesScopeMappingsRealmRoles calls DeleteClientScopesScopeMappingsRealmRolesFunc. -func (mock *GoCloakMock) DeleteClientScopesScopeMappingsRealmRoles(ctx context.Context, token string, realm string, idOfClientScope string, roles []gocloak.Role) error { - if mock.DeleteClientScopesScopeMappingsRealmRolesFunc == nil { - panic("GoCloakMock.DeleteClientScopesScopeMappingsRealmRolesFunc: method is nil but GoCloak.DeleteClientScopesScopeMappingsRealmRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClientScope: idOfClientScope, - Roles: roles, - } - mock.lockDeleteClientScopesScopeMappingsRealmRoles.Lock() - mock.calls.DeleteClientScopesScopeMappingsRealmRoles = append(mock.calls.DeleteClientScopesScopeMappingsRealmRoles, callInfo) - mock.lockDeleteClientScopesScopeMappingsRealmRoles.Unlock() - return mock.DeleteClientScopesScopeMappingsRealmRolesFunc(ctx, token, realm, idOfClientScope, roles) -} - -// DeleteClientScopesScopeMappingsRealmRolesCalls gets all the calls that were made to DeleteClientScopesScopeMappingsRealmRoles. -// Check the length with: -// -// len(mockedGoCloak.DeleteClientScopesScopeMappingsRealmRolesCalls()) -func (mock *GoCloakMock) DeleteClientScopesScopeMappingsRealmRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - Roles []gocloak.Role - } - mock.lockDeleteClientScopesScopeMappingsRealmRoles.RLock() - calls = mock.calls.DeleteClientScopesScopeMappingsRealmRoles - mock.lockDeleteClientScopesScopeMappingsRealmRoles.RUnlock() - return calls -} - -// DeleteComponent calls DeleteComponentFunc. -func (mock *GoCloakMock) DeleteComponent(ctx context.Context, accessToken string, realm string, componentID string) error { - if mock.DeleteComponentFunc == nil { - panic("GoCloakMock.DeleteComponentFunc: method is nil but GoCloak.DeleteComponent was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - ComponentID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - ComponentID: componentID, - } - mock.lockDeleteComponent.Lock() - mock.calls.DeleteComponent = append(mock.calls.DeleteComponent, callInfo) - mock.lockDeleteComponent.Unlock() - return mock.DeleteComponentFunc(ctx, accessToken, realm, componentID) -} - -// DeleteComponentCalls gets all the calls that were made to DeleteComponent. -// Check the length with: -// -// len(mockedGoCloak.DeleteComponentCalls()) -func (mock *GoCloakMock) DeleteComponentCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - ComponentID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - ComponentID string - } - mock.lockDeleteComponent.RLock() - calls = mock.calls.DeleteComponent - mock.lockDeleteComponent.RUnlock() - return calls -} - -// DeleteCredentials calls DeleteCredentialsFunc. -func (mock *GoCloakMock) DeleteCredentials(ctx context.Context, token string, realm string, UserID string, CredentialID string) error { - if mock.DeleteCredentialsFunc == nil { - panic("GoCloakMock.DeleteCredentialsFunc: method is nil but GoCloak.DeleteCredentials was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: UserID, - CredentialID: CredentialID, - } - mock.lockDeleteCredentials.Lock() - mock.calls.DeleteCredentials = append(mock.calls.DeleteCredentials, callInfo) - mock.lockDeleteCredentials.Unlock() - return mock.DeleteCredentialsFunc(ctx, token, realm, UserID, CredentialID) -} - -// DeleteCredentialsCalls gets all the calls that were made to DeleteCredentials. -// Check the length with: -// -// len(mockedGoCloak.DeleteCredentialsCalls()) -func (mock *GoCloakMock) DeleteCredentialsCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string - } - mock.lockDeleteCredentials.RLock() - calls = mock.calls.DeleteCredentials - mock.lockDeleteCredentials.RUnlock() - return calls -} - -// DeleteGroup calls DeleteGroupFunc. -func (mock *GoCloakMock) DeleteGroup(ctx context.Context, accessToken string, realm string, groupID string) error { - if mock.DeleteGroupFunc == nil { - panic("GoCloakMock.DeleteGroupFunc: method is nil but GoCloak.DeleteGroup was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - GroupID: groupID, - } - mock.lockDeleteGroup.Lock() - mock.calls.DeleteGroup = append(mock.calls.DeleteGroup, callInfo) - mock.lockDeleteGroup.Unlock() - return mock.DeleteGroupFunc(ctx, accessToken, realm, groupID) -} - -// DeleteGroupCalls gets all the calls that were made to DeleteGroup. -// Check the length with: -// -// len(mockedGoCloak.DeleteGroupCalls()) -func (mock *GoCloakMock) DeleteGroupCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - } - mock.lockDeleteGroup.RLock() - calls = mock.calls.DeleteGroup - mock.lockDeleteGroup.RUnlock() - return calls -} - -// DeleteIdentityProvider calls DeleteIdentityProviderFunc. -func (mock *GoCloakMock) DeleteIdentityProvider(ctx context.Context, token string, realm string, alias string) error { - if mock.DeleteIdentityProviderFunc == nil { - panic("GoCloakMock.DeleteIdentityProviderFunc: method is nil but GoCloak.DeleteIdentityProvider was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Alias string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Alias: alias, - } - mock.lockDeleteIdentityProvider.Lock() - mock.calls.DeleteIdentityProvider = append(mock.calls.DeleteIdentityProvider, callInfo) - mock.lockDeleteIdentityProvider.Unlock() - return mock.DeleteIdentityProviderFunc(ctx, token, realm, alias) -} - -// DeleteIdentityProviderCalls gets all the calls that were made to DeleteIdentityProvider. -// Check the length with: -// -// len(mockedGoCloak.DeleteIdentityProviderCalls()) -func (mock *GoCloakMock) DeleteIdentityProviderCalls() []struct { - Ctx context.Context - Token string - Realm string - Alias string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Alias string - } - mock.lockDeleteIdentityProvider.RLock() - calls = mock.calls.DeleteIdentityProvider - mock.lockDeleteIdentityProvider.RUnlock() - return calls -} - -// DeleteIdentityProviderMapper calls DeleteIdentityProviderMapperFunc. -func (mock *GoCloakMock) DeleteIdentityProviderMapper(ctx context.Context, token string, realm string, alias string, mapperID string) error { - if mock.DeleteIdentityProviderMapperFunc == nil { - panic("GoCloakMock.DeleteIdentityProviderMapperFunc: method is nil but GoCloak.DeleteIdentityProviderMapper was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Alias string - MapperID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Alias: alias, - MapperID: mapperID, - } - mock.lockDeleteIdentityProviderMapper.Lock() - mock.calls.DeleteIdentityProviderMapper = append(mock.calls.DeleteIdentityProviderMapper, callInfo) - mock.lockDeleteIdentityProviderMapper.Unlock() - return mock.DeleteIdentityProviderMapperFunc(ctx, token, realm, alias, mapperID) -} - -// DeleteIdentityProviderMapperCalls gets all the calls that were made to DeleteIdentityProviderMapper. -// Check the length with: -// -// len(mockedGoCloak.DeleteIdentityProviderMapperCalls()) -func (mock *GoCloakMock) DeleteIdentityProviderMapperCalls() []struct { - Ctx context.Context - Token string - Realm string - Alias string - MapperID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Alias string - MapperID string - } - mock.lockDeleteIdentityProviderMapper.RLock() - calls = mock.calls.DeleteIdentityProviderMapper - mock.lockDeleteIdentityProviderMapper.RUnlock() - return calls -} - -// DeletePermission calls DeletePermissionFunc. -func (mock *GoCloakMock) DeletePermission(ctx context.Context, token string, realm string, idOfClient string, permissionID string) error { - if mock.DeletePermissionFunc == nil { - panic("GoCloakMock.DeletePermissionFunc: method is nil but GoCloak.DeletePermission was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - PermissionID: permissionID, - } - mock.lockDeletePermission.Lock() - mock.calls.DeletePermission = append(mock.calls.DeletePermission, callInfo) - mock.lockDeletePermission.Unlock() - return mock.DeletePermissionFunc(ctx, token, realm, idOfClient, permissionID) -} - -// DeletePermissionCalls gets all the calls that were made to DeletePermission. -// Check the length with: -// -// len(mockedGoCloak.DeletePermissionCalls()) -func (mock *GoCloakMock) DeletePermissionCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string - } - mock.lockDeletePermission.RLock() - calls = mock.calls.DeletePermission - mock.lockDeletePermission.RUnlock() - return calls -} - -// DeletePolicy calls DeletePolicyFunc. -func (mock *GoCloakMock) DeletePolicy(ctx context.Context, token string, realm string, idOfClient string, policyID string) error { - if mock.DeletePolicyFunc == nil { - panic("GoCloakMock.DeletePolicyFunc: method is nil but GoCloak.DeletePolicy was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - PolicyID: policyID, - } - mock.lockDeletePolicy.Lock() - mock.calls.DeletePolicy = append(mock.calls.DeletePolicy, callInfo) - mock.lockDeletePolicy.Unlock() - return mock.DeletePolicyFunc(ctx, token, realm, idOfClient, policyID) -} - -// DeletePolicyCalls gets all the calls that were made to DeletePolicy. -// Check the length with: -// -// len(mockedGoCloak.DeletePolicyCalls()) -func (mock *GoCloakMock) DeletePolicyCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - } - mock.lockDeletePolicy.RLock() - calls = mock.calls.DeletePolicy - mock.lockDeletePolicy.RUnlock() - return calls -} - -// DeleteRealm calls DeleteRealmFunc. -func (mock *GoCloakMock) DeleteRealm(ctx context.Context, token string, realm string) error { - if mock.DeleteRealmFunc == nil { - panic("GoCloakMock.DeleteRealmFunc: method is nil but GoCloak.DeleteRealm was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockDeleteRealm.Lock() - mock.calls.DeleteRealm = append(mock.calls.DeleteRealm, callInfo) - mock.lockDeleteRealm.Unlock() - return mock.DeleteRealmFunc(ctx, token, realm) -} - -// DeleteRealmCalls gets all the calls that were made to DeleteRealm. -// Check the length with: -// -// len(mockedGoCloak.DeleteRealmCalls()) -func (mock *GoCloakMock) DeleteRealmCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockDeleteRealm.RLock() - calls = mock.calls.DeleteRealm - mock.lockDeleteRealm.RUnlock() - return calls -} - -// DeleteRealmRole calls DeleteRealmRoleFunc. -func (mock *GoCloakMock) DeleteRealmRole(ctx context.Context, token string, realm string, roleName string) error { - if mock.DeleteRealmRoleFunc == nil { - panic("GoCloakMock.DeleteRealmRoleFunc: method is nil but GoCloak.DeleteRealmRole was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleName string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleName: roleName, - } - mock.lockDeleteRealmRole.Lock() - mock.calls.DeleteRealmRole = append(mock.calls.DeleteRealmRole, callInfo) - mock.lockDeleteRealmRole.Unlock() - return mock.DeleteRealmRoleFunc(ctx, token, realm, roleName) -} - -// DeleteRealmRoleCalls gets all the calls that were made to DeleteRealmRole. -// Check the length with: -// -// len(mockedGoCloak.DeleteRealmRoleCalls()) -func (mock *GoCloakMock) DeleteRealmRoleCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleName string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleName string - } - mock.lockDeleteRealmRole.RLock() - calls = mock.calls.DeleteRealmRole - mock.lockDeleteRealmRole.RUnlock() - return calls -} - -// DeleteRealmRoleComposite calls DeleteRealmRoleCompositeFunc. -func (mock *GoCloakMock) DeleteRealmRoleComposite(ctx context.Context, token string, realm string, roleName string, roles []gocloak.Role) error { - if mock.DeleteRealmRoleCompositeFunc == nil { - panic("GoCloakMock.DeleteRealmRoleCompositeFunc: method is nil but GoCloak.DeleteRealmRoleComposite was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleName string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleName: roleName, - Roles: roles, - } - mock.lockDeleteRealmRoleComposite.Lock() - mock.calls.DeleteRealmRoleComposite = append(mock.calls.DeleteRealmRoleComposite, callInfo) - mock.lockDeleteRealmRoleComposite.Unlock() - return mock.DeleteRealmRoleCompositeFunc(ctx, token, realm, roleName, roles) -} - -// DeleteRealmRoleCompositeCalls gets all the calls that were made to DeleteRealmRoleComposite. -// Check the length with: -// -// len(mockedGoCloak.DeleteRealmRoleCompositeCalls()) -func (mock *GoCloakMock) DeleteRealmRoleCompositeCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleName string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleName string - Roles []gocloak.Role - } - mock.lockDeleteRealmRoleComposite.RLock() - calls = mock.calls.DeleteRealmRoleComposite - mock.lockDeleteRealmRoleComposite.RUnlock() - return calls -} - -// DeleteRealmRoleFromGroup calls DeleteRealmRoleFromGroupFunc. -func (mock *GoCloakMock) DeleteRealmRoleFromGroup(ctx context.Context, token string, realm string, groupID string, roles []gocloak.Role) error { - if mock.DeleteRealmRoleFromGroupFunc == nil { - panic("GoCloakMock.DeleteRealmRoleFromGroupFunc: method is nil but GoCloak.DeleteRealmRoleFromGroup was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - GroupID string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - GroupID: groupID, - Roles: roles, - } - mock.lockDeleteRealmRoleFromGroup.Lock() - mock.calls.DeleteRealmRoleFromGroup = append(mock.calls.DeleteRealmRoleFromGroup, callInfo) - mock.lockDeleteRealmRoleFromGroup.Unlock() - return mock.DeleteRealmRoleFromGroupFunc(ctx, token, realm, groupID, roles) -} - -// DeleteRealmRoleFromGroupCalls gets all the calls that were made to DeleteRealmRoleFromGroup. -// Check the length with: -// -// len(mockedGoCloak.DeleteRealmRoleFromGroupCalls()) -func (mock *GoCloakMock) DeleteRealmRoleFromGroupCalls() []struct { - Ctx context.Context - Token string - Realm string - GroupID string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - GroupID string - Roles []gocloak.Role - } - mock.lockDeleteRealmRoleFromGroup.RLock() - calls = mock.calls.DeleteRealmRoleFromGroup - mock.lockDeleteRealmRoleFromGroup.RUnlock() - return calls -} - -// DeleteRealmRoleFromUser calls DeleteRealmRoleFromUserFunc. -func (mock *GoCloakMock) DeleteRealmRoleFromUser(ctx context.Context, token string, realm string, userID string, roles []gocloak.Role) error { - if mock.DeleteRealmRoleFromUserFunc == nil { - panic("GoCloakMock.DeleteRealmRoleFromUserFunc: method is nil but GoCloak.DeleteRealmRoleFromUser was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - Roles []gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - Roles: roles, - } - mock.lockDeleteRealmRoleFromUser.Lock() - mock.calls.DeleteRealmRoleFromUser = append(mock.calls.DeleteRealmRoleFromUser, callInfo) - mock.lockDeleteRealmRoleFromUser.Unlock() - return mock.DeleteRealmRoleFromUserFunc(ctx, token, realm, userID, roles) -} - -// DeleteRealmRoleFromUserCalls gets all the calls that were made to DeleteRealmRoleFromUser. -// Check the length with: -// -// len(mockedGoCloak.DeleteRealmRoleFromUserCalls()) -func (mock *GoCloakMock) DeleteRealmRoleFromUserCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - Roles []gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - Roles []gocloak.Role - } - mock.lockDeleteRealmRoleFromUser.RLock() - calls = mock.calls.DeleteRealmRoleFromUser - mock.lockDeleteRealmRoleFromUser.RUnlock() - return calls -} - -// DeleteResource calls DeleteResourceFunc. -func (mock *GoCloakMock) DeleteResource(ctx context.Context, token string, realm string, idOfClient string, resourceID string) error { - if mock.DeleteResourceFunc == nil { - panic("GoCloakMock.DeleteResourceFunc: method is nil but GoCloak.DeleteResource was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ResourceID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - ResourceID: resourceID, - } - mock.lockDeleteResource.Lock() - mock.calls.DeleteResource = append(mock.calls.DeleteResource, callInfo) - mock.lockDeleteResource.Unlock() - return mock.DeleteResourceFunc(ctx, token, realm, idOfClient, resourceID) -} - -// DeleteResourceCalls gets all the calls that were made to DeleteResource. -// Check the length with: -// -// len(mockedGoCloak.DeleteResourceCalls()) -func (mock *GoCloakMock) DeleteResourceCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ResourceID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ResourceID string - } - mock.lockDeleteResource.RLock() - calls = mock.calls.DeleteResource - mock.lockDeleteResource.RUnlock() - return calls -} - -// DeleteResourceClient calls DeleteResourceClientFunc. -func (mock *GoCloakMock) DeleteResourceClient(ctx context.Context, token string, realm string, resourceID string) error { - if mock.DeleteResourceClientFunc == nil { - panic("GoCloakMock.DeleteResourceClientFunc: method is nil but GoCloak.DeleteResourceClient was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - ResourceID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - ResourceID: resourceID, - } - mock.lockDeleteResourceClient.Lock() - mock.calls.DeleteResourceClient = append(mock.calls.DeleteResourceClient, callInfo) - mock.lockDeleteResourceClient.Unlock() - return mock.DeleteResourceClientFunc(ctx, token, realm, resourceID) -} - -// DeleteResourceClientCalls gets all the calls that were made to DeleteResourceClient. -// Check the length with: -// -// len(mockedGoCloak.DeleteResourceClientCalls()) -func (mock *GoCloakMock) DeleteResourceClientCalls() []struct { - Ctx context.Context - Token string - Realm string - ResourceID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - ResourceID string - } - mock.lockDeleteResourceClient.RLock() - calls = mock.calls.DeleteResourceClient - mock.lockDeleteResourceClient.RUnlock() - return calls -} - -// DeleteResourcePolicy calls DeleteResourcePolicyFunc. -func (mock *GoCloakMock) DeleteResourcePolicy(ctx context.Context, token string, realm string, permissionID string) error { - if mock.DeleteResourcePolicyFunc == nil { - panic("GoCloakMock.DeleteResourcePolicyFunc: method is nil but GoCloak.DeleteResourcePolicy was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - PermissionID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - PermissionID: permissionID, - } - mock.lockDeleteResourcePolicy.Lock() - mock.calls.DeleteResourcePolicy = append(mock.calls.DeleteResourcePolicy, callInfo) - mock.lockDeleteResourcePolicy.Unlock() - return mock.DeleteResourcePolicyFunc(ctx, token, realm, permissionID) -} - -// DeleteResourcePolicyCalls gets all the calls that were made to DeleteResourcePolicy. -// Check the length with: -// -// len(mockedGoCloak.DeleteResourcePolicyCalls()) -func (mock *GoCloakMock) DeleteResourcePolicyCalls() []struct { - Ctx context.Context - Token string - Realm string - PermissionID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - PermissionID string - } - mock.lockDeleteResourcePolicy.RLock() - calls = mock.calls.DeleteResourcePolicy - mock.lockDeleteResourcePolicy.RUnlock() - return calls -} - -// DeleteScope calls DeleteScopeFunc. -func (mock *GoCloakMock) DeleteScope(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error { - if mock.DeleteScopeFunc == nil { - panic("GoCloakMock.DeleteScopeFunc: method is nil but GoCloak.DeleteScope was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - ScopeID: scopeID, - } - mock.lockDeleteScope.Lock() - mock.calls.DeleteScope = append(mock.calls.DeleteScope, callInfo) - mock.lockDeleteScope.Unlock() - return mock.DeleteScopeFunc(ctx, token, realm, idOfClient, scopeID) -} - -// DeleteScopeCalls gets all the calls that were made to DeleteScope. -// Check the length with: -// -// len(mockedGoCloak.DeleteScopeCalls()) -func (mock *GoCloakMock) DeleteScopeCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - } - mock.lockDeleteScope.RLock() - calls = mock.calls.DeleteScope - mock.lockDeleteScope.RUnlock() - return calls -} - -// DeleteUser calls DeleteUserFunc. -func (mock *GoCloakMock) DeleteUser(ctx context.Context, accessToken string, realm string, userID string) error { - if mock.DeleteUserFunc == nil { - panic("GoCloakMock.DeleteUserFunc: method is nil but GoCloak.DeleteUser was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - UserID: userID, - } - mock.lockDeleteUser.Lock() - mock.calls.DeleteUser = append(mock.calls.DeleteUser, callInfo) - mock.lockDeleteUser.Unlock() - return mock.DeleteUserFunc(ctx, accessToken, realm, userID) -} - -// DeleteUserCalls gets all the calls that were made to DeleteUser. -// Check the length with: -// -// len(mockedGoCloak.DeleteUserCalls()) -func (mock *GoCloakMock) DeleteUserCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - } - mock.lockDeleteUser.RLock() - calls = mock.calls.DeleteUser - mock.lockDeleteUser.RUnlock() - return calls -} - -// DeleteUserFederatedIdentity calls DeleteUserFederatedIdentityFunc. -func (mock *GoCloakMock) DeleteUserFederatedIdentity(ctx context.Context, token string, realm string, userID string, providerID string) error { - if mock.DeleteUserFederatedIdentityFunc == nil { - panic("GoCloakMock.DeleteUserFederatedIdentityFunc: method is nil but GoCloak.DeleteUserFederatedIdentity was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - ProviderID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - ProviderID: providerID, - } - mock.lockDeleteUserFederatedIdentity.Lock() - mock.calls.DeleteUserFederatedIdentity = append(mock.calls.DeleteUserFederatedIdentity, callInfo) - mock.lockDeleteUserFederatedIdentity.Unlock() - return mock.DeleteUserFederatedIdentityFunc(ctx, token, realm, userID, providerID) -} - -// DeleteUserFederatedIdentityCalls gets all the calls that were made to DeleteUserFederatedIdentity. -// Check the length with: -// -// len(mockedGoCloak.DeleteUserFederatedIdentityCalls()) -func (mock *GoCloakMock) DeleteUserFederatedIdentityCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - ProviderID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - ProviderID string - } - mock.lockDeleteUserFederatedIdentity.RLock() - calls = mock.calls.DeleteUserFederatedIdentity - mock.lockDeleteUserFederatedIdentity.RUnlock() - return calls -} - -// DeleteUserFromGroup calls DeleteUserFromGroupFunc. -func (mock *GoCloakMock) DeleteUserFromGroup(ctx context.Context, token string, realm string, userID string, groupID string) error { - if mock.DeleteUserFromGroupFunc == nil { - panic("GoCloakMock.DeleteUserFromGroupFunc: method is nil but GoCloak.DeleteUserFromGroup was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - GroupID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - GroupID: groupID, - } - mock.lockDeleteUserFromGroup.Lock() - mock.calls.DeleteUserFromGroup = append(mock.calls.DeleteUserFromGroup, callInfo) - mock.lockDeleteUserFromGroup.Unlock() - return mock.DeleteUserFromGroupFunc(ctx, token, realm, userID, groupID) -} - -// DeleteUserFromGroupCalls gets all the calls that were made to DeleteUserFromGroup. -// Check the length with: -// -// len(mockedGoCloak.DeleteUserFromGroupCalls()) -func (mock *GoCloakMock) DeleteUserFromGroupCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - GroupID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - GroupID string - } - mock.lockDeleteUserFromGroup.RLock() - calls = mock.calls.DeleteUserFromGroup - mock.lockDeleteUserFromGroup.RUnlock() - return calls -} - -// DeleteUserPermission calls DeleteUserPermissionFunc. -func (mock *GoCloakMock) DeleteUserPermission(ctx context.Context, token string, realm string, ticketID string) error { - if mock.DeleteUserPermissionFunc == nil { - panic("GoCloakMock.DeleteUserPermissionFunc: method is nil but GoCloak.DeleteUserPermission was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - TicketID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - TicketID: ticketID, - } - mock.lockDeleteUserPermission.Lock() - mock.calls.DeleteUserPermission = append(mock.calls.DeleteUserPermission, callInfo) - mock.lockDeleteUserPermission.Unlock() - return mock.DeleteUserPermissionFunc(ctx, token, realm, ticketID) -} - -// DeleteUserPermissionCalls gets all the calls that were made to DeleteUserPermission. -// Check the length with: -// -// len(mockedGoCloak.DeleteUserPermissionCalls()) -func (mock *GoCloakMock) DeleteUserPermissionCalls() []struct { - Ctx context.Context - Token string - Realm string - TicketID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - TicketID string - } - mock.lockDeleteUserPermission.RLock() - calls = mock.calls.DeleteUserPermission - mock.lockDeleteUserPermission.RUnlock() - return calls -} - -// DisableAllCredentialsByType calls DisableAllCredentialsByTypeFunc. -func (mock *GoCloakMock) DisableAllCredentialsByType(ctx context.Context, token string, realm string, userID string, types []string) error { - if mock.DisableAllCredentialsByTypeFunc == nil { - panic("GoCloakMock.DisableAllCredentialsByTypeFunc: method is nil but GoCloak.DisableAllCredentialsByType was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - Types []string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - Types: types, - } - mock.lockDisableAllCredentialsByType.Lock() - mock.calls.DisableAllCredentialsByType = append(mock.calls.DisableAllCredentialsByType, callInfo) - mock.lockDisableAllCredentialsByType.Unlock() - return mock.DisableAllCredentialsByTypeFunc(ctx, token, realm, userID, types) -} - -// DisableAllCredentialsByTypeCalls gets all the calls that were made to DisableAllCredentialsByType. -// Check the length with: -// -// len(mockedGoCloak.DisableAllCredentialsByTypeCalls()) -func (mock *GoCloakMock) DisableAllCredentialsByTypeCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - Types []string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - Types []string - } - mock.lockDisableAllCredentialsByType.RLock() - calls = mock.calls.DisableAllCredentialsByType - mock.lockDisableAllCredentialsByType.RUnlock() - return calls -} - -// ExecuteActionsEmail calls ExecuteActionsEmailFunc. -func (mock *GoCloakMock) ExecuteActionsEmail(ctx context.Context, token string, realm string, params gocloak.ExecuteActionsEmail) error { - if mock.ExecuteActionsEmailFunc == nil { - panic("GoCloakMock.ExecuteActionsEmailFunc: method is nil but GoCloak.ExecuteActionsEmail was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Params gocloak.ExecuteActionsEmail - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Params: params, - } - mock.lockExecuteActionsEmail.Lock() - mock.calls.ExecuteActionsEmail = append(mock.calls.ExecuteActionsEmail, callInfo) - mock.lockExecuteActionsEmail.Unlock() - return mock.ExecuteActionsEmailFunc(ctx, token, realm, params) -} - -// ExecuteActionsEmailCalls gets all the calls that were made to ExecuteActionsEmail. -// Check the length with: -// -// len(mockedGoCloak.ExecuteActionsEmailCalls()) -func (mock *GoCloakMock) ExecuteActionsEmailCalls() []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.ExecuteActionsEmail -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.ExecuteActionsEmail - } - mock.lockExecuteActionsEmail.RLock() - calls = mock.calls.ExecuteActionsEmail - mock.lockExecuteActionsEmail.RUnlock() - return calls -} - -// ExportIDPPublicBrokerConfig calls ExportIDPPublicBrokerConfigFunc. -func (mock *GoCloakMock) ExportIDPPublicBrokerConfig(ctx context.Context, token string, realm string, alias string) (*string, error) { - if mock.ExportIDPPublicBrokerConfigFunc == nil { - panic("GoCloakMock.ExportIDPPublicBrokerConfigFunc: method is nil but GoCloak.ExportIDPPublicBrokerConfig was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Alias string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Alias: alias, - } - mock.lockExportIDPPublicBrokerConfig.Lock() - mock.calls.ExportIDPPublicBrokerConfig = append(mock.calls.ExportIDPPublicBrokerConfig, callInfo) - mock.lockExportIDPPublicBrokerConfig.Unlock() - return mock.ExportIDPPublicBrokerConfigFunc(ctx, token, realm, alias) -} - -// ExportIDPPublicBrokerConfigCalls gets all the calls that were made to ExportIDPPublicBrokerConfig. -// Check the length with: -// -// len(mockedGoCloak.ExportIDPPublicBrokerConfigCalls()) -func (mock *GoCloakMock) ExportIDPPublicBrokerConfigCalls() []struct { - Ctx context.Context - Token string - Realm string - Alias string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Alias string - } - mock.lockExportIDPPublicBrokerConfig.RLock() - calls = mock.calls.ExportIDPPublicBrokerConfig - mock.lockExportIDPPublicBrokerConfig.RUnlock() - return calls -} - -// GetAdapterConfiguration calls GetAdapterConfigurationFunc. -func (mock *GoCloakMock) GetAdapterConfiguration(ctx context.Context, accessToken string, realm string, clientID string) (*gocloak.AdapterConfiguration, error) { - if mock.GetAdapterConfigurationFunc == nil { - panic("GoCloakMock.GetAdapterConfigurationFunc: method is nil but GoCloak.GetAdapterConfiguration was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - ClientID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - ClientID: clientID, - } - mock.lockGetAdapterConfiguration.Lock() - mock.calls.GetAdapterConfiguration = append(mock.calls.GetAdapterConfiguration, callInfo) - mock.lockGetAdapterConfiguration.Unlock() - return mock.GetAdapterConfigurationFunc(ctx, accessToken, realm, clientID) -} - -// GetAdapterConfigurationCalls gets all the calls that were made to GetAdapterConfiguration. -// Check the length with: -// -// len(mockedGoCloak.GetAdapterConfigurationCalls()) -func (mock *GoCloakMock) GetAdapterConfigurationCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - ClientID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - ClientID string - } - mock.lockGetAdapterConfiguration.RLock() - calls = mock.calls.GetAdapterConfiguration - mock.lockGetAdapterConfiguration.RUnlock() - return calls -} - -// GetAuthenticationExecutions calls GetAuthenticationExecutionsFunc. -func (mock *GoCloakMock) GetAuthenticationExecutions(ctx context.Context, token string, realm string, flow string) ([]*gocloak.ModifyAuthenticationExecutionRepresentation, error) { - if mock.GetAuthenticationExecutionsFunc == nil { - panic("GoCloakMock.GetAuthenticationExecutionsFunc: method is nil but GoCloak.GetAuthenticationExecutions was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Flow string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Flow: flow, - } - mock.lockGetAuthenticationExecutions.Lock() - mock.calls.GetAuthenticationExecutions = append(mock.calls.GetAuthenticationExecutions, callInfo) - mock.lockGetAuthenticationExecutions.Unlock() - return mock.GetAuthenticationExecutionsFunc(ctx, token, realm, flow) -} - -// GetAuthenticationExecutionsCalls gets all the calls that were made to GetAuthenticationExecutions. -// Check the length with: -// -// len(mockedGoCloak.GetAuthenticationExecutionsCalls()) -func (mock *GoCloakMock) GetAuthenticationExecutionsCalls() []struct { - Ctx context.Context - Token string - Realm string - Flow string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Flow string - } - mock.lockGetAuthenticationExecutions.RLock() - calls = mock.calls.GetAuthenticationExecutions - mock.lockGetAuthenticationExecutions.RUnlock() - return calls -} - -// GetAuthenticationFlows calls GetAuthenticationFlowsFunc. -func (mock *GoCloakMock) GetAuthenticationFlows(ctx context.Context, token string, realm string) ([]*gocloak.AuthenticationFlowRepresentation, error) { - if mock.GetAuthenticationFlowsFunc == nil { - panic("GoCloakMock.GetAuthenticationFlowsFunc: method is nil but GoCloak.GetAuthenticationFlows was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockGetAuthenticationFlows.Lock() - mock.calls.GetAuthenticationFlows = append(mock.calls.GetAuthenticationFlows, callInfo) - mock.lockGetAuthenticationFlows.Unlock() - return mock.GetAuthenticationFlowsFunc(ctx, token, realm) -} - -// GetAuthenticationFlowsCalls gets all the calls that were made to GetAuthenticationFlows. -// Check the length with: -// -// len(mockedGoCloak.GetAuthenticationFlowsCalls()) -func (mock *GoCloakMock) GetAuthenticationFlowsCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockGetAuthenticationFlows.RLock() - calls = mock.calls.GetAuthenticationFlows - mock.lockGetAuthenticationFlows.RUnlock() - return calls -} - -// GetAuthorizationPolicyAssociatedPolicies calls GetAuthorizationPolicyAssociatedPoliciesFunc. -func (mock *GoCloakMock) GetAuthorizationPolicyAssociatedPolicies(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PolicyRepresentation, error) { - if mock.GetAuthorizationPolicyAssociatedPoliciesFunc == nil { - panic("GoCloakMock.GetAuthorizationPolicyAssociatedPoliciesFunc: method is nil but GoCloak.GetAuthorizationPolicyAssociatedPolicies was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - PolicyID: policyID, - } - mock.lockGetAuthorizationPolicyAssociatedPolicies.Lock() - mock.calls.GetAuthorizationPolicyAssociatedPolicies = append(mock.calls.GetAuthorizationPolicyAssociatedPolicies, callInfo) - mock.lockGetAuthorizationPolicyAssociatedPolicies.Unlock() - return mock.GetAuthorizationPolicyAssociatedPoliciesFunc(ctx, token, realm, idOfClient, policyID) -} - -// GetAuthorizationPolicyAssociatedPoliciesCalls gets all the calls that were made to GetAuthorizationPolicyAssociatedPolicies. -// Check the length with: -// -// len(mockedGoCloak.GetAuthorizationPolicyAssociatedPoliciesCalls()) -func (mock *GoCloakMock) GetAuthorizationPolicyAssociatedPoliciesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - } - mock.lockGetAuthorizationPolicyAssociatedPolicies.RLock() - calls = mock.calls.GetAuthorizationPolicyAssociatedPolicies - mock.lockGetAuthorizationPolicyAssociatedPolicies.RUnlock() - return calls -} - -// GetAuthorizationPolicyResources calls GetAuthorizationPolicyResourcesFunc. -func (mock *GoCloakMock) GetAuthorizationPolicyResources(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PolicyResourceRepresentation, error) { - if mock.GetAuthorizationPolicyResourcesFunc == nil { - panic("GoCloakMock.GetAuthorizationPolicyResourcesFunc: method is nil but GoCloak.GetAuthorizationPolicyResources was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - PolicyID: policyID, - } - mock.lockGetAuthorizationPolicyResources.Lock() - mock.calls.GetAuthorizationPolicyResources = append(mock.calls.GetAuthorizationPolicyResources, callInfo) - mock.lockGetAuthorizationPolicyResources.Unlock() - return mock.GetAuthorizationPolicyResourcesFunc(ctx, token, realm, idOfClient, policyID) -} - -// GetAuthorizationPolicyResourcesCalls gets all the calls that were made to GetAuthorizationPolicyResources. -// Check the length with: -// -// len(mockedGoCloak.GetAuthorizationPolicyResourcesCalls()) -func (mock *GoCloakMock) GetAuthorizationPolicyResourcesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - } - mock.lockGetAuthorizationPolicyResources.RLock() - calls = mock.calls.GetAuthorizationPolicyResources - mock.lockGetAuthorizationPolicyResources.RUnlock() - return calls -} - -// GetAuthorizationPolicyScopes calls GetAuthorizationPolicyScopesFunc. -func (mock *GoCloakMock) GetAuthorizationPolicyScopes(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PolicyScopeRepresentation, error) { - if mock.GetAuthorizationPolicyScopesFunc == nil { - panic("GoCloakMock.GetAuthorizationPolicyScopesFunc: method is nil but GoCloak.GetAuthorizationPolicyScopes was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - PolicyID: policyID, - } - mock.lockGetAuthorizationPolicyScopes.Lock() - mock.calls.GetAuthorizationPolicyScopes = append(mock.calls.GetAuthorizationPolicyScopes, callInfo) - mock.lockGetAuthorizationPolicyScopes.Unlock() - return mock.GetAuthorizationPolicyScopesFunc(ctx, token, realm, idOfClient, policyID) -} - -// GetAuthorizationPolicyScopesCalls gets all the calls that were made to GetAuthorizationPolicyScopes. -// Check the length with: -// -// len(mockedGoCloak.GetAuthorizationPolicyScopesCalls()) -func (mock *GoCloakMock) GetAuthorizationPolicyScopesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - } - mock.lockGetAuthorizationPolicyScopes.RLock() - calls = mock.calls.GetAuthorizationPolicyScopes - mock.lockGetAuthorizationPolicyScopes.RUnlock() - return calls -} - -// GetAvailableClientRolesByGroupID calls GetAvailableClientRolesByGroupIDFunc. -func (mock *GoCloakMock) GetAvailableClientRolesByGroupID(ctx context.Context, token string, realm string, idOfClient string, groupID string) ([]*gocloak.Role, error) { - if mock.GetAvailableClientRolesByGroupIDFunc == nil { - panic("GoCloakMock.GetAvailableClientRolesByGroupIDFunc: method is nil but GoCloak.GetAvailableClientRolesByGroupID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - GroupID: groupID, - } - mock.lockGetAvailableClientRolesByGroupID.Lock() - mock.calls.GetAvailableClientRolesByGroupID = append(mock.calls.GetAvailableClientRolesByGroupID, callInfo) - mock.lockGetAvailableClientRolesByGroupID.Unlock() - return mock.GetAvailableClientRolesByGroupIDFunc(ctx, token, realm, idOfClient, groupID) -} - -// GetAvailableClientRolesByGroupIDCalls gets all the calls that were made to GetAvailableClientRolesByGroupID. -// Check the length with: -// -// len(mockedGoCloak.GetAvailableClientRolesByGroupIDCalls()) -func (mock *GoCloakMock) GetAvailableClientRolesByGroupIDCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - } - mock.lockGetAvailableClientRolesByGroupID.RLock() - calls = mock.calls.GetAvailableClientRolesByGroupID - mock.lockGetAvailableClientRolesByGroupID.RUnlock() - return calls -} - -// GetAvailableClientRolesByUserID calls GetAvailableClientRolesByUserIDFunc. -func (mock *GoCloakMock) GetAvailableClientRolesByUserID(ctx context.Context, token string, realm string, idOfClient string, userID string) ([]*gocloak.Role, error) { - if mock.GetAvailableClientRolesByUserIDFunc == nil { - panic("GoCloakMock.GetAvailableClientRolesByUserIDFunc: method is nil but GoCloak.GetAvailableClientRolesByUserID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - UserID: userID, - } - mock.lockGetAvailableClientRolesByUserID.Lock() - mock.calls.GetAvailableClientRolesByUserID = append(mock.calls.GetAvailableClientRolesByUserID, callInfo) - mock.lockGetAvailableClientRolesByUserID.Unlock() - return mock.GetAvailableClientRolesByUserIDFunc(ctx, token, realm, idOfClient, userID) -} - -// GetAvailableClientRolesByUserIDCalls gets all the calls that were made to GetAvailableClientRolesByUserID. -// Check the length with: -// -// len(mockedGoCloak.GetAvailableClientRolesByUserIDCalls()) -func (mock *GoCloakMock) GetAvailableClientRolesByUserIDCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - } - mock.lockGetAvailableClientRolesByUserID.RLock() - calls = mock.calls.GetAvailableClientRolesByUserID - mock.lockGetAvailableClientRolesByUserID.RUnlock() - return calls -} - -// GetAvailableRealmRolesByGroupID calls GetAvailableRealmRolesByGroupIDFunc. -func (mock *GoCloakMock) GetAvailableRealmRolesByGroupID(ctx context.Context, token string, realm string, groupID string) ([]*gocloak.Role, error) { - if mock.GetAvailableRealmRolesByGroupIDFunc == nil { - panic("GoCloakMock.GetAvailableRealmRolesByGroupIDFunc: method is nil but GoCloak.GetAvailableRealmRolesByGroupID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - GroupID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - GroupID: groupID, - } - mock.lockGetAvailableRealmRolesByGroupID.Lock() - mock.calls.GetAvailableRealmRolesByGroupID = append(mock.calls.GetAvailableRealmRolesByGroupID, callInfo) - mock.lockGetAvailableRealmRolesByGroupID.Unlock() - return mock.GetAvailableRealmRolesByGroupIDFunc(ctx, token, realm, groupID) -} - -// GetAvailableRealmRolesByGroupIDCalls gets all the calls that were made to GetAvailableRealmRolesByGroupID. -// Check the length with: -// -// len(mockedGoCloak.GetAvailableRealmRolesByGroupIDCalls()) -func (mock *GoCloakMock) GetAvailableRealmRolesByGroupIDCalls() []struct { - Ctx context.Context - Token string - Realm string - GroupID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - GroupID string - } - mock.lockGetAvailableRealmRolesByGroupID.RLock() - calls = mock.calls.GetAvailableRealmRolesByGroupID - mock.lockGetAvailableRealmRolesByGroupID.RUnlock() - return calls -} - -// GetAvailableRealmRolesByUserID calls GetAvailableRealmRolesByUserIDFunc. -func (mock *GoCloakMock) GetAvailableRealmRolesByUserID(ctx context.Context, token string, realm string, userID string) ([]*gocloak.Role, error) { - if mock.GetAvailableRealmRolesByUserIDFunc == nil { - panic("GoCloakMock.GetAvailableRealmRolesByUserIDFunc: method is nil but GoCloak.GetAvailableRealmRolesByUserID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - } - mock.lockGetAvailableRealmRolesByUserID.Lock() - mock.calls.GetAvailableRealmRolesByUserID = append(mock.calls.GetAvailableRealmRolesByUserID, callInfo) - mock.lockGetAvailableRealmRolesByUserID.Unlock() - return mock.GetAvailableRealmRolesByUserIDFunc(ctx, token, realm, userID) -} - -// GetAvailableRealmRolesByUserIDCalls gets all the calls that were made to GetAvailableRealmRolesByUserID. -// Check the length with: -// -// len(mockedGoCloak.GetAvailableRealmRolesByUserIDCalls()) -func (mock *GoCloakMock) GetAvailableRealmRolesByUserIDCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - } - mock.lockGetAvailableRealmRolesByUserID.RLock() - calls = mock.calls.GetAvailableRealmRolesByUserID - mock.lockGetAvailableRealmRolesByUserID.RUnlock() - return calls -} - -// GetCerts calls GetCertsFunc. -func (mock *GoCloakMock) GetCerts(ctx context.Context, realm string) (*gocloak.CertResponse, error) { - if mock.GetCertsFunc == nil { - panic("GoCloakMock.GetCertsFunc: method is nil but GoCloak.GetCerts was just called") - } - callInfo := struct { - Ctx context.Context - Realm string - }{ - Ctx: ctx, - Realm: realm, - } - mock.lockGetCerts.Lock() - mock.calls.GetCerts = append(mock.calls.GetCerts, callInfo) - mock.lockGetCerts.Unlock() - return mock.GetCertsFunc(ctx, realm) -} - -// GetCertsCalls gets all the calls that were made to GetCerts. -// Check the length with: -// -// len(mockedGoCloak.GetCertsCalls()) -func (mock *GoCloakMock) GetCertsCalls() []struct { - Ctx context.Context - Realm string -} { - var calls []struct { - Ctx context.Context - Realm string - } - mock.lockGetCerts.RLock() - calls = mock.calls.GetCerts - mock.lockGetCerts.RUnlock() - return calls -} - -// GetClient calls GetClientFunc. -func (mock *GoCloakMock) GetClient(ctx context.Context, accessToken string, realm string, idOfClient string) (*gocloak.Client, error) { - if mock.GetClientFunc == nil { - panic("GoCloakMock.GetClientFunc: method is nil but GoCloak.GetClient was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockGetClient.Lock() - mock.calls.GetClient = append(mock.calls.GetClient, callInfo) - mock.lockGetClient.Unlock() - return mock.GetClientFunc(ctx, accessToken, realm, idOfClient) -} - -// GetClientCalls gets all the calls that were made to GetClient. -// Check the length with: -// -// len(mockedGoCloak.GetClientCalls()) -func (mock *GoCloakMock) GetClientCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - } - mock.lockGetClient.RLock() - calls = mock.calls.GetClient - mock.lockGetClient.RUnlock() - return calls -} - -// GetClientOfflineSessions calls GetClientOfflineSessionsFunc. -func (mock *GoCloakMock) GetClientOfflineSessions(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.UserSessionRepresentation, error) { - if mock.GetClientOfflineSessionsFunc == nil { - panic("GoCloakMock.GetClientOfflineSessionsFunc: method is nil but GoCloak.GetClientOfflineSessions was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockGetClientOfflineSessions.Lock() - mock.calls.GetClientOfflineSessions = append(mock.calls.GetClientOfflineSessions, callInfo) - mock.lockGetClientOfflineSessions.Unlock() - return mock.GetClientOfflineSessionsFunc(ctx, token, realm, idOfClient) -} - -// GetClientOfflineSessionsCalls gets all the calls that were made to GetClientOfflineSessions. -// Check the length with: -// -// len(mockedGoCloak.GetClientOfflineSessionsCalls()) -func (mock *GoCloakMock) GetClientOfflineSessionsCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - } - mock.lockGetClientOfflineSessions.RLock() - calls = mock.calls.GetClientOfflineSessions - mock.lockGetClientOfflineSessions.RUnlock() - return calls -} - -// GetClientRepresentation calls GetClientRepresentationFunc. -func (mock *GoCloakMock) GetClientRepresentation(ctx context.Context, accessToken string, realm string, clientID string) (*gocloak.Client, error) { - if mock.GetClientRepresentationFunc == nil { - panic("GoCloakMock.GetClientRepresentationFunc: method is nil but GoCloak.GetClientRepresentation was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - ClientID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - ClientID: clientID, - } - mock.lockGetClientRepresentation.Lock() - mock.calls.GetClientRepresentation = append(mock.calls.GetClientRepresentation, callInfo) - mock.lockGetClientRepresentation.Unlock() - return mock.GetClientRepresentationFunc(ctx, accessToken, realm, clientID) -} - -// GetClientRepresentationCalls gets all the calls that were made to GetClientRepresentation. -// Check the length with: -// -// len(mockedGoCloak.GetClientRepresentationCalls()) -func (mock *GoCloakMock) GetClientRepresentationCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - ClientID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - ClientID string - } - mock.lockGetClientRepresentation.RLock() - calls = mock.calls.GetClientRepresentation - mock.lockGetClientRepresentation.RUnlock() - return calls -} - -// GetClientRole calls GetClientRoleFunc. -func (mock *GoCloakMock) GetClientRole(ctx context.Context, token string, realm string, idOfClient string, roleName string) (*gocloak.Role, error) { - if mock.GetClientRoleFunc == nil { - panic("GoCloakMock.GetClientRoleFunc: method is nil but GoCloak.GetClientRole was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - RoleName string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - RoleName: roleName, - } - mock.lockGetClientRole.Lock() - mock.calls.GetClientRole = append(mock.calls.GetClientRole, callInfo) - mock.lockGetClientRole.Unlock() - return mock.GetClientRoleFunc(ctx, token, realm, idOfClient, roleName) -} - -// GetClientRoleCalls gets all the calls that were made to GetClientRole. -// Check the length with: -// -// len(mockedGoCloak.GetClientRoleCalls()) -func (mock *GoCloakMock) GetClientRoleCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - RoleName string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - RoleName string - } - mock.lockGetClientRole.RLock() - calls = mock.calls.GetClientRole - mock.lockGetClientRole.RUnlock() - return calls -} - -// GetClientRoleByID calls GetClientRoleByIDFunc. -func (mock *GoCloakMock) GetClientRoleByID(ctx context.Context, accessToken string, realm string, roleID string) (*gocloak.Role, error) { - if mock.GetClientRoleByIDFunc == nil { - panic("GoCloakMock.GetClientRoleByIDFunc: method is nil but GoCloak.GetClientRoleByID was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - RoleID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - RoleID: roleID, - } - mock.lockGetClientRoleByID.Lock() - mock.calls.GetClientRoleByID = append(mock.calls.GetClientRoleByID, callInfo) - mock.lockGetClientRoleByID.Unlock() - return mock.GetClientRoleByIDFunc(ctx, accessToken, realm, roleID) -} - -// GetClientRoleByIDCalls gets all the calls that were made to GetClientRoleByID. -// Check the length with: -// -// len(mockedGoCloak.GetClientRoleByIDCalls()) -func (mock *GoCloakMock) GetClientRoleByIDCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - RoleID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - RoleID string - } - mock.lockGetClientRoleByID.RLock() - calls = mock.calls.GetClientRoleByID - mock.lockGetClientRoleByID.RUnlock() - return calls -} - -// GetClientRoles calls GetClientRolesFunc. -func (mock *GoCloakMock) GetClientRoles(ctx context.Context, accessToken string, realm string, idOfClient string, params gocloak.GetRoleParams) ([]*gocloak.Role, error) { - if mock.GetClientRolesFunc == nil { - panic("GoCloakMock.GetClientRolesFunc: method is nil but GoCloak.GetClientRoles was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - Params gocloak.GetRoleParams - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - IdOfClient: idOfClient, - Params: params, - } - mock.lockGetClientRoles.Lock() - mock.calls.GetClientRoles = append(mock.calls.GetClientRoles, callInfo) - mock.lockGetClientRoles.Unlock() - return mock.GetClientRolesFunc(ctx, accessToken, realm, idOfClient, params) -} - -// GetClientRolesCalls gets all the calls that were made to GetClientRoles. -// Check the length with: -// -// len(mockedGoCloak.GetClientRolesCalls()) -func (mock *GoCloakMock) GetClientRolesCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - Params gocloak.GetRoleParams -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - Params gocloak.GetRoleParams - } - mock.lockGetClientRoles.RLock() - calls = mock.calls.GetClientRoles - mock.lockGetClientRoles.RUnlock() - return calls -} - -// GetClientRolesByGroupID calls GetClientRolesByGroupIDFunc. -func (mock *GoCloakMock) GetClientRolesByGroupID(ctx context.Context, token string, realm string, idOfClient string, groupID string) ([]*gocloak.Role, error) { - if mock.GetClientRolesByGroupIDFunc == nil { - panic("GoCloakMock.GetClientRolesByGroupIDFunc: method is nil but GoCloak.GetClientRolesByGroupID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - GroupID: groupID, - } - mock.lockGetClientRolesByGroupID.Lock() - mock.calls.GetClientRolesByGroupID = append(mock.calls.GetClientRolesByGroupID, callInfo) - mock.lockGetClientRolesByGroupID.Unlock() - return mock.GetClientRolesByGroupIDFunc(ctx, token, realm, idOfClient, groupID) -} - -// GetClientRolesByGroupIDCalls gets all the calls that were made to GetClientRolesByGroupID. -// Check the length with: -// -// len(mockedGoCloak.GetClientRolesByGroupIDCalls()) -func (mock *GoCloakMock) GetClientRolesByGroupIDCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - } - mock.lockGetClientRolesByGroupID.RLock() - calls = mock.calls.GetClientRolesByGroupID - mock.lockGetClientRolesByGroupID.RUnlock() - return calls -} - -// GetClientRolesByUserID calls GetClientRolesByUserIDFunc. -func (mock *GoCloakMock) GetClientRolesByUserID(ctx context.Context, token string, realm string, idOfClient string, userID string) ([]*gocloak.Role, error) { - if mock.GetClientRolesByUserIDFunc == nil { - panic("GoCloakMock.GetClientRolesByUserIDFunc: method is nil but GoCloak.GetClientRolesByUserID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - UserID: userID, - } - mock.lockGetClientRolesByUserID.Lock() - mock.calls.GetClientRolesByUserID = append(mock.calls.GetClientRolesByUserID, callInfo) - mock.lockGetClientRolesByUserID.Unlock() - return mock.GetClientRolesByUserIDFunc(ctx, token, realm, idOfClient, userID) -} - -// GetClientRolesByUserIDCalls gets all the calls that were made to GetClientRolesByUserID. -// Check the length with: -// -// len(mockedGoCloak.GetClientRolesByUserIDCalls()) -func (mock *GoCloakMock) GetClientRolesByUserIDCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - } - mock.lockGetClientRolesByUserID.RLock() - calls = mock.calls.GetClientRolesByUserID - mock.lockGetClientRolesByUserID.RUnlock() - return calls -} - -// GetClientScope calls GetClientScopeFunc. -func (mock *GoCloakMock) GetClientScope(ctx context.Context, token string, realm string, scopeID string) (*gocloak.ClientScope, error) { - if mock.GetClientScopeFunc == nil { - panic("GoCloakMock.GetClientScopeFunc: method is nil but GoCloak.GetClientScope was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - ScopeID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - ScopeID: scopeID, - } - mock.lockGetClientScope.Lock() - mock.calls.GetClientScope = append(mock.calls.GetClientScope, callInfo) - mock.lockGetClientScope.Unlock() - return mock.GetClientScopeFunc(ctx, token, realm, scopeID) -} - -// GetClientScopeCalls gets all the calls that were made to GetClientScope. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopeCalls()) -func (mock *GoCloakMock) GetClientScopeCalls() []struct { - Ctx context.Context - Token string - Realm string - ScopeID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - ScopeID string - } - mock.lockGetClientScope.RLock() - calls = mock.calls.GetClientScope - mock.lockGetClientScope.RUnlock() - return calls -} - -// GetClientScopeMappings calls GetClientScopeMappingsFunc. -func (mock *GoCloakMock) GetClientScopeMappings(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.MappingsRepresentation, error) { - if mock.GetClientScopeMappingsFunc == nil { - panic("GoCloakMock.GetClientScopeMappingsFunc: method is nil but GoCloak.GetClientScopeMappings was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockGetClientScopeMappings.Lock() - mock.calls.GetClientScopeMappings = append(mock.calls.GetClientScopeMappings, callInfo) - mock.lockGetClientScopeMappings.Unlock() - return mock.GetClientScopeMappingsFunc(ctx, token, realm, idOfClient) -} - -// GetClientScopeMappingsCalls gets all the calls that were made to GetClientScopeMappings. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopeMappingsCalls()) -func (mock *GoCloakMock) GetClientScopeMappingsCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - } - mock.lockGetClientScopeMappings.RLock() - calls = mock.calls.GetClientScopeMappings - mock.lockGetClientScopeMappings.RUnlock() - return calls -} - -// GetClientScopeMappingsClientRoles calls GetClientScopeMappingsClientRolesFunc. -func (mock *GoCloakMock) GetClientScopeMappingsClientRoles(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string) ([]*gocloak.Role, error) { - if mock.GetClientScopeMappingsClientRolesFunc == nil { - panic("GoCloakMock.GetClientScopeMappingsClientRolesFunc: method is nil but GoCloak.GetClientScopeMappingsClientRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - IdOfSelectedClient: idOfSelectedClient, - } - mock.lockGetClientScopeMappingsClientRoles.Lock() - mock.calls.GetClientScopeMappingsClientRoles = append(mock.calls.GetClientScopeMappingsClientRoles, callInfo) - mock.lockGetClientScopeMappingsClientRoles.Unlock() - return mock.GetClientScopeMappingsClientRolesFunc(ctx, token, realm, idOfClient, idOfSelectedClient) -} - -// GetClientScopeMappingsClientRolesCalls gets all the calls that were made to GetClientScopeMappingsClientRoles. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopeMappingsClientRolesCalls()) -func (mock *GoCloakMock) GetClientScopeMappingsClientRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string - } - mock.lockGetClientScopeMappingsClientRoles.RLock() - calls = mock.calls.GetClientScopeMappingsClientRoles - mock.lockGetClientScopeMappingsClientRoles.RUnlock() - return calls -} - -// GetClientScopeMappingsClientRolesAvailable calls GetClientScopeMappingsClientRolesAvailableFunc. -func (mock *GoCloakMock) GetClientScopeMappingsClientRolesAvailable(ctx context.Context, token string, realm string, idOfClient string, idOfSelectedClient string) ([]*gocloak.Role, error) { - if mock.GetClientScopeMappingsClientRolesAvailableFunc == nil { - panic("GoCloakMock.GetClientScopeMappingsClientRolesAvailableFunc: method is nil but GoCloak.GetClientScopeMappingsClientRolesAvailable was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - IdOfSelectedClient: idOfSelectedClient, - } - mock.lockGetClientScopeMappingsClientRolesAvailable.Lock() - mock.calls.GetClientScopeMappingsClientRolesAvailable = append(mock.calls.GetClientScopeMappingsClientRolesAvailable, callInfo) - mock.lockGetClientScopeMappingsClientRolesAvailable.Unlock() - return mock.GetClientScopeMappingsClientRolesAvailableFunc(ctx, token, realm, idOfClient, idOfSelectedClient) -} - -// GetClientScopeMappingsClientRolesAvailableCalls gets all the calls that were made to GetClientScopeMappingsClientRolesAvailable. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopeMappingsClientRolesAvailableCalls()) -func (mock *GoCloakMock) GetClientScopeMappingsClientRolesAvailableCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - IdOfSelectedClient string - } - mock.lockGetClientScopeMappingsClientRolesAvailable.RLock() - calls = mock.calls.GetClientScopeMappingsClientRolesAvailable - mock.lockGetClientScopeMappingsClientRolesAvailable.RUnlock() - return calls -} - -// GetClientScopeMappingsRealmRoles calls GetClientScopeMappingsRealmRolesFunc. -func (mock *GoCloakMock) GetClientScopeMappingsRealmRoles(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.Role, error) { - if mock.GetClientScopeMappingsRealmRolesFunc == nil { - panic("GoCloakMock.GetClientScopeMappingsRealmRolesFunc: method is nil but GoCloak.GetClientScopeMappingsRealmRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockGetClientScopeMappingsRealmRoles.Lock() - mock.calls.GetClientScopeMappingsRealmRoles = append(mock.calls.GetClientScopeMappingsRealmRoles, callInfo) - mock.lockGetClientScopeMappingsRealmRoles.Unlock() - return mock.GetClientScopeMappingsRealmRolesFunc(ctx, token, realm, idOfClient) -} - -// GetClientScopeMappingsRealmRolesCalls gets all the calls that were made to GetClientScopeMappingsRealmRoles. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopeMappingsRealmRolesCalls()) -func (mock *GoCloakMock) GetClientScopeMappingsRealmRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - } - mock.lockGetClientScopeMappingsRealmRoles.RLock() - calls = mock.calls.GetClientScopeMappingsRealmRoles - mock.lockGetClientScopeMappingsRealmRoles.RUnlock() - return calls -} - -// GetClientScopeMappingsRealmRolesAvailable calls GetClientScopeMappingsRealmRolesAvailableFunc. -func (mock *GoCloakMock) GetClientScopeMappingsRealmRolesAvailable(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.Role, error) { - if mock.GetClientScopeMappingsRealmRolesAvailableFunc == nil { - panic("GoCloakMock.GetClientScopeMappingsRealmRolesAvailableFunc: method is nil but GoCloak.GetClientScopeMappingsRealmRolesAvailable was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockGetClientScopeMappingsRealmRolesAvailable.Lock() - mock.calls.GetClientScopeMappingsRealmRolesAvailable = append(mock.calls.GetClientScopeMappingsRealmRolesAvailable, callInfo) - mock.lockGetClientScopeMappingsRealmRolesAvailable.Unlock() - return mock.GetClientScopeMappingsRealmRolesAvailableFunc(ctx, token, realm, idOfClient) -} - -// GetClientScopeMappingsRealmRolesAvailableCalls gets all the calls that were made to GetClientScopeMappingsRealmRolesAvailable. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopeMappingsRealmRolesAvailableCalls()) -func (mock *GoCloakMock) GetClientScopeMappingsRealmRolesAvailableCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - } - mock.lockGetClientScopeMappingsRealmRolesAvailable.RLock() - calls = mock.calls.GetClientScopeMappingsRealmRolesAvailable - mock.lockGetClientScopeMappingsRealmRolesAvailable.RUnlock() - return calls -} - -// GetClientScopeProtocolMapper calls GetClientScopeProtocolMapperFunc. -func (mock *GoCloakMock) GetClientScopeProtocolMapper(ctx context.Context, token string, realm string, scopeID string, protocolMapperID string) (*gocloak.ProtocolMappers, error) { - if mock.GetClientScopeProtocolMapperFunc == nil { - panic("GoCloakMock.GetClientScopeProtocolMapperFunc: method is nil but GoCloak.GetClientScopeProtocolMapper was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - ScopeID string - ProtocolMapperID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - ScopeID: scopeID, - ProtocolMapperID: protocolMapperID, - } - mock.lockGetClientScopeProtocolMapper.Lock() - mock.calls.GetClientScopeProtocolMapper = append(mock.calls.GetClientScopeProtocolMapper, callInfo) - mock.lockGetClientScopeProtocolMapper.Unlock() - return mock.GetClientScopeProtocolMapperFunc(ctx, token, realm, scopeID, protocolMapperID) -} - -// GetClientScopeProtocolMapperCalls gets all the calls that were made to GetClientScopeProtocolMapper. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopeProtocolMapperCalls()) -func (mock *GoCloakMock) GetClientScopeProtocolMapperCalls() []struct { - Ctx context.Context - Token string - Realm string - ScopeID string - ProtocolMapperID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - ScopeID string - ProtocolMapperID string - } - mock.lockGetClientScopeProtocolMapper.RLock() - calls = mock.calls.GetClientScopeProtocolMapper - mock.lockGetClientScopeProtocolMapper.RUnlock() - return calls -} - -// GetClientScopeProtocolMappers calls GetClientScopeProtocolMappersFunc. -func (mock *GoCloakMock) GetClientScopeProtocolMappers(ctx context.Context, token string, realm string, scopeID string) ([]*gocloak.ProtocolMappers, error) { - if mock.GetClientScopeProtocolMappersFunc == nil { - panic("GoCloakMock.GetClientScopeProtocolMappersFunc: method is nil but GoCloak.GetClientScopeProtocolMappers was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - ScopeID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - ScopeID: scopeID, - } - mock.lockGetClientScopeProtocolMappers.Lock() - mock.calls.GetClientScopeProtocolMappers = append(mock.calls.GetClientScopeProtocolMappers, callInfo) - mock.lockGetClientScopeProtocolMappers.Unlock() - return mock.GetClientScopeProtocolMappersFunc(ctx, token, realm, scopeID) -} - -// GetClientScopeProtocolMappersCalls gets all the calls that were made to GetClientScopeProtocolMappers. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopeProtocolMappersCalls()) -func (mock *GoCloakMock) GetClientScopeProtocolMappersCalls() []struct { - Ctx context.Context - Token string - Realm string - ScopeID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - ScopeID string - } - mock.lockGetClientScopeProtocolMappers.RLock() - calls = mock.calls.GetClientScopeProtocolMappers - mock.lockGetClientScopeProtocolMappers.RUnlock() - return calls -} - -// GetClientScopes calls GetClientScopesFunc. -func (mock *GoCloakMock) GetClientScopes(ctx context.Context, token string, realm string) ([]*gocloak.ClientScope, error) { - if mock.GetClientScopesFunc == nil { - panic("GoCloakMock.GetClientScopesFunc: method is nil but GoCloak.GetClientScopes was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockGetClientScopes.Lock() - mock.calls.GetClientScopes = append(mock.calls.GetClientScopes, callInfo) - mock.lockGetClientScopes.Unlock() - return mock.GetClientScopesFunc(ctx, token, realm) -} - -// GetClientScopesCalls gets all the calls that were made to GetClientScopes. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopesCalls()) -func (mock *GoCloakMock) GetClientScopesCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockGetClientScopes.RLock() - calls = mock.calls.GetClientScopes - mock.lockGetClientScopes.RUnlock() - return calls -} - -// GetClientScopesScopeMappingsClientRoles calls GetClientScopesScopeMappingsClientRolesFunc. -func (mock *GoCloakMock) GetClientScopesScopeMappingsClientRoles(ctx context.Context, token string, realm string, idOfClientScope string, idOfClient string) ([]*gocloak.Role, error) { - if mock.GetClientScopesScopeMappingsClientRolesFunc == nil { - panic("GoCloakMock.GetClientScopesScopeMappingsClientRolesFunc: method is nil but GoCloak.GetClientScopesScopeMappingsClientRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClientScope: idOfClientScope, - IdOfClient: idOfClient, - } - mock.lockGetClientScopesScopeMappingsClientRoles.Lock() - mock.calls.GetClientScopesScopeMappingsClientRoles = append(mock.calls.GetClientScopesScopeMappingsClientRoles, callInfo) - mock.lockGetClientScopesScopeMappingsClientRoles.Unlock() - return mock.GetClientScopesScopeMappingsClientRolesFunc(ctx, token, realm, idOfClientScope, idOfClient) -} - -// GetClientScopesScopeMappingsClientRolesCalls gets all the calls that were made to GetClientScopesScopeMappingsClientRoles. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopesScopeMappingsClientRolesCalls()) -func (mock *GoCloakMock) GetClientScopesScopeMappingsClientRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IdOfClient string - } - mock.lockGetClientScopesScopeMappingsClientRoles.RLock() - calls = mock.calls.GetClientScopesScopeMappingsClientRoles - mock.lockGetClientScopesScopeMappingsClientRoles.RUnlock() - return calls -} - -// GetClientScopesScopeMappingsClientRolesAvailable calls GetClientScopesScopeMappingsClientRolesAvailableFunc. -func (mock *GoCloakMock) GetClientScopesScopeMappingsClientRolesAvailable(ctx context.Context, token string, realm string, idOfClientScope string, idOfClient string) ([]*gocloak.Role, error) { - if mock.GetClientScopesScopeMappingsClientRolesAvailableFunc == nil { - panic("GoCloakMock.GetClientScopesScopeMappingsClientRolesAvailableFunc: method is nil but GoCloak.GetClientScopesScopeMappingsClientRolesAvailable was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClientScope: idOfClientScope, - IdOfClient: idOfClient, - } - mock.lockGetClientScopesScopeMappingsClientRolesAvailable.Lock() - mock.calls.GetClientScopesScopeMappingsClientRolesAvailable = append(mock.calls.GetClientScopesScopeMappingsClientRolesAvailable, callInfo) - mock.lockGetClientScopesScopeMappingsClientRolesAvailable.Unlock() - return mock.GetClientScopesScopeMappingsClientRolesAvailableFunc(ctx, token, realm, idOfClientScope, idOfClient) -} - -// GetClientScopesScopeMappingsClientRolesAvailableCalls gets all the calls that were made to GetClientScopesScopeMappingsClientRolesAvailable. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopesScopeMappingsClientRolesAvailableCalls()) -func (mock *GoCloakMock) GetClientScopesScopeMappingsClientRolesAvailableCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - IdOfClient string - } - mock.lockGetClientScopesScopeMappingsClientRolesAvailable.RLock() - calls = mock.calls.GetClientScopesScopeMappingsClientRolesAvailable - mock.lockGetClientScopesScopeMappingsClientRolesAvailable.RUnlock() - return calls -} - -// GetClientScopesScopeMappingsRealmRoles calls GetClientScopesScopeMappingsRealmRolesFunc. -func (mock *GoCloakMock) GetClientScopesScopeMappingsRealmRoles(ctx context.Context, token string, realm string, idOfClientScope string) ([]*gocloak.Role, error) { - if mock.GetClientScopesScopeMappingsRealmRolesFunc == nil { - panic("GoCloakMock.GetClientScopesScopeMappingsRealmRolesFunc: method is nil but GoCloak.GetClientScopesScopeMappingsRealmRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClientScope: idOfClientScope, - } - mock.lockGetClientScopesScopeMappingsRealmRoles.Lock() - mock.calls.GetClientScopesScopeMappingsRealmRoles = append(mock.calls.GetClientScopesScopeMappingsRealmRoles, callInfo) - mock.lockGetClientScopesScopeMappingsRealmRoles.Unlock() - return mock.GetClientScopesScopeMappingsRealmRolesFunc(ctx, token, realm, idOfClientScope) -} - -// GetClientScopesScopeMappingsRealmRolesCalls gets all the calls that were made to GetClientScopesScopeMappingsRealmRoles. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopesScopeMappingsRealmRolesCalls()) -func (mock *GoCloakMock) GetClientScopesScopeMappingsRealmRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - } - mock.lockGetClientScopesScopeMappingsRealmRoles.RLock() - calls = mock.calls.GetClientScopesScopeMappingsRealmRoles - mock.lockGetClientScopesScopeMappingsRealmRoles.RUnlock() - return calls -} - -// GetClientScopesScopeMappingsRealmRolesAvailable calls GetClientScopesScopeMappingsRealmRolesAvailableFunc. -func (mock *GoCloakMock) GetClientScopesScopeMappingsRealmRolesAvailable(ctx context.Context, token string, realm string, idOfClientScope string) ([]*gocloak.Role, error) { - if mock.GetClientScopesScopeMappingsRealmRolesAvailableFunc == nil { - panic("GoCloakMock.GetClientScopesScopeMappingsRealmRolesAvailableFunc: method is nil but GoCloak.GetClientScopesScopeMappingsRealmRolesAvailable was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClientScope: idOfClientScope, - } - mock.lockGetClientScopesScopeMappingsRealmRolesAvailable.Lock() - mock.calls.GetClientScopesScopeMappingsRealmRolesAvailable = append(mock.calls.GetClientScopesScopeMappingsRealmRolesAvailable, callInfo) - mock.lockGetClientScopesScopeMappingsRealmRolesAvailable.Unlock() - return mock.GetClientScopesScopeMappingsRealmRolesAvailableFunc(ctx, token, realm, idOfClientScope) -} - -// GetClientScopesScopeMappingsRealmRolesAvailableCalls gets all the calls that were made to GetClientScopesScopeMappingsRealmRolesAvailable. -// Check the length with: -// -// len(mockedGoCloak.GetClientScopesScopeMappingsRealmRolesAvailableCalls()) -func (mock *GoCloakMock) GetClientScopesScopeMappingsRealmRolesAvailableCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClientScope string - } - mock.lockGetClientScopesScopeMappingsRealmRolesAvailable.RLock() - calls = mock.calls.GetClientScopesScopeMappingsRealmRolesAvailable - mock.lockGetClientScopesScopeMappingsRealmRolesAvailable.RUnlock() - return calls -} - -// GetClientSecret calls GetClientSecretFunc. -func (mock *GoCloakMock) GetClientSecret(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.CredentialRepresentation, error) { - if mock.GetClientSecretFunc == nil { - panic("GoCloakMock.GetClientSecretFunc: method is nil but GoCloak.GetClientSecret was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockGetClientSecret.Lock() - mock.calls.GetClientSecret = append(mock.calls.GetClientSecret, callInfo) - mock.lockGetClientSecret.Unlock() - return mock.GetClientSecretFunc(ctx, token, realm, idOfClient) -} - -// GetClientSecretCalls gets all the calls that were made to GetClientSecret. -// Check the length with: -// -// len(mockedGoCloak.GetClientSecretCalls()) -func (mock *GoCloakMock) GetClientSecretCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - } - mock.lockGetClientSecret.RLock() - calls = mock.calls.GetClientSecret - mock.lockGetClientSecret.RUnlock() - return calls -} - -// GetClientServiceAccount calls GetClientServiceAccountFunc. -func (mock *GoCloakMock) GetClientServiceAccount(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.User, error) { - if mock.GetClientServiceAccountFunc == nil { - panic("GoCloakMock.GetClientServiceAccountFunc: method is nil but GoCloak.GetClientServiceAccount was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockGetClientServiceAccount.Lock() - mock.calls.GetClientServiceAccount = append(mock.calls.GetClientServiceAccount, callInfo) - mock.lockGetClientServiceAccount.Unlock() - return mock.GetClientServiceAccountFunc(ctx, token, realm, idOfClient) -} - -// GetClientServiceAccountCalls gets all the calls that were made to GetClientServiceAccount. -// Check the length with: -// -// len(mockedGoCloak.GetClientServiceAccountCalls()) -func (mock *GoCloakMock) GetClientServiceAccountCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - } - mock.lockGetClientServiceAccount.RLock() - calls = mock.calls.GetClientServiceAccount - mock.lockGetClientServiceAccount.RUnlock() - return calls -} - -// GetClientUserSessions calls GetClientUserSessionsFunc. -func (mock *GoCloakMock) GetClientUserSessions(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.UserSessionRepresentation, error) { - if mock.GetClientUserSessionsFunc == nil { - panic("GoCloakMock.GetClientUserSessionsFunc: method is nil but GoCloak.GetClientUserSessions was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockGetClientUserSessions.Lock() - mock.calls.GetClientUserSessions = append(mock.calls.GetClientUserSessions, callInfo) - mock.lockGetClientUserSessions.Unlock() - return mock.GetClientUserSessionsFunc(ctx, token, realm, idOfClient) -} - -// GetClientUserSessionsCalls gets all the calls that were made to GetClientUserSessions. -// Check the length with: -// -// len(mockedGoCloak.GetClientUserSessionsCalls()) -func (mock *GoCloakMock) GetClientUserSessionsCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - } - mock.lockGetClientUserSessions.RLock() - calls = mock.calls.GetClientUserSessions - mock.lockGetClientUserSessions.RUnlock() - return calls -} - -// GetClients calls GetClientsFunc. -func (mock *GoCloakMock) GetClients(ctx context.Context, accessToken string, realm string, params gocloak.GetClientsParams) ([]*gocloak.Client, error) { - if mock.GetClientsFunc == nil { - panic("GoCloakMock.GetClientsFunc: method is nil but GoCloak.GetClients was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetClientsParams - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Params: params, - } - mock.lockGetClients.Lock() - mock.calls.GetClients = append(mock.calls.GetClients, callInfo) - mock.lockGetClients.Unlock() - return mock.GetClientsFunc(ctx, accessToken, realm, params) -} - -// GetClientsCalls gets all the calls that were made to GetClients. -// Check the length with: -// -// len(mockedGoCloak.GetClientsCalls()) -func (mock *GoCloakMock) GetClientsCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetClientsParams -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetClientsParams - } - mock.lockGetClients.RLock() - calls = mock.calls.GetClients - mock.lockGetClients.RUnlock() - return calls -} - -// GetClientsDefaultScopes calls GetClientsDefaultScopesFunc. -func (mock *GoCloakMock) GetClientsDefaultScopes(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.ClientScope, error) { - if mock.GetClientsDefaultScopesFunc == nil { - panic("GoCloakMock.GetClientsDefaultScopesFunc: method is nil but GoCloak.GetClientsDefaultScopes was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockGetClientsDefaultScopes.Lock() - mock.calls.GetClientsDefaultScopes = append(mock.calls.GetClientsDefaultScopes, callInfo) - mock.lockGetClientsDefaultScopes.Unlock() - return mock.GetClientsDefaultScopesFunc(ctx, token, realm, idOfClient) -} - -// GetClientsDefaultScopesCalls gets all the calls that were made to GetClientsDefaultScopes. -// Check the length with: -// -// len(mockedGoCloak.GetClientsDefaultScopesCalls()) -func (mock *GoCloakMock) GetClientsDefaultScopesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - } - mock.lockGetClientsDefaultScopes.RLock() - calls = mock.calls.GetClientsDefaultScopes - mock.lockGetClientsDefaultScopes.RUnlock() - return calls -} - -// GetClientsOptionalScopes calls GetClientsOptionalScopesFunc. -func (mock *GoCloakMock) GetClientsOptionalScopes(ctx context.Context, token string, realm string, idOfClient string) ([]*gocloak.ClientScope, error) { - if mock.GetClientsOptionalScopesFunc == nil { - panic("GoCloakMock.GetClientsOptionalScopesFunc: method is nil but GoCloak.GetClientsOptionalScopes was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockGetClientsOptionalScopes.Lock() - mock.calls.GetClientsOptionalScopes = append(mock.calls.GetClientsOptionalScopes, callInfo) - mock.lockGetClientsOptionalScopes.Unlock() - return mock.GetClientsOptionalScopesFunc(ctx, token, realm, idOfClient) -} - -// GetClientsOptionalScopesCalls gets all the calls that were made to GetClientsOptionalScopes. -// Check the length with: -// -// len(mockedGoCloak.GetClientsOptionalScopesCalls()) -func (mock *GoCloakMock) GetClientsOptionalScopesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - } - mock.lockGetClientsOptionalScopes.RLock() - calls = mock.calls.GetClientsOptionalScopes - mock.lockGetClientsOptionalScopes.RUnlock() - return calls -} - -// GetComponents calls GetComponentsFunc. -func (mock *GoCloakMock) GetComponents(ctx context.Context, accessToken string, realm string) ([]*gocloak.Component, error) { - if mock.GetComponentsFunc == nil { - panic("GoCloakMock.GetComponentsFunc: method is nil but GoCloak.GetComponents was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - } - mock.lockGetComponents.Lock() - mock.calls.GetComponents = append(mock.calls.GetComponents, callInfo) - mock.lockGetComponents.Unlock() - return mock.GetComponentsFunc(ctx, accessToken, realm) -} - -// GetComponentsCalls gets all the calls that were made to GetComponents. -// Check the length with: -// -// len(mockedGoCloak.GetComponentsCalls()) -func (mock *GoCloakMock) GetComponentsCalls() []struct { - Ctx context.Context - AccessToken string - Realm string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - } - mock.lockGetComponents.RLock() - calls = mock.calls.GetComponents - mock.lockGetComponents.RUnlock() - return calls -} - -// GetCompositeClientRolesByGroupID calls GetCompositeClientRolesByGroupIDFunc. -func (mock *GoCloakMock) GetCompositeClientRolesByGroupID(ctx context.Context, token string, realm string, idOfClient string, groupID string) ([]*gocloak.Role, error) { - if mock.GetCompositeClientRolesByGroupIDFunc == nil { - panic("GoCloakMock.GetCompositeClientRolesByGroupIDFunc: method is nil but GoCloak.GetCompositeClientRolesByGroupID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - GroupID: groupID, - } - mock.lockGetCompositeClientRolesByGroupID.Lock() - mock.calls.GetCompositeClientRolesByGroupID = append(mock.calls.GetCompositeClientRolesByGroupID, callInfo) - mock.lockGetCompositeClientRolesByGroupID.Unlock() - return mock.GetCompositeClientRolesByGroupIDFunc(ctx, token, realm, idOfClient, groupID) -} - -// GetCompositeClientRolesByGroupIDCalls gets all the calls that were made to GetCompositeClientRolesByGroupID. -// Check the length with: -// -// len(mockedGoCloak.GetCompositeClientRolesByGroupIDCalls()) -func (mock *GoCloakMock) GetCompositeClientRolesByGroupIDCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - GroupID string - } - mock.lockGetCompositeClientRolesByGroupID.RLock() - calls = mock.calls.GetCompositeClientRolesByGroupID - mock.lockGetCompositeClientRolesByGroupID.RUnlock() - return calls -} - -// GetCompositeClientRolesByRoleID calls GetCompositeClientRolesByRoleIDFunc. -func (mock *GoCloakMock) GetCompositeClientRolesByRoleID(ctx context.Context, token string, realm string, idOfClient string, roleID string) ([]*gocloak.Role, error) { - if mock.GetCompositeClientRolesByRoleIDFunc == nil { - panic("GoCloakMock.GetCompositeClientRolesByRoleIDFunc: method is nil but GoCloak.GetCompositeClientRolesByRoleID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - RoleID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - RoleID: roleID, - } - mock.lockGetCompositeClientRolesByRoleID.Lock() - mock.calls.GetCompositeClientRolesByRoleID = append(mock.calls.GetCompositeClientRolesByRoleID, callInfo) - mock.lockGetCompositeClientRolesByRoleID.Unlock() - return mock.GetCompositeClientRolesByRoleIDFunc(ctx, token, realm, idOfClient, roleID) -} - -// GetCompositeClientRolesByRoleIDCalls gets all the calls that were made to GetCompositeClientRolesByRoleID. -// Check the length with: -// -// len(mockedGoCloak.GetCompositeClientRolesByRoleIDCalls()) -func (mock *GoCloakMock) GetCompositeClientRolesByRoleIDCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - RoleID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - RoleID string - } - mock.lockGetCompositeClientRolesByRoleID.RLock() - calls = mock.calls.GetCompositeClientRolesByRoleID - mock.lockGetCompositeClientRolesByRoleID.RUnlock() - return calls -} - -// GetCompositeClientRolesByUserID calls GetCompositeClientRolesByUserIDFunc. -func (mock *GoCloakMock) GetCompositeClientRolesByUserID(ctx context.Context, token string, realm string, idOfClient string, userID string) ([]*gocloak.Role, error) { - if mock.GetCompositeClientRolesByUserIDFunc == nil { - panic("GoCloakMock.GetCompositeClientRolesByUserIDFunc: method is nil but GoCloak.GetCompositeClientRolesByUserID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - UserID: userID, - } - mock.lockGetCompositeClientRolesByUserID.Lock() - mock.calls.GetCompositeClientRolesByUserID = append(mock.calls.GetCompositeClientRolesByUserID, callInfo) - mock.lockGetCompositeClientRolesByUserID.Unlock() - return mock.GetCompositeClientRolesByUserIDFunc(ctx, token, realm, idOfClient, userID) -} - -// GetCompositeClientRolesByUserIDCalls gets all the calls that were made to GetCompositeClientRolesByUserID. -// Check the length with: -// -// len(mockedGoCloak.GetCompositeClientRolesByUserIDCalls()) -func (mock *GoCloakMock) GetCompositeClientRolesByUserIDCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - UserID string - } - mock.lockGetCompositeClientRolesByUserID.RLock() - calls = mock.calls.GetCompositeClientRolesByUserID - mock.lockGetCompositeClientRolesByUserID.RUnlock() - return calls -} - -// GetCompositeRealmRoles calls GetCompositeRealmRolesFunc. -func (mock *GoCloakMock) GetCompositeRealmRoles(ctx context.Context, token string, realm string, roleName string) ([]*gocloak.Role, error) { - if mock.GetCompositeRealmRolesFunc == nil { - panic("GoCloakMock.GetCompositeRealmRolesFunc: method is nil but GoCloak.GetCompositeRealmRoles was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleName string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleName: roleName, - } - mock.lockGetCompositeRealmRoles.Lock() - mock.calls.GetCompositeRealmRoles = append(mock.calls.GetCompositeRealmRoles, callInfo) - mock.lockGetCompositeRealmRoles.Unlock() - return mock.GetCompositeRealmRolesFunc(ctx, token, realm, roleName) -} - -// GetCompositeRealmRolesCalls gets all the calls that were made to GetCompositeRealmRoles. -// Check the length with: -// -// len(mockedGoCloak.GetCompositeRealmRolesCalls()) -func (mock *GoCloakMock) GetCompositeRealmRolesCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleName string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleName string - } - mock.lockGetCompositeRealmRoles.RLock() - calls = mock.calls.GetCompositeRealmRoles - mock.lockGetCompositeRealmRoles.RUnlock() - return calls -} - -// GetCompositeRealmRolesByGroupID calls GetCompositeRealmRolesByGroupIDFunc. -func (mock *GoCloakMock) GetCompositeRealmRolesByGroupID(ctx context.Context, token string, realm string, groupID string) ([]*gocloak.Role, error) { - if mock.GetCompositeRealmRolesByGroupIDFunc == nil { - panic("GoCloakMock.GetCompositeRealmRolesByGroupIDFunc: method is nil but GoCloak.GetCompositeRealmRolesByGroupID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - GroupID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - GroupID: groupID, - } - mock.lockGetCompositeRealmRolesByGroupID.Lock() - mock.calls.GetCompositeRealmRolesByGroupID = append(mock.calls.GetCompositeRealmRolesByGroupID, callInfo) - mock.lockGetCompositeRealmRolesByGroupID.Unlock() - return mock.GetCompositeRealmRolesByGroupIDFunc(ctx, token, realm, groupID) -} - -// GetCompositeRealmRolesByGroupIDCalls gets all the calls that were made to GetCompositeRealmRolesByGroupID. -// Check the length with: -// -// len(mockedGoCloak.GetCompositeRealmRolesByGroupIDCalls()) -func (mock *GoCloakMock) GetCompositeRealmRolesByGroupIDCalls() []struct { - Ctx context.Context - Token string - Realm string - GroupID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - GroupID string - } - mock.lockGetCompositeRealmRolesByGroupID.RLock() - calls = mock.calls.GetCompositeRealmRolesByGroupID - mock.lockGetCompositeRealmRolesByGroupID.RUnlock() - return calls -} - -// GetCompositeRealmRolesByRoleID calls GetCompositeRealmRolesByRoleIDFunc. -func (mock *GoCloakMock) GetCompositeRealmRolesByRoleID(ctx context.Context, token string, realm string, roleID string) ([]*gocloak.Role, error) { - if mock.GetCompositeRealmRolesByRoleIDFunc == nil { - panic("GoCloakMock.GetCompositeRealmRolesByRoleIDFunc: method is nil but GoCloak.GetCompositeRealmRolesByRoleID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleID: roleID, - } - mock.lockGetCompositeRealmRolesByRoleID.Lock() - mock.calls.GetCompositeRealmRolesByRoleID = append(mock.calls.GetCompositeRealmRolesByRoleID, callInfo) - mock.lockGetCompositeRealmRolesByRoleID.Unlock() - return mock.GetCompositeRealmRolesByRoleIDFunc(ctx, token, realm, roleID) -} - -// GetCompositeRealmRolesByRoleIDCalls gets all the calls that were made to GetCompositeRealmRolesByRoleID. -// Check the length with: -// -// len(mockedGoCloak.GetCompositeRealmRolesByRoleIDCalls()) -func (mock *GoCloakMock) GetCompositeRealmRolesByRoleIDCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleID string - } - mock.lockGetCompositeRealmRolesByRoleID.RLock() - calls = mock.calls.GetCompositeRealmRolesByRoleID - mock.lockGetCompositeRealmRolesByRoleID.RUnlock() - return calls -} - -// GetCompositeRealmRolesByUserID calls GetCompositeRealmRolesByUserIDFunc. -func (mock *GoCloakMock) GetCompositeRealmRolesByUserID(ctx context.Context, token string, realm string, userID string) ([]*gocloak.Role, error) { - if mock.GetCompositeRealmRolesByUserIDFunc == nil { - panic("GoCloakMock.GetCompositeRealmRolesByUserIDFunc: method is nil but GoCloak.GetCompositeRealmRolesByUserID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - } - mock.lockGetCompositeRealmRolesByUserID.Lock() - mock.calls.GetCompositeRealmRolesByUserID = append(mock.calls.GetCompositeRealmRolesByUserID, callInfo) - mock.lockGetCompositeRealmRolesByUserID.Unlock() - return mock.GetCompositeRealmRolesByUserIDFunc(ctx, token, realm, userID) -} - -// GetCompositeRealmRolesByUserIDCalls gets all the calls that were made to GetCompositeRealmRolesByUserID. -// Check the length with: -// -// len(mockedGoCloak.GetCompositeRealmRolesByUserIDCalls()) -func (mock *GoCloakMock) GetCompositeRealmRolesByUserIDCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - } - mock.lockGetCompositeRealmRolesByUserID.RLock() - calls = mock.calls.GetCompositeRealmRolesByUserID - mock.lockGetCompositeRealmRolesByUserID.RUnlock() - return calls -} - -// GetConfiguredUserStorageCredentialTypes calls GetConfiguredUserStorageCredentialTypesFunc. -func (mock *GoCloakMock) GetConfiguredUserStorageCredentialTypes(ctx context.Context, token string, realm string, userID string) ([]string, error) { - if mock.GetConfiguredUserStorageCredentialTypesFunc == nil { - panic("GoCloakMock.GetConfiguredUserStorageCredentialTypesFunc: method is nil but GoCloak.GetConfiguredUserStorageCredentialTypes was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - } - mock.lockGetConfiguredUserStorageCredentialTypes.Lock() - mock.calls.GetConfiguredUserStorageCredentialTypes = append(mock.calls.GetConfiguredUserStorageCredentialTypes, callInfo) - mock.lockGetConfiguredUserStorageCredentialTypes.Unlock() - return mock.GetConfiguredUserStorageCredentialTypesFunc(ctx, token, realm, userID) -} - -// GetConfiguredUserStorageCredentialTypesCalls gets all the calls that were made to GetConfiguredUserStorageCredentialTypes. -// Check the length with: -// -// len(mockedGoCloak.GetConfiguredUserStorageCredentialTypesCalls()) -func (mock *GoCloakMock) GetConfiguredUserStorageCredentialTypesCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - } - mock.lockGetConfiguredUserStorageCredentialTypes.RLock() - calls = mock.calls.GetConfiguredUserStorageCredentialTypes - mock.lockGetConfiguredUserStorageCredentialTypes.RUnlock() - return calls -} - -// GetCredentialRegistrators calls GetCredentialRegistratorsFunc. -func (mock *GoCloakMock) GetCredentialRegistrators(ctx context.Context, token string, realm string) ([]string, error) { - if mock.GetCredentialRegistratorsFunc == nil { - panic("GoCloakMock.GetCredentialRegistratorsFunc: method is nil but GoCloak.GetCredentialRegistrators was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockGetCredentialRegistrators.Lock() - mock.calls.GetCredentialRegistrators = append(mock.calls.GetCredentialRegistrators, callInfo) - mock.lockGetCredentialRegistrators.Unlock() - return mock.GetCredentialRegistratorsFunc(ctx, token, realm) -} - -// GetCredentialRegistratorsCalls gets all the calls that were made to GetCredentialRegistrators. -// Check the length with: -// -// len(mockedGoCloak.GetCredentialRegistratorsCalls()) -func (mock *GoCloakMock) GetCredentialRegistratorsCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockGetCredentialRegistrators.RLock() - calls = mock.calls.GetCredentialRegistrators - mock.lockGetCredentialRegistrators.RUnlock() - return calls -} - -// GetCredentials calls GetCredentialsFunc. -func (mock *GoCloakMock) GetCredentials(ctx context.Context, token string, realm string, UserID string) ([]*gocloak.CredentialRepresentation, error) { - if mock.GetCredentialsFunc == nil { - panic("GoCloakMock.GetCredentialsFunc: method is nil but GoCloak.GetCredentials was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: UserID, - } - mock.lockGetCredentials.Lock() - mock.calls.GetCredentials = append(mock.calls.GetCredentials, callInfo) - mock.lockGetCredentials.Unlock() - return mock.GetCredentialsFunc(ctx, token, realm, UserID) -} - -// GetCredentialsCalls gets all the calls that were made to GetCredentials. -// Check the length with: -// -// len(mockedGoCloak.GetCredentialsCalls()) -func (mock *GoCloakMock) GetCredentialsCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - } - mock.lockGetCredentials.RLock() - calls = mock.calls.GetCredentials - mock.lockGetCredentials.RUnlock() - return calls -} - -// GetDefaultDefaultClientScopes calls GetDefaultDefaultClientScopesFunc. -func (mock *GoCloakMock) GetDefaultDefaultClientScopes(ctx context.Context, token string, realm string) ([]*gocloak.ClientScope, error) { - if mock.GetDefaultDefaultClientScopesFunc == nil { - panic("GoCloakMock.GetDefaultDefaultClientScopesFunc: method is nil but GoCloak.GetDefaultDefaultClientScopes was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockGetDefaultDefaultClientScopes.Lock() - mock.calls.GetDefaultDefaultClientScopes = append(mock.calls.GetDefaultDefaultClientScopes, callInfo) - mock.lockGetDefaultDefaultClientScopes.Unlock() - return mock.GetDefaultDefaultClientScopesFunc(ctx, token, realm) -} - -// GetDefaultDefaultClientScopesCalls gets all the calls that were made to GetDefaultDefaultClientScopes. -// Check the length with: -// -// len(mockedGoCloak.GetDefaultDefaultClientScopesCalls()) -func (mock *GoCloakMock) GetDefaultDefaultClientScopesCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockGetDefaultDefaultClientScopes.RLock() - calls = mock.calls.GetDefaultDefaultClientScopes - mock.lockGetDefaultDefaultClientScopes.RUnlock() - return calls -} - -// GetDefaultGroups calls GetDefaultGroupsFunc. -func (mock *GoCloakMock) GetDefaultGroups(ctx context.Context, accessToken string, realm string) ([]*gocloak.Group, error) { - if mock.GetDefaultGroupsFunc == nil { - panic("GoCloakMock.GetDefaultGroupsFunc: method is nil but GoCloak.GetDefaultGroups was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - } - mock.lockGetDefaultGroups.Lock() - mock.calls.GetDefaultGroups = append(mock.calls.GetDefaultGroups, callInfo) - mock.lockGetDefaultGroups.Unlock() - return mock.GetDefaultGroupsFunc(ctx, accessToken, realm) -} - -// GetDefaultGroupsCalls gets all the calls that were made to GetDefaultGroups. -// Check the length with: -// -// len(mockedGoCloak.GetDefaultGroupsCalls()) -func (mock *GoCloakMock) GetDefaultGroupsCalls() []struct { - Ctx context.Context - AccessToken string - Realm string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - } - mock.lockGetDefaultGroups.RLock() - calls = mock.calls.GetDefaultGroups - mock.lockGetDefaultGroups.RUnlock() - return calls -} - -// GetDefaultOptionalClientScopes calls GetDefaultOptionalClientScopesFunc. -func (mock *GoCloakMock) GetDefaultOptionalClientScopes(ctx context.Context, token string, realm string) ([]*gocloak.ClientScope, error) { - if mock.GetDefaultOptionalClientScopesFunc == nil { - panic("GoCloakMock.GetDefaultOptionalClientScopesFunc: method is nil but GoCloak.GetDefaultOptionalClientScopes was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockGetDefaultOptionalClientScopes.Lock() - mock.calls.GetDefaultOptionalClientScopes = append(mock.calls.GetDefaultOptionalClientScopes, callInfo) - mock.lockGetDefaultOptionalClientScopes.Unlock() - return mock.GetDefaultOptionalClientScopesFunc(ctx, token, realm) -} - -// GetDefaultOptionalClientScopesCalls gets all the calls that were made to GetDefaultOptionalClientScopes. -// Check the length with: -// -// len(mockedGoCloak.GetDefaultOptionalClientScopesCalls()) -func (mock *GoCloakMock) GetDefaultOptionalClientScopesCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockGetDefaultOptionalClientScopes.RLock() - calls = mock.calls.GetDefaultOptionalClientScopes - mock.lockGetDefaultOptionalClientScopes.RUnlock() - return calls -} - -// GetDependentPermissions calls GetDependentPermissionsFunc. -func (mock *GoCloakMock) GetDependentPermissions(ctx context.Context, token string, realm string, idOfClient string, policyID string) ([]*gocloak.PermissionRepresentation, error) { - if mock.GetDependentPermissionsFunc == nil { - panic("GoCloakMock.GetDependentPermissionsFunc: method is nil but GoCloak.GetDependentPermissions was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - PolicyID: policyID, - } - mock.lockGetDependentPermissions.Lock() - mock.calls.GetDependentPermissions = append(mock.calls.GetDependentPermissions, callInfo) - mock.lockGetDependentPermissions.Unlock() - return mock.GetDependentPermissionsFunc(ctx, token, realm, idOfClient, policyID) -} - -// GetDependentPermissionsCalls gets all the calls that were made to GetDependentPermissions. -// Check the length with: -// -// len(mockedGoCloak.GetDependentPermissionsCalls()) -func (mock *GoCloakMock) GetDependentPermissionsCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - } - mock.lockGetDependentPermissions.RLock() - calls = mock.calls.GetDependentPermissions - mock.lockGetDependentPermissions.RUnlock() - return calls -} - -// GetEvents calls GetEventsFunc. -func (mock *GoCloakMock) GetEvents(ctx context.Context, token string, realm string, params gocloak.GetEventsParams) ([]*gocloak.EventRepresentation, error) { - if mock.GetEventsFunc == nil { - panic("GoCloakMock.GetEventsFunc: method is nil but GoCloak.GetEvents was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetEventsParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Params: params, - } - mock.lockGetEvents.Lock() - mock.calls.GetEvents = append(mock.calls.GetEvents, callInfo) - mock.lockGetEvents.Unlock() - return mock.GetEventsFunc(ctx, token, realm, params) -} - -// GetEventsCalls gets all the calls that were made to GetEvents. -// Check the length with: -// -// len(mockedGoCloak.GetEventsCalls()) -func (mock *GoCloakMock) GetEventsCalls() []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetEventsParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetEventsParams - } - mock.lockGetEvents.RLock() - calls = mock.calls.GetEvents - mock.lockGetEvents.RUnlock() - return calls -} - -// GetGroup calls GetGroupFunc. -func (mock *GoCloakMock) GetGroup(ctx context.Context, accessToken string, realm string, groupID string) (*gocloak.Group, error) { - if mock.GetGroupFunc == nil { - panic("GoCloakMock.GetGroupFunc: method is nil but GoCloak.GetGroup was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - GroupID: groupID, - } - mock.lockGetGroup.Lock() - mock.calls.GetGroup = append(mock.calls.GetGroup, callInfo) - mock.lockGetGroup.Unlock() - return mock.GetGroupFunc(ctx, accessToken, realm, groupID) -} - -// GetGroupCalls gets all the calls that were made to GetGroup. -// Check the length with: -// -// len(mockedGoCloak.GetGroupCalls()) -func (mock *GoCloakMock) GetGroupCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - } - mock.lockGetGroup.RLock() - calls = mock.calls.GetGroup - mock.lockGetGroup.RUnlock() - return calls -} - -// GetGroupMembers calls GetGroupMembersFunc. -func (mock *GoCloakMock) GetGroupMembers(ctx context.Context, accessToken string, realm string, groupID string, params gocloak.GetGroupsParams) ([]*gocloak.User, error) { - if mock.GetGroupMembersFunc == nil { - panic("GoCloakMock.GetGroupMembersFunc: method is nil but GoCloak.GetGroupMembers was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - Params gocloak.GetGroupsParams - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - GroupID: groupID, - Params: params, - } - mock.lockGetGroupMembers.Lock() - mock.calls.GetGroupMembers = append(mock.calls.GetGroupMembers, callInfo) - mock.lockGetGroupMembers.Unlock() - return mock.GetGroupMembersFunc(ctx, accessToken, realm, groupID, params) -} - -// GetGroupMembersCalls gets all the calls that were made to GetGroupMembers. -// Check the length with: -// -// len(mockedGoCloak.GetGroupMembersCalls()) -func (mock *GoCloakMock) GetGroupMembersCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - Params gocloak.GetGroupsParams -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - Params gocloak.GetGroupsParams - } - mock.lockGetGroupMembers.RLock() - calls = mock.calls.GetGroupMembers - mock.lockGetGroupMembers.RUnlock() - return calls -} - -// GetGroups calls GetGroupsFunc. -func (mock *GoCloakMock) GetGroups(ctx context.Context, accessToken string, realm string, params gocloak.GetGroupsParams) ([]*gocloak.Group, error) { - if mock.GetGroupsFunc == nil { - panic("GoCloakMock.GetGroupsFunc: method is nil but GoCloak.GetGroups was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetGroupsParams - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Params: params, - } - mock.lockGetGroups.Lock() - mock.calls.GetGroups = append(mock.calls.GetGroups, callInfo) - mock.lockGetGroups.Unlock() - return mock.GetGroupsFunc(ctx, accessToken, realm, params) -} - -// GetGroupsCalls gets all the calls that were made to GetGroups. -// Check the length with: -// -// len(mockedGoCloak.GetGroupsCalls()) -func (mock *GoCloakMock) GetGroupsCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetGroupsParams -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetGroupsParams - } - mock.lockGetGroups.RLock() - calls = mock.calls.GetGroups - mock.lockGetGroups.RUnlock() - return calls -} - -// GetGroupsByRole calls GetGroupsByRoleFunc. -func (mock *GoCloakMock) GetGroupsByRole(ctx context.Context, accessToken string, realm string, roleName string) ([]*gocloak.Group, error) { - if mock.GetGroupsByRoleFunc == nil { - panic("GoCloakMock.GetGroupsByRoleFunc: method is nil but GoCloak.GetGroupsByRole was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - RoleName string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - RoleName: roleName, - } - mock.lockGetGroupsByRole.Lock() - mock.calls.GetGroupsByRole = append(mock.calls.GetGroupsByRole, callInfo) - mock.lockGetGroupsByRole.Unlock() - return mock.GetGroupsByRoleFunc(ctx, accessToken, realm, roleName) -} - -// GetGroupsByRoleCalls gets all the calls that were made to GetGroupsByRole. -// Check the length with: -// -// len(mockedGoCloak.GetGroupsByRoleCalls()) -func (mock *GoCloakMock) GetGroupsByRoleCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - RoleName string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - RoleName string - } - mock.lockGetGroupsByRole.RLock() - calls = mock.calls.GetGroupsByRole - mock.lockGetGroupsByRole.RUnlock() - return calls -} - -// GetGroupsCount calls GetGroupsCountFunc. -func (mock *GoCloakMock) GetGroupsCount(ctx context.Context, token string, realm string, params gocloak.GetGroupsParams) (int, error) { - if mock.GetGroupsCountFunc == nil { - panic("GoCloakMock.GetGroupsCountFunc: method is nil but GoCloak.GetGroupsCount was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetGroupsParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Params: params, - } - mock.lockGetGroupsCount.Lock() - mock.calls.GetGroupsCount = append(mock.calls.GetGroupsCount, callInfo) - mock.lockGetGroupsCount.Unlock() - return mock.GetGroupsCountFunc(ctx, token, realm, params) -} - -// GetGroupsCountCalls gets all the calls that were made to GetGroupsCount. -// Check the length with: -// -// len(mockedGoCloak.GetGroupsCountCalls()) -func (mock *GoCloakMock) GetGroupsCountCalls() []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetGroupsParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetGroupsParams - } - mock.lockGetGroupsCount.RLock() - calls = mock.calls.GetGroupsCount - mock.lockGetGroupsCount.RUnlock() - return calls -} - -// GetIdentityProvider calls GetIdentityProviderFunc. -func (mock *GoCloakMock) GetIdentityProvider(ctx context.Context, token string, realm string, alias string) (*gocloak.IdentityProviderRepresentation, error) { - if mock.GetIdentityProviderFunc == nil { - panic("GoCloakMock.GetIdentityProviderFunc: method is nil but GoCloak.GetIdentityProvider was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Alias string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Alias: alias, - } - mock.lockGetIdentityProvider.Lock() - mock.calls.GetIdentityProvider = append(mock.calls.GetIdentityProvider, callInfo) - mock.lockGetIdentityProvider.Unlock() - return mock.GetIdentityProviderFunc(ctx, token, realm, alias) -} - -// GetIdentityProviderCalls gets all the calls that were made to GetIdentityProvider. -// Check the length with: -// -// len(mockedGoCloak.GetIdentityProviderCalls()) -func (mock *GoCloakMock) GetIdentityProviderCalls() []struct { - Ctx context.Context - Token string - Realm string - Alias string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Alias string - } - mock.lockGetIdentityProvider.RLock() - calls = mock.calls.GetIdentityProvider - mock.lockGetIdentityProvider.RUnlock() - return calls -} - -// GetIdentityProviderMapperByID calls GetIdentityProviderMapperByIDFunc. -func (mock *GoCloakMock) GetIdentityProviderMapperByID(ctx context.Context, token string, realm string, alias string, mapperID string) (*gocloak.IdentityProviderMapper, error) { - if mock.GetIdentityProviderMapperByIDFunc == nil { - panic("GoCloakMock.GetIdentityProviderMapperByIDFunc: method is nil but GoCloak.GetIdentityProviderMapperByID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Alias string - MapperID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Alias: alias, - MapperID: mapperID, - } - mock.lockGetIdentityProviderMapperByID.Lock() - mock.calls.GetIdentityProviderMapperByID = append(mock.calls.GetIdentityProviderMapperByID, callInfo) - mock.lockGetIdentityProviderMapperByID.Unlock() - return mock.GetIdentityProviderMapperByIDFunc(ctx, token, realm, alias, mapperID) -} - -// GetIdentityProviderMapperByIDCalls gets all the calls that were made to GetIdentityProviderMapperByID. -// Check the length with: -// -// len(mockedGoCloak.GetIdentityProviderMapperByIDCalls()) -func (mock *GoCloakMock) GetIdentityProviderMapperByIDCalls() []struct { - Ctx context.Context - Token string - Realm string - Alias string - MapperID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Alias string - MapperID string - } - mock.lockGetIdentityProviderMapperByID.RLock() - calls = mock.calls.GetIdentityProviderMapperByID - mock.lockGetIdentityProviderMapperByID.RUnlock() - return calls -} - -// GetIdentityProviderMappers calls GetIdentityProviderMappersFunc. -func (mock *GoCloakMock) GetIdentityProviderMappers(ctx context.Context, token string, realm string, alias string) ([]*gocloak.IdentityProviderMapper, error) { - if mock.GetIdentityProviderMappersFunc == nil { - panic("GoCloakMock.GetIdentityProviderMappersFunc: method is nil but GoCloak.GetIdentityProviderMappers was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Alias string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Alias: alias, - } - mock.lockGetIdentityProviderMappers.Lock() - mock.calls.GetIdentityProviderMappers = append(mock.calls.GetIdentityProviderMappers, callInfo) - mock.lockGetIdentityProviderMappers.Unlock() - return mock.GetIdentityProviderMappersFunc(ctx, token, realm, alias) -} - -// GetIdentityProviderMappersCalls gets all the calls that were made to GetIdentityProviderMappers. -// Check the length with: -// -// len(mockedGoCloak.GetIdentityProviderMappersCalls()) -func (mock *GoCloakMock) GetIdentityProviderMappersCalls() []struct { - Ctx context.Context - Token string - Realm string - Alias string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Alias string - } - mock.lockGetIdentityProviderMappers.RLock() - calls = mock.calls.GetIdentityProviderMappers - mock.lockGetIdentityProviderMappers.RUnlock() - return calls -} - -// GetIdentityProviders calls GetIdentityProvidersFunc. -func (mock *GoCloakMock) GetIdentityProviders(ctx context.Context, token string, realm string) ([]*gocloak.IdentityProviderRepresentation, error) { - if mock.GetIdentityProvidersFunc == nil { - panic("GoCloakMock.GetIdentityProvidersFunc: method is nil but GoCloak.GetIdentityProviders was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockGetIdentityProviders.Lock() - mock.calls.GetIdentityProviders = append(mock.calls.GetIdentityProviders, callInfo) - mock.lockGetIdentityProviders.Unlock() - return mock.GetIdentityProvidersFunc(ctx, token, realm) -} - -// GetIdentityProvidersCalls gets all the calls that were made to GetIdentityProviders. -// Check the length with: -// -// len(mockedGoCloak.GetIdentityProvidersCalls()) -func (mock *GoCloakMock) GetIdentityProvidersCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockGetIdentityProviders.RLock() - calls = mock.calls.GetIdentityProviders - mock.lockGetIdentityProviders.RUnlock() - return calls -} - -// GetIssuer calls GetIssuerFunc. -func (mock *GoCloakMock) GetIssuer(ctx context.Context, realm string) (*gocloak.IssuerResponse, error) { - if mock.GetIssuerFunc == nil { - panic("GoCloakMock.GetIssuerFunc: method is nil but GoCloak.GetIssuer was just called") - } - callInfo := struct { - Ctx context.Context - Realm string - }{ - Ctx: ctx, - Realm: realm, - } - mock.lockGetIssuer.Lock() - mock.calls.GetIssuer = append(mock.calls.GetIssuer, callInfo) - mock.lockGetIssuer.Unlock() - return mock.GetIssuerFunc(ctx, realm) -} - -// GetIssuerCalls gets all the calls that were made to GetIssuer. -// Check the length with: -// -// len(mockedGoCloak.GetIssuerCalls()) -func (mock *GoCloakMock) GetIssuerCalls() []struct { - Ctx context.Context - Realm string -} { - var calls []struct { - Ctx context.Context - Realm string - } - mock.lockGetIssuer.RLock() - calls = mock.calls.GetIssuer - mock.lockGetIssuer.RUnlock() - return calls -} - -// GetKeyStoreConfig calls GetKeyStoreConfigFunc. -func (mock *GoCloakMock) GetKeyStoreConfig(ctx context.Context, accessToken string, realm string) (*gocloak.KeyStoreConfig, error) { - if mock.GetKeyStoreConfigFunc == nil { - panic("GoCloakMock.GetKeyStoreConfigFunc: method is nil but GoCloak.GetKeyStoreConfig was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - } - mock.lockGetKeyStoreConfig.Lock() - mock.calls.GetKeyStoreConfig = append(mock.calls.GetKeyStoreConfig, callInfo) - mock.lockGetKeyStoreConfig.Unlock() - return mock.GetKeyStoreConfigFunc(ctx, accessToken, realm) -} - -// GetKeyStoreConfigCalls gets all the calls that were made to GetKeyStoreConfig. -// Check the length with: -// -// len(mockedGoCloak.GetKeyStoreConfigCalls()) -func (mock *GoCloakMock) GetKeyStoreConfigCalls() []struct { - Ctx context.Context - AccessToken string - Realm string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - } - mock.lockGetKeyStoreConfig.RLock() - calls = mock.calls.GetKeyStoreConfig - mock.lockGetKeyStoreConfig.RUnlock() - return calls -} - -// GetPermission calls GetPermissionFunc. -func (mock *GoCloakMock) GetPermission(ctx context.Context, token string, realm string, idOfClient string, permissionID string) (*gocloak.PermissionRepresentation, error) { - if mock.GetPermissionFunc == nil { - panic("GoCloakMock.GetPermissionFunc: method is nil but GoCloak.GetPermission was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - PermissionID: permissionID, - } - mock.lockGetPermission.Lock() - mock.calls.GetPermission = append(mock.calls.GetPermission, callInfo) - mock.lockGetPermission.Unlock() - return mock.GetPermissionFunc(ctx, token, realm, idOfClient, permissionID) -} - -// GetPermissionCalls gets all the calls that were made to GetPermission. -// Check the length with: -// -// len(mockedGoCloak.GetPermissionCalls()) -func (mock *GoCloakMock) GetPermissionCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string - } - mock.lockGetPermission.RLock() - calls = mock.calls.GetPermission - mock.lockGetPermission.RUnlock() - return calls -} - -// GetPermissionResources calls GetPermissionResourcesFunc. -func (mock *GoCloakMock) GetPermissionResources(ctx context.Context, token string, realm string, idOfClient string, permissionID string) ([]*gocloak.PermissionResource, error) { - if mock.GetPermissionResourcesFunc == nil { - panic("GoCloakMock.GetPermissionResourcesFunc: method is nil but GoCloak.GetPermissionResources was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - PermissionID: permissionID, - } - mock.lockGetPermissionResources.Lock() - mock.calls.GetPermissionResources = append(mock.calls.GetPermissionResources, callInfo) - mock.lockGetPermissionResources.Unlock() - return mock.GetPermissionResourcesFunc(ctx, token, realm, idOfClient, permissionID) -} - -// GetPermissionResourcesCalls gets all the calls that were made to GetPermissionResources. -// Check the length with: -// -// len(mockedGoCloak.GetPermissionResourcesCalls()) -func (mock *GoCloakMock) GetPermissionResourcesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string - } - mock.lockGetPermissionResources.RLock() - calls = mock.calls.GetPermissionResources - mock.lockGetPermissionResources.RUnlock() - return calls -} - -// GetPermissionScopes calls GetPermissionScopesFunc. -func (mock *GoCloakMock) GetPermissionScopes(ctx context.Context, token string, realm string, idOfClient string, permissionID string) ([]*gocloak.PermissionScope, error) { - if mock.GetPermissionScopesFunc == nil { - panic("GoCloakMock.GetPermissionScopesFunc: method is nil but GoCloak.GetPermissionScopes was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - PermissionID: permissionID, - } - mock.lockGetPermissionScopes.Lock() - mock.calls.GetPermissionScopes = append(mock.calls.GetPermissionScopes, callInfo) - mock.lockGetPermissionScopes.Unlock() - return mock.GetPermissionScopesFunc(ctx, token, realm, idOfClient, permissionID) -} - -// GetPermissionScopesCalls gets all the calls that were made to GetPermissionScopes. -// Check the length with: -// -// len(mockedGoCloak.GetPermissionScopesCalls()) -func (mock *GoCloakMock) GetPermissionScopesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PermissionID string - } - mock.lockGetPermissionScopes.RLock() - calls = mock.calls.GetPermissionScopes - mock.lockGetPermissionScopes.RUnlock() - return calls -} - -// GetPermissions calls GetPermissionsFunc. -func (mock *GoCloakMock) GetPermissions(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetPermissionParams) ([]*gocloak.PermissionRepresentation, error) { - if mock.GetPermissionsFunc == nil { - panic("GoCloakMock.GetPermissionsFunc: method is nil but GoCloak.GetPermissions was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetPermissionParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Params: params, - } - mock.lockGetPermissions.Lock() - mock.calls.GetPermissions = append(mock.calls.GetPermissions, callInfo) - mock.lockGetPermissions.Unlock() - return mock.GetPermissionsFunc(ctx, token, realm, idOfClient, params) -} - -// GetPermissionsCalls gets all the calls that were made to GetPermissions. -// Check the length with: -// -// len(mockedGoCloak.GetPermissionsCalls()) -func (mock *GoCloakMock) GetPermissionsCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetPermissionParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetPermissionParams - } - mock.lockGetPermissions.RLock() - calls = mock.calls.GetPermissions - mock.lockGetPermissions.RUnlock() - return calls -} - -// GetPolicies calls GetPoliciesFunc. -func (mock *GoCloakMock) GetPolicies(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetPolicyParams) ([]*gocloak.PolicyRepresentation, error) { - if mock.GetPoliciesFunc == nil { - panic("GoCloakMock.GetPoliciesFunc: method is nil but GoCloak.GetPolicies was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetPolicyParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Params: params, - } - mock.lockGetPolicies.Lock() - mock.calls.GetPolicies = append(mock.calls.GetPolicies, callInfo) - mock.lockGetPolicies.Unlock() - return mock.GetPoliciesFunc(ctx, token, realm, idOfClient, params) -} - -// GetPoliciesCalls gets all the calls that were made to GetPolicies. -// Check the length with: -// -// len(mockedGoCloak.GetPoliciesCalls()) -func (mock *GoCloakMock) GetPoliciesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetPolicyParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetPolicyParams - } - mock.lockGetPolicies.RLock() - calls = mock.calls.GetPolicies - mock.lockGetPolicies.RUnlock() - return calls -} - -// GetPolicy calls GetPolicyFunc. -func (mock *GoCloakMock) GetPolicy(ctx context.Context, token string, realm string, idOfClient string, policyID string) (*gocloak.PolicyRepresentation, error) { - if mock.GetPolicyFunc == nil { - panic("GoCloakMock.GetPolicyFunc: method is nil but GoCloak.GetPolicy was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - PolicyID: policyID, - } - mock.lockGetPolicy.Lock() - mock.calls.GetPolicy = append(mock.calls.GetPolicy, callInfo) - mock.lockGetPolicy.Unlock() - return mock.GetPolicyFunc(ctx, token, realm, idOfClient, policyID) -} - -// GetPolicyCalls gets all the calls that were made to GetPolicy. -// Check the length with: -// -// len(mockedGoCloak.GetPolicyCalls()) -func (mock *GoCloakMock) GetPolicyCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - PolicyID string - } - mock.lockGetPolicy.RLock() - calls = mock.calls.GetPolicy - mock.lockGetPolicy.RUnlock() - return calls -} - -// GetRawUserInfo calls GetRawUserInfoFunc. -func (mock *GoCloakMock) GetRawUserInfo(ctx context.Context, accessToken string, realm string) (map[string]interface{}, error) { - if mock.GetRawUserInfoFunc == nil { - panic("GoCloakMock.GetRawUserInfoFunc: method is nil but GoCloak.GetRawUserInfo was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - } - mock.lockGetRawUserInfo.Lock() - mock.calls.GetRawUserInfo = append(mock.calls.GetRawUserInfo, callInfo) - mock.lockGetRawUserInfo.Unlock() - return mock.GetRawUserInfoFunc(ctx, accessToken, realm) -} - -// GetRawUserInfoCalls gets all the calls that were made to GetRawUserInfo. -// Check the length with: -// -// len(mockedGoCloak.GetRawUserInfoCalls()) -func (mock *GoCloakMock) GetRawUserInfoCalls() []struct { - Ctx context.Context - AccessToken string - Realm string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - } - mock.lockGetRawUserInfo.RLock() - calls = mock.calls.GetRawUserInfo - mock.lockGetRawUserInfo.RUnlock() - return calls -} - -// GetRealm calls GetRealmFunc. -func (mock *GoCloakMock) GetRealm(ctx context.Context, token string, realm string) (*gocloak.RealmRepresentation, error) { - if mock.GetRealmFunc == nil { - panic("GoCloakMock.GetRealmFunc: method is nil but GoCloak.GetRealm was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockGetRealm.Lock() - mock.calls.GetRealm = append(mock.calls.GetRealm, callInfo) - mock.lockGetRealm.Unlock() - return mock.GetRealmFunc(ctx, token, realm) -} - -// GetRealmCalls gets all the calls that were made to GetRealm. -// Check the length with: -// -// len(mockedGoCloak.GetRealmCalls()) -func (mock *GoCloakMock) GetRealmCalls() []struct { - Ctx context.Context - Token string - Realm string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - } - mock.lockGetRealm.RLock() - calls = mock.calls.GetRealm - mock.lockGetRealm.RUnlock() - return calls -} - -// GetRealmRole calls GetRealmRoleFunc. -func (mock *GoCloakMock) GetRealmRole(ctx context.Context, token string, realm string, roleName string) (*gocloak.Role, error) { - if mock.GetRealmRoleFunc == nil { - panic("GoCloakMock.GetRealmRoleFunc: method is nil but GoCloak.GetRealmRole was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleName string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleName: roleName, - } - mock.lockGetRealmRole.Lock() - mock.calls.GetRealmRole = append(mock.calls.GetRealmRole, callInfo) - mock.lockGetRealmRole.Unlock() - return mock.GetRealmRoleFunc(ctx, token, realm, roleName) -} - -// GetRealmRoleCalls gets all the calls that were made to GetRealmRole. -// Check the length with: -// -// len(mockedGoCloak.GetRealmRoleCalls()) -func (mock *GoCloakMock) GetRealmRoleCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleName string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleName string - } - mock.lockGetRealmRole.RLock() - calls = mock.calls.GetRealmRole - mock.lockGetRealmRole.RUnlock() - return calls -} - -// GetRealmRoleByID calls GetRealmRoleByIDFunc. -func (mock *GoCloakMock) GetRealmRoleByID(ctx context.Context, token string, realm string, roleID string) (*gocloak.Role, error) { - if mock.GetRealmRoleByIDFunc == nil { - panic("GoCloakMock.GetRealmRoleByIDFunc: method is nil but GoCloak.GetRealmRoleByID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleID: roleID, - } - mock.lockGetRealmRoleByID.Lock() - mock.calls.GetRealmRoleByID = append(mock.calls.GetRealmRoleByID, callInfo) - mock.lockGetRealmRoleByID.Unlock() - return mock.GetRealmRoleByIDFunc(ctx, token, realm, roleID) -} - -// GetRealmRoleByIDCalls gets all the calls that were made to GetRealmRoleByID. -// Check the length with: -// -// len(mockedGoCloak.GetRealmRoleByIDCalls()) -func (mock *GoCloakMock) GetRealmRoleByIDCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleID string - } - mock.lockGetRealmRoleByID.RLock() - calls = mock.calls.GetRealmRoleByID - mock.lockGetRealmRoleByID.RUnlock() - return calls -} - -// GetRealmRoles calls GetRealmRolesFunc. -func (mock *GoCloakMock) GetRealmRoles(ctx context.Context, accessToken string, realm string, params gocloak.GetRoleParams) ([]*gocloak.Role, error) { - if mock.GetRealmRolesFunc == nil { - panic("GoCloakMock.GetRealmRolesFunc: method is nil but GoCloak.GetRealmRoles was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetRoleParams - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Params: params, - } - mock.lockGetRealmRoles.Lock() - mock.calls.GetRealmRoles = append(mock.calls.GetRealmRoles, callInfo) - mock.lockGetRealmRoles.Unlock() - return mock.GetRealmRolesFunc(ctx, accessToken, realm, params) -} - -// GetRealmRolesCalls gets all the calls that were made to GetRealmRoles. -// Check the length with: -// -// len(mockedGoCloak.GetRealmRolesCalls()) -func (mock *GoCloakMock) GetRealmRolesCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetRoleParams -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetRoleParams - } - mock.lockGetRealmRoles.RLock() - calls = mock.calls.GetRealmRoles - mock.lockGetRealmRoles.RUnlock() - return calls -} - -// GetRealmRolesByGroupID calls GetRealmRolesByGroupIDFunc. -func (mock *GoCloakMock) GetRealmRolesByGroupID(ctx context.Context, accessToken string, realm string, groupID string) ([]*gocloak.Role, error) { - if mock.GetRealmRolesByGroupIDFunc == nil { - panic("GoCloakMock.GetRealmRolesByGroupIDFunc: method is nil but GoCloak.GetRealmRolesByGroupID was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - GroupID: groupID, - } - mock.lockGetRealmRolesByGroupID.Lock() - mock.calls.GetRealmRolesByGroupID = append(mock.calls.GetRealmRolesByGroupID, callInfo) - mock.lockGetRealmRolesByGroupID.Unlock() - return mock.GetRealmRolesByGroupIDFunc(ctx, accessToken, realm, groupID) -} - -// GetRealmRolesByGroupIDCalls gets all the calls that were made to GetRealmRolesByGroupID. -// Check the length with: -// -// len(mockedGoCloak.GetRealmRolesByGroupIDCalls()) -func (mock *GoCloakMock) GetRealmRolesByGroupIDCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - } - mock.lockGetRealmRolesByGroupID.RLock() - calls = mock.calls.GetRealmRolesByGroupID - mock.lockGetRealmRolesByGroupID.RUnlock() - return calls -} - -// GetRealmRolesByUserID calls GetRealmRolesByUserIDFunc. -func (mock *GoCloakMock) GetRealmRolesByUserID(ctx context.Context, accessToken string, realm string, userID string) ([]*gocloak.Role, error) { - if mock.GetRealmRolesByUserIDFunc == nil { - panic("GoCloakMock.GetRealmRolesByUserIDFunc: method is nil but GoCloak.GetRealmRolesByUserID was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - UserID: userID, - } - mock.lockGetRealmRolesByUserID.Lock() - mock.calls.GetRealmRolesByUserID = append(mock.calls.GetRealmRolesByUserID, callInfo) - mock.lockGetRealmRolesByUserID.Unlock() - return mock.GetRealmRolesByUserIDFunc(ctx, accessToken, realm, userID) -} - -// GetRealmRolesByUserIDCalls gets all the calls that were made to GetRealmRolesByUserID. -// Check the length with: -// -// len(mockedGoCloak.GetRealmRolesByUserIDCalls()) -func (mock *GoCloakMock) GetRealmRolesByUserIDCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - } - mock.lockGetRealmRolesByUserID.RLock() - calls = mock.calls.GetRealmRolesByUserID - mock.lockGetRealmRolesByUserID.RUnlock() - return calls -} - -// GetRealms calls GetRealmsFunc. -func (mock *GoCloakMock) GetRealms(ctx context.Context, token string) ([]*gocloak.RealmRepresentation, error) { - if mock.GetRealmsFunc == nil { - panic("GoCloakMock.GetRealmsFunc: method is nil but GoCloak.GetRealms was just called") - } - callInfo := struct { - Ctx context.Context - Token string - }{ - Ctx: ctx, - Token: token, - } - mock.lockGetRealms.Lock() - mock.calls.GetRealms = append(mock.calls.GetRealms, callInfo) - mock.lockGetRealms.Unlock() - return mock.GetRealmsFunc(ctx, token) -} - -// GetRealmsCalls gets all the calls that were made to GetRealms. -// Check the length with: -// -// len(mockedGoCloak.GetRealmsCalls()) -func (mock *GoCloakMock) GetRealmsCalls() []struct { - Ctx context.Context - Token string -} { - var calls []struct { - Ctx context.Context - Token string - } - mock.lockGetRealms.RLock() - calls = mock.calls.GetRealms - mock.lockGetRealms.RUnlock() - return calls -} - -// GetRequestingPartyPermissionDecision calls GetRequestingPartyPermissionDecisionFunc. -func (mock *GoCloakMock) GetRequestingPartyPermissionDecision(ctx context.Context, token string, realm string, options gocloak.RequestingPartyTokenOptions) (*gocloak.RequestingPartyPermissionDecision, error) { - if mock.GetRequestingPartyPermissionDecisionFunc == nil { - panic("GoCloakMock.GetRequestingPartyPermissionDecisionFunc: method is nil but GoCloak.GetRequestingPartyPermissionDecision was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Options gocloak.RequestingPartyTokenOptions - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Options: options, - } - mock.lockGetRequestingPartyPermissionDecision.Lock() - mock.calls.GetRequestingPartyPermissionDecision = append(mock.calls.GetRequestingPartyPermissionDecision, callInfo) - mock.lockGetRequestingPartyPermissionDecision.Unlock() - return mock.GetRequestingPartyPermissionDecisionFunc(ctx, token, realm, options) -} - -// GetRequestingPartyPermissionDecisionCalls gets all the calls that were made to GetRequestingPartyPermissionDecision. -// Check the length with: -// -// len(mockedGoCloak.GetRequestingPartyPermissionDecisionCalls()) -func (mock *GoCloakMock) GetRequestingPartyPermissionDecisionCalls() []struct { - Ctx context.Context - Token string - Realm string - Options gocloak.RequestingPartyTokenOptions -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Options gocloak.RequestingPartyTokenOptions - } - mock.lockGetRequestingPartyPermissionDecision.RLock() - calls = mock.calls.GetRequestingPartyPermissionDecision - mock.lockGetRequestingPartyPermissionDecision.RUnlock() - return calls -} - -// GetRequestingPartyPermissions calls GetRequestingPartyPermissionsFunc. -func (mock *GoCloakMock) GetRequestingPartyPermissions(ctx context.Context, token string, realm string, options gocloak.RequestingPartyTokenOptions) (*[]gocloak.RequestingPartyPermission, error) { - if mock.GetRequestingPartyPermissionsFunc == nil { - panic("GoCloakMock.GetRequestingPartyPermissionsFunc: method is nil but GoCloak.GetRequestingPartyPermissions was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Options gocloak.RequestingPartyTokenOptions - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Options: options, - } - mock.lockGetRequestingPartyPermissions.Lock() - mock.calls.GetRequestingPartyPermissions = append(mock.calls.GetRequestingPartyPermissions, callInfo) - mock.lockGetRequestingPartyPermissions.Unlock() - return mock.GetRequestingPartyPermissionsFunc(ctx, token, realm, options) -} - -// GetRequestingPartyPermissionsCalls gets all the calls that were made to GetRequestingPartyPermissions. -// Check the length with: -// -// len(mockedGoCloak.GetRequestingPartyPermissionsCalls()) -func (mock *GoCloakMock) GetRequestingPartyPermissionsCalls() []struct { - Ctx context.Context - Token string - Realm string - Options gocloak.RequestingPartyTokenOptions -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Options gocloak.RequestingPartyTokenOptions - } - mock.lockGetRequestingPartyPermissions.RLock() - calls = mock.calls.GetRequestingPartyPermissions - mock.lockGetRequestingPartyPermissions.RUnlock() - return calls -} - -// GetRequestingPartyToken calls GetRequestingPartyTokenFunc. -func (mock *GoCloakMock) GetRequestingPartyToken(ctx context.Context, token string, realm string, options gocloak.RequestingPartyTokenOptions) (*gocloak.JWT, error) { - if mock.GetRequestingPartyTokenFunc == nil { - panic("GoCloakMock.GetRequestingPartyTokenFunc: method is nil but GoCloak.GetRequestingPartyToken was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Options gocloak.RequestingPartyTokenOptions - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Options: options, - } - mock.lockGetRequestingPartyToken.Lock() - mock.calls.GetRequestingPartyToken = append(mock.calls.GetRequestingPartyToken, callInfo) - mock.lockGetRequestingPartyToken.Unlock() - return mock.GetRequestingPartyTokenFunc(ctx, token, realm, options) -} - -// GetRequestingPartyTokenCalls gets all the calls that were made to GetRequestingPartyToken. -// Check the length with: -// -// len(mockedGoCloak.GetRequestingPartyTokenCalls()) -func (mock *GoCloakMock) GetRequestingPartyTokenCalls() []struct { - Ctx context.Context - Token string - Realm string - Options gocloak.RequestingPartyTokenOptions -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Options gocloak.RequestingPartyTokenOptions - } - mock.lockGetRequestingPartyToken.RLock() - calls = mock.calls.GetRequestingPartyToken - mock.lockGetRequestingPartyToken.RUnlock() - return calls -} - -// GetResource calls GetResourceFunc. -func (mock *GoCloakMock) GetResource(ctx context.Context, token string, realm string, idOfClient string, resourceID string) (*gocloak.ResourceRepresentation, error) { - if mock.GetResourceFunc == nil { - panic("GoCloakMock.GetResourceFunc: method is nil but GoCloak.GetResource was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ResourceID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - ResourceID: resourceID, - } - mock.lockGetResource.Lock() - mock.calls.GetResource = append(mock.calls.GetResource, callInfo) - mock.lockGetResource.Unlock() - return mock.GetResourceFunc(ctx, token, realm, idOfClient, resourceID) -} - -// GetResourceCalls gets all the calls that were made to GetResource. -// Check the length with: -// -// len(mockedGoCloak.GetResourceCalls()) -func (mock *GoCloakMock) GetResourceCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ResourceID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ResourceID string - } - mock.lockGetResource.RLock() - calls = mock.calls.GetResource - mock.lockGetResource.RUnlock() - return calls -} - -// GetResourceClient calls GetResourceClientFunc. -func (mock *GoCloakMock) GetResourceClient(ctx context.Context, token string, realm string, resourceID string) (*gocloak.ResourceRepresentation, error) { - if mock.GetResourceClientFunc == nil { - panic("GoCloakMock.GetResourceClientFunc: method is nil but GoCloak.GetResourceClient was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - ResourceID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - ResourceID: resourceID, - } - mock.lockGetResourceClient.Lock() - mock.calls.GetResourceClient = append(mock.calls.GetResourceClient, callInfo) - mock.lockGetResourceClient.Unlock() - return mock.GetResourceClientFunc(ctx, token, realm, resourceID) -} - -// GetResourceClientCalls gets all the calls that were made to GetResourceClient. -// Check the length with: -// -// len(mockedGoCloak.GetResourceClientCalls()) -func (mock *GoCloakMock) GetResourceClientCalls() []struct { - Ctx context.Context - Token string - Realm string - ResourceID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - ResourceID string - } - mock.lockGetResourceClient.RLock() - calls = mock.calls.GetResourceClient - mock.lockGetResourceClient.RUnlock() - return calls -} - -// GetResourcePolicies calls GetResourcePoliciesFunc. -func (mock *GoCloakMock) GetResourcePolicies(ctx context.Context, token string, realm string, params gocloak.GetResourcePoliciesParams) ([]*gocloak.ResourcePolicyRepresentation, error) { - if mock.GetResourcePoliciesFunc == nil { - panic("GoCloakMock.GetResourcePoliciesFunc: method is nil but GoCloak.GetResourcePolicies was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetResourcePoliciesParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Params: params, - } - mock.lockGetResourcePolicies.Lock() - mock.calls.GetResourcePolicies = append(mock.calls.GetResourcePolicies, callInfo) - mock.lockGetResourcePolicies.Unlock() - return mock.GetResourcePoliciesFunc(ctx, token, realm, params) -} - -// GetResourcePoliciesCalls gets all the calls that were made to GetResourcePolicies. -// Check the length with: -// -// len(mockedGoCloak.GetResourcePoliciesCalls()) -func (mock *GoCloakMock) GetResourcePoliciesCalls() []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetResourcePoliciesParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetResourcePoliciesParams - } - mock.lockGetResourcePolicies.RLock() - calls = mock.calls.GetResourcePolicies - mock.lockGetResourcePolicies.RUnlock() - return calls -} - -// GetResourcePolicy calls GetResourcePolicyFunc. -func (mock *GoCloakMock) GetResourcePolicy(ctx context.Context, token string, realm string, permissionID string) (*gocloak.ResourcePolicyRepresentation, error) { - if mock.GetResourcePolicyFunc == nil { - panic("GoCloakMock.GetResourcePolicyFunc: method is nil but GoCloak.GetResourcePolicy was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - PermissionID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - PermissionID: permissionID, - } - mock.lockGetResourcePolicy.Lock() - mock.calls.GetResourcePolicy = append(mock.calls.GetResourcePolicy, callInfo) - mock.lockGetResourcePolicy.Unlock() - return mock.GetResourcePolicyFunc(ctx, token, realm, permissionID) -} - -// GetResourcePolicyCalls gets all the calls that were made to GetResourcePolicy. -// Check the length with: -// -// len(mockedGoCloak.GetResourcePolicyCalls()) -func (mock *GoCloakMock) GetResourcePolicyCalls() []struct { - Ctx context.Context - Token string - Realm string - PermissionID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - PermissionID string - } - mock.lockGetResourcePolicy.RLock() - calls = mock.calls.GetResourcePolicy - mock.lockGetResourcePolicy.RUnlock() - return calls -} - -// GetResources calls GetResourcesFunc. -func (mock *GoCloakMock) GetResources(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetResourceParams) ([]*gocloak.ResourceRepresentation, error) { - if mock.GetResourcesFunc == nil { - panic("GoCloakMock.GetResourcesFunc: method is nil but GoCloak.GetResources was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetResourceParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Params: params, - } - mock.lockGetResources.Lock() - mock.calls.GetResources = append(mock.calls.GetResources, callInfo) - mock.lockGetResources.Unlock() - return mock.GetResourcesFunc(ctx, token, realm, idOfClient, params) -} - -// GetResourcesCalls gets all the calls that were made to GetResources. -// Check the length with: -// -// len(mockedGoCloak.GetResourcesCalls()) -func (mock *GoCloakMock) GetResourcesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetResourceParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetResourceParams - } - mock.lockGetResources.RLock() - calls = mock.calls.GetResources - mock.lockGetResources.RUnlock() - return calls -} - -// GetResourcesClient calls GetResourcesClientFunc. -func (mock *GoCloakMock) GetResourcesClient(ctx context.Context, token string, realm string, params gocloak.GetResourceParams) ([]*gocloak.ResourceRepresentation, error) { - if mock.GetResourcesClientFunc == nil { - panic("GoCloakMock.GetResourcesClientFunc: method is nil but GoCloak.GetResourcesClient was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetResourceParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Params: params, - } - mock.lockGetResourcesClient.Lock() - mock.calls.GetResourcesClient = append(mock.calls.GetResourcesClient, callInfo) - mock.lockGetResourcesClient.Unlock() - return mock.GetResourcesClientFunc(ctx, token, realm, params) -} - -// GetResourcesClientCalls gets all the calls that were made to GetResourcesClient. -// Check the length with: -// -// len(mockedGoCloak.GetResourcesClientCalls()) -func (mock *GoCloakMock) GetResourcesClientCalls() []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetResourceParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetResourceParams - } - mock.lockGetResourcesClient.RLock() - calls = mock.calls.GetResourcesClient - mock.lockGetResourcesClient.RUnlock() - return calls -} - -// GetRoleMappingByGroupID calls GetRoleMappingByGroupIDFunc. -func (mock *GoCloakMock) GetRoleMappingByGroupID(ctx context.Context, accessToken string, realm string, groupID string) (*gocloak.MappingsRepresentation, error) { - if mock.GetRoleMappingByGroupIDFunc == nil { - panic("GoCloakMock.GetRoleMappingByGroupIDFunc: method is nil but GoCloak.GetRoleMappingByGroupID was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - GroupID: groupID, - } - mock.lockGetRoleMappingByGroupID.Lock() - mock.calls.GetRoleMappingByGroupID = append(mock.calls.GetRoleMappingByGroupID, callInfo) - mock.lockGetRoleMappingByGroupID.Unlock() - return mock.GetRoleMappingByGroupIDFunc(ctx, accessToken, realm, groupID) -} - -// GetRoleMappingByGroupIDCalls gets all the calls that were made to GetRoleMappingByGroupID. -// Check the length with: -// -// len(mockedGoCloak.GetRoleMappingByGroupIDCalls()) -func (mock *GoCloakMock) GetRoleMappingByGroupIDCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - } - mock.lockGetRoleMappingByGroupID.RLock() - calls = mock.calls.GetRoleMappingByGroupID - mock.lockGetRoleMappingByGroupID.RUnlock() - return calls -} - -// GetRoleMappingByUserID calls GetRoleMappingByUserIDFunc. -func (mock *GoCloakMock) GetRoleMappingByUserID(ctx context.Context, accessToken string, realm string, userID string) (*gocloak.MappingsRepresentation, error) { - if mock.GetRoleMappingByUserIDFunc == nil { - panic("GoCloakMock.GetRoleMappingByUserIDFunc: method is nil but GoCloak.GetRoleMappingByUserID was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - UserID: userID, - } - mock.lockGetRoleMappingByUserID.Lock() - mock.calls.GetRoleMappingByUserID = append(mock.calls.GetRoleMappingByUserID, callInfo) - mock.lockGetRoleMappingByUserID.Unlock() - return mock.GetRoleMappingByUserIDFunc(ctx, accessToken, realm, userID) -} - -// GetRoleMappingByUserIDCalls gets all the calls that were made to GetRoleMappingByUserID. -// Check the length with: -// -// len(mockedGoCloak.GetRoleMappingByUserIDCalls()) -func (mock *GoCloakMock) GetRoleMappingByUserIDCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - } - mock.lockGetRoleMappingByUserID.RLock() - calls = mock.calls.GetRoleMappingByUserID - mock.lockGetRoleMappingByUserID.RUnlock() - return calls -} - -// GetScope calls GetScopeFunc. -func (mock *GoCloakMock) GetScope(ctx context.Context, token string, realm string, idOfClient string, scopeID string) (*gocloak.ScopeRepresentation, error) { - if mock.GetScopeFunc == nil { - panic("GoCloakMock.GetScopeFunc: method is nil but GoCloak.GetScope was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - ScopeID: scopeID, - } - mock.lockGetScope.Lock() - mock.calls.GetScope = append(mock.calls.GetScope, callInfo) - mock.lockGetScope.Unlock() - return mock.GetScopeFunc(ctx, token, realm, idOfClient, scopeID) -} - -// GetScopeCalls gets all the calls that were made to GetScope. -// Check the length with: -// -// len(mockedGoCloak.GetScopeCalls()) -func (mock *GoCloakMock) GetScopeCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - } - mock.lockGetScope.RLock() - calls = mock.calls.GetScope - mock.lockGetScope.RUnlock() - return calls -} - -// GetScopes calls GetScopesFunc. -func (mock *GoCloakMock) GetScopes(ctx context.Context, token string, realm string, idOfClient string, params gocloak.GetScopeParams) ([]*gocloak.ScopeRepresentation, error) { - if mock.GetScopesFunc == nil { - panic("GoCloakMock.GetScopesFunc: method is nil but GoCloak.GetScopes was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetScopeParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Params: params, - } - mock.lockGetScopes.Lock() - mock.calls.GetScopes = append(mock.calls.GetScopes, callInfo) - mock.lockGetScopes.Unlock() - return mock.GetScopesFunc(ctx, token, realm, idOfClient, params) -} - -// GetScopesCalls gets all the calls that were made to GetScopes. -// Check the length with: -// -// len(mockedGoCloak.GetScopesCalls()) -func (mock *GoCloakMock) GetScopesCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetScopeParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Params gocloak.GetScopeParams - } - mock.lockGetScopes.RLock() - calls = mock.calls.GetScopes - mock.lockGetScopes.RUnlock() - return calls -} - -// GetServerInfo calls GetServerInfoFunc. -func (mock *GoCloakMock) GetServerInfo(ctx context.Context, accessToken string) (*gocloak.ServerInfoRepesentation, error) { - if mock.GetServerInfoFunc == nil { - panic("GoCloakMock.GetServerInfoFunc: method is nil but GoCloak.GetServerInfo was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - }{ - Ctx: ctx, - AccessToken: accessToken, - } - mock.lockGetServerInfo.Lock() - mock.calls.GetServerInfo = append(mock.calls.GetServerInfo, callInfo) - mock.lockGetServerInfo.Unlock() - return mock.GetServerInfoFunc(ctx, accessToken) -} - -// GetServerInfoCalls gets all the calls that were made to GetServerInfo. -// Check the length with: -// -// len(mockedGoCloak.GetServerInfoCalls()) -func (mock *GoCloakMock) GetServerInfoCalls() []struct { - Ctx context.Context - AccessToken string -} { - var calls []struct { - Ctx context.Context - AccessToken string - } - mock.lockGetServerInfo.RLock() - calls = mock.calls.GetServerInfo - mock.lockGetServerInfo.RUnlock() - return calls -} - -// GetToken calls GetTokenFunc. -func (mock *GoCloakMock) GetToken(ctx context.Context, realm string, options gocloak.TokenOptions) (*gocloak.JWT, error) { - if mock.GetTokenFunc == nil { - panic("GoCloakMock.GetTokenFunc: method is nil but GoCloak.GetToken was just called") - } - callInfo := struct { - Ctx context.Context - Realm string - Options gocloak.TokenOptions - }{ - Ctx: ctx, - Realm: realm, - Options: options, - } - mock.lockGetToken.Lock() - mock.calls.GetToken = append(mock.calls.GetToken, callInfo) - mock.lockGetToken.Unlock() - return mock.GetTokenFunc(ctx, realm, options) -} - -// GetTokenCalls gets all the calls that were made to GetToken. -// Check the length with: -// -// len(mockedGoCloak.GetTokenCalls()) -func (mock *GoCloakMock) GetTokenCalls() []struct { - Ctx context.Context - Realm string - Options gocloak.TokenOptions -} { - var calls []struct { - Ctx context.Context - Realm string - Options gocloak.TokenOptions - } - mock.lockGetToken.RLock() - calls = mock.calls.GetToken - mock.lockGetToken.RUnlock() - return calls -} - -// GetUserByID calls GetUserByIDFunc. -func (mock *GoCloakMock) GetUserByID(ctx context.Context, accessToken string, realm string, userID string) (*gocloak.User, error) { - if mock.GetUserByIDFunc == nil { - panic("GoCloakMock.GetUserByIDFunc: method is nil but GoCloak.GetUserByID was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - UserID: userID, - } - mock.lockGetUserByID.Lock() - mock.calls.GetUserByID = append(mock.calls.GetUserByID, callInfo) - mock.lockGetUserByID.Unlock() - return mock.GetUserByIDFunc(ctx, accessToken, realm, userID) -} - -// GetUserByIDCalls gets all the calls that were made to GetUserByID. -// Check the length with: -// -// len(mockedGoCloak.GetUserByIDCalls()) -func (mock *GoCloakMock) GetUserByIDCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - } - mock.lockGetUserByID.RLock() - calls = mock.calls.GetUserByID - mock.lockGetUserByID.RUnlock() - return calls -} - -// GetUserCount calls GetUserCountFunc. -func (mock *GoCloakMock) GetUserCount(ctx context.Context, accessToken string, realm string, params gocloak.GetUsersParams) (int, error) { - if mock.GetUserCountFunc == nil { - panic("GoCloakMock.GetUserCountFunc: method is nil but GoCloak.GetUserCount was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetUsersParams - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Params: params, - } - mock.lockGetUserCount.Lock() - mock.calls.GetUserCount = append(mock.calls.GetUserCount, callInfo) - mock.lockGetUserCount.Unlock() - return mock.GetUserCountFunc(ctx, accessToken, realm, params) -} - -// GetUserCountCalls gets all the calls that were made to GetUserCount. -// Check the length with: -// -// len(mockedGoCloak.GetUserCountCalls()) -func (mock *GoCloakMock) GetUserCountCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetUsersParams -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetUsersParams - } - mock.lockGetUserCount.RLock() - calls = mock.calls.GetUserCount - mock.lockGetUserCount.RUnlock() - return calls -} - -// GetUserFederatedIdentities calls GetUserFederatedIdentitiesFunc. -func (mock *GoCloakMock) GetUserFederatedIdentities(ctx context.Context, token string, realm string, userID string) ([]*gocloak.FederatedIdentityRepresentation, error) { - if mock.GetUserFederatedIdentitiesFunc == nil { - panic("GoCloakMock.GetUserFederatedIdentitiesFunc: method is nil but GoCloak.GetUserFederatedIdentities was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - } - mock.lockGetUserFederatedIdentities.Lock() - mock.calls.GetUserFederatedIdentities = append(mock.calls.GetUserFederatedIdentities, callInfo) - mock.lockGetUserFederatedIdentities.Unlock() - return mock.GetUserFederatedIdentitiesFunc(ctx, token, realm, userID) -} - -// GetUserFederatedIdentitiesCalls gets all the calls that were made to GetUserFederatedIdentities. -// Check the length with: -// -// len(mockedGoCloak.GetUserFederatedIdentitiesCalls()) -func (mock *GoCloakMock) GetUserFederatedIdentitiesCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - } - mock.lockGetUserFederatedIdentities.RLock() - calls = mock.calls.GetUserFederatedIdentities - mock.lockGetUserFederatedIdentities.RUnlock() - return calls -} - -// GetUserGroups calls GetUserGroupsFunc. -func (mock *GoCloakMock) GetUserGroups(ctx context.Context, accessToken string, realm string, userID string, params gocloak.GetGroupsParams) ([]*gocloak.Group, error) { - if mock.GetUserGroupsFunc == nil { - panic("GoCloakMock.GetUserGroupsFunc: method is nil but GoCloak.GetUserGroups was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - Params gocloak.GetGroupsParams - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - UserID: userID, - Params: params, - } - mock.lockGetUserGroups.Lock() - mock.calls.GetUserGroups = append(mock.calls.GetUserGroups, callInfo) - mock.lockGetUserGroups.Unlock() - return mock.GetUserGroupsFunc(ctx, accessToken, realm, userID, params) -} - -// GetUserGroupsCalls gets all the calls that were made to GetUserGroups. -// Check the length with: -// -// len(mockedGoCloak.GetUserGroupsCalls()) -func (mock *GoCloakMock) GetUserGroupsCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - Params gocloak.GetGroupsParams -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - Params gocloak.GetGroupsParams - } - mock.lockGetUserGroups.RLock() - calls = mock.calls.GetUserGroups - mock.lockGetUserGroups.RUnlock() - return calls -} - -// GetUserInfo calls GetUserInfoFunc. -func (mock *GoCloakMock) GetUserInfo(ctx context.Context, accessToken string, realm string) (*gocloak.UserInfo, error) { - if mock.GetUserInfoFunc == nil { - panic("GoCloakMock.GetUserInfoFunc: method is nil but GoCloak.GetUserInfo was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - } - mock.lockGetUserInfo.Lock() - mock.calls.GetUserInfo = append(mock.calls.GetUserInfo, callInfo) - mock.lockGetUserInfo.Unlock() - return mock.GetUserInfoFunc(ctx, accessToken, realm) -} - -// GetUserInfoCalls gets all the calls that were made to GetUserInfo. -// Check the length with: -// -// len(mockedGoCloak.GetUserInfoCalls()) -func (mock *GoCloakMock) GetUserInfoCalls() []struct { - Ctx context.Context - AccessToken string - Realm string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - } - mock.lockGetUserInfo.RLock() - calls = mock.calls.GetUserInfo - mock.lockGetUserInfo.RUnlock() - return calls -} - -// GetUserOfflineSessionsForClient calls GetUserOfflineSessionsForClientFunc. -func (mock *GoCloakMock) GetUserOfflineSessionsForClient(ctx context.Context, token string, realm string, userID string, idOfClient string) ([]*gocloak.UserSessionRepresentation, error) { - if mock.GetUserOfflineSessionsForClientFunc == nil { - panic("GoCloakMock.GetUserOfflineSessionsForClientFunc: method is nil but GoCloak.GetUserOfflineSessionsForClient was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - IdOfClient: idOfClient, - } - mock.lockGetUserOfflineSessionsForClient.Lock() - mock.calls.GetUserOfflineSessionsForClient = append(mock.calls.GetUserOfflineSessionsForClient, callInfo) - mock.lockGetUserOfflineSessionsForClient.Unlock() - return mock.GetUserOfflineSessionsForClientFunc(ctx, token, realm, userID, idOfClient) -} - -// GetUserOfflineSessionsForClientCalls gets all the calls that were made to GetUserOfflineSessionsForClient. -// Check the length with: -// -// len(mockedGoCloak.GetUserOfflineSessionsForClientCalls()) -func (mock *GoCloakMock) GetUserOfflineSessionsForClientCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - IdOfClient string - } - mock.lockGetUserOfflineSessionsForClient.RLock() - calls = mock.calls.GetUserOfflineSessionsForClient - mock.lockGetUserOfflineSessionsForClient.RUnlock() - return calls -} - -// GetUserPermissions calls GetUserPermissionsFunc. -func (mock *GoCloakMock) GetUserPermissions(ctx context.Context, token string, realm string, params gocloak.GetUserPermissionParams) ([]*gocloak.PermissionGrantResponseRepresentation, error) { - if mock.GetUserPermissionsFunc == nil { - panic("GoCloakMock.GetUserPermissionsFunc: method is nil but GoCloak.GetUserPermissions was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetUserPermissionParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Params: params, - } - mock.lockGetUserPermissions.Lock() - mock.calls.GetUserPermissions = append(mock.calls.GetUserPermissions, callInfo) - mock.lockGetUserPermissions.Unlock() - return mock.GetUserPermissionsFunc(ctx, token, realm, params) -} - -// GetUserPermissionsCalls gets all the calls that were made to GetUserPermissions. -// Check the length with: -// -// len(mockedGoCloak.GetUserPermissionsCalls()) -func (mock *GoCloakMock) GetUserPermissionsCalls() []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetUserPermissionParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Params gocloak.GetUserPermissionParams - } - mock.lockGetUserPermissions.RLock() - calls = mock.calls.GetUserPermissions - mock.lockGetUserPermissions.RUnlock() - return calls -} - -// GetUserSessions calls GetUserSessionsFunc. -func (mock *GoCloakMock) GetUserSessions(ctx context.Context, token string, realm string, userID string) ([]*gocloak.UserSessionRepresentation, error) { - if mock.GetUserSessionsFunc == nil { - panic("GoCloakMock.GetUserSessionsFunc: method is nil but GoCloak.GetUserSessions was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - } - mock.lockGetUserSessions.Lock() - mock.calls.GetUserSessions = append(mock.calls.GetUserSessions, callInfo) - mock.lockGetUserSessions.Unlock() - return mock.GetUserSessionsFunc(ctx, token, realm, userID) -} - -// GetUserSessionsCalls gets all the calls that were made to GetUserSessions. -// Check the length with: -// -// len(mockedGoCloak.GetUserSessionsCalls()) -func (mock *GoCloakMock) GetUserSessionsCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - } - mock.lockGetUserSessions.RLock() - calls = mock.calls.GetUserSessions - mock.lockGetUserSessions.RUnlock() - return calls -} - -// GetUsers calls GetUsersFunc. -func (mock *GoCloakMock) GetUsers(ctx context.Context, accessToken string, realm string, params gocloak.GetUsersParams) ([]*gocloak.User, error) { - if mock.GetUsersFunc == nil { - panic("GoCloakMock.GetUsersFunc: method is nil but GoCloak.GetUsers was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetUsersParams - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Params: params, - } - mock.lockGetUsers.Lock() - mock.calls.GetUsers = append(mock.calls.GetUsers, callInfo) - mock.lockGetUsers.Unlock() - return mock.GetUsersFunc(ctx, accessToken, realm, params) -} - -// GetUsersCalls gets all the calls that were made to GetUsers. -// Check the length with: -// -// len(mockedGoCloak.GetUsersCalls()) -func (mock *GoCloakMock) GetUsersCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetUsersParams -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Params gocloak.GetUsersParams - } - mock.lockGetUsers.RLock() - calls = mock.calls.GetUsers - mock.lockGetUsers.RUnlock() - return calls -} - -// GetUsersByClientRoleName calls GetUsersByClientRoleNameFunc. -func (mock *GoCloakMock) GetUsersByClientRoleName(ctx context.Context, token string, realm string, idOfClient string, roleName string, params gocloak.GetUsersByRoleParams) ([]*gocloak.User, error) { - if mock.GetUsersByClientRoleNameFunc == nil { - panic("GoCloakMock.GetUsersByClientRoleNameFunc: method is nil but GoCloak.GetUsersByClientRoleName was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - RoleName string - Params gocloak.GetUsersByRoleParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - RoleName: roleName, - Params: params, - } - mock.lockGetUsersByClientRoleName.Lock() - mock.calls.GetUsersByClientRoleName = append(mock.calls.GetUsersByClientRoleName, callInfo) - mock.lockGetUsersByClientRoleName.Unlock() - return mock.GetUsersByClientRoleNameFunc(ctx, token, realm, idOfClient, roleName, params) -} - -// GetUsersByClientRoleNameCalls gets all the calls that were made to GetUsersByClientRoleName. -// Check the length with: -// -// len(mockedGoCloak.GetUsersByClientRoleNameCalls()) -func (mock *GoCloakMock) GetUsersByClientRoleNameCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - RoleName string - Params gocloak.GetUsersByRoleParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - RoleName string - Params gocloak.GetUsersByRoleParams - } - mock.lockGetUsersByClientRoleName.RLock() - calls = mock.calls.GetUsersByClientRoleName - mock.lockGetUsersByClientRoleName.RUnlock() - return calls -} - -// GetUsersByRoleName calls GetUsersByRoleNameFunc. -func (mock *GoCloakMock) GetUsersByRoleName(ctx context.Context, token string, realm string, roleName string) ([]*gocloak.User, error) { - if mock.GetUsersByRoleNameFunc == nil { - panic("GoCloakMock.GetUsersByRoleNameFunc: method is nil but GoCloak.GetUsersByRoleName was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleName string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleName: roleName, - } - mock.lockGetUsersByRoleName.Lock() - mock.calls.GetUsersByRoleName = append(mock.calls.GetUsersByRoleName, callInfo) - mock.lockGetUsersByRoleName.Unlock() - return mock.GetUsersByRoleNameFunc(ctx, token, realm, roleName) -} - -// GetUsersByRoleNameCalls gets all the calls that were made to GetUsersByRoleName. -// Check the length with: -// -// len(mockedGoCloak.GetUsersByRoleNameCalls()) -func (mock *GoCloakMock) GetUsersByRoleNameCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleName string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleName string - } - mock.lockGetUsersByRoleName.RLock() - calls = mock.calls.GetUsersByRoleName - mock.lockGetUsersByRoleName.RUnlock() - return calls -} - -// GrantUserPermission calls GrantUserPermissionFunc. -func (mock *GoCloakMock) GrantUserPermission(ctx context.Context, token string, realm string, permission gocloak.PermissionGrantParams) (*gocloak.PermissionGrantResponseRepresentation, error) { - if mock.GrantUserPermissionFunc == nil { - panic("GoCloakMock.GrantUserPermissionFunc: method is nil but GoCloak.GrantUserPermission was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Permission gocloak.PermissionGrantParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Permission: permission, - } - mock.lockGrantUserPermission.Lock() - mock.calls.GrantUserPermission = append(mock.calls.GrantUserPermission, callInfo) - mock.lockGrantUserPermission.Unlock() - return mock.GrantUserPermissionFunc(ctx, token, realm, permission) -} - -// GrantUserPermissionCalls gets all the calls that were made to GrantUserPermission. -// Check the length with: -// -// len(mockedGoCloak.GrantUserPermissionCalls()) -func (mock *GoCloakMock) GrantUserPermissionCalls() []struct { - Ctx context.Context - Token string - Realm string - Permission gocloak.PermissionGrantParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Permission gocloak.PermissionGrantParams - } - mock.lockGrantUserPermission.RLock() - calls = mock.calls.GrantUserPermission - mock.lockGrantUserPermission.RUnlock() - return calls -} - -// ImportIdentityProviderConfig calls ImportIdentityProviderConfigFunc. -func (mock *GoCloakMock) ImportIdentityProviderConfig(ctx context.Context, token string, realm string, fromURL string, providerID string) (map[string]string, error) { - if mock.ImportIdentityProviderConfigFunc == nil { - panic("GoCloakMock.ImportIdentityProviderConfigFunc: method is nil but GoCloak.ImportIdentityProviderConfig was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - FromURL string - ProviderID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - FromURL: fromURL, - ProviderID: providerID, - } - mock.lockImportIdentityProviderConfig.Lock() - mock.calls.ImportIdentityProviderConfig = append(mock.calls.ImportIdentityProviderConfig, callInfo) - mock.lockImportIdentityProviderConfig.Unlock() - return mock.ImportIdentityProviderConfigFunc(ctx, token, realm, fromURL, providerID) -} - -// ImportIdentityProviderConfigCalls gets all the calls that were made to ImportIdentityProviderConfig. -// Check the length with: -// -// len(mockedGoCloak.ImportIdentityProviderConfigCalls()) -func (mock *GoCloakMock) ImportIdentityProviderConfigCalls() []struct { - Ctx context.Context - Token string - Realm string - FromURL string - ProviderID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - FromURL string - ProviderID string - } - mock.lockImportIdentityProviderConfig.RLock() - calls = mock.calls.ImportIdentityProviderConfig - mock.lockImportIdentityProviderConfig.RUnlock() - return calls -} - -// ImportIdentityProviderConfigFromFile calls ImportIdentityProviderConfigFromFileFunc. -func (mock *GoCloakMock) ImportIdentityProviderConfigFromFile(ctx context.Context, token string, realm string, providerID string, fileName string, fileBody io.Reader) (map[string]string, error) { - if mock.ImportIdentityProviderConfigFromFileFunc == nil { - panic("GoCloakMock.ImportIdentityProviderConfigFromFileFunc: method is nil but GoCloak.ImportIdentityProviderConfigFromFile was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - ProviderID string - FileName string - FileBody io.Reader - }{ - Ctx: ctx, - Token: token, - Realm: realm, - ProviderID: providerID, - FileName: fileName, - FileBody: fileBody, - } - mock.lockImportIdentityProviderConfigFromFile.Lock() - mock.calls.ImportIdentityProviderConfigFromFile = append(mock.calls.ImportIdentityProviderConfigFromFile, callInfo) - mock.lockImportIdentityProviderConfigFromFile.Unlock() - return mock.ImportIdentityProviderConfigFromFileFunc(ctx, token, realm, providerID, fileName, fileBody) -} - -// ImportIdentityProviderConfigFromFileCalls gets all the calls that were made to ImportIdentityProviderConfigFromFile. -// Check the length with: -// -// len(mockedGoCloak.ImportIdentityProviderConfigFromFileCalls()) -func (mock *GoCloakMock) ImportIdentityProviderConfigFromFileCalls() []struct { - Ctx context.Context - Token string - Realm string - ProviderID string - FileName string - FileBody io.Reader -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - ProviderID string - FileName string - FileBody io.Reader - } - mock.lockImportIdentityProviderConfigFromFile.RLock() - calls = mock.calls.ImportIdentityProviderConfigFromFile - mock.lockImportIdentityProviderConfigFromFile.RUnlock() - return calls -} - -// Login calls LoginFunc. -func (mock *GoCloakMock) Login(ctx context.Context, clientID string, clientSecret string, realm string, username string, password string) (*gocloak.JWT, error) { - if mock.LoginFunc == nil { - panic("GoCloakMock.LoginFunc: method is nil but GoCloak.Login was just called") - } - callInfo := struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - Username string - Password string - }{ - Ctx: ctx, - ClientID: clientID, - ClientSecret: clientSecret, - Realm: realm, - Username: username, - Password: password, - } - mock.lockLogin.Lock() - mock.calls.Login = append(mock.calls.Login, callInfo) - mock.lockLogin.Unlock() - return mock.LoginFunc(ctx, clientID, clientSecret, realm, username, password) -} - -// LoginCalls gets all the calls that were made to Login. -// Check the length with: -// -// len(mockedGoCloak.LoginCalls()) -func (mock *GoCloakMock) LoginCalls() []struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - Username string - Password string -} { - var calls []struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - Username string - Password string - } - mock.lockLogin.RLock() - calls = mock.calls.Login - mock.lockLogin.RUnlock() - return calls -} - -// LoginAdmin calls LoginAdminFunc. -func (mock *GoCloakMock) LoginAdmin(ctx context.Context, username string, password string, realm string) (*gocloak.JWT, error) { - if mock.LoginAdminFunc == nil { - panic("GoCloakMock.LoginAdminFunc: method is nil but GoCloak.LoginAdmin was just called") - } - callInfo := struct { - Ctx context.Context - Username string - Password string - Realm string - }{ - Ctx: ctx, - Username: username, - Password: password, - Realm: realm, - } - mock.lockLoginAdmin.Lock() - mock.calls.LoginAdmin = append(mock.calls.LoginAdmin, callInfo) - mock.lockLoginAdmin.Unlock() - return mock.LoginAdminFunc(ctx, username, password, realm) -} - -// LoginAdminCalls gets all the calls that were made to LoginAdmin. -// Check the length with: -// -// len(mockedGoCloak.LoginAdminCalls()) -func (mock *GoCloakMock) LoginAdminCalls() []struct { - Ctx context.Context - Username string - Password string - Realm string -} { - var calls []struct { - Ctx context.Context - Username string - Password string - Realm string - } - mock.lockLoginAdmin.RLock() - calls = mock.calls.LoginAdmin - mock.lockLoginAdmin.RUnlock() - return calls -} - -// LoginClient calls LoginClientFunc. -func (mock *GoCloakMock) LoginClient(ctx context.Context, clientID string, clientSecret string, realm string) (*gocloak.JWT, error) { - if mock.LoginClientFunc == nil { - panic("GoCloakMock.LoginClientFunc: method is nil but GoCloak.LoginClient was just called") - } - callInfo := struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - }{ - Ctx: ctx, - ClientID: clientID, - ClientSecret: clientSecret, - Realm: realm, - } - mock.lockLoginClient.Lock() - mock.calls.LoginClient = append(mock.calls.LoginClient, callInfo) - mock.lockLoginClient.Unlock() - return mock.LoginClientFunc(ctx, clientID, clientSecret, realm) -} - -// LoginClientCalls gets all the calls that were made to LoginClient. -// Check the length with: -// -// len(mockedGoCloak.LoginClientCalls()) -func (mock *GoCloakMock) LoginClientCalls() []struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string -} { - var calls []struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - } - mock.lockLoginClient.RLock() - calls = mock.calls.LoginClient - mock.lockLoginClient.RUnlock() - return calls -} - -// LoginClientSignedJWT calls LoginClientSignedJWTFunc. -func (mock *GoCloakMock) LoginClientSignedJWT(ctx context.Context, idOfClient string, realm string, key interface{}, signedMethod jwt.SigningMethod, expiresAt *jwt.NumericDate) (*gocloak.JWT, error) { - if mock.LoginClientSignedJWTFunc == nil { - panic("GoCloakMock.LoginClientSignedJWTFunc: method is nil but GoCloak.LoginClientSignedJWT was just called") - } - callInfo := struct { - Ctx context.Context - IdOfClient string - Realm string - Key interface{} - SignedMethod jwt.SigningMethod - ExpiresAt *jwt.NumericDate - }{ - Ctx: ctx, - IdOfClient: idOfClient, - Realm: realm, - Key: key, - SignedMethod: signedMethod, - ExpiresAt: expiresAt, - } - mock.lockLoginClientSignedJWT.Lock() - mock.calls.LoginClientSignedJWT = append(mock.calls.LoginClientSignedJWT, callInfo) - mock.lockLoginClientSignedJWT.Unlock() - return mock.LoginClientSignedJWTFunc(ctx, idOfClient, realm, key, signedMethod, expiresAt) -} - -// LoginClientSignedJWTCalls gets all the calls that were made to LoginClientSignedJWT. -// Check the length with: -// -// len(mockedGoCloak.LoginClientSignedJWTCalls()) -func (mock *GoCloakMock) LoginClientSignedJWTCalls() []struct { - Ctx context.Context - IdOfClient string - Realm string - Key interface{} - SignedMethod jwt.SigningMethod - ExpiresAt *jwt.NumericDate -} { - var calls []struct { - Ctx context.Context - IdOfClient string - Realm string - Key interface{} - SignedMethod jwt.SigningMethod - ExpiresAt *jwt.NumericDate - } - mock.lockLoginClientSignedJWT.RLock() - calls = mock.calls.LoginClientSignedJWT - mock.lockLoginClientSignedJWT.RUnlock() - return calls -} - -// LoginClientTokenExchange calls LoginClientTokenExchangeFunc. -func (mock *GoCloakMock) LoginClientTokenExchange(ctx context.Context, clientID string, token string, clientSecret string, realm string, targetClient string, userID string) (*gocloak.JWT, error) { - if mock.LoginClientTokenExchangeFunc == nil { - panic("GoCloakMock.LoginClientTokenExchangeFunc: method is nil but GoCloak.LoginClientTokenExchange was just called") - } - callInfo := struct { - Ctx context.Context - ClientID string - Token string - ClientSecret string - Realm string - TargetClient string - UserID string - }{ - Ctx: ctx, - ClientID: clientID, - Token: token, - ClientSecret: clientSecret, - Realm: realm, - TargetClient: targetClient, - UserID: userID, - } - mock.lockLoginClientTokenExchange.Lock() - mock.calls.LoginClientTokenExchange = append(mock.calls.LoginClientTokenExchange, callInfo) - mock.lockLoginClientTokenExchange.Unlock() - return mock.LoginClientTokenExchangeFunc(ctx, clientID, token, clientSecret, realm, targetClient, userID) -} - -// LoginClientTokenExchangeCalls gets all the calls that were made to LoginClientTokenExchange. -// Check the length with: -// -// len(mockedGoCloak.LoginClientTokenExchangeCalls()) -func (mock *GoCloakMock) LoginClientTokenExchangeCalls() []struct { - Ctx context.Context - ClientID string - Token string - ClientSecret string - Realm string - TargetClient string - UserID string -} { - var calls []struct { - Ctx context.Context - ClientID string - Token string - ClientSecret string - Realm string - TargetClient string - UserID string - } - mock.lockLoginClientTokenExchange.RLock() - calls = mock.calls.LoginClientTokenExchange - mock.lockLoginClientTokenExchange.RUnlock() - return calls -} - -// LoginOtp calls LoginOtpFunc. -func (mock *GoCloakMock) LoginOtp(ctx context.Context, clientID string, clientSecret string, realm string, username string, password string, totp string) (*gocloak.JWT, error) { - if mock.LoginOtpFunc == nil { - panic("GoCloakMock.LoginOtpFunc: method is nil but GoCloak.LoginOtp was just called") - } - callInfo := struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - Username string - Password string - Totp string - }{ - Ctx: ctx, - ClientID: clientID, - ClientSecret: clientSecret, - Realm: realm, - Username: username, - Password: password, - Totp: totp, - } - mock.lockLoginOtp.Lock() - mock.calls.LoginOtp = append(mock.calls.LoginOtp, callInfo) - mock.lockLoginOtp.Unlock() - return mock.LoginOtpFunc(ctx, clientID, clientSecret, realm, username, password, totp) -} - -// LoginOtpCalls gets all the calls that were made to LoginOtp. -// Check the length with: -// -// len(mockedGoCloak.LoginOtpCalls()) -func (mock *GoCloakMock) LoginOtpCalls() []struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - Username string - Password string - Totp string -} { - var calls []struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - Username string - Password string - Totp string - } - mock.lockLoginOtp.RLock() - calls = mock.calls.LoginOtp - mock.lockLoginOtp.RUnlock() - return calls -} - -// Logout calls LogoutFunc. -func (mock *GoCloakMock) Logout(ctx context.Context, clientID string, clientSecret string, realm string, refreshToken string) error { - if mock.LogoutFunc == nil { - panic("GoCloakMock.LogoutFunc: method is nil but GoCloak.Logout was just called") - } - callInfo := struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - RefreshToken string - }{ - Ctx: ctx, - ClientID: clientID, - ClientSecret: clientSecret, - Realm: realm, - RefreshToken: refreshToken, - } - mock.lockLogout.Lock() - mock.calls.Logout = append(mock.calls.Logout, callInfo) - mock.lockLogout.Unlock() - return mock.LogoutFunc(ctx, clientID, clientSecret, realm, refreshToken) -} - -// LogoutCalls gets all the calls that were made to Logout. -// Check the length with: -// -// len(mockedGoCloak.LogoutCalls()) -func (mock *GoCloakMock) LogoutCalls() []struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - RefreshToken string -} { - var calls []struct { - Ctx context.Context - ClientID string - ClientSecret string - Realm string - RefreshToken string - } - mock.lockLogout.RLock() - calls = mock.calls.Logout - mock.lockLogout.RUnlock() - return calls -} - -// LogoutAllSessions calls LogoutAllSessionsFunc. -func (mock *GoCloakMock) LogoutAllSessions(ctx context.Context, accessToken string, realm string, userID string) error { - if mock.LogoutAllSessionsFunc == nil { - panic("GoCloakMock.LogoutAllSessionsFunc: method is nil but GoCloak.LogoutAllSessions was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - UserID: userID, - } - mock.lockLogoutAllSessions.Lock() - mock.calls.LogoutAllSessions = append(mock.calls.LogoutAllSessions, callInfo) - mock.lockLogoutAllSessions.Unlock() - return mock.LogoutAllSessionsFunc(ctx, accessToken, realm, userID) -} - -// LogoutAllSessionsCalls gets all the calls that were made to LogoutAllSessions. -// Check the length with: -// -// len(mockedGoCloak.LogoutAllSessionsCalls()) -func (mock *GoCloakMock) LogoutAllSessionsCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - } - mock.lockLogoutAllSessions.RLock() - calls = mock.calls.LogoutAllSessions - mock.lockLogoutAllSessions.RUnlock() - return calls -} - -// LogoutPublicClient calls LogoutPublicClientFunc. -func (mock *GoCloakMock) LogoutPublicClient(ctx context.Context, idOfClient string, realm string, accessToken string, refreshToken string) error { - if mock.LogoutPublicClientFunc == nil { - panic("GoCloakMock.LogoutPublicClientFunc: method is nil but GoCloak.LogoutPublicClient was just called") - } - callInfo := struct { - Ctx context.Context - IdOfClient string - Realm string - AccessToken string - RefreshToken string - }{ - Ctx: ctx, - IdOfClient: idOfClient, - Realm: realm, - AccessToken: accessToken, - RefreshToken: refreshToken, - } - mock.lockLogoutPublicClient.Lock() - mock.calls.LogoutPublicClient = append(mock.calls.LogoutPublicClient, callInfo) - mock.lockLogoutPublicClient.Unlock() - return mock.LogoutPublicClientFunc(ctx, idOfClient, realm, accessToken, refreshToken) -} - -// LogoutPublicClientCalls gets all the calls that were made to LogoutPublicClient. -// Check the length with: -// -// len(mockedGoCloak.LogoutPublicClientCalls()) -func (mock *GoCloakMock) LogoutPublicClientCalls() []struct { - Ctx context.Context - IdOfClient string - Realm string - AccessToken string - RefreshToken string -} { - var calls []struct { - Ctx context.Context - IdOfClient string - Realm string - AccessToken string - RefreshToken string - } - mock.lockLogoutPublicClient.RLock() - calls = mock.calls.LogoutPublicClient - mock.lockLogoutPublicClient.RUnlock() - return calls -} - -// LogoutUserSession calls LogoutUserSessionFunc. -func (mock *GoCloakMock) LogoutUserSession(ctx context.Context, accessToken string, realm string, session string) error { - if mock.LogoutUserSessionFunc == nil { - panic("GoCloakMock.LogoutUserSessionFunc: method is nil but GoCloak.LogoutUserSession was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Session string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Session: session, - } - mock.lockLogoutUserSession.Lock() - mock.calls.LogoutUserSession = append(mock.calls.LogoutUserSession, callInfo) - mock.lockLogoutUserSession.Unlock() - return mock.LogoutUserSessionFunc(ctx, accessToken, realm, session) -} - -// LogoutUserSessionCalls gets all the calls that were made to LogoutUserSession. -// Check the length with: -// -// len(mockedGoCloak.LogoutUserSessionCalls()) -func (mock *GoCloakMock) LogoutUserSessionCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Session string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Session string - } - mock.lockLogoutUserSession.RLock() - calls = mock.calls.LogoutUserSession - mock.lockLogoutUserSession.RUnlock() - return calls -} - -// MoveCredentialBehind calls MoveCredentialBehindFunc. -func (mock *GoCloakMock) MoveCredentialBehind(ctx context.Context, token string, realm string, userID string, credentialID string, newPreviousCredentialID string) error { - if mock.MoveCredentialBehindFunc == nil { - panic("GoCloakMock.MoveCredentialBehindFunc: method is nil but GoCloak.MoveCredentialBehind was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string - NewPreviousCredentialID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - CredentialID: credentialID, - NewPreviousCredentialID: newPreviousCredentialID, - } - mock.lockMoveCredentialBehind.Lock() - mock.calls.MoveCredentialBehind = append(mock.calls.MoveCredentialBehind, callInfo) - mock.lockMoveCredentialBehind.Unlock() - return mock.MoveCredentialBehindFunc(ctx, token, realm, userID, credentialID, newPreviousCredentialID) -} - -// MoveCredentialBehindCalls gets all the calls that were made to MoveCredentialBehind. -// Check the length with: -// -// len(mockedGoCloak.MoveCredentialBehindCalls()) -func (mock *GoCloakMock) MoveCredentialBehindCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string - NewPreviousCredentialID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string - NewPreviousCredentialID string - } - mock.lockMoveCredentialBehind.RLock() - calls = mock.calls.MoveCredentialBehind - mock.lockMoveCredentialBehind.RUnlock() - return calls -} - -// MoveCredentialToFirst calls MoveCredentialToFirstFunc. -func (mock *GoCloakMock) MoveCredentialToFirst(ctx context.Context, token string, realm string, userID string, credentialID string) error { - if mock.MoveCredentialToFirstFunc == nil { - panic("GoCloakMock.MoveCredentialToFirstFunc: method is nil but GoCloak.MoveCredentialToFirst was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - CredentialID: credentialID, - } - mock.lockMoveCredentialToFirst.Lock() - mock.calls.MoveCredentialToFirst = append(mock.calls.MoveCredentialToFirst, callInfo) - mock.lockMoveCredentialToFirst.Unlock() - return mock.MoveCredentialToFirstFunc(ctx, token, realm, userID, credentialID) -} - -// MoveCredentialToFirstCalls gets all the calls that were made to MoveCredentialToFirst. -// Check the length with: -// -// len(mockedGoCloak.MoveCredentialToFirstCalls()) -func (mock *GoCloakMock) MoveCredentialToFirstCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string - } - mock.lockMoveCredentialToFirst.RLock() - calls = mock.calls.MoveCredentialToFirst - mock.lockMoveCredentialToFirst.RUnlock() - return calls -} - -// RefreshToken calls RefreshTokenFunc. -func (mock *GoCloakMock) RefreshToken(ctx context.Context, refreshToken string, clientID string, clientSecret string, realm string) (*gocloak.JWT, error) { - if mock.RefreshTokenFunc == nil { - panic("GoCloakMock.RefreshTokenFunc: method is nil but GoCloak.RefreshToken was just called") - } - callInfo := struct { - Ctx context.Context - RefreshToken string - ClientID string - ClientSecret string - Realm string - }{ - Ctx: ctx, - RefreshToken: refreshToken, - ClientID: clientID, - ClientSecret: clientSecret, - Realm: realm, - } - mock.lockRefreshToken.Lock() - mock.calls.RefreshToken = append(mock.calls.RefreshToken, callInfo) - mock.lockRefreshToken.Unlock() - return mock.RefreshTokenFunc(ctx, refreshToken, clientID, clientSecret, realm) -} - -// RefreshTokenCalls gets all the calls that were made to RefreshToken. -// Check the length with: -// -// len(mockedGoCloak.RefreshTokenCalls()) -func (mock *GoCloakMock) RefreshTokenCalls() []struct { - Ctx context.Context - RefreshToken string - ClientID string - ClientSecret string - Realm string -} { - var calls []struct { - Ctx context.Context - RefreshToken string - ClientID string - ClientSecret string - Realm string - } - mock.lockRefreshToken.RLock() - calls = mock.calls.RefreshToken - mock.lockRefreshToken.RUnlock() - return calls -} - -// RegenerateClientSecret calls RegenerateClientSecretFunc. -func (mock *GoCloakMock) RegenerateClientSecret(ctx context.Context, token string, realm string, idOfClient string) (*gocloak.CredentialRepresentation, error) { - if mock.RegenerateClientSecretFunc == nil { - panic("GoCloakMock.RegenerateClientSecretFunc: method is nil but GoCloak.RegenerateClientSecret was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - } - mock.lockRegenerateClientSecret.Lock() - mock.calls.RegenerateClientSecret = append(mock.calls.RegenerateClientSecret, callInfo) - mock.lockRegenerateClientSecret.Unlock() - return mock.RegenerateClientSecretFunc(ctx, token, realm, idOfClient) -} - -// RegenerateClientSecretCalls gets all the calls that were made to RegenerateClientSecret. -// Check the length with: -// -// len(mockedGoCloak.RegenerateClientSecretCalls()) -func (mock *GoCloakMock) RegenerateClientSecretCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - } - mock.lockRegenerateClientSecret.RLock() - calls = mock.calls.RegenerateClientSecret - mock.lockRegenerateClientSecret.RUnlock() - return calls -} - -// RemoveDefaultGroup calls RemoveDefaultGroupFunc. -func (mock *GoCloakMock) RemoveDefaultGroup(ctx context.Context, accessToken string, realm string, groupID string) error { - if mock.RemoveDefaultGroupFunc == nil { - panic("GoCloakMock.RemoveDefaultGroupFunc: method is nil but GoCloak.RemoveDefaultGroup was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - GroupID: groupID, - } - mock.lockRemoveDefaultGroup.Lock() - mock.calls.RemoveDefaultGroup = append(mock.calls.RemoveDefaultGroup, callInfo) - mock.lockRemoveDefaultGroup.Unlock() - return mock.RemoveDefaultGroupFunc(ctx, accessToken, realm, groupID) -} - -// RemoveDefaultGroupCalls gets all the calls that were made to RemoveDefaultGroup. -// Check the length with: -// -// len(mockedGoCloak.RemoveDefaultGroupCalls()) -func (mock *GoCloakMock) RemoveDefaultGroupCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - GroupID string - } - mock.lockRemoveDefaultGroup.RLock() - calls = mock.calls.RemoveDefaultGroup - mock.lockRemoveDefaultGroup.RUnlock() - return calls -} - -// RemoveDefaultScopeFromClient calls RemoveDefaultScopeFromClientFunc. -func (mock *GoCloakMock) RemoveDefaultScopeFromClient(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error { - if mock.RemoveDefaultScopeFromClientFunc == nil { - panic("GoCloakMock.RemoveDefaultScopeFromClientFunc: method is nil but GoCloak.RemoveDefaultScopeFromClient was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - ScopeID: scopeID, - } - mock.lockRemoveDefaultScopeFromClient.Lock() - mock.calls.RemoveDefaultScopeFromClient = append(mock.calls.RemoveDefaultScopeFromClient, callInfo) - mock.lockRemoveDefaultScopeFromClient.Unlock() - return mock.RemoveDefaultScopeFromClientFunc(ctx, token, realm, idOfClient, scopeID) -} - -// RemoveDefaultScopeFromClientCalls gets all the calls that were made to RemoveDefaultScopeFromClient. -// Check the length with: -// -// len(mockedGoCloak.RemoveDefaultScopeFromClientCalls()) -func (mock *GoCloakMock) RemoveDefaultScopeFromClientCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - } - mock.lockRemoveDefaultScopeFromClient.RLock() - calls = mock.calls.RemoveDefaultScopeFromClient - mock.lockRemoveDefaultScopeFromClient.RUnlock() - return calls -} - -// RemoveOptionalScopeFromClient calls RemoveOptionalScopeFromClientFunc. -func (mock *GoCloakMock) RemoveOptionalScopeFromClient(ctx context.Context, token string, realm string, idOfClient string, scopeID string) error { - if mock.RemoveOptionalScopeFromClientFunc == nil { - panic("GoCloakMock.RemoveOptionalScopeFromClientFunc: method is nil but GoCloak.RemoveOptionalScopeFromClient was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - ScopeID: scopeID, - } - mock.lockRemoveOptionalScopeFromClient.Lock() - mock.calls.RemoveOptionalScopeFromClient = append(mock.calls.RemoveOptionalScopeFromClient, callInfo) - mock.lockRemoveOptionalScopeFromClient.Unlock() - return mock.RemoveOptionalScopeFromClientFunc(ctx, token, realm, idOfClient, scopeID) -} - -// RemoveOptionalScopeFromClientCalls gets all the calls that were made to RemoveOptionalScopeFromClient. -// Check the length with: -// -// len(mockedGoCloak.RemoveOptionalScopeFromClientCalls()) -func (mock *GoCloakMock) RemoveOptionalScopeFromClientCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - ScopeID string - } - mock.lockRemoveOptionalScopeFromClient.RLock() - calls = mock.calls.RemoveOptionalScopeFromClient - mock.lockRemoveOptionalScopeFromClient.RUnlock() - return calls -} - -// RestyClient calls RestyClientFunc. -func (mock *GoCloakMock) RestyClient() *resty.Client { - if mock.RestyClientFunc == nil { - panic("GoCloakMock.RestyClientFunc: method is nil but GoCloak.RestyClient was just called") - } - callInfo := struct { - }{} - mock.lockRestyClient.Lock() - mock.calls.RestyClient = append(mock.calls.RestyClient, callInfo) - mock.lockRestyClient.Unlock() - return mock.RestyClientFunc() -} - -// RestyClientCalls gets all the calls that were made to RestyClient. -// Check the length with: -// -// len(mockedGoCloak.RestyClientCalls()) -func (mock *GoCloakMock) RestyClientCalls() []struct { -} { - var calls []struct { - } - mock.lockRestyClient.RLock() - calls = mock.calls.RestyClient - mock.lockRestyClient.RUnlock() - return calls -} - -// RetrospectToken calls RetrospectTokenFunc. -func (mock *GoCloakMock) RetrospectToken(ctx context.Context, accessToken string, clientID string, clientSecret string, realm string) (*gocloak.RetrospecTokenResult, error) { - if mock.RetrospectTokenFunc == nil { - panic("GoCloakMock.RetrospectTokenFunc: method is nil but GoCloak.RetrospectToken was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - ClientID string - ClientSecret string - Realm string - }{ - Ctx: ctx, - AccessToken: accessToken, - ClientID: clientID, - ClientSecret: clientSecret, - Realm: realm, - } - mock.lockRetrospectToken.Lock() - mock.calls.RetrospectToken = append(mock.calls.RetrospectToken, callInfo) - mock.lockRetrospectToken.Unlock() - return mock.RetrospectTokenFunc(ctx, accessToken, clientID, clientSecret, realm) -} - -// RetrospectTokenCalls gets all the calls that were made to RetrospectToken. -// Check the length with: -// -// len(mockedGoCloak.RetrospectTokenCalls()) -func (mock *GoCloakMock) RetrospectTokenCalls() []struct { - Ctx context.Context - AccessToken string - ClientID string - ClientSecret string - Realm string -} { - var calls []struct { - Ctx context.Context - AccessToken string - ClientID string - ClientSecret string - Realm string - } - mock.lockRetrospectToken.RLock() - calls = mock.calls.RetrospectToken - mock.lockRetrospectToken.RUnlock() - return calls -} - -// RevokeUserConsents calls RevokeUserConsentsFunc. -func (mock *GoCloakMock) RevokeUserConsents(ctx context.Context, accessToken string, realm string, userID string, clientID string) error { - if mock.RevokeUserConsentsFunc == nil { - panic("GoCloakMock.RevokeUserConsentsFunc: method is nil but GoCloak.RevokeUserConsents was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - ClientID string - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - UserID: userID, - ClientID: clientID, - } - mock.lockRevokeUserConsents.Lock() - mock.calls.RevokeUserConsents = append(mock.calls.RevokeUserConsents, callInfo) - mock.lockRevokeUserConsents.Unlock() - return mock.RevokeUserConsentsFunc(ctx, accessToken, realm, userID, clientID) -} - -// RevokeUserConsentsCalls gets all the calls that were made to RevokeUserConsents. -// Check the length with: -// -// len(mockedGoCloak.RevokeUserConsentsCalls()) -func (mock *GoCloakMock) RevokeUserConsentsCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - ClientID string -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - UserID string - ClientID string - } - mock.lockRevokeUserConsents.RLock() - calls = mock.calls.RevokeUserConsents - mock.lockRevokeUserConsents.RUnlock() - return calls -} - -// SetPassword calls SetPasswordFunc. -func (mock *GoCloakMock) SetPassword(ctx context.Context, token string, userID string, realm string, password string, temporary bool) error { - if mock.SetPasswordFunc == nil { - panic("GoCloakMock.SetPasswordFunc: method is nil but GoCloak.SetPassword was just called") - } - callInfo := struct { - Ctx context.Context - Token string - UserID string - Realm string - Password string - Temporary bool - }{ - Ctx: ctx, - Token: token, - UserID: userID, - Realm: realm, - Password: password, - Temporary: temporary, - } - mock.lockSetPassword.Lock() - mock.calls.SetPassword = append(mock.calls.SetPassword, callInfo) - mock.lockSetPassword.Unlock() - return mock.SetPasswordFunc(ctx, token, userID, realm, password, temporary) -} - -// SetPasswordCalls gets all the calls that were made to SetPassword. -// Check the length with: -// -// len(mockedGoCloak.SetPasswordCalls()) -func (mock *GoCloakMock) SetPasswordCalls() []struct { - Ctx context.Context - Token string - UserID string - Realm string - Password string - Temporary bool -} { - var calls []struct { - Ctx context.Context - Token string - UserID string - Realm string - Password string - Temporary bool - } - mock.lockSetPassword.RLock() - calls = mock.calls.SetPassword - mock.lockSetPassword.RUnlock() - return calls -} - -// SetRestyClient calls SetRestyClientFunc. -func (mock *GoCloakMock) SetRestyClient(restyClient *resty.Client) { - if mock.SetRestyClientFunc == nil { - panic("GoCloakMock.SetRestyClientFunc: method is nil but GoCloak.SetRestyClient was just called") - } - callInfo := struct { - RestyClient *resty.Client - }{ - RestyClient: restyClient, - } - mock.lockSetRestyClient.Lock() - mock.calls.SetRestyClient = append(mock.calls.SetRestyClient, callInfo) - mock.lockSetRestyClient.Unlock() - mock.SetRestyClientFunc(restyClient) -} - -// SetRestyClientCalls gets all the calls that were made to SetRestyClient. -// Check the length with: -// -// len(mockedGoCloak.SetRestyClientCalls()) -func (mock *GoCloakMock) SetRestyClientCalls() []struct { - RestyClient *resty.Client -} { - var calls []struct { - RestyClient *resty.Client - } - mock.lockSetRestyClient.RLock() - calls = mock.calls.SetRestyClient - mock.lockSetRestyClient.RUnlock() - return calls -} - -// UpdateAuthenticationExecution calls UpdateAuthenticationExecutionFunc. -func (mock *GoCloakMock) UpdateAuthenticationExecution(ctx context.Context, token string, realm string, flow string, execution gocloak.ModifyAuthenticationExecutionRepresentation) error { - if mock.UpdateAuthenticationExecutionFunc == nil { - panic("GoCloakMock.UpdateAuthenticationExecutionFunc: method is nil but GoCloak.UpdateAuthenticationExecution was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Flow string - Execution gocloak.ModifyAuthenticationExecutionRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Flow: flow, - Execution: execution, - } - mock.lockUpdateAuthenticationExecution.Lock() - mock.calls.UpdateAuthenticationExecution = append(mock.calls.UpdateAuthenticationExecution, callInfo) - mock.lockUpdateAuthenticationExecution.Unlock() - return mock.UpdateAuthenticationExecutionFunc(ctx, token, realm, flow, execution) -} - -// UpdateAuthenticationExecutionCalls gets all the calls that were made to UpdateAuthenticationExecution. -// Check the length with: -// -// len(mockedGoCloak.UpdateAuthenticationExecutionCalls()) -func (mock *GoCloakMock) UpdateAuthenticationExecutionCalls() []struct { - Ctx context.Context - Token string - Realm string - Flow string - Execution gocloak.ModifyAuthenticationExecutionRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Flow string - Execution gocloak.ModifyAuthenticationExecutionRepresentation - } - mock.lockUpdateAuthenticationExecution.RLock() - calls = mock.calls.UpdateAuthenticationExecution - mock.lockUpdateAuthenticationExecution.RUnlock() - return calls -} - -// UpdateClient calls UpdateClientFunc. -func (mock *GoCloakMock) UpdateClient(ctx context.Context, accessToken string, realm string, updatedClient gocloak.Client) error { - if mock.UpdateClientFunc == nil { - panic("GoCloakMock.UpdateClientFunc: method is nil but GoCloak.UpdateClient was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - UpdatedClient gocloak.Client - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - UpdatedClient: updatedClient, - } - mock.lockUpdateClient.Lock() - mock.calls.UpdateClient = append(mock.calls.UpdateClient, callInfo) - mock.lockUpdateClient.Unlock() - return mock.UpdateClientFunc(ctx, accessToken, realm, updatedClient) -} - -// UpdateClientCalls gets all the calls that were made to UpdateClient. -// Check the length with: -// -// len(mockedGoCloak.UpdateClientCalls()) -func (mock *GoCloakMock) UpdateClientCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - UpdatedClient gocloak.Client -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - UpdatedClient gocloak.Client - } - mock.lockUpdateClient.RLock() - calls = mock.calls.UpdateClient - mock.lockUpdateClient.RUnlock() - return calls -} - -// UpdateClientProtocolMapper calls UpdateClientProtocolMapperFunc. -func (mock *GoCloakMock) UpdateClientProtocolMapper(ctx context.Context, token string, realm string, idOfClient string, mapperID string, mapper gocloak.ProtocolMapperRepresentation) error { - if mock.UpdateClientProtocolMapperFunc == nil { - panic("GoCloakMock.UpdateClientProtocolMapperFunc: method is nil but GoCloak.UpdateClientProtocolMapper was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - MapperID string - Mapper gocloak.ProtocolMapperRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - MapperID: mapperID, - Mapper: mapper, - } - mock.lockUpdateClientProtocolMapper.Lock() - mock.calls.UpdateClientProtocolMapper = append(mock.calls.UpdateClientProtocolMapper, callInfo) - mock.lockUpdateClientProtocolMapper.Unlock() - return mock.UpdateClientProtocolMapperFunc(ctx, token, realm, idOfClient, mapperID, mapper) -} - -// UpdateClientProtocolMapperCalls gets all the calls that were made to UpdateClientProtocolMapper. -// Check the length with: -// -// len(mockedGoCloak.UpdateClientProtocolMapperCalls()) -func (mock *GoCloakMock) UpdateClientProtocolMapperCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - MapperID string - Mapper gocloak.ProtocolMapperRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - MapperID string - Mapper gocloak.ProtocolMapperRepresentation - } - mock.lockUpdateClientProtocolMapper.RLock() - calls = mock.calls.UpdateClientProtocolMapper - mock.lockUpdateClientProtocolMapper.RUnlock() - return calls -} - -// UpdateClientRepresentation calls UpdateClientRepresentationFunc. -func (mock *GoCloakMock) UpdateClientRepresentation(ctx context.Context, accessToken string, realm string, updatedClient gocloak.Client) (*gocloak.Client, error) { - if mock.UpdateClientRepresentationFunc == nil { - panic("GoCloakMock.UpdateClientRepresentationFunc: method is nil but GoCloak.UpdateClientRepresentation was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - UpdatedClient gocloak.Client - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - UpdatedClient: updatedClient, - } - mock.lockUpdateClientRepresentation.Lock() - mock.calls.UpdateClientRepresentation = append(mock.calls.UpdateClientRepresentation, callInfo) - mock.lockUpdateClientRepresentation.Unlock() - return mock.UpdateClientRepresentationFunc(ctx, accessToken, realm, updatedClient) -} - -// UpdateClientRepresentationCalls gets all the calls that were made to UpdateClientRepresentation. -// Check the length with: -// -// len(mockedGoCloak.UpdateClientRepresentationCalls()) -func (mock *GoCloakMock) UpdateClientRepresentationCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - UpdatedClient gocloak.Client -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - UpdatedClient gocloak.Client - } - mock.lockUpdateClientRepresentation.RLock() - calls = mock.calls.UpdateClientRepresentation - mock.lockUpdateClientRepresentation.RUnlock() - return calls -} - -// UpdateClientScope calls UpdateClientScopeFunc. -func (mock *GoCloakMock) UpdateClientScope(ctx context.Context, accessToken string, realm string, scope gocloak.ClientScope) error { - if mock.UpdateClientScopeFunc == nil { - panic("GoCloakMock.UpdateClientScopeFunc: method is nil but GoCloak.UpdateClientScope was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - Scope gocloak.ClientScope - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - Scope: scope, - } - mock.lockUpdateClientScope.Lock() - mock.calls.UpdateClientScope = append(mock.calls.UpdateClientScope, callInfo) - mock.lockUpdateClientScope.Unlock() - return mock.UpdateClientScopeFunc(ctx, accessToken, realm, scope) -} - -// UpdateClientScopeCalls gets all the calls that were made to UpdateClientScope. -// Check the length with: -// -// len(mockedGoCloak.UpdateClientScopeCalls()) -func (mock *GoCloakMock) UpdateClientScopeCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - Scope gocloak.ClientScope -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - Scope gocloak.ClientScope - } - mock.lockUpdateClientScope.RLock() - calls = mock.calls.UpdateClientScope - mock.lockUpdateClientScope.RUnlock() - return calls -} - -// UpdateClientScopeProtocolMapper calls UpdateClientScopeProtocolMapperFunc. -func (mock *GoCloakMock) UpdateClientScopeProtocolMapper(ctx context.Context, accessToken string, realm string, scopeID string, protocolMapper gocloak.ProtocolMappers) error { - if mock.UpdateClientScopeProtocolMapperFunc == nil { - panic("GoCloakMock.UpdateClientScopeProtocolMapperFunc: method is nil but GoCloak.UpdateClientScopeProtocolMapper was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - ProtocolMapper gocloak.ProtocolMappers - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - ScopeID: scopeID, - ProtocolMapper: protocolMapper, - } - mock.lockUpdateClientScopeProtocolMapper.Lock() - mock.calls.UpdateClientScopeProtocolMapper = append(mock.calls.UpdateClientScopeProtocolMapper, callInfo) - mock.lockUpdateClientScopeProtocolMapper.Unlock() - return mock.UpdateClientScopeProtocolMapperFunc(ctx, accessToken, realm, scopeID, protocolMapper) -} - -// UpdateClientScopeProtocolMapperCalls gets all the calls that were made to UpdateClientScopeProtocolMapper. -// Check the length with: -// -// len(mockedGoCloak.UpdateClientScopeProtocolMapperCalls()) -func (mock *GoCloakMock) UpdateClientScopeProtocolMapperCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - ProtocolMapper gocloak.ProtocolMappers -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - ScopeID string - ProtocolMapper gocloak.ProtocolMappers - } - mock.lockUpdateClientScopeProtocolMapper.RLock() - calls = mock.calls.UpdateClientScopeProtocolMapper - mock.lockUpdateClientScopeProtocolMapper.RUnlock() - return calls -} - -// UpdateCredentialUserLabel calls UpdateCredentialUserLabelFunc. -func (mock *GoCloakMock) UpdateCredentialUserLabel(ctx context.Context, token string, realm string, userID string, credentialID string, userLabel string) error { - if mock.UpdateCredentialUserLabelFunc == nil { - panic("GoCloakMock.UpdateCredentialUserLabelFunc: method is nil but GoCloak.UpdateCredentialUserLabel was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string - UserLabel string - }{ - Ctx: ctx, - Token: token, - Realm: realm, - UserID: userID, - CredentialID: credentialID, - UserLabel: userLabel, - } - mock.lockUpdateCredentialUserLabel.Lock() - mock.calls.UpdateCredentialUserLabel = append(mock.calls.UpdateCredentialUserLabel, callInfo) - mock.lockUpdateCredentialUserLabel.Unlock() - return mock.UpdateCredentialUserLabelFunc(ctx, token, realm, userID, credentialID, userLabel) -} - -// UpdateCredentialUserLabelCalls gets all the calls that were made to UpdateCredentialUserLabel. -// Check the length with: -// -// len(mockedGoCloak.UpdateCredentialUserLabelCalls()) -func (mock *GoCloakMock) UpdateCredentialUserLabelCalls() []struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string - UserLabel string -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - UserID string - CredentialID string - UserLabel string - } - mock.lockUpdateCredentialUserLabel.RLock() - calls = mock.calls.UpdateCredentialUserLabel - mock.lockUpdateCredentialUserLabel.RUnlock() - return calls -} - -// UpdateGroup calls UpdateGroupFunc. -func (mock *GoCloakMock) UpdateGroup(ctx context.Context, accessToken string, realm string, updatedGroup gocloak.Group) error { - if mock.UpdateGroupFunc == nil { - panic("GoCloakMock.UpdateGroupFunc: method is nil but GoCloak.UpdateGroup was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - UpdatedGroup gocloak.Group - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - UpdatedGroup: updatedGroup, - } - mock.lockUpdateGroup.Lock() - mock.calls.UpdateGroup = append(mock.calls.UpdateGroup, callInfo) - mock.lockUpdateGroup.Unlock() - return mock.UpdateGroupFunc(ctx, accessToken, realm, updatedGroup) -} - -// UpdateGroupCalls gets all the calls that were made to UpdateGroup. -// Check the length with: -// -// len(mockedGoCloak.UpdateGroupCalls()) -func (mock *GoCloakMock) UpdateGroupCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - UpdatedGroup gocloak.Group -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - UpdatedGroup gocloak.Group - } - mock.lockUpdateGroup.RLock() - calls = mock.calls.UpdateGroup - mock.lockUpdateGroup.RUnlock() - return calls -} - -// UpdateIdentityProvider calls UpdateIdentityProviderFunc. -func (mock *GoCloakMock) UpdateIdentityProvider(ctx context.Context, token string, realm string, alias string, providerRep gocloak.IdentityProviderRepresentation) error { - if mock.UpdateIdentityProviderFunc == nil { - panic("GoCloakMock.UpdateIdentityProviderFunc: method is nil but GoCloak.UpdateIdentityProvider was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Alias string - ProviderRep gocloak.IdentityProviderRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Alias: alias, - ProviderRep: providerRep, - } - mock.lockUpdateIdentityProvider.Lock() - mock.calls.UpdateIdentityProvider = append(mock.calls.UpdateIdentityProvider, callInfo) - mock.lockUpdateIdentityProvider.Unlock() - return mock.UpdateIdentityProviderFunc(ctx, token, realm, alias, providerRep) -} - -// UpdateIdentityProviderCalls gets all the calls that were made to UpdateIdentityProvider. -// Check the length with: -// -// len(mockedGoCloak.UpdateIdentityProviderCalls()) -func (mock *GoCloakMock) UpdateIdentityProviderCalls() []struct { - Ctx context.Context - Token string - Realm string - Alias string - ProviderRep gocloak.IdentityProviderRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Alias string - ProviderRep gocloak.IdentityProviderRepresentation - } - mock.lockUpdateIdentityProvider.RLock() - calls = mock.calls.UpdateIdentityProvider - mock.lockUpdateIdentityProvider.RUnlock() - return calls -} - -// UpdateIdentityProviderMapper calls UpdateIdentityProviderMapperFunc. -func (mock *GoCloakMock) UpdateIdentityProviderMapper(ctx context.Context, token string, realm string, alias string, mapper gocloak.IdentityProviderMapper) error { - if mock.UpdateIdentityProviderMapperFunc == nil { - panic("GoCloakMock.UpdateIdentityProviderMapperFunc: method is nil but GoCloak.UpdateIdentityProviderMapper was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Alias string - Mapper gocloak.IdentityProviderMapper - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Alias: alias, - Mapper: mapper, - } - mock.lockUpdateIdentityProviderMapper.Lock() - mock.calls.UpdateIdentityProviderMapper = append(mock.calls.UpdateIdentityProviderMapper, callInfo) - mock.lockUpdateIdentityProviderMapper.Unlock() - return mock.UpdateIdentityProviderMapperFunc(ctx, token, realm, alias, mapper) -} - -// UpdateIdentityProviderMapperCalls gets all the calls that were made to UpdateIdentityProviderMapper. -// Check the length with: -// -// len(mockedGoCloak.UpdateIdentityProviderMapperCalls()) -func (mock *GoCloakMock) UpdateIdentityProviderMapperCalls() []struct { - Ctx context.Context - Token string - Realm string - Alias string - Mapper gocloak.IdentityProviderMapper -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Alias string - Mapper gocloak.IdentityProviderMapper - } - mock.lockUpdateIdentityProviderMapper.RLock() - calls = mock.calls.UpdateIdentityProviderMapper - mock.lockUpdateIdentityProviderMapper.RUnlock() - return calls -} - -// UpdatePermission calls UpdatePermissionFunc. -func (mock *GoCloakMock) UpdatePermission(ctx context.Context, token string, realm string, idOfClient string, permission gocloak.PermissionRepresentation) error { - if mock.UpdatePermissionFunc == nil { - panic("GoCloakMock.UpdatePermissionFunc: method is nil but GoCloak.UpdatePermission was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Permission gocloak.PermissionRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Permission: permission, - } - mock.lockUpdatePermission.Lock() - mock.calls.UpdatePermission = append(mock.calls.UpdatePermission, callInfo) - mock.lockUpdatePermission.Unlock() - return mock.UpdatePermissionFunc(ctx, token, realm, idOfClient, permission) -} - -// UpdatePermissionCalls gets all the calls that were made to UpdatePermission. -// Check the length with: -// -// len(mockedGoCloak.UpdatePermissionCalls()) -func (mock *GoCloakMock) UpdatePermissionCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Permission gocloak.PermissionRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Permission gocloak.PermissionRepresentation - } - mock.lockUpdatePermission.RLock() - calls = mock.calls.UpdatePermission - mock.lockUpdatePermission.RUnlock() - return calls -} - -// UpdatePolicy calls UpdatePolicyFunc. -func (mock *GoCloakMock) UpdatePolicy(ctx context.Context, token string, realm string, idOfClient string, policy gocloak.PolicyRepresentation) error { - if mock.UpdatePolicyFunc == nil { - panic("GoCloakMock.UpdatePolicyFunc: method is nil but GoCloak.UpdatePolicy was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Policy gocloak.PolicyRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Policy: policy, - } - mock.lockUpdatePolicy.Lock() - mock.calls.UpdatePolicy = append(mock.calls.UpdatePolicy, callInfo) - mock.lockUpdatePolicy.Unlock() - return mock.UpdatePolicyFunc(ctx, token, realm, idOfClient, policy) -} - -// UpdatePolicyCalls gets all the calls that were made to UpdatePolicy. -// Check the length with: -// -// len(mockedGoCloak.UpdatePolicyCalls()) -func (mock *GoCloakMock) UpdatePolicyCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Policy gocloak.PolicyRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Policy gocloak.PolicyRepresentation - } - mock.lockUpdatePolicy.RLock() - calls = mock.calls.UpdatePolicy - mock.lockUpdatePolicy.RUnlock() - return calls -} - -// UpdateRealm calls UpdateRealmFunc. -func (mock *GoCloakMock) UpdateRealm(ctx context.Context, token string, realm gocloak.RealmRepresentation) error { - if mock.UpdateRealmFunc == nil { - panic("GoCloakMock.UpdateRealmFunc: method is nil but GoCloak.UpdateRealm was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm gocloak.RealmRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - } - mock.lockUpdateRealm.Lock() - mock.calls.UpdateRealm = append(mock.calls.UpdateRealm, callInfo) - mock.lockUpdateRealm.Unlock() - return mock.UpdateRealmFunc(ctx, token, realm) -} - -// UpdateRealmCalls gets all the calls that were made to UpdateRealm. -// Check the length with: -// -// len(mockedGoCloak.UpdateRealmCalls()) -func (mock *GoCloakMock) UpdateRealmCalls() []struct { - Ctx context.Context - Token string - Realm gocloak.RealmRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm gocloak.RealmRepresentation - } - mock.lockUpdateRealm.RLock() - calls = mock.calls.UpdateRealm - mock.lockUpdateRealm.RUnlock() - return calls -} - -// UpdateRealmRole calls UpdateRealmRoleFunc. -func (mock *GoCloakMock) UpdateRealmRole(ctx context.Context, token string, realm string, roleName string, role gocloak.Role) error { - if mock.UpdateRealmRoleFunc == nil { - panic("GoCloakMock.UpdateRealmRoleFunc: method is nil but GoCloak.UpdateRealmRole was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleName string - Role gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleName: roleName, - Role: role, - } - mock.lockUpdateRealmRole.Lock() - mock.calls.UpdateRealmRole = append(mock.calls.UpdateRealmRole, callInfo) - mock.lockUpdateRealmRole.Unlock() - return mock.UpdateRealmRoleFunc(ctx, token, realm, roleName, role) -} - -// UpdateRealmRoleCalls gets all the calls that were made to UpdateRealmRole. -// Check the length with: -// -// len(mockedGoCloak.UpdateRealmRoleCalls()) -func (mock *GoCloakMock) UpdateRealmRoleCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleName string - Role gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleName string - Role gocloak.Role - } - mock.lockUpdateRealmRole.RLock() - calls = mock.calls.UpdateRealmRole - mock.lockUpdateRealmRole.RUnlock() - return calls -} - -// UpdateRealmRoleByID calls UpdateRealmRoleByIDFunc. -func (mock *GoCloakMock) UpdateRealmRoleByID(ctx context.Context, token string, realm string, roleID string, role gocloak.Role) error { - if mock.UpdateRealmRoleByIDFunc == nil { - panic("GoCloakMock.UpdateRealmRoleByIDFunc: method is nil but GoCloak.UpdateRealmRoleByID was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RoleID string - Role gocloak.Role - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RoleID: roleID, - Role: role, - } - mock.lockUpdateRealmRoleByID.Lock() - mock.calls.UpdateRealmRoleByID = append(mock.calls.UpdateRealmRoleByID, callInfo) - mock.lockUpdateRealmRoleByID.Unlock() - return mock.UpdateRealmRoleByIDFunc(ctx, token, realm, roleID, role) -} - -// UpdateRealmRoleByIDCalls gets all the calls that were made to UpdateRealmRoleByID. -// Check the length with: -// -// len(mockedGoCloak.UpdateRealmRoleByIDCalls()) -func (mock *GoCloakMock) UpdateRealmRoleByIDCalls() []struct { - Ctx context.Context - Token string - Realm string - RoleID string - Role gocloak.Role -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RoleID string - Role gocloak.Role - } - mock.lockUpdateRealmRoleByID.RLock() - calls = mock.calls.UpdateRealmRoleByID - mock.lockUpdateRealmRoleByID.RUnlock() - return calls -} - -// UpdateRequiredAction calls UpdateRequiredActionFunc. -func (mock *GoCloakMock) UpdateRequiredAction(ctx context.Context, token string, realm string, requiredAction gocloak.RequiredActionProviderRepresentation) error { - if mock.UpdateRequiredActionFunc == nil { - panic("GoCloakMock.UpdateRequiredActionFunc: method is nil but GoCloak.UpdateRequiredAction was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - RequiredAction gocloak.RequiredActionProviderRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - RequiredAction: requiredAction, - } - mock.lockUpdateRequiredAction.Lock() - mock.calls.UpdateRequiredAction = append(mock.calls.UpdateRequiredAction, callInfo) - mock.lockUpdateRequiredAction.Unlock() - return mock.UpdateRequiredActionFunc(ctx, token, realm, requiredAction) -} - -// UpdateRequiredActionCalls gets all the calls that were made to UpdateRequiredAction. -// Check the length with: -// -// len(mockedGoCloak.UpdateRequiredActionCalls()) -func (mock *GoCloakMock) UpdateRequiredActionCalls() []struct { - Ctx context.Context - Token string - Realm string - RequiredAction gocloak.RequiredActionProviderRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - RequiredAction gocloak.RequiredActionProviderRepresentation - } - mock.lockUpdateRequiredAction.RLock() - calls = mock.calls.UpdateRequiredAction - mock.lockUpdateRequiredAction.RUnlock() - return calls -} - -// UpdateResource calls UpdateResourceFunc. -func (mock *GoCloakMock) UpdateResource(ctx context.Context, token string, realm string, idOfClient string, resource gocloak.ResourceRepresentation) error { - if mock.UpdateResourceFunc == nil { - panic("GoCloakMock.UpdateResourceFunc: method is nil but GoCloak.UpdateResource was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Resource gocloak.ResourceRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Resource: resource, - } - mock.lockUpdateResource.Lock() - mock.calls.UpdateResource = append(mock.calls.UpdateResource, callInfo) - mock.lockUpdateResource.Unlock() - return mock.UpdateResourceFunc(ctx, token, realm, idOfClient, resource) -} - -// UpdateResourceCalls gets all the calls that were made to UpdateResource. -// Check the length with: -// -// len(mockedGoCloak.UpdateResourceCalls()) -func (mock *GoCloakMock) UpdateResourceCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Resource gocloak.ResourceRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Resource gocloak.ResourceRepresentation - } - mock.lockUpdateResource.RLock() - calls = mock.calls.UpdateResource - mock.lockUpdateResource.RUnlock() - return calls -} - -// UpdateResourceClient calls UpdateResourceClientFunc. -func (mock *GoCloakMock) UpdateResourceClient(ctx context.Context, token string, realm string, resource gocloak.ResourceRepresentation) error { - if mock.UpdateResourceClientFunc == nil { - panic("GoCloakMock.UpdateResourceClientFunc: method is nil but GoCloak.UpdateResourceClient was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Resource gocloak.ResourceRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Resource: resource, - } - mock.lockUpdateResourceClient.Lock() - mock.calls.UpdateResourceClient = append(mock.calls.UpdateResourceClient, callInfo) - mock.lockUpdateResourceClient.Unlock() - return mock.UpdateResourceClientFunc(ctx, token, realm, resource) -} - -// UpdateResourceClientCalls gets all the calls that were made to UpdateResourceClient. -// Check the length with: -// -// len(mockedGoCloak.UpdateResourceClientCalls()) -func (mock *GoCloakMock) UpdateResourceClientCalls() []struct { - Ctx context.Context - Token string - Realm string - Resource gocloak.ResourceRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Resource gocloak.ResourceRepresentation - } - mock.lockUpdateResourceClient.RLock() - calls = mock.calls.UpdateResourceClient - mock.lockUpdateResourceClient.RUnlock() - return calls -} - -// UpdateResourcePolicy calls UpdateResourcePolicyFunc. -func (mock *GoCloakMock) UpdateResourcePolicy(ctx context.Context, token string, realm string, permissionID string, policy gocloak.ResourcePolicyRepresentation) error { - if mock.UpdateResourcePolicyFunc == nil { - panic("GoCloakMock.UpdateResourcePolicyFunc: method is nil but GoCloak.UpdateResourcePolicy was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - PermissionID string - Policy gocloak.ResourcePolicyRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - PermissionID: permissionID, - Policy: policy, - } - mock.lockUpdateResourcePolicy.Lock() - mock.calls.UpdateResourcePolicy = append(mock.calls.UpdateResourcePolicy, callInfo) - mock.lockUpdateResourcePolicy.Unlock() - return mock.UpdateResourcePolicyFunc(ctx, token, realm, permissionID, policy) -} - -// UpdateResourcePolicyCalls gets all the calls that were made to UpdateResourcePolicy. -// Check the length with: -// -// len(mockedGoCloak.UpdateResourcePolicyCalls()) -func (mock *GoCloakMock) UpdateResourcePolicyCalls() []struct { - Ctx context.Context - Token string - Realm string - PermissionID string - Policy gocloak.ResourcePolicyRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - PermissionID string - Policy gocloak.ResourcePolicyRepresentation - } - mock.lockUpdateResourcePolicy.RLock() - calls = mock.calls.UpdateResourcePolicy - mock.lockUpdateResourcePolicy.RUnlock() - return calls -} - -// UpdateRole calls UpdateRoleFunc. -func (mock *GoCloakMock) UpdateRole(ctx context.Context, accessToken string, realm string, idOfClient string, role gocloak.Role) error { - if mock.UpdateRoleFunc == nil { - panic("GoCloakMock.UpdateRoleFunc: method is nil but GoCloak.UpdateRole was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - Role gocloak.Role - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - IdOfClient: idOfClient, - Role: role, - } - mock.lockUpdateRole.Lock() - mock.calls.UpdateRole = append(mock.calls.UpdateRole, callInfo) - mock.lockUpdateRole.Unlock() - return mock.UpdateRoleFunc(ctx, accessToken, realm, idOfClient, role) -} - -// UpdateRoleCalls gets all the calls that were made to UpdateRole. -// Check the length with: -// -// len(mockedGoCloak.UpdateRoleCalls()) -func (mock *GoCloakMock) UpdateRoleCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - Role gocloak.Role -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - IdOfClient string - Role gocloak.Role - } - mock.lockUpdateRole.RLock() - calls = mock.calls.UpdateRole - mock.lockUpdateRole.RUnlock() - return calls -} - -// UpdateScope calls UpdateScopeFunc. -func (mock *GoCloakMock) UpdateScope(ctx context.Context, token string, realm string, idOfClient string, resource gocloak.ScopeRepresentation) error { - if mock.UpdateScopeFunc == nil { - panic("GoCloakMock.UpdateScopeFunc: method is nil but GoCloak.UpdateScope was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Resource gocloak.ScopeRepresentation - }{ - Ctx: ctx, - Token: token, - Realm: realm, - IdOfClient: idOfClient, - Resource: resource, - } - mock.lockUpdateScope.Lock() - mock.calls.UpdateScope = append(mock.calls.UpdateScope, callInfo) - mock.lockUpdateScope.Unlock() - return mock.UpdateScopeFunc(ctx, token, realm, idOfClient, resource) -} - -// UpdateScopeCalls gets all the calls that were made to UpdateScope. -// Check the length with: -// -// len(mockedGoCloak.UpdateScopeCalls()) -func (mock *GoCloakMock) UpdateScopeCalls() []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Resource gocloak.ScopeRepresentation -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - IdOfClient string - Resource gocloak.ScopeRepresentation - } - mock.lockUpdateScope.RLock() - calls = mock.calls.UpdateScope - mock.lockUpdateScope.RUnlock() - return calls -} - -// UpdateUser calls UpdateUserFunc. -func (mock *GoCloakMock) UpdateUser(ctx context.Context, accessToken string, realm string, user gocloak.User) error { - if mock.UpdateUserFunc == nil { - panic("GoCloakMock.UpdateUserFunc: method is nil but GoCloak.UpdateUser was just called") - } - callInfo := struct { - Ctx context.Context - AccessToken string - Realm string - User gocloak.User - }{ - Ctx: ctx, - AccessToken: accessToken, - Realm: realm, - User: user, - } - mock.lockUpdateUser.Lock() - mock.calls.UpdateUser = append(mock.calls.UpdateUser, callInfo) - mock.lockUpdateUser.Unlock() - return mock.UpdateUserFunc(ctx, accessToken, realm, user) -} - -// UpdateUserCalls gets all the calls that were made to UpdateUser. -// Check the length with: -// -// len(mockedGoCloak.UpdateUserCalls()) -func (mock *GoCloakMock) UpdateUserCalls() []struct { - Ctx context.Context - AccessToken string - Realm string - User gocloak.User -} { - var calls []struct { - Ctx context.Context - AccessToken string - Realm string - User gocloak.User - } - mock.lockUpdateUser.RLock() - calls = mock.calls.UpdateUser - mock.lockUpdateUser.RUnlock() - return calls -} - -// UpdateUserPermission calls UpdateUserPermissionFunc. -func (mock *GoCloakMock) UpdateUserPermission(ctx context.Context, token string, realm string, permission gocloak.PermissionGrantParams) (*gocloak.PermissionGrantResponseRepresentation, error) { - if mock.UpdateUserPermissionFunc == nil { - panic("GoCloakMock.UpdateUserPermissionFunc: method is nil but GoCloak.UpdateUserPermission was just called") - } - callInfo := struct { - Ctx context.Context - Token string - Realm string - Permission gocloak.PermissionGrantParams - }{ - Ctx: ctx, - Token: token, - Realm: realm, - Permission: permission, - } - mock.lockUpdateUserPermission.Lock() - mock.calls.UpdateUserPermission = append(mock.calls.UpdateUserPermission, callInfo) - mock.lockUpdateUserPermission.Unlock() - return mock.UpdateUserPermissionFunc(ctx, token, realm, permission) -} - -// UpdateUserPermissionCalls gets all the calls that were made to UpdateUserPermission. -// Check the length with: -// -// len(mockedGoCloak.UpdateUserPermissionCalls()) -func (mock *GoCloakMock) UpdateUserPermissionCalls() []struct { - Ctx context.Context - Token string - Realm string - Permission gocloak.PermissionGrantParams -} { - var calls []struct { - Ctx context.Context - Token string - Realm string - Permission gocloak.PermissionGrantParams - } - mock.lockUpdateUserPermission.RLock() - calls = mock.calls.UpdateUserPermission - mock.lockUpdateUserPermission.RUnlock() - return calls -} diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index 40345076a9..37ba161011 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -43,6 +43,8 @@ const ( ClusterOperationsTotalCount = "cluster_operations_total_count" labelOperation = "operation" + expiredCentralsCount = "expired_centrals_count" + ReconcilerDuration = "reconciler_duration_in_seconds" ReconcilerSuccessCount = "reconciler_success_count" ReconcilerFailureCount = "reconciler_failure_count" @@ -326,6 +328,20 @@ func UpdateCentralPerClusterCountMetric(clusterID string, clusterExternalID stri centralPerClusterCountMetric.With(labels).Set(float64(count)) } +// create a new gaugeVec with the total number of expired centrals +var expiredCentralsMetric = prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Subsystem: FleetManager, + Name: expiredCentralsCount, + Help: "total number of expired centrals", + }, + []string{}, +) + +func UpdateCentralsExpiredMetric(n float64) { + expiredCentralsMetric.WithLabelValues().Set(n) +} + // #### Metrics for Dataplane clusters - End #### // #### Metrics for Centrals - Start #### @@ -723,6 +739,7 @@ func init() { prometheus.MustRegister(centralOperationsTotalCountMetric) prometheus.MustRegister(centralStatusSinceCreatedMetric) prometheus.MustRegister(CentralStatusCountMetric) + prometheus.MustRegister(expiredCentralsMetric) // metrics for reconcilers prometheus.MustRegister(reconcilerDurationMetric) @@ -791,6 +808,7 @@ func Reset() { centralOperationsTotalCountMetric.Reset() centralStatusSinceCreatedMetric.Reset() CentralStatusCountMetric.Reset() + expiredCentralsMetric.Reset() reconcilerDurationMetric.Reset() reconcilerSuccessCountMetric.Reset() diff --git a/pkg/providers/core.go b/pkg/providers/core.go index 77e3aa3b63..b65ff5236f 100644 --- a/pkg/providers/core.go +++ b/pkg/providers/core.go @@ -22,7 +22,6 @@ import ( "github.com/stackrox/acs-fleet-manager/pkg/services/account" "github.com/stackrox/acs-fleet-manager/pkg/services/authorization" "github.com/stackrox/acs-fleet-manager/pkg/services/sentry" - "github.com/stackrox/acs-fleet-manager/pkg/services/sso" ) // CoreConfigProviders ... @@ -92,9 +91,6 @@ func ServiceProviders() di.Option { di.Provide(acl.NewAccessControlListMiddleware), di.Provide(handlers.NewErrorsHandler), - di.Provide(func(c *iam.IAMConfig) sso.IAMService { - return sso.NewIAMService(c) - }), di.Provide(services.NewTelemetryAuth), // Types registered as a BootService are started when the env is started diff --git a/pkg/services/sso/iam_service.go b/pkg/services/sso/iam_service.go deleted file mode 100644 index 420c54aa66..0000000000 --- a/pkg/services/sso/iam_service.go +++ /dev/null @@ -1,37 +0,0 @@ -// Package sso ... -package sso - -import ( - "github.com/stackrox/acs-fleet-manager/pkg/api" - "github.com/stackrox/acs-fleet-manager/pkg/client/iam" - "github.com/stackrox/acs-fleet-manager/pkg/client/redhatsso/serviceaccounts" - "github.com/stackrox/acs-fleet-manager/pkg/errors" -) - -// Provider ... -type Provider string - -// CompleteServiceAccountRequest ... -type CompleteServiceAccountRequest struct { - Owner string - OwnerAccountID string - OrgID string - ClientID string - Name string - Description string -} - -// IAMService ... -// -//go:generate moq -out iam_service_moq.go . IAMService -type IAMService interface { - RegisterAcsFleetshardOperatorServiceAccount(agentClusterID string) (*api.ServiceAccount, *errors.ServiceError) - DeRegisterAcsFleetshardOperatorServiceAccount(agentClusterID string) *errors.ServiceError -} - -// NewIAMService ... -func NewIAMService(config *iam.IAMConfig) IAMService { - return &redhatssoService{ - serviceAccountsAPI: serviceaccounts.NewServiceAccountsAPI(config.RedhatSSORealm), - } -} diff --git a/pkg/services/sso/iam_service_moq.go b/pkg/services/sso/iam_service_moq.go deleted file mode 100644 index fc4461530d..0000000000 --- a/pkg/services/sso/iam_service_moq.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by moq; DO NOT EDIT. -// github.com/matryer/moq - -package sso - -import ( - "github.com/stackrox/acs-fleet-manager/pkg/api" - "github.com/stackrox/acs-fleet-manager/pkg/errors" - "sync" -) - -// Ensure, that IAMServiceMock does implement IAMService. -// If this is not the case, regenerate this file with moq. -var _ IAMService = &IAMServiceMock{} - -// IAMServiceMock is a mock implementation of IAMService. -// -// func TestSomethingThatUsesIAMService(t *testing.T) { -// -// // make and configure a mocked IAMService -// mockedIAMService := &IAMServiceMock{ -// DeRegisterAcsFleetshardOperatorServiceAccountFunc: func(agentClusterID string) *errors.ServiceError { -// panic("mock out the DeRegisterAcsFleetshardOperatorServiceAccount method") -// }, -// RegisterAcsFleetshardOperatorServiceAccountFunc: func(agentClusterID string) (*api.ServiceAccount, *errors.ServiceError) { -// panic("mock out the RegisterAcsFleetshardOperatorServiceAccount method") -// }, -// } -// -// // use mockedIAMService in code that requires IAMService -// // and then make assertions. -// -// } -type IAMServiceMock struct { - // DeRegisterAcsFleetshardOperatorServiceAccountFunc mocks the DeRegisterAcsFleetshardOperatorServiceAccount method. - DeRegisterAcsFleetshardOperatorServiceAccountFunc func(agentClusterID string) *errors.ServiceError - - // RegisterAcsFleetshardOperatorServiceAccountFunc mocks the RegisterAcsFleetshardOperatorServiceAccount method. - RegisterAcsFleetshardOperatorServiceAccountFunc func(agentClusterID string) (*api.ServiceAccount, *errors.ServiceError) - - // calls tracks calls to the methods. - calls struct { - // DeRegisterAcsFleetshardOperatorServiceAccount holds details about calls to the DeRegisterAcsFleetshardOperatorServiceAccount method. - DeRegisterAcsFleetshardOperatorServiceAccount []struct { - // AgentClusterID is the agentClusterID argument value. - AgentClusterID string - } - // RegisterAcsFleetshardOperatorServiceAccount holds details about calls to the RegisterAcsFleetshardOperatorServiceAccount method. - RegisterAcsFleetshardOperatorServiceAccount []struct { - // AgentClusterID is the agentClusterID argument value. - AgentClusterID string - } - } - lockDeRegisterAcsFleetshardOperatorServiceAccount sync.RWMutex - lockRegisterAcsFleetshardOperatorServiceAccount sync.RWMutex -} - -// DeRegisterAcsFleetshardOperatorServiceAccount calls DeRegisterAcsFleetshardOperatorServiceAccountFunc. -func (mock *IAMServiceMock) DeRegisterAcsFleetshardOperatorServiceAccount(agentClusterID string) *errors.ServiceError { - if mock.DeRegisterAcsFleetshardOperatorServiceAccountFunc == nil { - panic("IAMServiceMock.DeRegisterAcsFleetshardOperatorServiceAccountFunc: method is nil but IAMService.DeRegisterAcsFleetshardOperatorServiceAccount was just called") - } - callInfo := struct { - AgentClusterID string - }{ - AgentClusterID: agentClusterID, - } - mock.lockDeRegisterAcsFleetshardOperatorServiceAccount.Lock() - mock.calls.DeRegisterAcsFleetshardOperatorServiceAccount = append(mock.calls.DeRegisterAcsFleetshardOperatorServiceAccount, callInfo) - mock.lockDeRegisterAcsFleetshardOperatorServiceAccount.Unlock() - return mock.DeRegisterAcsFleetshardOperatorServiceAccountFunc(agentClusterID) -} - -// DeRegisterAcsFleetshardOperatorServiceAccountCalls gets all the calls that were made to DeRegisterAcsFleetshardOperatorServiceAccount. -// Check the length with: -// -// len(mockedIAMService.DeRegisterAcsFleetshardOperatorServiceAccountCalls()) -func (mock *IAMServiceMock) DeRegisterAcsFleetshardOperatorServiceAccountCalls() []struct { - AgentClusterID string -} { - var calls []struct { - AgentClusterID string - } - mock.lockDeRegisterAcsFleetshardOperatorServiceAccount.RLock() - calls = mock.calls.DeRegisterAcsFleetshardOperatorServiceAccount - mock.lockDeRegisterAcsFleetshardOperatorServiceAccount.RUnlock() - return calls -} - -// RegisterAcsFleetshardOperatorServiceAccount calls RegisterAcsFleetshardOperatorServiceAccountFunc. -func (mock *IAMServiceMock) RegisterAcsFleetshardOperatorServiceAccount(agentClusterID string) (*api.ServiceAccount, *errors.ServiceError) { - if mock.RegisterAcsFleetshardOperatorServiceAccountFunc == nil { - panic("IAMServiceMock.RegisterAcsFleetshardOperatorServiceAccountFunc: method is nil but IAMService.RegisterAcsFleetshardOperatorServiceAccount was just called") - } - callInfo := struct { - AgentClusterID string - }{ - AgentClusterID: agentClusterID, - } - mock.lockRegisterAcsFleetshardOperatorServiceAccount.Lock() - mock.calls.RegisterAcsFleetshardOperatorServiceAccount = append(mock.calls.RegisterAcsFleetshardOperatorServiceAccount, callInfo) - mock.lockRegisterAcsFleetshardOperatorServiceAccount.Unlock() - return mock.RegisterAcsFleetshardOperatorServiceAccountFunc(agentClusterID) -} - -// RegisterAcsFleetshardOperatorServiceAccountCalls gets all the calls that were made to RegisterAcsFleetshardOperatorServiceAccount. -// Check the length with: -// -// len(mockedIAMService.RegisterAcsFleetshardOperatorServiceAccountCalls()) -func (mock *IAMServiceMock) RegisterAcsFleetshardOperatorServiceAccountCalls() []struct { - AgentClusterID string -} { - var calls []struct { - AgentClusterID string - } - mock.lockRegisterAcsFleetshardOperatorServiceAccount.RLock() - calls = mock.calls.RegisterAcsFleetshardOperatorServiceAccount - mock.lockRegisterAcsFleetshardOperatorServiceAccount.RUnlock() - return calls -} diff --git a/pkg/services/sso/redhatsso_service.go b/pkg/services/sso/redhatsso_service.go deleted file mode 100644 index 5dfe77914d..0000000000 --- a/pkg/services/sso/redhatsso_service.go +++ /dev/null @@ -1,77 +0,0 @@ -package sso - -import ( - "context" - "fmt" - "net/http" - "time" - - "github.com/golang/glog" - serviceaccountsclient "github.com/redhat-developer/app-services-sdk-core/app-services-sdk-go/serviceaccountmgmt/apiv1/client" - "github.com/stackrox/acs-fleet-manager/pkg/api" - "github.com/stackrox/acs-fleet-manager/pkg/errors" - "github.com/stackrox/acs-fleet-manager/pkg/shared" -) - -var _ IAMService = &redhatssoService{} - -type redhatssoService struct { - serviceAccountsAPI serviceaccountsclient.ServiceAccountsApi -} - -// RegisterAcsFleetshardOperatorServiceAccount ... -func (r *redhatssoService) RegisterAcsFleetshardOperatorServiceAccount(agentClusterID string) (*api.ServiceAccount, *errors.ServiceError) { - glog.V(5).Infof("Registering agent service account with cluster: %s", agentClusterID) - - ctx := context.Background() - description := fmt.Sprintf("service account for agent on cluster %s", agentClusterID) - svcData, _, err := r.serviceAccountsAPI.CreateServiceAccount(ctx). - ServiceAccountCreateRequestData(serviceaccountsclient.ServiceAccountCreateRequestData{ - Name: agentClusterID, - Description: &description, - }). - Execute() - if err != nil { - return nil, errors.NewWithCause(errors.ErrorGeneral, err, "failed to create agent service account") - } - - glog.V(5).Infof("Agent service account registered with cluster: %s", agentClusterID) - return convertServiceAccountDataToAPIServiceAccount(&svcData), nil -} - -// DeRegisterAcsFleetshardOperatorServiceAccount ... -func (r *redhatssoService) DeRegisterAcsFleetshardOperatorServiceAccount(agentClusterID string) *errors.ServiceError { - glog.V(5).Infof("Deregistering ACS fleetshard operator service account with cluster: %s", agentClusterID) - - ctx := context.Background() - _, resp, err := r.serviceAccountsAPI.GetServiceAccount(ctx, agentClusterID).Execute() - if err != nil { - return errors.NewWithCause(errors.ErrorFailedToDeleteServiceAccount, err, "Failed to delete service account: %s", agentClusterID) - } - if resp.StatusCode == http.StatusNotFound { - // if the account to be deleted does not exist, we simply exit with no errors - glog.V(5).Infof("ACS fleetshard operator service account not found") - return nil - } - - _, err = r.serviceAccountsAPI.DeleteServiceAccount(ctx, agentClusterID).Execute() - if err != nil { - return errors.NewWithCause(errors.ErrorFailedToDeleteServiceAccount, err, "Failed to delete service account: %s", agentClusterID) - } - - glog.V(5).Infof("ACS fleetshard operator service account deregistered with cluster: %s", agentClusterID) - return nil -} - -// // utility functions -func convertServiceAccountDataToAPIServiceAccount(data *serviceaccountsclient.ServiceAccountData) *api.ServiceAccount { - return &api.ServiceAccount{ - ID: shared.SafeString(data.Id), - ClientID: shared.SafeString(data.ClientId), - ClientSecret: shared.SafeString(data.Secret), - Name: shared.SafeString(data.Name), - CreatedBy: shared.SafeString(data.CreatedBy), - Description: shared.SafeString(data.Description), - CreatedAt: time.Unix(0, shared.SafeInt64(data.CreatedAt)*int64(time.Millisecond)), - } -} diff --git a/templates/service-template.yml b/templates/service-template.yml index a9a1161e6c..9041be3903 100644 --- a/templates/service-template.yml +++ b/templates/service-template.yml @@ -53,21 +53,37 @@ parameters: value: "10" - name: MEMORY_REQUEST - description: Memory request for the API pods. + description: Memory request for the fleet manager container. value: "512Mi" - name: MEMORY_LIMIT - description: Memory limit for the API pods. + description: Memory limit for the fleet manager container. value: "1Gi" - name: CPU_REQUEST - description: CPU request for the API pods. + description: CPU request for the fleet manager container. value: "200m" - name: CPU_LIMIT - description: CPU limit for the API pods. + description: CPU limit for the fleet manager container. value: "1" +- name: ENVOY_MEMORY_REQUEST + description: Memory request for the envoy sidecar container. + value: "256Mi" + +- name: ENVOY_MEMORY_LIMIT + description: Memory limit for the envoy sidecar container. + value: "512Mi" + +- name: ENVOY_CPU_REQUEST + description: CPU request for the envoy sidecar container. + value: "250m" + +- name: ENVOY_CPU_LIMIT + description: CPU limit for the envoy sidecar container. + value: "500m" + - name: JWKS_URL displayName: JWK Token Certificate URL @@ -233,11 +249,6 @@ parameters: description: The default value of maximum number of instances that can be created by users. value: "1" -- name: MAX_LIMIT_FOR_SSO_GET_CLIENTS - displayName: Max clients fetch by get clients - description: The default value of maximum number of clients fetch from sso. - value: "100" - - name: REGISTERED_SERVICE_ACCOUNTS displayName: A list of service accounts description: A list of service accounts that are allowed to create standard CENTRAL instances without requiring an organisation to do so in a yaml format. @@ -258,19 +269,6 @@ parameters: description: A list of read only users. A user is identified by its username. value: "[]" -- name: SSO_DEBUG - displayName: SSO API Debug mode - description: Debug mode for SSO API client - value: "false" - -- name: SSO_BASE_URL - displayName: SSO Host Url - description: SSO Host url - -- name: SSO_REALM - displayName: SSO REALM for Central SSO Clients and Service Accounts - description: SSO realm for Central SSO Clients and Service Accounts - - name: CLUSTER_OPENSHIFT_VERSION displayName: The version of openshift description: The version of openshift to be deployed on a new created OSD cluster @@ -357,16 +355,6 @@ parameters: description: Enables reconciliation for data plane clusters in the 'Ready' state value: "true" -- name: CENTRAL_OPERATOR_OLM_INDEX_IMAGE - displayName: Central operator OLM index image - description: Central operator OLM index image - value: "quay.io/osd-addons/managed-central:production-82b42db" - -- name: FLEETSHARD_OLM_INDEX_IMAGE - displayName: fleetshard operator OLM index image - description: fleetshard operator OLM index image - value: "quay.io/osd-addons/fleetshard-operator:production-82b42db" - - name: IMAGE_PULL_POLICY displayName: image pull policy description: image pull policy @@ -1315,13 +1303,9 @@ objects: - --ocm-addon-url=${OCM_ADDON_SERVICE_URL} - --ocm-addon-client-id-file=/secrets/fleet-manager-credentials/ocm-addon-service.clientId - --ocm-addon-client-secret-file=/secrets/fleet-manager-credentials/ocm-addon-service.clientSecret - - --ocm-addon-client-secret-file=/secrets/fleet-manager-credentials/ocm-addon-service.clientSecret - --inherit-fleetshard-sync-image-tag=${OCM_ADDON_SERVICE_INHERIT_FLEETSHARD_SYNC_IMAGE_TAG} - --addon-self-token-file=/secrets/fleet-manager-credentials/ocm-addon-service.token - --fleetshard-sync-image-tag=${IMAGE_TAG} - - --sso-base-url=${SSO_BASE_URL} - - --max-limit-for-sso-get-clients=${MAX_LIMIT_FOR_SSO_GET_CLIENTS} - - --sso-debug=${SSO_DEBUG} - --self-token-file=/secrets/service/ocm-service.token - --ocm-base-url=${OCM_URL} - --ams-base-url=${AMS_URL} @@ -1361,8 +1345,6 @@ objects: - --observability-config-access-token-file=/secrets/service/observability-config-access.token - --observability-config-tag=${OBSERVABILITY_CONFIG_TAG} - --public-host-url=${SERVICE_PUBLIC_HOST_URL} - - --central-operator-index-image=${CENTRAL_OPERATOR_OLM_INDEX_IMAGE} - - --fleetshard-operator-index-image=${FLEETSHARD_OLM_INDEX_IMAGE} - --dataplane-cluster-scaling-type=${DATAPLANE_CLUSTER_SCALING_TYPE} - --central-domain-name=${CENTRAL_DOMAIN_NAME} - --alsologtostderr @@ -1447,11 +1429,11 @@ objects: failureThreshold: 10 resources: requests: - memory: 256Mi - cpu: 250m + memory: ${ENVOY_MEMORY_REQUEST} + cpu: ${ENVOY_CPU_REQUEST} limits: - memory: 512Mi - cpu: 500m + memory: ${ENVOY_MEMORY_LIMIT} + cpu: ${ENVOY_CPU_LIMIT} - kind: PodDisruptionBudget apiVersion: policy/v1 diff --git a/test/mocks/api_server.go b/test/mocks/api_server.go index f0e08eafa2..582da9b2f6 100644 --- a/test/mocks/api_server.go +++ b/test/mocks/api_server.go @@ -103,11 +103,7 @@ const ( // MockIngressListening default mock ingress listening used in the mock ocm server MockIngressListening = clustersmgmtv1.ListeningMethodExternal // MockClusterAddonID default mock cluster addon ID - MockClusterAddonID = "managed-central-qe" - // MockFleetshardAddonID default mock ID for the Fleetshard Operator - MockFleetshardAddonID = "fleetshard-operator-qe" - // MockClusterLoggingOperatorAddonID default mock ID for the Cluster Logging Operator - MockClusterLoggingOperatorAddonID = "cluster-logging-operator" + MockClusterAddonID = "acs-fleetshard-dev" // MockClusterAddonState default mock cluster addon state MockClusterAddonState = clustersmgmtv1.AddOnInstallationStateReady // MockClusterAddonDescription default mock cluster addon description @@ -174,25 +170,23 @@ var ( // to override these values, do not set them directly e.g. mocks.MockSyncset = ... // instead use the Set*Response functions provided by MockConfigurableServerBuilder e.g. SetClusterGetResponse(...) var ( - MockIdentityProvider *clustersmgmtv1.IdentityProvider - MockSyncset *clustersmgmtv1.Syncset - MockIngressList *clustersmgmtv1.IngressList - MockCloudProvider *clustersmgmtv1.CloudProvider - MockCloudProviderList *clustersmgmtv1.CloudProviderList - MockCloudProviderRegion *clustersmgmtv1.CloudRegion - MockCloudProviderRegionList *clustersmgmtv1.CloudRegionList - MockClusterStatus *clustersmgmtv1.ClusterStatus - MockClusterAddonInstallation *clustersmgmtv1.AddOnInstallation - MockClusterAddonInstallationList *clustersmgmtv1.AddOnInstallationList - MockFleetshardOperatorAddonInstallation *clustersmgmtv1.AddOnInstallation - MockClusterLoggingOperatorAddonInstallation *clustersmgmtv1.AddOnInstallation - MockMachinePoolList *clustersmgmtv1.MachinePoolList - MockMachinePool *clustersmgmtv1.MachinePool - MockCluster *clustersmgmtv1.Cluster - MockClusterAuthorization *amsv1.ClusterAuthorizationResponse - MockSubscription *amsv1.Subscription - MockSubscriptionSearch []*amsv1.Subscription - MockTermsReview *authorizationsv1.TermsReviewResponse + MockIdentityProvider *clustersmgmtv1.IdentityProvider + MockSyncset *clustersmgmtv1.Syncset + MockIngressList *clustersmgmtv1.IngressList + MockCloudProvider *clustersmgmtv1.CloudProvider + MockCloudProviderList *clustersmgmtv1.CloudProviderList + MockCloudProviderRegion *clustersmgmtv1.CloudRegion + MockCloudProviderRegionList *clustersmgmtv1.CloudRegionList + MockClusterStatus *clustersmgmtv1.ClusterStatus + MockClusterAddonInstallation *clustersmgmtv1.AddOnInstallation + MockClusterAddonInstallationList *clustersmgmtv1.AddOnInstallationList + MockMachinePoolList *clustersmgmtv1.MachinePoolList + MockMachinePool *clustersmgmtv1.MachinePool + MockCluster *clustersmgmtv1.Cluster + MockClusterAuthorization *amsv1.ClusterAuthorizationResponse + MockSubscription *amsv1.Subscription + MockSubscriptionSearch []*amsv1.Subscription + MockTermsReview *authorizationsv1.TermsReviewResponse ) // routerSwapper is an http.Handler that allows you to swap mux routers. @@ -476,42 +470,36 @@ func getDefaultHandlerRegister() (HandlerRegister, error) { // define a list of default endpoints and handlers in the mock ocm api server, when new endpoints are used in the // managed-services-api service, a default ocm response should also be added here return HandlerRegister{ - EndpointClusterGet: buildMockRequestHandler(MockCluster, nil), - EndpointClusterPatch: buildMockRequestHandler(MockCluster, nil), - EndpointDinosaurDelete: buildMockRequestHandler(MockSyncset, nil), - EndpointClustersGet: buildMockRequestHandler(MockCluster, nil), - EndpointClustersPost: buildMockRequestHandler(MockCluster, nil), - EndpointClusterDelete: buildMockRequestHandler(MockCluster, ocmErrors.NotFound("setting this to not found to mimick a successul deletion")), - EndpointClusterSyncsetsPost: buildMockRequestHandler(MockSyncset, nil), - EndpointClusterSyncsetGet: buildMockRequestHandler(MockSyncset, nil), - EndpointClusterSyncsetPatch: buildMockRequestHandler(MockSyncset, nil), - EndpointClusterIngressGet: buildMockRequestHandler(MockIngressList, nil), - EndpointCloudProvidersGet: buildMockRequestHandler(MockCloudProviderList, nil), - EndpointCloudProviderGet: buildMockRequestHandler(MockCloudProvider, nil), - EndpointCloudProviderRegionsGet: buildMockRequestHandler(MockCloudProviderRegionList, nil), - EndpointCloudProviderRegionGet: buildMockRequestHandler(MockCloudProviderRegion, nil), - EndpointClusterStatusGet: buildMockRequestHandler(MockClusterStatus, nil), - EndpointClusterAddonsGet: buildMockRequestHandler(MockClusterAddonInstallationList, nil), - EndpointClusterAddonPost: buildMockRequestHandler(MockClusterAddonInstallation, nil), - EndpointMachinePoolsGet: buildMockRequestHandler(MockMachinePoolList, nil), - EndpointMachinePoolGet: buildMockRequestHandler(MockMachinePool, nil), - EndpointMachinePoolPatch: buildMockRequestHandler(MockMachinePool, nil), - EndpointMachinePoolPost: buildMockRequestHandler(MockMachinePool, nil), - EndpointIdentityProviderPatch: buildMockRequestHandler(MockIdentityProvider, nil), - EndpointIdentityProviderPost: buildMockRequestHandler(MockIdentityProvider, nil), - EndpointAddonInstallationsPost: buildMockRequestHandler(MockClusterAddonInstallation, nil), - EndpointAddonInstallationGet: buildMockRequestHandler(MockClusterAddonInstallation, nil), - EndpointAddonInstallationPatch: buildMockRequestHandler(MockClusterAddonInstallation, nil), - EndpointFleetshardOperatorAddonInstallationGet: buildMockRequestHandler(MockFleetshardOperatorAddonInstallation, nil), - EndpointFleetshardOperatorAddonInstallationPatch: buildMockRequestHandler(MockFleetshardOperatorAddonInstallation, nil), - EndpointFleetshardOperatorAddonInstallationPost: buildMockRequestHandler(MockFleetshardOperatorAddonInstallation, nil), - EndpointClusterLoggingOperatorAddonInstallationGet: buildMockRequestHandler(MockClusterLoggingOperatorAddonInstallation, nil), - EndpointClusterLoggingOperatorAddonInstallationPatch: buildMockRequestHandler(MockClusterLoggingOperatorAddonInstallation, nil), - EndpointClusterLoggingOperatorAddonInstallationPost: buildMockRequestHandler(MockClusterLoggingOperatorAddonInstallation, nil), - EndpointClusterAuthorizationPost: buildMockRequestHandler(MockClusterAuthorization, nil), - EndpointSubscriptionDelete: buildMockRequestHandler(MockSubscription, nil), - EndpointSubscriptionSearch: buildMockRequestHandler(MockSubscriptionSearch, nil), - EndpointTermsReviewPost: buildMockRequestHandler(MockTermsReview, nil), + EndpointClusterGet: buildMockRequestHandler(MockCluster, nil), + EndpointClusterPatch: buildMockRequestHandler(MockCluster, nil), + EndpointDinosaurDelete: buildMockRequestHandler(MockSyncset, nil), + EndpointClustersGet: buildMockRequestHandler(MockCluster, nil), + EndpointClustersPost: buildMockRequestHandler(MockCluster, nil), + EndpointClusterDelete: buildMockRequestHandler(MockCluster, ocmErrors.NotFound("setting this to not found to mimick a successul deletion")), + EndpointClusterSyncsetsPost: buildMockRequestHandler(MockSyncset, nil), + EndpointClusterSyncsetGet: buildMockRequestHandler(MockSyncset, nil), + EndpointClusterSyncsetPatch: buildMockRequestHandler(MockSyncset, nil), + EndpointClusterIngressGet: buildMockRequestHandler(MockIngressList, nil), + EndpointCloudProvidersGet: buildMockRequestHandler(MockCloudProviderList, nil), + EndpointCloudProviderGet: buildMockRequestHandler(MockCloudProvider, nil), + EndpointCloudProviderRegionsGet: buildMockRequestHandler(MockCloudProviderRegionList, nil), + EndpointCloudProviderRegionGet: buildMockRequestHandler(MockCloudProviderRegion, nil), + EndpointClusterStatusGet: buildMockRequestHandler(MockClusterStatus, nil), + EndpointClusterAddonsGet: buildMockRequestHandler(MockClusterAddonInstallationList, nil), + EndpointClusterAddonPost: buildMockRequestHandler(MockClusterAddonInstallation, nil), + EndpointMachinePoolsGet: buildMockRequestHandler(MockMachinePoolList, nil), + EndpointMachinePoolGet: buildMockRequestHandler(MockMachinePool, nil), + EndpointMachinePoolPatch: buildMockRequestHandler(MockMachinePool, nil), + EndpointMachinePoolPost: buildMockRequestHandler(MockMachinePool, nil), + EndpointIdentityProviderPatch: buildMockRequestHandler(MockIdentityProvider, nil), + EndpointIdentityProviderPost: buildMockRequestHandler(MockIdentityProvider, nil), + EndpointAddonInstallationsPost: buildMockRequestHandler(MockClusterAddonInstallation, nil), + EndpointAddonInstallationGet: buildMockRequestHandler(MockClusterAddonInstallation, nil), + EndpointAddonInstallationPatch: buildMockRequestHandler(MockClusterAddonInstallation, nil), + EndpointClusterAuthorizationPost: buildMockRequestHandler(MockClusterAuthorization, nil), + EndpointSubscriptionDelete: buildMockRequestHandler(MockSubscription, nil), + EndpointSubscriptionSearch: buildMockRequestHandler(MockSubscriptionSearch, nil), + EndpointTermsReviewPost: buildMockRequestHandler(MockTermsReview, nil), }, nil } @@ -852,14 +840,6 @@ func init() { if err != nil { panic(err) } - MockFleetshardOperatorAddonInstallation, err = GetMockClusterAddonInstallation(nil, MockFleetshardAddonID) - if err != nil { - panic(err) - } - MockClusterLoggingOperatorAddonInstallation, err = GetMockClusterAddonInstallation(nil, MockClusterLoggingOperatorAddonID) - if err != nil { - panic(err) - } MockCluster, err = GetMockCluster(nil) if err != nil { panic(err) @@ -1117,9 +1097,7 @@ func GetMockClusterAddonInstallation(modifyFn func(*clustersmgmtv1.AddOnInstalla // GetMockClusterAddonInstallationList for emulated OCM server func GetMockClusterAddonInstallationList(modifyFn func(*clustersmgmtv1.AddOnInstallationList, error)) (*clustersmgmtv1.AddOnInstallationList, error) { list, err := clustersmgmtv1.NewAddOnInstallationList().Items( - GetMockClusterAddonInstallationBuilder(nil, MockClusterAddonID), - GetMockClusterAddonInstallationBuilder(nil, MockClusterLoggingOperatorAddonID), - GetMockClusterAddonInstallationBuilder(nil, MockFleetshardAddonID)). + GetMockClusterAddonInstallationBuilder(nil, MockClusterAddonID)). Build() if modifyFn != nil { modifyFn(list, err) diff --git a/tools/go.mod b/tools/go.mod index 644ecedc30..aca0fa7979 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -4,15 +4,15 @@ go 1.20 require ( github.com/go-bindata/go-bindata/v3 v3.1.4-0.20210427095211-26949cc13d95 - github.com/matryer/moq v0.3.3 + github.com/matryer/moq v0.3.4 github.com/onsi/ginkgo/v2 v2.15.0 - github.com/segmentio/chamber/v2 v2.13.6 + github.com/segmentio/chamber/v2 v2.14.0 gotest.tools/gotestsum v1.11.0 ) require ( - github.com/alessio/shellescape v1.4.1 // indirect - github.com/aws/aws-sdk-go v1.44.312 // indirect + github.com/alessio/shellescape v1.4.2 // indirect + github.com/aws/aws-sdk-go v1.50.10 // indirect github.com/bitfield/gotestdox v0.2.1 // indirect github.com/dnephin/pflag v1.0.7 // indirect github.com/fatih/color v1.15.0 // indirect @@ -29,17 +29,17 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/segmentio/analytics-go/v3 v3.2.1 // indirect + github.com/segmentio/analytics-go/v3 v3.3.0 // indirect github.com/segmentio/backo-go v1.0.1 // indirect - github.com/spf13/cobra v1.7.0 // indirect + github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.16.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.16.1 // indirect + golang.org/x/tools v0.17.0 // indirect gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index e72ef40cfb..77ffebc00e 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,14 +1,14 @@ -github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= -github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= -github.com/aws/aws-sdk-go v1.44.312 h1:llrElfzeqG/YOLFFKjg1xNpZCFJ2xraIi3PqSuP+95k= -github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4uEoM0= +github.com/alessio/shellescape v1.4.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= +github.com/aws/aws-sdk-go v1.50.10 h1:H3NQvqRUKG+9oysCKTIyylpkqfPA7MiBtzTnu/cIGqE= +github.com/aws/aws-sdk-go v1.50.10/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/bitfield/gotestdox v0.2.1 h1:Zj8IMLAO5/oiAKoMmtN96eyFiPZraJRTH2p0zDgtxc0= github.com/bitfield/gotestdox v0.2.1/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -50,8 +50,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/matryer/moq v0.3.3 h1:pScMH9VyrdT4S93yiLpVyU8rCDqGQr24uOyBxmktG5Q= -github.com/matryer/moq v0.3.3/go.mod h1:RJ75ZZZD71hejp39j4crZLsEDszGk6iH4v4YsWFKH4s= +github.com/matryer/moq v0.3.4 h1:czCFIos9rI2tyOehN9ktc/6bQ76N9J4xQ2n3dk063ac= +github.com/matryer/moq v0.3.4/go.mod h1:wqm9QObyoMuUtH81zFfs3EK6mXEcByy+TjvSROOXJ2U= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -63,20 +63,19 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg= -github.com/segmentio/analytics-go/v3 v3.2.1/go.mod h1:p8owAF8X+5o27jmvUognuXxdtqvSGtD0ZrfY2kcS9bE= +github.com/segmentio/analytics-go/v3 v3.3.0 h1:8VOMaVGBW03pdBrj1CMFfY9o/rnjJC+1wyQHlVxjw5o= +github.com/segmentio/analytics-go/v3 v3.3.0/go.mod h1:p8owAF8X+5o27jmvUognuXxdtqvSGtD0ZrfY2kcS9bE= github.com/segmentio/backo-go v1.0.1 h1:68RQccglxZeyURy93ASB/2kc9QudzgIDexJ927N++y4= github.com/segmentio/backo-go v1.0.1/go.mod h1:9/Rh6yILuLysoQnZ2oNooD2g7aBnvM7r/fNVxRNWfBc= -github.com/segmentio/chamber/v2 v2.13.6 h1:FobdrZ26GRfMrfw8rxtdmcVaTM4AyBrSV5R0/mHIC/M= -github.com/segmentio/chamber/v2 v2.13.6/go.mod h1:uo12NVgOrFvf7Zo6bN8H8GtLqlLwNWhNt+xmumwmoiA= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/segmentio/chamber/v2 v2.14.0 h1:qdky89Dsb/eVh/3lxXWbBjEgM++Yxr1GB3K0MJOq8HI= +github.com/segmentio/chamber/v2 v2.14.0/go.mod h1:qLPRUVeflUwdCMlqxHzwjHOQRJehGCMYzbI3UYeJHGk= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -104,18 +103,17 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -127,16 +125,14 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= @@ -145,7 +141,6 @@ golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= @@ -159,8 +154,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/tools/noop.go b/tools/noop.go new file mode 100644 index 0000000000..843adb94b9 --- /dev/null +++ b/tools/noop.go @@ -0,0 +1,3 @@ +package tools + +// There needs to be at least one go file without build tags, otherwise the git hooks complain