mayope / keycloakmigration

Manage your Keycloak configuration with code.
https://mayope.net
MIT License
108 stars 22 forks source link

fix(identityProvider): make displayName optional #45

Closed MrDeerly closed 2 years ago

MrDeerly commented 2 years ago

Hey there!

This PR fixes a bug where identityProviders without a displayName can't be updated (and probably not deleted).

The field is optional by keycloak (e.g. for so called "social identity providers" like LinkedIn) and should therefore also be optional internally.

Reproduction:

  1. Create an identityProvider without displayName field (e.g. LinkedIn).
  2. Update the identityProvider:
  - updateIdentityProvider:
      alias: google
      config:
        clientId: test
        clientSecret: test

Results in:

Exception in thread "main" feign.FeignException: Instantiation of [simple type, class de.klg71.keycloakmigration.keycloakapi.model.IdentityProvider] value failed for JSON property displayName due to missing (therefore NULL) value for creator parameter displayName which is a non-nullable type

MrDeerly commented 2 years ago

Existing tests shouldn't be affected at all

klg71 commented 2 years ago

Hey @MrDeerly thanks for another Merge Request :). Do we need to update the documentation on this field?

MrDeerly commented 2 years ago

just checked, no adjustments needed!