FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

JCL-382: Access Credential Query builder by acoburn · Pull Request #532 · inrupt/solid-client-java · GitHub

Repository navigation

JCL-382: Access Credential Query builder - #532

Merged
acoburn merged 2 commits into
mainfrom
JCL-382-query-builder
Jun 15, 2023
Merged

acoburn merged 2 commits into
mainfrom
JCL-382-query-builder

Conversation

acoburn commented Jun 14, 2023

Copy link
Copy Markdown
Contributor

This adds an AccessCredentialQuery class to make it easier to add permutations to the query interface. In particular, this makes it possible to add multiple access modes ("Read", "Write") and purpose identifiers to a query.

Otherwise, one needs to make multiple requests with the client and manage the set operations manually.

This builder looks like this:

var q = AccessCredentialQuery.newBuilder()
        .resource(uri)
        .recipient(agent)
        .purpose(purpose1)
        .purpose(purpose2)
        .mode("Read")
        .mode("Write")
        .build(AccessGrant.class);

client.query(q)
        .toCompletableFuture()
        .join();

acoburn requested review from a team and kay-kim June 14, 2023 21:04

kay-kim left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

works for me!

timea-solid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Elegant

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

None of the tests cover cases where either multiple modes or purposes are set, would it be worth adding one?

* @return the resource, may be {@code null}
*/
public URI getResource() {
return resource;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Even if it may not be supported by all Access Management Applications, an Access Grant may cover multiple resources. Is it something that should be reflected in the querying capabilities? Or do we want to push this constraint down to the client libraries, in which case we should consider the same for the JC client.

acoburn enabled auto-merge (squash) June 15, 2023 13:12
acoburn merged commit 2265c44 into main Jun 15, 2023
acoburn deleted the JCL-382-query-builder branch June 15, 2023 13:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL