Something went wrong. Try again.
Go boilerplate library for building atproto apps
atproto go
Something went wrong. Try again.
atp scopes.go
627 B · 18 lines
Go
12345678910111213141516171819package atp
// ScopesForCollections builds an OAuth scope list from collection NSIDs.// It always includes "atproto" as the first scope, then adds "repo:<collection>"// for each collection provided.//// ScopesForCollections("x.y.bean", "x.y.brew")// // => ["atproto", "repo:x.y.bean", "repo:x.y.brew"]//// TODO: add support for collections and more granular control than just full rwfunc ScopesForCollections(collections ...string) []string { scopes := make([]string, 0, 1+len(collections)) scopes = append(scopes, "atproto") for _, c := range collections { scopes = append(scopes, "repo:"+c) } return scopes}