Documentation
¶
Index ¶
- type AccessToken
- type Client
- func (c Client) GetAccessToken(authorizationCode string) (*AccessToken, error)
- func (c Client) GetEntryOwnerEmails() ([]string, error)
- func (c Client) GetGroup(groupName string) (*Group, error)
- func (c Client) GetMe(accessToken string) (*User, error)
- func (c Client) GetUser(userName string) (*User, error)
- func (c Client) IsEntryOwner(user User) bool
- type Group
- type GroupMember
- type Member
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
}
AccessToken denotes the response of https://${sso.domain}/oauth2/token
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client communicate with the SSO service
func (Client) GetAccessToken ¶
func (c Client) GetAccessToken(authorizationCode string) (*AccessToken, error)
GetAccessToken get accessToken from SSO
func (Client) GetEntryOwnerEmails ¶
GetEntryOwnerEmails get emails of the owners of entry
func (Client) IsEntryOwner ¶
IsEntryOwner judge whether user is entry's owner
type Group ¶
type Group struct {
Members []Member `json:"members"`
GroupMembers []GroupMember `json:"group_members"`
}
Group denotes the response of https://${sso.domain}/api/groups/{groupname}
type GroupMember ¶
type GroupMember struct {
Name string `json:"name"`
Fullname string `json:"fullname"`
Role string `json:"role"`
}
GroupMember denotes the subgroup of group
Click to show internal directories.
Click to hide internal directories.