File tree Expand file tree Collapse file tree 4 files changed +36
-3
lines changed
services/celest_cloud_auth Expand file tree Collapse file tree 4 files changed +36
-3
lines changed Original file line number Diff line number Diff line change 1+ ## 0.3.1
2+
3+ - fix: Allow dashes in routes
4+
15## 0.3.0
26
37- feat!: Make database modular
Original file line number Diff line number Diff line change @@ -210,14 +210,19 @@ final class RouteWildcard extends RouteSegment {
210210 /// Not a standard, but a generally accepted upper bound on reasonable URLs.
211211 static const int _maxUrlLength = 2048 ;
212212
213+ /// Allowed characters in a URL path segment.
214+ // TODO(dnys1): Handle percent-encoded characters.
215+ // https://github.com/googleapis/googleapis/blob/master/google/api/http.proto#L241
216+ static final Parser <String > _validChar = pattern ('-_.~0-9a-zA-Z' );
217+
213218 late final Parser <String > _parser = greedy
214219 // The syntax `**` matches zero or more URL path segments
215- ? (word () | char ('/' ))
220+ ? (_validChar | char ('/' ))
216221 .repeatLazy (endOfInput (), 0 , _maxUrlLength)
217222 .flatten ('**' )
218223
219224 // The syntax `*` matches a single URL path segment.
220- : word () .plus ().flatten ('*' );
225+ : _validChar .plus ().flatten ('*' );
221226
222227 @override
223228 Result <String > parseOn (Context context) {
Original file line number Diff line number Diff line change 11name : celest_cloud_auth
22description : A Dart-native authentication and authorization service built on Celest, Cedar, and SQLite.
3- version : 0.3.0
3+ version : 0.3.1
44homepage : https://celest.dev
55repository : https://github.com/celest-dev/celest/tree/main/services/celest_cloud_auth
66
Original file line number Diff line number Diff line change @@ -246,6 +246,30 @@ final _testCases = <_TestCase>[
246246 ),
247247 ],
248248 ),
249+ (
250+ route: '/v1alpha1/{name=organizations/*/projects/*}' ,
251+ expectedSegments: [
252+ RouteLiteral ('v1alpha1' ),
253+ RouteParameter (
254+ variable: 'name' ,
255+ segments: [
256+ RouteLiteral ('organizations' ),
257+ RouteWildcard (greedy: false ),
258+ RouteLiteral ('projects' ),
259+ RouteWildcard (greedy: false ),
260+ ],
261+ ),
262+ ],
263+ expectedVerb: null ,
264+ matchTests: [
265+ (
266+ route: '/v1alpha1/organizations/org_1234/projects/my-project' ,
267+ expected: {
268+ 'name' : 'organizations/org_1234/projects/my-project' ,
269+ },
270+ ),
271+ ],
272+ ),
249273 (
250274 route: '/v1alpha1/auth/{name=organizations/*/users/*}' ,
251275 expectedSegments: [
You can’t perform that action at this time.
0 commit comments