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

[ELY-515] ServerAuthenticationContext rework #426

Merged
merged 14 commits into from May 4, 2016

Conversation

dmlloyd
Copy link
Contributor

@dmlloyd dmlloyd commented Apr 28, 2016

No description provided.

@fjuma
Copy link
Contributor

fjuma commented Apr 28, 2016

(Wasn't able to add a comment directly on SAC since the diff for that file is too large to be shown, so am commenting here.)

It looks like the following two lines in SAC#assignName are in the wrong order - the post-realm NameRewriters should get applied after the realm has been selected.

https://github.com/dmlloyd/wildfly-elytron/blob/ely-515/src/main/java/org/wildfly/security/auth/server/ServerAuthenticationContext.java#L583-L584

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Apr 28, 2016

Ah you're right, good catch. I copy-pasted that bit in pieces, must have scrambled it.

@fjuma
Copy link
Contributor

fjuma commented Apr 28, 2016

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Apr 28, 2016

Hmm I forgot to change that one to create an intermedate NameAssignedState. I better look at that more closely...

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Apr 28, 2016

I'm also going to make changes so that realm identities are disposed in finally blocks where appropriate.

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Apr 28, 2016

Added one missing commit: UnassignedState.authorize() didn't check for anonymous.

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Apr 28, 2016

Actually I'm going to update it though, to support non-required login permission checking for anonymous identities.

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Apr 29, 2016

Added a commit which shrinks the IdentityPropagationTestCase by using the importIdentity method directly.

@dmlloyd
Copy link
Contributor Author

dmlloyd commented May 3, 2016

The checks disappeared so I fired off a new run.

*
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
public final class IdentityLocator {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is 'Locator' really a good name here? To me locator gives the impression that it does something but from what I can see it is more a container for three optional values that can be used to obtain the realm identity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just so named because it "locates" the RealmIdentity. I'm open to suggestions though.

@darranl
Copy link
Contributor

darranl commented May 3, 2016

The one point really leaving me with questions is the IdentityLocator - I have mentioned some notes in the PR but thinking - are we sure it needs a name and a principal?

We only seem to set the Principal in two locations, verifyEvidence where it is extracted from the evidence - but the evidence is contained within the IdentityLocator anyway.

Secondly in assignName but now we end up with two different values to locate the RealmIdentity.

Two other comments about SAC.
I don't know if it needs to live in the javadoc or elsewhere but I think we need some very detailed documentation of this class and the states so when supported it can be clearly understood.

Secondly we need a strategy around trace logging to diagnose issues, either we need a lot more in the code or if we don't want to do this possibly ensure something like ByteMan can capture enough information.

@fjuma
Copy link
Contributor

fjuma commented May 3, 2016

+1, additional documentation of SAC and its states would be good (especially a state diagram).

@dmlloyd
Copy link
Contributor Author

dmlloyd commented May 3, 2016

I'm working on documentation. I want to have some visual diagrams if possible; what I'm working out right now is whether there is a way that the diagrams can be generated, so that we can source-revision them without dealing in binary blobs, and so that we can update them seamlessly without worrying too much about tools going out of date.

Trace logging is a good idea. I can add a good deal around that.

…nor behavioral tweaks to conform to the documentation)
@darranl darranl added the +1 DAL label May 4, 2016
@fjuma fjuma added the +1 FJ label May 4, 2016
@dmlloyd dmlloyd merged commit 5708be1 into wildfly-security:master May 4, 2016
@dmlloyd dmlloyd deleted the ely-515 branch May 4, 2016 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants