package atp // ScopesForCollections builds an OAuth scope list from collection NSIDs. // It always includes "atproto" as the first scope, then adds "repo:" // 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 rw func 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 }