summaryrefslogtreecommitdiff
path: root/internal/web/web.go
diff options
context:
space:
mode:
authorLibravatar Kevin Gimbel <kevin@gimbel.dev>2025-11-14 10:52:13 +0100
committerLibravatar tobi <tobi.smethurst@protonmail.com>2025-11-17 14:15:53 +0100
commitbc7ff907077b523f33b6bf8cb406d55d7c873628 (patch)
treee7e12a10e1c9477e106b709a9732e3c6e14882d2 /internal/web/web.go
parent[bugfix] Add Swagger docs for the user:notification stream (#4555) (diff)
downloadgotosocial-bc7ff907077b523f33b6bf8cb406d55d7c873628.tar.xz
[feature] Implement stub `authorize_interaction` route (#4557)
Updates #4548 # Description This PR implements a route for the `/authorize_interaction` endpoint. This endpoint is used when an interaction request comes from a remote Mastodon instance, e.g. when a user clicks on the reply button and enters their GoToSocial server address into the field. closes #4548 ## Checklist - [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md). - [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat. - [x] I/we have not leveraged AI to create the proposed changes. - [x] I/we have performed a self-review of added code. - [x] I/we have written code that is legible and maintainable by others. - [x] I/we have commented the added code, particularly in hard-to-understand areas. - [x] I/we have made any necessary changes to documentation. - [ ] I/we have added tests that cover new code. - [ ] I/we have run tests and they pass locally with the changes. - [ ] I/we have run `go fmt ./...` and `golangci-lint run`. Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4557 Co-authored-by: Kevin Gimbel <kevin@gimbel.dev> Co-committed-by: Kevin Gimbel <kevin@gimbel.dev>
Diffstat (limited to 'internal/web/web.go')
-rw-r--r--internal/web/web.go32
1 files changed, 17 insertions, 15 deletions
diff --git a/internal/web/web.go b/internal/web/web.go
index 3468ef63b..72b640fb3 100644
--- a/internal/web/web.go
+++ b/internal/web/web.go
@@ -33,21 +33,22 @@ import (
)
const (
- confirmEmailPath = "/" + uris.ConfirmEmailPath
- profileGroupPath = "/@:username"
- statusPath = "/statuses/:" + apiutil.WebStatusIDKey // leave out the '/@:username' prefix as this will be served within the profile group
- tagsPath = "/tags/:" + apiutil.TagNameKey
- customCSSPath = profileGroupPath + "/custom.css"
- instanceCustomCSSPath = "/custom.css"
- rssFeedPath = profileGroupPath + "/feed.rss"
- assetsPathPrefix = "/assets"
- distPathPrefix = assetsPathPrefix + "/dist"
- themesPathPrefix = assetsPathPrefix + "/themes"
- settingsPathPrefix = "/settings"
- settingsPanelGlob = settingsPathPrefix + "/*panel"
- userPanelPath = settingsPathPrefix + "/user"
- adminPanelPath = settingsPathPrefix + "/admin"
- signupPath = "/signup"
+ confirmEmailPath = "/" + uris.ConfirmEmailPath
+ profileGroupPath = "/@:username"
+ statusPath = "/statuses/:" + apiutil.WebStatusIDKey // leave out the '/@:username' prefix as this will be served within the profile group
+ tagsPath = "/tags/:" + apiutil.TagNameKey
+ customCSSPath = profileGroupPath + "/custom.css"
+ instanceCustomCSSPath = "/custom.css"
+ rssFeedPath = profileGroupPath + "/feed.rss"
+ assetsPathPrefix = "/assets"
+ distPathPrefix = assetsPathPrefix + "/dist"
+ themesPathPrefix = assetsPathPrefix + "/themes"
+ settingsPathPrefix = "/settings"
+ settingsPanelGlob = settingsPathPrefix + "/*panel"
+ userPanelPath = settingsPathPrefix + "/user"
+ adminPanelPath = settingsPathPrefix + "/admin"
+ signupPath = "/signup"
+ authorizeInteractionPath = "/authorize_interaction"
cacheControlHeader = "Cache-Control" // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
cacheControlNoCache = "no-cache" // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#response_directives
@@ -127,6 +128,7 @@ func (m *Module) Route(r *router.Router, mi ...gin.HandlerFunc) {
everythingElseGroup.Handle(http.MethodGet, domainAllowlistPath, m.domainAllowlistGETHandler)
everythingElseGroup.Handle(http.MethodGet, tagsPath, m.tagGETHandler)
everythingElseGroup.Handle(http.MethodGet, signupPath, m.signupGETHandler)
+ everythingElseGroup.Handle(http.MethodGet, authorizeInteractionPath, m.authorizeInteractionGETHandler)
everythingElseGroup.Handle(http.MethodPost, signupPath, m.signupPOSTHandler)
// Redirects from old endpoints for back compat.