lmccay commented on code in PR #1448:
URL: https://github.com/apache/knox/pull/1448#discussion_r4243642529
##########
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/AudienceResource.java:
##########
@@ -66,20 +77,29 @@ public record AudienceResource(String host, int
effectivePort, String namespace,
static final int DEFAULT_HTTPS_PORT = 443;
/**
- * Parses a single {@code aud} claim entry as a k8s-style destination URL.
Returns
- * {@link Optional#empty()} for any entry that is not a well-formed
+ * Parses a single {@code aud} claim entry in the custom form. Returns
{@link Optional#empty()}
+ * for any entry that is not a well-formed
* {@code
https://host[:port]/[skipped-segments/]namespace/service-name[/resource-path]}
URL --
* including a {@code null} or blank entry, a non-{@code https} scheme, a
missing or
* userinfo-carrying authority, a path that never contains a non-blank
{@code pathPrefix},
* fewer than two path segments once past any such prefix, or a resource
path that is not
- * already in RFC 3986 remove_dot_segments normal form -- rather than
throwing.
+ * already in RFC 3986 remove_dot_segments normal form -- rather than
throwing. The result's
+ * {@code host} and {@code effectivePort} are always set, unlike a {@link
#parseDnsForm(String,
+ * String)} result.
*
* <p>See the class javadoc for exactly how {@code pathPrefix} is searched
for and consumed.
*
* <p>A {@code ?query} or {@code #fragment} on the entry is discarded before
the path is parsed,
* so it plays no part in {@code pathPrefix} matching or in the resulting
resource path.
+ *
+ * @param audEntry the raw {@code aud} claim entry to parse
+ * @param pathPrefix the leading path segment(s) to search for and skip
past, as described
+ * above, or {@code null}/blank to require namespace and service-name to
begin straight
+ * after the authority
+ * @return the parsed result, or {@link Optional#empty()} if {@code
audEntry} is not a
+ * well-formed custom-form URL as described above
*/
- public static Optional<AudienceResource> parse(String audEntry, String
pathPrefix) {
+ public static Optional<AudienceResource> parseCustomForm(String audEntry,
String pathPrefix) {
Review Comment:
@hsheinblatt - if this is an existing API in released code then this may be
valid but if it isn't being used by any consumers in an actual release then we
can resolve this as not an issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]