8000 may colon (:) be valid char as spring:session:sessions · Issue #201 · cache2k/cache2k · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

may colon (:) be valid char as spring:session:sessions #201

New issue

8000 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

Open
trydofor opened this issue Jan 27, 2023 · 3 comments
Open

may colon (:) be valid char as spring:session:sessions #201

trydofor opened this issue Jan 27, 2023 · 3 comments
Milestone

Comments

@trydofor
Copy link

in spring-session project, spring:session:sessions is used as default name.
so may : be valid in cache name pattern.

as the docs says

For maximum compatibility cache names should only
be composed with the characters [-_.a-zA-Z0-9].
The characters {}|^&=";:<>*?/ are not allowed in a cache name.

and the code impl

public static void checkName(String s) {
for (char c : s.toCharArray()) {
if (c == '.' ||
c == '-' ||
c == '~' ||
c == ',' ||
c == '@' ||
c == ' ' ||
c == '(' ||
c == ')' ||
c == '+' ||
c == '!' ||
c == '\'' ||
c == '%' ||
c == '#') {
continue;
}
if (c < 32 || c >= 127 || !Character.isJavaIdentifierPart(c)) {
throw new IllegalArgumentException(
"Cache name contains illegal character: '" + c + "', name=\"" + s + "\"");
}
}
}

@cruftex
Copy link
Member
cruftex commented Jan 27, 2023

No the :' is excluded or forbidden. I try to limit the use of special characters in cache names because the names could be used by extensions, for example JMX and micrometer, so it should be clear what characters need to be supported. Also the : is used as separator in cache2k <manager>:<name>.

If there is common use of : in cache names, we should allow it.

Thanks for the hint about spring-sessions. I see that spring:session:sessions used as default for Hazelcast. But its possible to change and I don't find a reference to the Spring caching abstraction. How is a cache being used there?

@trydofor
Copy link
Author
trydofor commented Jan 27, 2023

If there is common use of : in cache names, we should allow it.

i change the naming pattern from : to ~ now

I see that spring:session:sessions used as default for Hazelcast

redis and hazelcast use this pattern in code and document.

@cruftex cruftex added this to the v3 milestone Jan 27, 2023
@cruftex
Copy link
Member
cruftex commented Jan 27, 2023

Good. We can keep the issue open for now. If others see the need for change please comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0