gocloak icon indicating copy to clipboard operation
gocloak copied to clipboard

WIP: Support for Keycloak 17+ / Version 19 as target

Open Nerzal opened this issue 1 year ago • 5 comments

WIP

Contains several breaking changes. Mostly due to keycloak changing things

Fixes

Fixes: #358 Fixes: #346 Fixes: #341

Introduced new functional option:

SetLegacyWildFlySupport()

usage:

client := gocloak.NewClient("hostname", gocloak.SetLegacyWildFlySupport())

Features

Implements: #331

Improvements:

Closes: #334

Renamed the following functions:

AddClientRoleToUser AddClientRoleToGroup DeleteClientRoleFromUser

to:

AddClientRolesToUser AddClientRolesToGroup DeleteClientRolesFromUser

The old functions are still in place but deprecated.

This Closes: #248

Nerzal avatar Aug 04 '22 22:08 Nerzal

Hello,

My company is currently using this library and are interested in the status of this PR and what it means for the future of gocloak:

  • Do you have an estimated timeline on when a you will cut a new release with keycloak 17+ support?
  • I see that this particular PR will not work with Keycloak before version 17. Are there any plans to make gocloak v11+ backwards compatible at all?
  • Is there anything we could do to assist? Testing, etc.?

Thank you for developing such a great library. We truly appreciate it

jack-bischoff avatar Aug 23 '22 23:08 jack-bischoff

Hi @jack-bischoff

i need to find some time to fix the last issues here.

  1. Merge conflicts
  2. There are 11 failing test still on the dev-branch some of them might be tricky to fix

In general: when using the new functional option

SetLegacyWildFlySupport()

Most functionalities should still be compatible to older keycloak versions. Determining, what stays compatible and what might not isn't done yet.

I currently cannot give an estimation, when i'll be able to fix up the remaining tests. If you want to help, feel free to fetch the dev branch and try to fix some, that would really help.

Nerzal avatar Aug 25 '22 14:08 Nerzal

@Nerzal hi i created pull request #367 to this dev branch, which fixes realm import, env variable no longer works, failed tests with CreatePolicy failed fail because uploads-scripts is disabled https://www.keycloak.org/2022/04/keycloak-1800-released as i understand js policies should not be uploaded but deployed as jars (yes and i see this in keycloak logs on tests java.lang.RuntimeException: Script upload is disabled)

these 4 tests fail because of policy type js:

Test_CreateListGetUpdateDeletePermission Test_JSPolicy Test_CreateListGetUpdateDeletePolicy Test_AggregatedPolicy

p53 avatar Sep 22 '22 13:09 p53

i pushed another changes, now only 2 tests are failing

p53 avatar Sep 24 '22 10:09 p53

all tests now fixed

p53 avatar Sep 24 '22 21:09 p53

Codecov Report

Merging #361 (0ab1e93) into main (b4b5d20) will decrease coverage by 0.14%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #361      +/-   ##
==========================================
- Coverage   77.28%   77.13%   -0.15%     
==========================================
  Files           4        4              
  Lines        2122     2139      +17     
==========================================
+ Hits         1640     1650      +10     
- Misses        327      333       +6     
- Partials      155      156       +1     
Impacted Files Coverage Δ
client.go 75.41% <ø> (-0.15%) :arrow_down:
models.go 93.33% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Oct 19 '22 12:10 codecov[bot]