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
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static SpiffeId parse(final String id) {
throw new IllegalArgumentException(EMPTY);
}

if (!id.contains(SCHEME_PREFIX)) {
if (!id.startsWith(SCHEME_PREFIX)) {
throw new InvalidSpiffeIdException(WRONG_SCHEME);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ static Stream<Arguments> provideInvalidSpiffeIds() {
Arguments.of("spiffe://trustdomain/./other", "Path cannot contain dot segments"),
Arguments.of("spiffe://trustdomain/../other", "Path cannot contain dot segments"),
Arguments.of("spiffe://trustdomain/", "Path cannot have a trailing slash"),
Arguments.of("spiffe://trustdomain/path/", "Path cannot have a trailing slash")
Arguments.of("spiffe://trustdomain/path/", "Path cannot have a trailing slash"),
Arguments.of("xspiffe://trustdomain/path", "Scheme is missing or invalid")
);
}

Expand Down