| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Looks good to me. |
Sorry, something went wrong.
|
Just to make sure I understand this pattern: the Builder constructor being package-private means that the only way to go is to do var req = AccessRequest.RequestParameters.Builder().....build() ? I expected the AccessRequest.RequestParameters class to have a static method to instantiate the builder, like it is done in e.g. SolidSyncClient, and as your initial code snippet hinted @acoburn . |
Sorry, something went wrong.
|
@NSeydoux you are right, we're missing a static method: newBuilder(), which I would have seen as soon as I started writing tests, and which I will get to today :-) |
Sorry, something went wrong.
| * @return this builder | ||
| */ | ||
| public Builder purposes(final Collection<URI> purposes) { | ||
| if (purposes != null) { |
There was a problem hiding this comment.
I don't think there is a test case for a collection cleared this way.
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This adds the implementation code for a builder pattern for access requests. In particular, this makes it possible to set an issuance date in the future, which is otherwise not possible in the current API.
The first commit just adds the boilerplate code for the new AccessRequest.RequestParameter class and connects that to the AccessGrantClient.requestAccess method (adding a new overload). The getIssuedAt value is then propagated through the rest of the methods (e.g. grantAccess() and denyAccess()).
Note: I re-ordered the parameters for some internal (private) methods to group the arguments into a more logical order. This does not affect the public API.
Some items still needed here include:
The way this would be used is like so: