gplazma: multimap fix op regression #7658
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
Commit ef2dc1e introduced a regression in the multimap plugin. Where the 'op' principal type is used, logins will fail with dCache logging a stacktrace like:
This problem is because the above commit replaced the single-string constructor that was being used by the multimap plugin via reflection.
Modification:
Define the following semantics:
When
op
is used as a principal matcher, the matcher will be selected when the login has an OAuthProviderPrincipal with that value as its (dCache) name; for example,op:FOO
will match if the login has an OAuthProviderPrincipal with nameFOO
. The URL of the issuer (theiss
claim value) is not considered. This recreates the previous semantics.When used as a principal, the
op
takes two colon-sparated arguments: the (dCache) name for the OP and the issuer URL (theiss
claim value). For example,op:FOO:https://my-op.example.org/
creates an OP with nameFOO
and issuer URLhttps://my-op.example.org/
.For backwards compatibility, if the second colon and the issuer URL is omitted then a placeholder URL is used and a warning is logged; for example,
op:FOO
will add a OAuthProviderPrincipal with nameFOO
and a placeholder issuer URL.Unit tests are added that verify correct behaviour.
Result:
A regression is fixed in the multimap plugin when
op:
principal type is used.Target: master
Request: 10.1
Request: 10.0
Request: 9.2
Requires-notes: yes
Requires-book: no
Closes: #7654
Patch: https://rb.dcache.org/r/14314/
Acked-by: Tigran Mkrtchyan