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

cant add xam.dk nor apache/camel to a catalog #1746

Open
maxandersen opened this issue Feb 10, 2024 · 6 comments
Open

cant add xam.dk nor apache/camel to a catalog #1746

maxandersen opened this issue Feb 10, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@maxandersen
Copy link
Collaborator

not sure if this is a bug or not....but I can do:

jbang catalog add --name xam.dk xam.dk even though I can do jbang catalog list xam.dk

shouldn't we allow aliases with .'s or is that going too far to be able to list https://... based catalogs?

@maxandersen maxandersen added the bug Something isn't working label Feb 10, 2024
@maxandersen maxandersen changed the title cant add xam.dk to a catalog cant add xam.dk nor apache/camel to a catalog Feb 10, 2024
@maxandersen
Copy link
Collaborator Author

i just realised you also can't add apache/camel ...nor jbanghub/eclipse using the CLI but you can do it when editing the json directly.

its quite nice being able to list catalogs this way....should we lift the restriction on the cli or you consider this a bug and thus shouldn't be able to list these names ?

@quintesse
Copy link
Contributor

Well, in the JSON you can of course put whatever you like, it's supposed to be "safe". Just never thought about EvilMax trying to edit his way out of CLI restrictions :-)

The reason for the limit has more to do with the fact that if you allow a bunch of special characters in alias names you run the risk of ambiguities: things that look like URLs or implicit catalog references, or Maven GAVs etc, and that right now get flagged as such, and things that are supposed to be aliases. But it's not as if I've listed all the possible ambiguities, it was more of a "safe bet".

@maxandersen
Copy link
Collaborator Author

I know we treat names with . as then it must be a http url - but that afaik is after alias resolution (haven't double checkked) so if thats true it should be fine..? and even if we dont do it for hostnames - it feels to aliases with /'s in it should be allowed if not for anything but you can make catalog that lists other implictly named catalogs...could even consider adding criteria that the catalog alias is equivalent to the implicit alias if wanna be on safe side?

@quintesse
Copy link
Contributor

you can make catalog that lists other implictly named catalogs

I don't think that makes any sense, I could imagine being able to use implicit catalog names as the value of a catalog ref but not as it's name. I mean, what's the point? Isn't foo/bar meant to indicate a repo called "bar" in an org called "foo" (either on github, gitlab or bitbucket)?

What's the specific use-case of allowing alias names with slashes (or .s for that matter)? After all an alias is just a name that you give to something more complex that you don't want to type each time. But I have the feeling you want to use it for "fakery" (pretending to be something, like an implicit catalog or a URL, when you're really an alias)

@quintesse
Copy link
Contributor

Btw, I just remembered that JBang, internally, does make use of the fact that we can give aliases names with special chars. Heck we even store entire URLs it seems (although I have no idea why). This is done so we don't need to go look up the value of @maxandersen each time, otherwise we'd have to do the lookup in github, gitlab or bitbucket each time.

So to be honest I just don't know what's right or wrong anymore :-)

@maxandersen
Copy link
Collaborator Author

you can make catalog that lists other implictly named catalogs

I don't think that makes any sense, I could imagine being able to use implicit catalog names as the value of a catalog ref but not as it's name. I mean, what's the point? Isn't foo/bar meant to indicate a repo called "bar" in an org called "foo" (either on github, gitlab or bitbucket)?

What's the specific use-case of allowing alias names with slashes (or .s for that matter)? After all an alias is just a name that you give to something more complex that you don't want to type each time. But I have the feeling you want to use it for "fakery" (pretending to be something, like an implicit catalog or a URL, when you're really an alias)

The usecase is to have jbang catalog list show list of aliases using their implicit aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants