+1
-1
atproto/syntax/aturi.go
+1
-1
atproto/syntax/aturi.go
···
6
6
"strings"
7
7
)
8
8
9
-
var aturiRegex = regexp.MustCompile(`^at:\/\/(?P<authority>[a-zA-Z0-9._:%-]+)(\/(?P<collection>[a-zA-Z0-9-.]+)(\/(?P<rkey>[a-zA-Z0-9_~.-]{1,512}))?)?$`)
9
+
var aturiRegex = regexp.MustCompile(`^at:\/\/(?P<authority>[a-zA-Z0-9._:%-]+)(\/(?P<collection>[a-zA-Z0-9-.]+)(\/(?P<rkey>[a-zA-Z0-9_~.:-]{1,512}))?)?$`)
10
10
11
11
// String type which represents a syntaxtually valid AT URI, as would pass Lexicon syntax validation for the 'at-uri' field (no query or fragment parts)
12
12
//
+1
-1
atproto/syntax/recordkey.go
+1
-1
atproto/syntax/recordkey.go
+8
atproto/syntax/testdata/aturi_syntax_valid.txt
+8
atproto/syntax/testdata/aturi_syntax_valid.txt
···
24
24
at://did:plc:asdf123/com.atproto.feed.post/asdf-123
25
25
at://did:abc:123
26
26
at://did:abc:123/io.nsid.someFunc/record-key
27
+
28
+
at://did:abc:123/io.nsid.someFunc/self.
29
+
at://did:abc:123/io.nsid.someFunc/lang:
30
+
at://did:abc:123/io.nsid.someFunc/:
31
+
at://did:abc:123/io.nsid.someFunc/-
32
+
at://did:abc:123/io.nsid.someFunc/_
33
+
at://did:abc:123/io.nsid.someFunc/~
34
+
at://did:abc:123/io.nsid.someFunc/...
+3
-2
atproto/syntax/testdata/recordkey_syntax_invalid.txt
+3
-2
atproto/syntax/testdata/recordkey_syntax_invalid.txt
···
1
1
# specs
2
-
literal:self
3
2
alpha/beta
4
3
.
5
4
..
···
10
9
number[3]
11
10
number(3)
12
11
"quote"
13
-
pre:fix
14
12
dHJ1ZQ==
13
+
14
+
# too long: 'o'.repeat(513)
15
+
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
+13
atproto/syntax/testdata/recordkey_syntax_valid.txt
+13
atproto/syntax/testdata/recordkey_syntax_valid.txt
···
3
3
example.com
4
4
~1.2-3_
5
5
dHJ1ZQ
6
+
_
7
+
literal:self
8
+
pre:fix
9
+
10
+
# more corner-cases
11
+
:
12
+
-
13
+
_
14
+
~
15
+
...
16
+
self.
17
+
lang:
18
+
:lang
6
19
7
20
# very long: 'o'.repeat(512)
8
21
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo