Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JoinPathSegments to disallow dot segments #221

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Conversation

azdagron
Copy link
Member

@azdagron azdagron commented Mar 16, 2023

JoinPathSegments does not fail for dot segments but should.

This PR also exports ValidatePathSegment for convenience.

JoinPathSegments does not fail for dot segments but should.

This PR also exports ValidatePathSegment for convenience.

Signed-off-by: Andrew Harding <andrew@spirl.com>
@azdagron azdagron force-pushed the fix-join-path-segments branch from 364a7c5 to 123dc6b Compare March 16, 2023 15:52
// ValidatePathSegment validates that a string is a conformant segment for
// inclusion in the path for a SPIFFE ID.
// See https://github.com/spiffe/spiffe/blob/main/standards/SPIFFE-ID.md#22-path
func ValidatePathSegment(segment string) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe it worth to start using this ValidatePathSegment inside ValidatePath, that is doing the same thing

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, they are very similar. Can we push that refactoring to another time?

Copy link
Collaborator

Choose a reason for hiding this comment

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

sure, we can just add an issue to not forgot about that

Copy link
Member

@evan2645 evan2645 left a comment

Choose a reason for hiding this comment

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

🥧 📙

@azdagron azdagron merged commit acf23ce into main Mar 16, 2023
@azdagron azdagron deleted the fix-join-path-segments branch March 16, 2023 16:44
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.

3 participants