Skip to content

Draft Authentication API #128

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

Merged
merged 2 commits into from
Feb 25, 2016
Merged

Draft Authentication API #128

merged 2 commits into from
Feb 25, 2016

Conversation

boggle
Copy link
Contributor

@boggle boggle commented Feb 19, 2016

NOT READY FOR MERGE!

This is a draft of a new driver API for authentication support

@@ -67,6 +72,7 @@ private Config( ConfigBuilder builder )

this.encryptionLevel = builder.encruptionLevel;
this.trustStrategy = builder.trustStrategy;
this.authToken = builder.authToken;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason we didn't add AuthToken to Config was that that makes having a default config kind-of pointless unless we have add a defaultConfigWithAuthToken factory method.

Copy link
Contributor

Choose a reason for hiding this comment

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

But isn't that what we have - Config.build().withAuthToken(..)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't connecting to a URL with AuthToken the most common thing todo with a driver? Why does a user have to care about setting up a config to achieve that goal?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, yeah you're right. I'll change it.

@boggle
Copy link
Contributor Author

boggle commented Feb 23, 2016

Also since we only have two classes in it and they need to be fairly easy to find it feels like we should move everything from the auth package one level up again.

@jakewins
Copy link
Contributor

@boggle hmm, I'm concerned about the number of things in that namespace - but as per our discussion today and your point above, this thing is something every driver user will use, meaning it makes sense to put it top-level. If we add more complex functionality later (eg. expand back towards the full object model of the underlying model you outlined) we can add that in a security package.

- This keeps the same model - principal, credential, token - as
  originally proposed, but only exposes the concrete parts of the
  model as required to satisfy a minimal use case. This should be
  suitable to build upon as need arises for end users.
@boggle
Copy link
Contributor Author

boggle commented Feb 23, 2016

On that note, I'd love to separate the driver API into a part shared between connector and driver and a driver specific part. Perhaps that would help a bit with this.

@jakewins
Copy link
Contributor

@boggle IMO we shouldn't do that unless we decide to make the Connector API layer public, then it'd make sense to have classes that are shared between them in a third component, agreed - although IMO I think I'd prefer a clean separation, so the Connector layer has it's own representation of what an AuthToken is, but maybe that is overly separatey.

@boggle
Copy link
Contributor Author

boggle commented Feb 23, 2016

I was more thinking about types like Session and Value that might be shared. We need to sort out dependencies between driver, api, connector, and product.

@jakewins
Copy link
Contributor

I disagree the concrete classes should be shared - while they share the abstract concepts, a Session is exposed in a different way on the connection layer than on the end-user layer. Same for Value - the needs we have internally for an API for values is different from what we'd want to commit to in a public API, I think.

But - this is all just my subjective opinion, like with so many other things :p

In any case, I think that's orthogonal to this PR, lets keep exploring the API layering tho.

jakewins added a commit that referenced this pull request Feb 25, 2016
@jakewins jakewins merged commit 6384157 into neo4j:1.0 Feb 25, 2016
@jakewins jakewins deleted the 1.0-basic-auth branch February 25, 2016 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants