Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeggi authored Oct 21, 2021
2 parents bca1d17 + 852f284 commit 6b89fa0
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions keycloak/openid_audience_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ func (mapper *OpenIdAudienceProtocolMapper) convertToGenericProtocolMapper() *pr
}

func (protocolMapper *protocolMapper) convertToOpenIdAudienceProtocolMapper(realmId, clientId, clientScopeId string) (*OpenIdAudienceProtocolMapper, error) {
addToIdToken, err := strconv.ParseBool(protocolMapper.Config[addToIdTokenField])
addToIdToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToIdTokenField])
if err != nil {
return nil, err
}

addToAccessToken, err := strconv.ParseBool(protocolMapper.Config[addToAccessTokenField])
addToAccessToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToAccessTokenField])
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions keycloak/openid_full_name_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ func (mapper *OpenIdFullNameProtocolMapper) convertToGenericProtocolMapper() *pr
}

func (protocolMapper *protocolMapper) convertToOpenIdFullNameProtocolMapper(realmId, clientId, clientScopeId string) (*OpenIdFullNameProtocolMapper, error) {
idTokenClaim, err := strconv.ParseBool(protocolMapper.Config[addToIdTokenField])
idTokenClaim, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToIdTokenField])
if err != nil {
return nil, err
}

accessTokenClaim, err := strconv.ParseBool(protocolMapper.Config[addToAccessTokenField])
accessTokenClaim, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToAccessTokenField])
if err != nil {
return nil, err
}

userinfoTokenClaim, err := strconv.ParseBool(protocolMapper.Config[addToUserInfoField])
userinfoTokenClaim, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToUserInfoField])
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions keycloak/openid_group_membership_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ func (mapper *OpenIdGroupMembershipProtocolMapper) convertToGenericProtocolMappe
}

func (protocolMapper *protocolMapper) convertToOpenIdGroupMembershipProtocolMapper(realmId, clientId, clientScopeId string) (*OpenIdGroupMembershipProtocolMapper, error) {
fullPath, err := strconv.ParseBool(protocolMapper.Config[fullPathField])
fullPath, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[fullPathField])
if err != nil {
return nil, err
}

idTokenClaim, err := strconv.ParseBool(protocolMapper.Config[addToIdTokenField])
idTokenClaim, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToIdTokenField])
if err != nil {
return nil, err
}

accessTokenClaim, err := strconv.ParseBool(protocolMapper.Config[addToAccessTokenField])
accessTokenClaim, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToAccessTokenField])
if err != nil {
return nil, err
}

userinfoTokenClaim, err := strconv.ParseBool(protocolMapper.Config[addToUserInfoField])
userinfoTokenClaim, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToUserInfoField])
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions keycloak/openid_hardcoded_claim_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ func (mapper *OpenIdHardcodedClaimProtocolMapper) convertToGenericProtocolMapper
}

func (protocolMapper *protocolMapper) convertToOpenIdHardcodedClaimProtocolMapper(realmId, clientId, clientScopeId string) (*OpenIdHardcodedClaimProtocolMapper, error) {
addToIdToken, err := strconv.ParseBool(protocolMapper.Config[addToIdTokenField])
addToIdToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToIdTokenField])
if err != nil {
return nil, err
}

addToAccessToken, err := strconv.ParseBool(protocolMapper.Config[addToAccessTokenField])
addToAccessToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToAccessTokenField])
if err != nil {
return nil, err
}

addToUserInfo, err := strconv.ParseBool(protocolMapper.Config[addToUserInfoField])
addToUserInfo, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToUserInfoField])
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions keycloak/openid_script_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ func (mapper *OpenIdScriptProtocolMapper) convertToGenericProtocolMapper() *prot
}

func (protocolMapper *protocolMapper) convertToOpenIdScriptProtocolMapper(realmId, clientId, clientScopeId string) (*OpenIdScriptProtocolMapper, error) {
addToIdToken, err := strconv.ParseBool(protocolMapper.Config[addToIdTokenField])
addToIdToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToIdTokenField])
if err != nil {
return nil, err
}

addToAccessToken, err := strconv.ParseBool(protocolMapper.Config[addToAccessTokenField])
addToAccessToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToAccessTokenField])
if err != nil {
return nil, err
}

addToUserInfo, err := strconv.ParseBool(protocolMapper.Config[addToUserInfoField])
addToUserInfo, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToUserInfoField])
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions keycloak/openid_user_attribute_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ func (mapper *OpenIdUserAttributeProtocolMapper) convertToGenericProtocolMapper(
}

func (protocolMapper *protocolMapper) convertToOpenIdUserAttributeProtocolMapper(realmId, clientId, clientScopeId string) (*OpenIdUserAttributeProtocolMapper, error) {
addToIdToken, err := strconv.ParseBool(protocolMapper.Config[addToIdTokenField])
addToIdToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToIdTokenField])
if err != nil {
return nil, err
}

addToAccessToken, err := strconv.ParseBool(protocolMapper.Config[addToAccessTokenField])
addToAccessToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToAccessTokenField])
if err != nil {
return nil, err
}

addToUserInfo, err := strconv.ParseBool(protocolMapper.Config[addToUserInfoField])
addToUserInfo, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToUserInfoField])
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions keycloak/openid_user_client_role_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ func (mapper *OpenIdUserClientRoleProtocolMapper) convertToGenericProtocolMapper
}

func (protocolMapper *protocolMapper) convertToOpenIdUserClientRoleProtocolMapper(realmId, clientId, clientScopeId string) (*OpenIdUserClientRoleProtocolMapper, error) {
addToIdToken, err := strconv.ParseBool(protocolMapper.Config[addToIdTokenField])
addToIdToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToIdTokenField])
if err != nil {
return nil, err
}

addToAccessToken, err := strconv.ParseBool(protocolMapper.Config[addToAccessTokenField])
addToAccessToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToAccessTokenField])
if err != nil {
return nil, err
}

addToUserInfo, err := strconv.ParseBool(protocolMapper.Config[addToUserInfoField])
addToUserInfo, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToUserInfoField])
if err != nil {
return nil, err
}

multivalued, err := strconv.ParseBool(protocolMapper.Config[multivaluedField])
multivalued, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[multivaluedField])
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions keycloak/openid_user_property_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ func (mapper *OpenIdUserPropertyProtocolMapper) convertToGenericProtocolMapper()
}

func (protocolMapper *protocolMapper) convertToOpenIdUserPropertyProtocolMapper(realmId, clientId, clientScopeId string) (*OpenIdUserPropertyProtocolMapper, error) {
addToIdToken, err := strconv.ParseBool(protocolMapper.Config[addToIdTokenField])
addToIdToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToIdTokenField])
if err != nil {
return nil, err
}

addToAccessToken, err := strconv.ParseBool(protocolMapper.Config[addToAccessTokenField])
addToAccessToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToAccessTokenField])
if err != nil {
return nil, err
}

addToUserInfo, err := strconv.ParseBool(protocolMapper.Config[addToUserInfoField])
addToUserInfo, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToUserInfoField])
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions keycloak/openid_user_realm_role_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ func (mapper *OpenIdUserRealmRoleProtocolMapper) convertToGenericProtocolMapper(
}

func (protocolMapper *protocolMapper) convertToOpenIdUserRealmRoleProtocolMapper(realmId, clientId, clientScopeId string) (*OpenIdUserRealmRoleProtocolMapper, error) {
addToIdToken, err := strconv.ParseBool(protocolMapper.Config[addToIdTokenField])
addToIdToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToIdTokenField])
if err != nil {
return nil, err
}

addToAccessToken, err := strconv.ParseBool(protocolMapper.Config[addToAccessTokenField])
addToAccessToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToAccessTokenField])
if err != nil {
return nil, err
}

addToUserInfo, err := strconv.ParseBool(protocolMapper.Config[addToUserInfoField])
addToUserInfo, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToUserInfoField])
if err != nil {
return nil, err
}

multivalued, err := strconv.ParseBool(protocolMapper.Config[multivaluedField])
multivalued, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[multivaluedField])
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions keycloak/openid_user_session_note_protocol_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ func (mapper *OpenIdUserSessionNoteProtocolMapper) convertToGenericProtocolMappe
}

func (protocolMapper *protocolMapper) convertToOpenIdUserSessionNoteProtocolMapper(realmId, clientId, clientScopeId string) (*OpenIdUserSessionNoteProtocolMapper, error) {
addToIdToken, err := strconv.ParseBool(protocolMapper.Config[addToIdTokenField])
addToIdToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToIdTokenField])
if err != nil {
return nil, err
}

addToAccessToken, err := strconv.ParseBool(protocolMapper.Config[addToAccessTokenField])
addToAccessToken, err := parseBoolAndTreatEmptyStringAsFalse(protocolMapper.Config[addToAccessTokenField])
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 6b89fa0

Please sign in to comment.