scope.go 820 B

1234567891011121314151617181920212223242526272829303132
  1. package oauth
  2. import "strings"
  3. const (
  4. //Scopetrialwhitelist获取测试权限上线删
  5. Scopetrialwhitelist = "trial.whitelist"
  6. //ScopeUserInfo获取用户公开信息
  7. ScopeUserInfo = "user_info"
  8. //ScopeUserdata获取用户基础信息
  9. ScopeUserdata = "data.external.user"
  10. //ScopeUserVideo获取用户视频信息
  11. ScopeUserVideo = "video.data.bind"
  12. )
  13. // GetUserScope 获取用户相关scope
  14. func GetUserScope() string {
  15. scopes := []string{ScopeUserInfo, Scopetrialwhitelist}
  16. return strings.Join(scopes, ",")
  17. }
  18. // GetVideoScope 获取视频相关Scope.
  19. func GetVideoScope() string {
  20. scopes := []string{ScopeUserVideo}
  21. return strings.Join(scopes, ",")
  22. }
  23. // GetAllScope 获取所有Scope.
  24. func GetAllScope() string {
  25. scopes := []string{GetUserScope(), GetVideoScope()}
  26. return strings.Join(scopes, ",")
  27. }