-
Notifications
You must be signed in to change notification settings - Fork 6k
Add Support Extracting DN From X500Principal #16984
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR @franticticktick Upon review, I think that it makes more sense to deprecate and create a What are your thoughts @jzheaux ? |
Yes, @rwinch, I agree. Originally, I was trying to be a bit more conservative and reuse what we have, but I believe a new implementation will allow for a name that clearly indicates what it's for. |
@rwinch @jzheaux there is one problem I would like to discuss. By default, the
We see an oid instead of an
To get a text string instead of an encoded value, we need to explicitly specify the format, this is RFC1779.
In this case, the generated
In this format we can get email, but no matter what format we specify, we will still get oid in the string. Even if we leave the dn extraction by pattern, it will be very non-obvious. For example:
This is a pretty hard to understand API. At the same time, the
And this will give the same result as the current implementation. If you have any ideas on how to better implement this feature, I'm ready to listen. |
@franticticktick Thanks for reaching out. I do not think that we can use the toString method because it is implementation dependent. I think that we should probably allow for the format and regex to be injected. We can have an additional boolean property for extracting the email address that in turn sets the format and regex to extract the email address. This will simplify the usage for users that do not want to dig into the details of how things work under the covers. Does that work? |
@rwinch I considered this solution. Provided that we provide the ability to extract dn via cn and email, this will work. Frankly speaking, I don't really like flags, they sometimes confuse, but as I understand it, in our situation there is no other solution. I will prepare a pr. |
c44bf81
to
fa9c24b
Compare
Closes spring-projectsgh-16980 Signed-off-by: Max Batischev <[email protected]>
Signed-off-by: Max Batischev <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @franticticktick! I think this is getting close. I'd like to preserve the idea of having a regex for extracting the principal name and allowing the user to specify the format. The difference would be that the extractPrincipalNameFromEmail would set the correct format + the correct regex without needing to understand how it works.
I'd argue that we probably don't need any properties on the DSLs but instead just allow the user to set the properties on SubjectX500PrincipalExtractor and then the extractor on the DSL (or exposed as a Bean...however it works now)
Closes gh-16980