Bump github.com/Nerzal/gocloak/v13 from 13.1.0 to 13.8.0

Bumps [github.com/Nerzal/gocloak/v13](https://github.com/Nerzal/gocloak) from 13.1.0 to 13.8.0.
- [Release notes](https://github.com/Nerzal/gocloak/releases)
- [Commits](https://github.com/Nerzal/gocloak/compare/v13.1.0...v13.8.0)

---
updated-dependencies:
- dependency-name: github.com/Nerzal/gocloak/v13
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2023-08-30 09:32:48 +02:00
committed by Ralf Haferkamp
parent 5a1f2fe37d
commit 74567ee08d
9 changed files with 626 additions and 386 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ require (
github.com/KimMachineGun/automemlimit v0.2.6
github.com/Masterminds/semver v1.5.0
github.com/MicahParks/keyfunc v1.5.1
github.com/Nerzal/gocloak/v13 v13.1.0
github.com/Nerzal/gocloak/v13 v13.8.0
github.com/bbalet/stopwords v1.0.0
github.com/blevesearch/bleve/v2 v2.3.9
github.com/coreos/go-oidc v2.2.1+incompatible
+2 -2
View File
@@ -658,8 +658,8 @@ github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugX
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg=
github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE=
github.com/Nerzal/gocloak/v13 v13.1.0 h1:ret4pZTIsSQGZHURDMJ4jXnUmHyEoRykBqDTsAKoj8c=
github.com/Nerzal/gocloak/v13 v13.1.0/go.mod h1:rRBtEdh5N0+JlZZEsrfZcB2sRMZWbgSxI2EIv9jpJp4=
github.com/Nerzal/gocloak/v13 v13.8.0 h1:7s9cK8X3vy8OIic+pG4POE9vGy02tSHkMhvWXv0P2m8=
github.com/Nerzal/gocloak/v13 v13.8.0/go.mod h1:rRBtEdh5N0+JlZZEsrfZcB2sRMZWbgSxI2EIv9jpJp4=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8=
github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
+1 -1
View File
@@ -6,6 +6,6 @@ ENV KEYCLOAK_USER=admin
ENV KEYCLOAK_PASSWORD=secret
ENV KEYCLOAK_ADMIN=admin
ENV KEYCLOAK_ADMIN_PASSWORD=secret
ENV KC_FEATURES=account-api,account2,authorization,client-policies,impersonation,docker,scripts,upload_scripts
ENV KC_FEATURES=account-api,account2,authorization,client-policies,impersonation,docker,scripts,upload_scripts,admin-fine-grained-authz
RUN /opt/keycloak/bin/kc.sh import --file /data/import/gocloak-realm.json
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
+4 -2
View File
@@ -1,6 +1,8 @@
test:
./run-tests.sh
start-keycloak:
start-keycloak: stop-keycloak
docker-compose up -d
stop-keycloak:
docker-compose down
docker-compose up -d
+15 -3
View File
@@ -80,7 +80,7 @@ go get github.com/Nerzal/gocloak/v13
panic("Inspection failed:"+ err.Error())
}
if !rptResult.Active {
if !*rptResult.Active {
panic("Token is not active")
}
@@ -280,8 +280,8 @@ type GoCloak interface {
ClearUserCache(ctx context.Context, token, realm string) error
ClearKeysCache(ctx context.Context, token, realm string) error
GetClientUserSessions(ctx context.Context, token, realm, idOfClient string) ([]*UserSessionRepresentation, error)
GetClientOfflineSessions(ctx context.Context, token, realm, idOfClient string) ([]*UserSessionRepresentation, error)
GetClientUserSessions(ctx context.Context, token, realm, idOfClient string, params ...GetClientUserSessionsParams) ([]*UserSessionRepresentation, error)
GetClientOfflineSessions(ctx context.Context, token, realm, idOfClient string, params ...GetClientUserSessionsParams) ([]*UserSessionRepresentation, error)
GetUserSessions(ctx context.Context, token, realm, userID string) ([]*UserSessionRepresentation, error)
GetUserOfflineSessionsForClient(ctx context.Context, token, realm, userID, idOfClient string) ([]*UserSessionRepresentation, error)
@@ -475,6 +475,18 @@ yields
Note that empty parameters are not included, because of the use of ```omitempty``` in the type definitions.
## Examples
* [Add client role to user](./examples/ADD_CLIENT_ROLE_TO_USER.md)
* [Create User Federation & Sync](./examples/USER_FEDERATION.md)
* [Create User Federation & Sync with group ldap mapper](./examples/USER_FEDERATION_GROUP_LDAP_MAPPER.md)
* [Create User Federation & Sync with role ldap mapper](./examples/USER_FEDERATION_ROLE_LDAP_MAPPER.md)
* [Create User Federation & Sync with user attribute ldap mapper](./examples/USER_FEDERATION_USER_ATTRIBUTE_LDAP_MAPPER.md)
## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FNerzal%2Fgocloak.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FNerzal%2Fgocloak?ref=badge_large)
+429 -256
View File
File diff suppressed because it is too large Load Diff
+161 -118
View File
@@ -342,11 +342,13 @@ type GroupsCount struct {
// GetGroupsParams represents the optional parameters for getting groups
type GetGroupsParams struct {
First *int `json:"first,string,omitempty"`
Max *int `json:"max,string,omitempty"`
Search *string `json:"search,omitempty"`
Full *bool `json:"full,string,omitempty"`
BriefRepresentation *bool `json:"briefRepresentation,string,omitempty"`
Exact *bool `json:"exact,string,omitempty"`
First *int `json:"first,string,omitempty"`
Full *bool `json:"full,string,omitempty"`
Max *int `json:"max,string,omitempty"`
Q *string `json:"q,omitempty"`
Search *string `json:"search,omitempty"`
}
// MarshalJSON is a custom json marshaling function to automatically set the Full and BriefRepresentation properties
@@ -445,6 +447,7 @@ type ProtocolMappersConfig struct {
AttributeName *string `json:"attribute.name,omitempty"`
AttributeNameFormat *string `json:"attribute.nameformat,omitempty"`
Single *string `json:"single,omitempty"`
Script *string `json:"script,omitempty"`
}
// Client is a ClientRepresentation
@@ -717,120 +720,122 @@ type RolesRepresentation struct {
// RealmRepresentation represents a realm
type RealmRepresentation struct {
AccessCodeLifespan *int `json:"accessCodeLifespan,omitempty"`
AccessCodeLifespanLogin *int `json:"accessCodeLifespanLogin,omitempty"`
AccessCodeLifespanUserAction *int `json:"accessCodeLifespanUserAction,omitempty"`
AccessTokenLifespan *int `json:"accessTokenLifespan,omitempty"`
AccessTokenLifespanForImplicitFlow *int `json:"accessTokenLifespanForImplicitFlow,omitempty"`
AccountTheme *string `json:"accountTheme,omitempty"`
ActionTokenGeneratedByAdminLifespan *int `json:"actionTokenGeneratedByAdminLifespan,omitempty"`
ActionTokenGeneratedByUserLifespan *int `json:"actionTokenGeneratedByUserLifespan,omitempty"`
AdminEventsDetailsEnabled *bool `json:"adminEventsDetailsEnabled,omitempty"`
AdminEventsEnabled *bool `json:"adminEventsEnabled,omitempty"`
AdminTheme *string `json:"adminTheme,omitempty"`
Attributes *map[string]string `json:"attributes,omitempty"`
AuthenticationFlows *[]interface{} `json:"authenticationFlows,omitempty"`
AuthenticatorConfig *[]interface{} `json:"authenticatorConfig,omitempty"`
BrowserFlow *string `json:"browserFlow,omitempty"`
BrowserSecurityHeaders *map[string]string `json:"browserSecurityHeaders,omitempty"`
BruteForceProtected *bool `json:"bruteForceProtected,omitempty"`
ClientAuthenticationFlow *string `json:"clientAuthenticationFlow,omitempty"`
ClientScopeMappings *map[string]string `json:"clientScopeMappings,omitempty"`
ClientScopes *[]ClientScope `json:"clientScopes,omitempty"`
Clients *[]Client `json:"clients,omitempty"`
Components interface{} `json:"components,omitempty"`
DefaultDefaultClientScopes *[]string `json:"defaultDefaultClientScopes,omitempty"`
DefaultGroups *[]string `json:"defaultGroups,omitempty"`
DefaultLocale *string `json:"defaultLocale,omitempty"`
DefaultOptionalClientScopes *[]string `json:"defaultOptionalClientScopes,omitempty"`
DefaultRole *Role `json:"defaultRole,omitempty"`
DefaultRoles *[]string `json:"defaultRoles,omitempty"`
DefaultSignatureAlgorithm *string `json:"defaultSignatureAlgorithm,omitempty"`
DirectGrantFlow *string `json:"directGrantFlow,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
DisplayNameHTML *string `json:"displayNameHtml,omitempty"`
DockerAuthenticationFlow *string `json:"dockerAuthenticationFlow,omitempty"`
DuplicateEmailsAllowed *bool `json:"duplicateEmailsAllowed,omitempty"`
EditUsernameAllowed *bool `json:"editUsernameAllowed,omitempty"`
EmailTheme *string `json:"emailTheme,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
EnabledEventTypes *[]string `json:"enabledEventTypes,omitempty"`
EventsEnabled *bool `json:"eventsEnabled,omitempty"`
EventsExpiration *int64 `json:"eventsExpiration,omitempty"`
EventsListeners *[]string `json:"eventsListeners,omitempty"`
FailureFactor *int `json:"failureFactor,omitempty"`
FederatedUsers *[]interface{} `json:"federatedUsers,omitempty"`
Groups *[]interface{} `json:"groups,omitempty"`
ID *string `json:"id,omitempty"`
IdentityProviderMappers *[]interface{} `json:"identityProviderMappers,omitempty"`
IdentityProviders *[]interface{} `json:"identityProviders,omitempty"`
InternationalizationEnabled *bool `json:"internationalizationEnabled,omitempty"`
KeycloakVersion *string `json:"keycloakVersion,omitempty"`
LoginTheme *string `json:"loginTheme,omitempty"`
LoginWithEmailAllowed *bool `json:"loginWithEmailAllowed,omitempty"`
MaxDeltaTimeSeconds *int `json:"maxDeltaTimeSeconds,omitempty"`
MaxFailureWaitSeconds *int `json:"maxFailureWaitSeconds,omitempty"`
MinimumQuickLoginWaitSeconds *int `json:"minimumQuickLoginWaitSeconds,omitempty"`
NotBefore *int `json:"notBefore,omitempty"`
OfflineSessionIdleTimeout *int `json:"offlineSessionIdleTimeout,omitempty"`
OfflineSessionMaxLifespan *int `json:"offlineSessionMaxLifespan,omitempty"`
OfflineSessionMaxLifespanEnabled *bool `json:"offlineSessionMaxLifespanEnabled,omitempty"`
OtpPolicyAlgorithm *string `json:"otpPolicyAlgorithm,omitempty"`
OtpPolicyDigits *int `json:"otpPolicyDigits,omitempty"`
OtpPolicyInitialCounter *int `json:"otpPolicyInitialCounter,omitempty"`
OtpPolicyLookAheadWindow *int `json:"otpPolicyLookAheadWindow,omitempty"`
OtpPolicyPeriod *int `json:"otpPolicyPeriod,omitempty"`
OtpPolicyType *string `json:"otpPolicyType,omitempty"`
OtpSupportedApplications *[]string `json:"otpSupportedApplications,omitempty"`
PasswordPolicy *string `json:"passwordPolicy,omitempty"`
PermanentLockout *bool `json:"permanentLockout,omitempty"`
ProtocolMappers *[]interface{} `json:"protocolMappers,omitempty"`
QuickLoginCheckMilliSeconds *int64 `json:"quickLoginCheckMilliSeconds,omitempty"`
Realm *string `json:"realm,omitempty"`
RefreshTokenMaxReuse *int `json:"refreshTokenMaxReuse,omitempty"`
RegistrationAllowed *bool `json:"registrationAllowed,omitempty"`
RegistrationEmailAsUsername *bool `json:"registrationEmailAsUsername,omitempty"`
RegistrationFlow *string `json:"registrationFlow,omitempty"`
RememberMe *bool `json:"rememberMe,omitempty"`
RequiredActions *[]interface{} `json:"requiredActions,omitempty"`
ResetCredentialsFlow *string `json:"resetCredentialsFlow,omitempty"`
ResetPasswordAllowed *bool `json:"resetPasswordAllowed,omitempty"`
RevokeRefreshToken *bool `json:"revokeRefreshToken,omitempty"`
Roles *RolesRepresentation `json:"roles,omitempty"`
ScopeMappings *[]interface{} `json:"scopeMappings,omitempty"`
SMTPServer *map[string]string `json:"smtpServer,omitempty"`
SslRequired *string `json:"sslRequired,omitempty"`
SsoSessionIdleTimeout *int `json:"ssoSessionIdleTimeout,omitempty"`
SsoSessionIdleTimeoutRememberMe *int `json:"ssoSessionIdleTimeoutRememberMe,omitempty"`
SsoSessionMaxLifespan *int `json:"ssoSessionMaxLifespan,omitempty"`
SsoSessionMaxLifespanRememberMe *int `json:"ssoSessionMaxLifespanRememberMe,omitempty"`
SupportedLocales *[]string `json:"supportedLocales,omitempty"`
UserFederationMappers *[]interface{} `json:"userFederationMappers,omitempty"`
UserFederationProviders *[]interface{} `json:"userFederationProviders,omitempty"`
UserManagedAccessAllowed *bool `json:"userManagedAccessAllowed,omitempty"`
Users *[]User `json:"users,omitempty"`
VerifyEmail *bool `json:"verifyEmail,omitempty"`
WaitIncrementSeconds *int `json:"waitIncrementSeconds,omitempty"`
WebAuthnPolicyAcceptableAaguids *[]string `json:"webAuthnPolicyAcceptableAaguids,omitempty"`
WebAuthnPolicyAttestationConveyancePreference *string `json:"webAuthnPolicyAttestationConveyancePreference,omitempty"`
WebAuthnPolicyAuthenticatorAttachment *string `json:"webAuthnPolicyAuthenticatorAttachment,omitempty"`
WebAuthnPolicyAvoidSameAuthenticatorRegister *bool `json:"webAuthnPolicyAvoidSameAuthenticatorRegister,omitempty"`
WebAuthnPolicyCreateTimeout *int `json:"webAuthnPolicyCreateTimeout,omitempty"`
WebAuthnPolicyPasswordlessAcceptableAaguids *[]string `json:"webAuthnPolicyPasswordlessAcceptableAaguids,omitempty"`
WebAuthnPolicyPasswordlessAttestationConveyancePreference *string `json:"webAuthnPolicyPasswordlessAttestationConveyancePreference,omitempty"`
WebAuthnPolicyPasswordlessAuthenticatorAttachment *string `json:"webAuthnPolicyPasswordlessAuthenticatorAttachment,omitempty"`
WebAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister *bool `json:"webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister,omitempty"`
WebAuthnPolicyPasswordlessCreateTimeout *int `json:"webAuthnPolicyPasswordlessCreateTimeout,omitempty"`
WebAuthnPolicyPasswordlessRequireResidentKey *string `json:"webAuthnPolicyPasswordlessRequireResidentKey,omitempty"`
WebAuthnPolicyPasswordlessRpEntityName *string `json:"webAuthnPolicyPasswordlessRpEntityName,omitempty"`
WebAuthnPolicyPasswordlessRpID *string `json:"webAuthnPolicyPasswordlessRpId,omitempty"`
WebAuthnPolicyPasswordlessSignatureAlgorithms *[]string `json:"webAuthnPolicyPasswordlessSignatureAlgorithms,omitempty"`
WebAuthnPolicyPasswordlessUserVerificationRequirement *string `json:"webAuthnPolicyPasswordlessUserVerificationRequirement,omitempty"`
WebAuthnPolicyRequireResidentKey *string `json:"webAuthnPolicyRequireResidentKey,omitempty"`
WebAuthnPolicyRpEntityName *string `json:"webAuthnPolicyRpEntityName,omitempty"`
WebAuthnPolicyRpID *string `json:"webAuthnPolicyRpId,omitempty"`
WebAuthnPolicySignatureAlgorithms *[]string `json:"webAuthnPolicySignatureAlgorithms,omitempty"`
WebAuthnPolicyUserVerificationRequirement *string `json:"webAuthnPolicyUserVerificationRequirement,omitempty"`
AccessCodeLifespan *int `json:"accessCodeLifespan,omitempty"`
AccessCodeLifespanLogin *int `json:"accessCodeLifespanLogin,omitempty"`
AccessCodeLifespanUserAction *int `json:"accessCodeLifespanUserAction,omitempty"`
AccessTokenLifespan *int `json:"accessTokenLifespan,omitempty"`
AccessTokenLifespanForImplicitFlow *int `json:"accessTokenLifespanForImplicitFlow,omitempty"`
AccountTheme *string `json:"accountTheme,omitempty"`
ActionTokenGeneratedByAdminLifespan *int `json:"actionTokenGeneratedByAdminLifespan,omitempty"`
ActionTokenGeneratedByUserLifespan *int `json:"actionTokenGeneratedByUserLifespan,omitempty"`
AdminEventsDetailsEnabled *bool `json:"adminEventsDetailsEnabled,omitempty"`
AdminEventsEnabled *bool `json:"adminEventsEnabled,omitempty"`
AdminTheme *string `json:"adminTheme,omitempty"`
Attributes *map[string]string `json:"attributes,omitempty"`
AuthenticationFlows *[]interface{} `json:"authenticationFlows,omitempty"`
AuthenticatorConfig *[]interface{} `json:"authenticatorConfig,omitempty"`
BrowserFlow *string `json:"browserFlow,omitempty"`
BrowserSecurityHeaders *map[string]string `json:"browserSecurityHeaders,omitempty"`
BruteForceProtected *bool `json:"bruteForceProtected,omitempty"`
ClientAuthenticationFlow *string `json:"clientAuthenticationFlow,omitempty"`
ClientPolicies *map[string][]interface{} `json:"clientPolicies,omitempty"`
ClientProfiles *map[string][]interface{} `json:"clientProfiles,omitempty"`
ClientScopeMappings *map[string][]interface{} `json:"clientScopeMappings,omitempty"`
ClientScopes *[]ClientScope `json:"clientScopes,omitempty"`
Clients *[]Client `json:"clients,omitempty"`
Components interface{} `json:"components,omitempty"`
DefaultDefaultClientScopes *[]string `json:"defaultDefaultClientScopes,omitempty"`
DefaultGroups *[]string `json:"defaultGroups,omitempty"`
DefaultLocale *string `json:"defaultLocale,omitempty"`
DefaultOptionalClientScopes *[]string `json:"defaultOptionalClientScopes,omitempty"`
DefaultRole *Role `json:"defaultRole,omitempty"`
DefaultRoles *[]string `json:"defaultRoles,omitempty"`
DefaultSignatureAlgorithm *string `json:"defaultSignatureAlgorithm,omitempty"`
DirectGrantFlow *string `json:"directGrantFlow,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
DisplayNameHTML *string `json:"displayNameHtml,omitempty"`
DockerAuthenticationFlow *string `json:"dockerAuthenticationFlow,omitempty"`
DuplicateEmailsAllowed *bool `json:"duplicateEmailsAllowed,omitempty"`
EditUsernameAllowed *bool `json:"editUsernameAllowed,omitempty"`
EmailTheme *string `json:"emailTheme,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
EnabledEventTypes *[]string `json:"enabledEventTypes,omitempty"`
EventsEnabled *bool `json:"eventsEnabled,omitempty"`
EventsExpiration *int64 `json:"eventsExpiration,omitempty"`
EventsListeners *[]string `json:"eventsListeners,omitempty"`
FailureFactor *int `json:"failureFactor,omitempty"`
FederatedUsers *[]interface{} `json:"federatedUsers,omitempty"`
Groups *[]interface{} `json:"groups,omitempty"`
ID *string `json:"id,omitempty"`
IdentityProviderMappers *[]interface{} `json:"identityProviderMappers,omitempty"`
IdentityProviders *[]interface{} `json:"identityProviders,omitempty"`
InternationalizationEnabled *bool `json:"internationalizationEnabled,omitempty"`
KeycloakVersion *string `json:"keycloakVersion,omitempty"`
LoginTheme *string `json:"loginTheme,omitempty"`
LoginWithEmailAllowed *bool `json:"loginWithEmailAllowed,omitempty"`
MaxDeltaTimeSeconds *int `json:"maxDeltaTimeSeconds,omitempty"`
MaxFailureWaitSeconds *int `json:"maxFailureWaitSeconds,omitempty"`
MinimumQuickLoginWaitSeconds *int `json:"minimumQuickLoginWaitSeconds,omitempty"`
NotBefore *int `json:"notBefore,omitempty"`
OfflineSessionIdleTimeout *int `json:"offlineSessionIdleTimeout,omitempty"`
OfflineSessionMaxLifespan *int `json:"offlineSessionMaxLifespan,omitempty"`
OfflineSessionMaxLifespanEnabled *bool `json:"offlineSessionMaxLifespanEnabled,omitempty"`
OtpPolicyAlgorithm *string `json:"otpPolicyAlgorithm,omitempty"`
OtpPolicyDigits *int `json:"otpPolicyDigits,omitempty"`
OtpPolicyInitialCounter *int `json:"otpPolicyInitialCounter,omitempty"`
OtpPolicyLookAheadWindow *int `json:"otpPolicyLookAheadWindow,omitempty"`
OtpPolicyPeriod *int `json:"otpPolicyPeriod,omitempty"`
OtpPolicyType *string `json:"otpPolicyType,omitempty"`
OtpSupportedApplications *[]string `json:"otpSupportedApplications,omitempty"`
PasswordPolicy *string `json:"passwordPolicy,omitempty"`
PermanentLockout *bool `json:"permanentLockout,omitempty"`
ProtocolMappers *[]interface{} `json:"protocolMappers,omitempty"`
QuickLoginCheckMilliSeconds *int64 `json:"quickLoginCheckMilliSeconds,omitempty"`
Realm *string `json:"realm,omitempty"`
RefreshTokenMaxReuse *int `json:"refreshTokenMaxReuse,omitempty"`
RegistrationAllowed *bool `json:"registrationAllowed,omitempty"`
RegistrationEmailAsUsername *bool `json:"registrationEmailAsUsername,omitempty"`
RegistrationFlow *string `json:"registrationFlow,omitempty"`
RememberMe *bool `json:"rememberMe,omitempty"`
RequiredActions *[]interface{} `json:"requiredActions,omitempty"`
ResetCredentialsFlow *string `json:"resetCredentialsFlow,omitempty"`
ResetPasswordAllowed *bool `json:"resetPasswordAllowed,omitempty"`
RevokeRefreshToken *bool `json:"revokeRefreshToken,omitempty"`
Roles *RolesRepresentation `json:"roles,omitempty"`
ScopeMappings *[]interface{} `json:"scopeMappings,omitempty"`
SMTPServer *map[string]string `json:"smtpServer,omitempty"`
SslRequired *string `json:"sslRequired,omitempty"`
SsoSessionIdleTimeout *int `json:"ssoSessionIdleTimeout,omitempty"`
SsoSessionIdleTimeoutRememberMe *int `json:"ssoSessionIdleTimeoutRememberMe,omitempty"`
SsoSessionMaxLifespan *int `json:"ssoSessionMaxLifespan,omitempty"`
SsoSessionMaxLifespanRememberMe *int `json:"ssoSessionMaxLifespanRememberMe,omitempty"`
SupportedLocales *[]string `json:"supportedLocales,omitempty"`
UserFederationMappers *[]interface{} `json:"userFederationMappers,omitempty"`
UserFederationProviders *[]interface{} `json:"userFederationProviders,omitempty"`
UserManagedAccessAllowed *bool `json:"userManagedAccessAllowed,omitempty"`
Users *[]User `json:"users,omitempty"`
VerifyEmail *bool `json:"verifyEmail,omitempty"`
WaitIncrementSeconds *int `json:"waitIncrementSeconds,omitempty"`
WebAuthnPolicyAcceptableAaguids *[]string `json:"webAuthnPolicyAcceptableAaguids,omitempty"`
WebAuthnPolicyAttestationConveyancePreference *string `json:"webAuthnPolicyAttestationConveyancePreference,omitempty"`
WebAuthnPolicyAuthenticatorAttachment *string `json:"webAuthnPolicyAuthenticatorAttachment,omitempty"`
WebAuthnPolicyAvoidSameAuthenticatorRegister *bool `json:"webAuthnPolicyAvoidSameAuthenticatorRegister,omitempty"`
WebAuthnPolicyCreateTimeout *int `json:"webAuthnPolicyCreateTimeout,omitempty"`
WebAuthnPolicyPasswordlessAcceptableAaguids *[]string `json:"webAuthnPolicyPasswordlessAcceptableAaguids,omitempty"`
WebAuthnPolicyPasswordlessAttestationConveyancePreference *string `json:"webAuthnPolicyPasswordlessAttestationConveyancePreference,omitempty"`
WebAuthnPolicyPasswordlessAuthenticatorAttachment *string `json:"webAuthnPolicyPasswordlessAuthenticatorAttachment,omitempty"`
WebAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister *bool `json:"webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister,omitempty"`
WebAuthnPolicyPasswordlessCreateTimeout *int `json:"webAuthnPolicyPasswordlessCreateTimeout,omitempty"`
WebAuthnPolicyPasswordlessRequireResidentKey *string `json:"webAuthnPolicyPasswordlessRequireResidentKey,omitempty"`
WebAuthnPolicyPasswordlessRpEntityName *string `json:"webAuthnPolicyPasswordlessRpEntityName,omitempty"`
WebAuthnPolicyPasswordlessRpID *string `json:"webAuthnPolicyPasswordlessRpId,omitempty"`
WebAuthnPolicyPasswordlessSignatureAlgorithms *[]string `json:"webAuthnPolicyPasswordlessSignatureAlgorithms,omitempty"`
WebAuthnPolicyPasswordlessUserVerificationRequirement *string `json:"webAuthnPolicyPasswordlessUserVerificationRequirement,omitempty"`
WebAuthnPolicyRequireResidentKey *string `json:"webAuthnPolicyRequireResidentKey,omitempty"`
WebAuthnPolicyRpEntityName *string `json:"webAuthnPolicyRpEntityName,omitempty"`
WebAuthnPolicyRpID *string `json:"webAuthnPolicyRpId,omitempty"`
WebAuthnPolicySignatureAlgorithms *[]string `json:"webAuthnPolicySignatureAlgorithms,omitempty"`
WebAuthnPolicyUserVerificationRequirement *string `json:"webAuthnPolicyUserVerificationRequirement,omitempty"`
}
// AuthenticationFlowRepresentation represents an authentication flow of a realm
@@ -893,6 +898,29 @@ type MultiValuedHashMap struct {
Threshold *int32 `json:"threshold,omitempty"`
}
// AuthorizationParameters represents the options to obtain get an authorization
type AuthorizationParameters struct {
ResponseType *string `json:"code,omitempty"`
ClientID *string `json:"client_id,omitempty"`
Scope *string `json:"scope,omitempty"`
RedirectURI *string `json:"redirect_uri,omitempty"`
State *string `json:"state,omitempty"`
Nonce *string `json:"nonce,omitempty"`
IDTokenHint *string `json:"id_token_hint,omitempty"`
}
// FormData returns a map of options to be used in SetFormData function
func (p *AuthorizationParameters) FormData() map[string]string {
m, _ := json.Marshal(p)
var res map[string]string
_ = json.Unmarshal(m, &res)
return res
}
// AuthorizationResponse represents the response to an authorization request.
type AuthorizationResponse struct {
}
// TokenOptions represents the options to obtain a token
type TokenOptions struct {
ClientID *string `json:"client_id,omitempty"`
@@ -1380,6 +1408,20 @@ type RequiredActionProviderRepresentation struct {
ProviderID *string `json:"providerId,omitempty"`
}
// ManagementPermissionRepresentation is a representation of management permissions
// v18: https://www.keycloak.org/docs-api/18.0/rest-api/#_managementpermissionreference
type ManagementPermissionRepresentation struct {
Enabled *bool `json:"enabled,omitempty"`
Resource *string `json:"resource,omitempty"`
ScopePermissions *map[string]string `json:"scopePermissions,omitempty"`
}
// GetClientUserSessionsParams represents the optional parameters for getting user sessions associated with the client
type GetClientUserSessionsParams struct {
First *int `json:"first,string,omitempty"`
Max *int `json:"max,string,omitempty"`
}
// prettyStringStruct returns struct formatted into pretty string
func prettyStringStruct(t interface{}) string {
json, err := json.MarshalIndent(t, "", "\t")
@@ -1473,3 +1515,4 @@ func (v *GetResourcePoliciesParams) String() string { return pre
func (v *CredentialRepresentation) String() string { return prettyStringStruct(v) }
func (v *RequiredActionProviderRepresentation) String() string { return prettyStringStruct(v) }
func (v *BruteForceStatus) String() string { return prettyStringStruct(v) }
func (v *GetClientUserSessionsParams) String() string { return prettyStringStruct(v) }
+12 -2
View File
@@ -3,7 +3,17 @@
docker-compose down
docker-compose up -d
sleep 10
keycloakServer=http://localhost:8080
url="${keycloakServer}/health"
echo "Checking service availability at $url (CTRL+C to exit)"
while true; do
response=$(curl -s -o /dev/null -w "%{http_code}" $url)
if [ $response -eq 200 ]; then
break
fi
sleep 1
done
echo "Service is now available at ${keycloakServer}"
ARGS=()
if [ $# -gt 0 ]; then
@@ -13,4 +23,4 @@ fi
go test -failfast -race -cover -coverprofile=coverage.out -covermode=atomic -p 10 -cpu 1,2 -bench . -benchmem ${ARGS[@]}
docker-compose down
docker-compose down
+1 -1
View File
@@ -32,7 +32,7 @@ github.com/MicahParks/keyfunc
github.com/Microsoft/go-winio
github.com/Microsoft/go-winio/internal/socket
github.com/Microsoft/go-winio/pkg/guid
# github.com/Nerzal/gocloak/v13 v13.1.0
# github.com/Nerzal/gocloak/v13 v13.8.0
## explicit; go 1.18
github.com/Nerzal/gocloak/v13
github.com/Nerzal/gocloak/v13/pkg/jwx