Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keycloak_clientscope_type: sort default and optional clientscope lists before diff #9202

Conversation

fgruenbauer
Copy link
Contributor

SUMMARY

The change sorts the default and optional clientscope lists before the diff, to make the diff more accurate.

Before:

 {
     "default_clientscopes": [
+        "email",
+        "web-origins",
         "acr",
-        "profile",
-        "roles",
-        "basic",
-        "email"
+        "profile"
     ],
     "optional_clientscopes": [
-        "web-origins",
         "address",
-        "sAMAccountName",
+        "microprofile-jwt",
+        "organization",
         "offline_access",
-        "microprofile-jwt"
+        "phone"
     ]
 }

After:

 {
     "default_clientscopes": [
         "acr",
-        "basic",
         "email",
         "profile",
-        "roles"
+        "web-origins"
     ],
     "optional_clientscopes": [
         "address",
         "microprofile-jwt",
         "offline_access",
-        "sAMAccountName",
-        "web-origins"
+        "organization",
+        "phone"
     ]
 }
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

keycloak_clientscope_type

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Nov 27, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-9 Automatically create a backport for the stable-9 branch backport-10 Automatically create a backport for the stable-10 branch labels Nov 28, 2024
@felixfontein
Copy link
Collaborator

If nobody objects, I'll merge this on Sunday.

@russoz
Copy link
Collaborator

russoz commented Dec 1, 2024

unrelated to the PR, but when I opened the file to check something out, I spotted a typo (an "e" missing) in line 43, doc block. You might one to add that to this PR already ;-)

Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is a minor adjustment that could be made, other than that LGTM.

Comment on lines +194 to +198
scopes_copy = scopes.copy()
if isinstance(scopes_copy.get('default_clientscopes'), list):
scopes_copy['default_clientscopes'] = sorted(scopes_copy['default_clientscopes'])
if isinstance(scopes_copy.get('optional_clientscopes'), list):
scopes_copy['optional_clientscopes'] = sorted(scopes_copy['optional_clientscopes'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing the copy is a bit redundant. This could be simplified as:

Suggested change
scopes_copy = scopes.copy()
if isinstance(scopes_copy.get('default_clientscopes'), list):
scopes_copy['default_clientscopes'] = sorted(scopes_copy['default_clientscopes'])
if isinstance(scopes_copy.get('optional_clientscopes'), list):
scopes_copy['optional_clientscopes'] = sorted(scopes_copy['optional_clientscopes'])
scopes_copy = {
'default_clientscopes': sorted(scopes['default_clientscopes']) if scopes['default_clientscopes'] else [],
'optional_clientscopes': sorted(scopes['optional_clientscopes']) if scopes['optional_clientscopes'] else [],
}

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Dec 2, 2024
@felixfontein felixfontein merged commit 55d714d into ansible-collections:main Dec 2, 2024
129 checks passed
Copy link

patchback bot commented Dec 2, 2024

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/55d714da81fb6caa018cada300315b6086042c8e/pr-9202

Backported as #9221

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Dec 2, 2024
…s before diff (#9202)

* sort default and optional clientscope lists before diff

* add changelog fragment

(cherry picked from commit 55d714d)
Copy link

patchback bot commented Dec 2, 2024

Backport to stable-10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-10/55d714da81fb6caa018cada300315b6086042c8e/pr-9202

Backported as #9222

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator

@fgruenbauer thanks for your contribution!
@russoz thanks for reviewing!

patchback bot pushed a commit that referenced this pull request Dec 2, 2024
…s before diff (#9202)

* sort default and optional clientscope lists before diff

* add changelog fragment

(cherry picked from commit 55d714d)
felixfontein pushed a commit that referenced this pull request Dec 2, 2024
…t default and optional clientscope lists before diff (#9221)

keycloak_clientscope_type: sort default and optional clientscope lists before diff (#9202)

* sort default and optional clientscope lists before diff

* add changelog fragment

(cherry picked from commit 55d714d)

Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
felixfontein pushed a commit that referenced this pull request Dec 2, 2024
…rt default and optional clientscope lists before diff (#9222)

keycloak_clientscope_type: sort default and optional clientscope lists before diff (#9202)

* sort default and optional clientscope lists before diff

* add changelog fragment

(cherry picked from commit 55d714d)

Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
…s before diff (ansible-collections#9202)

* sort default and optional clientscope lists before diff

* add changelog fragment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 Automatically create a backport for the stable-9 branch backport-10 Automatically create a backport for the stable-10 branch bug This issue/PR relates to a bug module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants