Skip to content

Commit

Permalink
fix after review
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf4ood committed Jun 20, 2023
1 parent dd3a6e5 commit 3afe05c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class SsiIdentityServiceExtension implements ServiceExtension {

public static final String EXTENSION_NAME = "SSI Identity Service";

@Setting(value = "SSI Endpoint audience")
@Setting(value = "SSI Endpoint audience of this connector")
public static final String ENDPOINT_AUDIENCE = "tx.ssi.endpoint.audience";

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Result<Void> checkRule(@NotNull ClaimToken toVerify, @Nullable Map<String
if (audiences.isEmpty()) {
return Result.failure("Required audience (aud) claim is missing in token");
} else if (!audiences.contains(endpointAudience)) {
return Result.failure("Token audience (aud) claim did not contain connector audience: " + endpointAudience);
return Result.failure("Token audience (aud) claim did not contain audience: " + endpointAudience);
}
return Result.success();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void validationKoBecauseAudienceNotRespected() {

assertThat(result.succeeded()).isFalse();
assertThat(result.getFailureMessages()).hasSize(1)
.contains("Token audience (aud) claim did not contain connector audience: test-audience");
.contains("Token audience (aud) claim did not contain audience: test-audience");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import static jakarta.json.JsonValue.ValueType.OBJECT;
import static java.lang.String.format;

/**
* Extractor for field from a {@link JsonObject} with a customizable error reporting
*/
public class JsonLdFieldExtractor {

private String fieldAlias;
Expand Down Expand Up @@ -53,7 +56,7 @@ public Result<JsonObject> extract(JsonObject root) {

public static class Builder {

JsonLdFieldExtractor extractor;
private final JsonLdFieldExtractor extractor;

private Builder(JsonLdFieldExtractor extractor) {
this.extractor = extractor;
Expand All @@ -77,7 +80,7 @@ public Builder errorPrefix(String errorPrefix) {
this.extractor.errorPrefix = errorPrefix;
return this;
}

public JsonLdFieldExtractor build() {
Objects.requireNonNull(extractor.field);
Objects.requireNonNull(extractor.fieldAlias);
Expand Down

0 comments on commit 3afe05c

Please sign in to comment.