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

Evaluate how reference-names with slashes can be properly handled in human-facing URLs #584

Closed
snazy opened this issue Dec 17, 2020 · 2 comments · Fixed by #5596
Closed
Assignees

Comments

@snazy
Copy link
Member

snazy commented Dec 17, 2020

Reference names (branches, tags) can contain slashes. The REST API requires those reference names to be properly escaped, which is fine, because it's intended for machine-to-machine communication.

But users (humans) probably want "nice to read" URLs like https://my-nessie-server-ui/tree/my/project/branch/name/commits in the UI, which reads better than https://my-nessie-server-ui/tree/my%2fproject%2fbranch%2fname/commits

@snazy snazy added this to the 1.0.0 milestone Sep 8, 2021
@rymurr rymurr removed this from the 1.0.0 milestone Sep 15, 2021
@snazy
Copy link
Member Author

snazy commented Aug 9, 2022

From two experiments against GH:
First, create branch tree/bom -> then a create-branch tree fails. Other way aound:
First, create branch tree -> then a create-branch tree/bom fails.
So there seems to be some path-ish validation.

@dimas-b dimas-b self-assigned this Aug 22, 2022
@dimas-b
Copy link
Member

dimas-b commented Aug 22, 2022

Another point: Even though using %2F in the URL path currently works, it is inconvenient for programmatic use because tools (e.g. rest-assured) will generally re-escape the % if it is passed to them in the URL path. At the same time tools will not escape / charts that are part of the ref name because they lack the knowledge of its special meaning.

@snazy snazy mentioned this issue Sep 6, 2022
21 tasks
dimas-b added a commit to dimas-b/nessie that referenced this issue Dec 1, 2022
* Use the right RegEx constant for resolving path parameters for
  GET /trees/{ref}

* Other endpoints appear to use the right RegEx constant already.

* Correct URL path parameter RegEx to account for tools encoding the
  `@` char as `%40`.

* Drop the spurious `?` at the end of the RegEx

Fixes projectnessie#584
dimas-b added a commit to dimas-b/nessie that referenced this issue Dec 1, 2022
* Use the right RegEx constant for resolving path parameters for
  GET /trees/{ref}

* Other endpoints appear to use the right RegEx constant already.

* Correct URL path parameter RegEx to account for tools encoding the
  `@` char as `%40`.

* Drop the spurious `?` at the end of the RegEx

Fixes projectnessie#584
dimas-b added a commit that referenced this issue Dec 2, 2022
* Use the right RegEx constant for resolving path parameters for
  GET /trees/{ref}

* Other endpoints appear to use the right RegEx constant already.

* Correct URL path parameter RegEx to account for tools encoding the
  `@` char as `%40`.

* Drop the spurious `?` at the end of the RegEx

Fixes #584
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 a pull request may close this issue.

3 participants