Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
INRUPT_TEST_REQUEST_METADATA_HEADERS_THAT_PROPAGATE: ${{ secrets.INRUPT_PROD_HEADERS_THAT_PROPAGATE }}

- name: Dev Integration tests
if: ${{ github.actor != 'dependabot[bot]' && matrix.java == 11 }}
if: ${{ github.actor != 'dependabot[bot]' && matrix.java == 17 }}
continue-on-error: true
run: mvn -B -ntp verify -Pci -pl integration/uma,integration/openid
env:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -461,90 +461,6 @@ <T extends AccessCredential> T cast(final Map<String, Object> data, final Class<
return null;
}

/**
* Perform an Access Credentials query and returns 0 to N matching access credentials.
*
* @param <T> the AccessCredential type
* @param resource the resource identifier, may be {@code null}
* @param creator the identifier for the agent who created the credential, may be {@code null}
* @param recipient the identifier for the agent who is the recipient for the credential, may be {@code null}
* @param purpose the access purpose, may be {@code null}
* @param mode the access mode, may be {@code null}
* @param clazz the AccessCredential type, either {@link AccessGrant} or {@link AccessRequest}
* @return the next stage of completion, including the matched Access Credentials
* @deprecated As of 1.3, replaced by {@link #query(CredentialFilter)}
*/
@Deprecated
public <T extends AccessCredential> CompletionStage<List<T>> query(final URI resource, final URI creator,
final URI recipient, final URI purpose, final String mode, final Class<T> clazz) {

final Set<String> modes = mode != null ? Collections.singleton(mode) : Collections.emptySet();
final Set<URI> purposes = purpose != null ? Collections.singleton(purpose) : Collections.emptySet();

return query(resource, creator, recipient, purposes, modes, clazz);
}

/**
* Perform an Access Credentials query and returns 0 to N matching access credentials.
*
* @param <T> the AccessCredential type
* @param query the access credential query, never {@code null}
* @return the next stage of completion, including the matched Access Credentials
* @deprecated As of 1.3, replaced by {@link #query(CredentialFilter)}
*/
@Deprecated
public <T extends AccessCredential> CompletionStage<List<T>> query(final AccessCredentialQuery<T> query) {
Objects.requireNonNull(query, "The query may not be null!");
return query(query.getResource(), query.getCreator(), query.getRecipient(), query.getPurposes(),
query.getModes(), query.getAccessCredentialType());
}

private <T extends AccessCredential> CompletionStage<List<T>> query(final URI resource, final URI creator,
final URI recipient, final Set<URI> purposes, final Set<String> modes, final Class<T> clazz) {
Objects.requireNonNull(clazz, "The clazz parameter must not be null!");

final URI type;
final Set<String> supportedTypes;
if (AccessGrant.class.isAssignableFrom(clazz)) {
type = URI.create(SOLID_ACCESS_GRANT);
supportedTypes = ACCESS_GRANT_TYPES;
} else if (AccessRequest.class.isAssignableFrom(clazz)) {
type = URI.create(SOLID_ACCESS_REQUEST);
supportedTypes = ACCESS_REQUEST_TYPES;
} else if (AccessDenial.class.isAssignableFrom(clazz)) {
type = URI.create(SOLID_ACCESS_DENIAL);
supportedTypes = ACCESS_DENIAL_TYPES;
} else {
throw new AccessGrantException("Unsupported type " + clazz + " in query request");
}

return v1Metadata().thenApply(metadata -> {
if (metadata.deriveEndpoint == null) {
throw new AccessGrantException("Server does not support queries via AccessCredentialQuery objects");
}
final List<T> responses = new ArrayList<>();
for (final Map<String, Object> data :
buildQuery(config.getIssuer(), type, resource, creator, recipient, purposes, modes)) {
final Request req = Request.newBuilder(metadata.deriveEndpoint)
.header(CONTENT_TYPE, APPLICATION_JSON)
.POST(Request.BodyPublishers.ofByteArray(serialize(data))).build();
final Response<InputStream> response = client.send(req, Response.BodyHandlers.ofInputStream())
.toCompletableFuture().join();

try (final InputStream input = response.body()) {
final int status = response.statusCode();
if (isSuccess(status)) {
responses.addAll(processQueryResponse(input, supportedTypes, clazz));
}
} catch (final IOException ex) {
throw new AccessGrantException(
"Unexpected I/O exception while processing Access Grant query", ex);
}
}
return responses;
});
}

/**
* Revoke an access credential.
*
Expand Down Expand Up @@ -682,7 +598,6 @@ CompletionStage<Metadata> v1Metadata() {
})
.thenApply(metadata -> {
final Metadata m = new Metadata();
m.deriveEndpoint = asUri(metadata.get("derivationService"));
m.queryEndpoint = asUri(metadata.get("queryService"));
m.issueEndpoint = asUri(metadata.get("issuerService"));
m.verifyEndpoint = asUri(metadata.get("verifierService"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ class Metadata {
public URI issueEndpoint;
public URI statusEndpoint;
public URI verifyEndpoint;
public URI deriveEndpoint;
}
Loading
Loading