diff options
| author | 2025-04-07 16:14:41 +0200 | |
|---|---|---|
| committer | 2025-04-07 16:14:41 +0200 | |
| commit | 365b5753419238bb96bc3f9b744d380ff20cbafc (patch) | |
| tree | 6b8e8b605c4cddeb6e3bc0f574ffbc856657e56c /cmd | |
| parent | [bugfix] Don't assume `"manuallyApprovesFollowers": true` if not set (#3978) (diff) | |
| download | gotosocial-365b5753419238bb96bc3f9b744d380ff20cbafc.tar.xz | |
[feature] add TOTP two-factor authentication (2FA) (#3960)
* [feature] add TOTP two-factor authentication (2FA)
* use byteutil.S2B to avoid allocations when comparing + generating password hashes
* don't bother with string conversion for consts
* use io.ReadFull
* use MustGenerateSecret for backup codes
* rename util functions
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/gotosocial/action/server/server.go | 20 | ||||
| -rw-r--r-- | cmd/gotosocial/action/testrig/testrig.go | 20 |
2 files changed, 20 insertions, 20 deletions
diff --git a/cmd/gotosocial/action/server/server.go b/cmd/gotosocial/action/server/server.go index 8c4fad247..f934aaadd 100644 --- a/cmd/gotosocial/action/server/server.go +++ b/cmd/gotosocial/action/server/server.go @@ -515,16 +515,16 @@ var Start action.GTSAction = func(ctx context.Context) error { } var ( - authModule = api.NewAuth(dbService, process, idp, routerSession, sessionName) // auth/oauth paths - clientModule = api.NewClient(state, process) // api client endpoints - metricsModule = api.NewMetrics() // Metrics endpoints - healthModule = api.NewHealth(dbService.Ready) // Health check endpoints - fileserverModule = api.NewFileserver(process) // fileserver endpoints - robotsModule = api.NewRobots() // robots.txt endpoint - wellKnownModule = api.NewWellKnown(process) // .well-known endpoints - nodeInfoModule = api.NewNodeInfo(process) // nodeinfo endpoint - activityPubModule = api.NewActivityPub(dbService, process) // ActivityPub endpoints - webModule = web.New(dbService, process) // web pages + user profiles + settings panels etc + authModule = api.NewAuth(state, process, idp, routerSession, sessionName) // auth/oauth paths + clientModule = api.NewClient(state, process) // api client endpoints + metricsModule = api.NewMetrics() // Metrics endpoints + healthModule = api.NewHealth(dbService.Ready) // Health check endpoints + fileserverModule = api.NewFileserver(process) // fileserver endpoints + robotsModule = api.NewRobots() // robots.txt endpoint + wellKnownModule = api.NewWellKnown(process) // .well-known endpoints + nodeInfoModule = api.NewNodeInfo(process) // nodeinfo endpoint + activityPubModule = api.NewActivityPub(dbService, process) // ActivityPub endpoints + webModule = web.New(dbService, process) // web pages + user profiles + settings panels etc ) // Create per-route / per-grouping middlewares. diff --git a/cmd/gotosocial/action/testrig/testrig.go b/cmd/gotosocial/action/testrig/testrig.go index 05704ecb6..c0c080e38 100644 --- a/cmd/gotosocial/action/testrig/testrig.go +++ b/cmd/gotosocial/action/testrig/testrig.go @@ -283,16 +283,16 @@ var Start action.GTSAction = func(ctx context.Context) error { } var ( - authModule = api.NewAuth(state.DB, processor, idp, routerSession, sessionName) // auth/oauth paths - clientModule = api.NewClient(state, processor) // api client endpoints - metricsModule = api.NewMetrics() // Metrics endpoints - healthModule = api.NewHealth(state.DB.Ready) // Health check endpoints - fileserverModule = api.NewFileserver(processor) // fileserver endpoints - robotsModule = api.NewRobots() // robots.txt endpoint - wellKnownModule = api.NewWellKnown(processor) // .well-known endpoints - nodeInfoModule = api.NewNodeInfo(processor) // nodeinfo endpoint - activityPubModule = api.NewActivityPub(state.DB, processor) // ActivityPub endpoints - webModule = web.New(state.DB, processor) // web pages + user profiles + settings panels etc + authModule = api.NewAuth(state, processor, idp, routerSession, sessionName) // auth/oauth paths + clientModule = api.NewClient(state, processor) // api client endpoints + metricsModule = api.NewMetrics() // Metrics endpoints + healthModule = api.NewHealth(state.DB.Ready) // Health check endpoints + fileserverModule = api.NewFileserver(processor) // fileserver endpoints + robotsModule = api.NewRobots() // robots.txt endpoint + wellKnownModule = api.NewWellKnown(processor) // .well-known endpoints + nodeInfoModule = api.NewNodeInfo(processor) // nodeinfo endpoint + activityPubModule = api.NewActivityPub(state.DB, processor) // ActivityPub endpoints + webModule = web.New(state.DB, processor) // web pages + user profiles + settings panels etc ) // these should be routed in order |
