diff options
author | 2024-07-26 12:04:28 +0200 | |
---|---|---|
committer | 2024-07-26 12:04:28 +0200 | |
commit | 8ab2b19a946251f258446d22f420d401f61d22f6 (patch) | |
tree | 39fb674f135fd1cfcf4de5b319913f0d0c17d11a /internal/regexes/regexes.go | |
parent | [docs] Add separate migration section + instructions for moving to GtS and no... (diff) | |
download | gotosocial-8ab2b19a946251f258446d22f420d401f61d22f6.tar.xz |
[feature] Federate interaction policies + Accepts; enforce policies (#3138)
* [feature] Federate interaction policies + Accepts; enforce policies
* use Acceptable type
* fix index
* remove appendIRIStrs
* add GetAccept federatingdb function
* lock on object IRI
Diffstat (limited to 'internal/regexes/regexes.go')
-rw-r--r-- | internal/regexes/regexes.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/regexes/regexes.go b/internal/regexes/regexes.go index aca502345..799557657 100644 --- a/internal/regexes/regexes.go +++ b/internal/regexes/regexes.go @@ -38,6 +38,7 @@ const ( follow = "follow" blocks = "blocks" reports = "reports" + accepts = "accepts" schemes = `(http|https)://` // Allowed URI protocols for parsing links in text. alphaNumeric = `\p{L}\p{M}*|\p{N}` // A single number or script character in any language, including chars with accents. @@ -71,6 +72,7 @@ const ( followPath = userPathPrefix + `/` + follow + `/(` + ulid + `)$` likePath = userPathPrefix + `/` + liked + `/(` + ulid + `)$` statusesPath = userPathPrefix + `/` + statuses + `/(` + ulid + `)$` + acceptsPath = userPathPrefix + `/` + accepts + `/(` + ulid + `)$` blockPath = userPathPrefix + `/` + blocks + `/(` + ulid + `)$` reportPath = `^/?` + reports + `/(` + ulid + `)$` filePath = `^/?(` + ulid + `)/([a-z]+)/([a-z]+)/(` + ulid + `)\.([a-z0-9]+)$` @@ -158,6 +160,10 @@ var ( // from eg /reports/01GP3AWY4CRDVRNZKW0TEAMB5R ReportPath = regexp.MustCompile(reportPath) + // ReportPath parses a path that validates and captures the username part and the ulid part + // from eg /users/example_username/accepts/01GP3AWY4CRDVRNZKW0TEAMB5R + AcceptsPath = regexp.MustCompile(acceptsPath) + // FilePath parses a file storage path of the form [ACCOUNT_ID]/[MEDIA_TYPE]/[MEDIA_SIZE]/[FILE_NAME] // eg 01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpeg // It captures the account id, media type, media size, file name, and file extension, eg |