mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
docs(lambda): correct the FunctionName charset claim in CodeStore (#3310)
The Javadoc on getVersionsPath, and the matching comment in CodeStoreTest, say floci "does not restrict the character set of FunctionName today, only that it is non-blank". That is wrong. LambdaArnUtils.validateName has validated the name since #450, against [a-zA-Z0-9-_.]+ with a 256 character ceiling. The conclusion both comments draw is unaffected: a dot is an accepted character, so "foo.v1" really is a function a user can create, and it really would have collided with a "<name>.v<n>" sibling directory. Only the stated reason was wrong, and it misdescribes the validation a reader would go on to look for. Both now name the actual pattern and point at #3238, which tracks the divergence from the live service. Comments only. No behaviour change. Refs #3238
This commit is contained in:
1 parent
b988dc5d1a
commit
a339f3ae70
2 files changed
+13
-11
No files matched your search
@@ -70,11 +70,12 @@ public class CodeStore {
|
||||
*
|
||||
* <p>The {@link #VERSIONS_DIR_SUFFIX} is what keeps that sibling from colliding with a real
|
||||
* function. {@link #sanitizeName} maps every name into {@code [a-zA-Z0-9_.-]}, so no function
|
||||
* can produce a directory name containing {@code @}, whatever it is called. Floci does not
|
||||
* restrict the character set of {@code FunctionName} today, only that it is non-blank, so a
|
||||
* plainer {@code <name>.v<n>} sibling carried no such guarantee: a function genuinely named
|
||||
* {@code foo.v1} owns the exact directory {@code foo}'s version 1 would otherwise claim, and
|
||||
* deleting either one silently corrupts the other.
|
||||
* can produce a directory name containing {@code @}, whatever it is called. A plainer
|
||||
* {@code <name>.v<n>} sibling carried no such guarantee, because a dot is an accepted character
|
||||
* in a function name: {@code LambdaArnUtils} validates against {@code [a-zA-Z0-9-_.]+}, which is
|
||||
* wider than the live service (issue #3238). So a function genuinely named {@code foo.v1} owns
|
||||
* the exact directory {@code foo}'s version 1 would otherwise claim, and deleting either one
|
||||
* silently corrupts the other.
|
||||
*/
|
||||
public Path getVersionsPath(String accountId, String region, String functionName) {
|
||||
return baseDir.resolve(sanitizeName(accountId))
|
||||
|
||||
Reference in new issue
Block a user