Yōten: A social tracker for your language learning journey built on the atproto.

feat(oauth): add permission sets #36

merged opened by brookjeynes.dev targeting master from push-nmwnmyxsvpww
Labels

None yet.

Participants 1
AT URI
at://did:plc:4mj54vc4ha3lh32ksxwunnbh/sh.tangled.repo.pull/3md2xevpy3v22
+12 -2
Diff #0
+12 -2
internal/server/oauth/oauth.go
··· 34 34 func New(config *config.Config, ph posthog.Client, idResolver *atproto.Resolver, logger *slog.Logger) (*OAuth, error) { 35 35 var oauthConfig oauth.ClientConfig 36 36 var clientUri string 37 + scope := []string{ 38 + "atproto", 39 + "repo:app.yoten.feed.reaction", 40 + "repo:app.yoten.feed.resource", 41 + "repo:app.yoten.feed.comment", 42 + "repo:app.yoten.feed.session", 43 + "repo:app.yoten.actor.profile", 44 + "repo:app.yoten.activity.def", 45 + "repo:app.yoten.graph.follow", 46 + } 37 47 38 48 if config.Core.Dev { 39 49 clientUri = "http://127.0.0.1:" + config.Core.Port 40 50 callbackUri := clientUri + "/oauth/callback" 41 - oauthConfig = oauth.NewLocalhostConfig(callbackUri, []string{"atproto", "transition:generic"}) 51 + oauthConfig = oauth.NewLocalhostConfig(callbackUri, scope) 42 52 } else { 43 53 clientUri = config.Core.Host 44 54 clientId := fmt.Sprintf("%s/oauth/client-metadata.json", clientUri) 45 55 callbackUri := clientUri + "/oauth/callback" 46 - oauthConfig = oauth.NewPublicConfig(clientId, callbackUri, []string{"atproto", "transition:generic"}) 56 + oauthConfig = oauth.NewPublicConfig(clientId, callbackUri, scope) 47 57 } 48 58 49 59 priv, err := atcrypto.ParsePrivateMultibase(config.OAuth.ClientSecret)

History

1 round 0 comments
sign up or login to add to the discussion
brookjeynes.dev submitted #0
1 commit
expand
feat(oauth): add permission scopes
expand 0 comments
pull request successfully merged