Documentation
¶
Overview ¶
Package crowd provides methods for interacting with the Atlassian Crowd authentication, directory integration, and Single Sign-On system.
Index ¶
- type CookieConfig
- type Crowd
- func (c *Crowd) Authenticate(user string, pass string) (User, error)
- func (c *Crowd) CreateGroup(name string, description string) (status bool)
- func (c *Crowd) GetCookieConfig() (CookieConfig, error)
- func (c *Crowd) GetDirectGroups(user string) ([]*Group, error)
- func (c *Crowd) GetGroup(name string) (*Group, error)
- func (c *Crowd) GetGroups(user string, donested bool) ([]*Group, error)
- func (c *Crowd) GetNestedGroups(user string) ([]*Group, error)
- func (c *Crowd) GetSession(token string) (s Session, err error)
- func (c *Crowd) GetUser(user string) (User, error)
- func (c *Crowd) GetUserByEmail(email string) (User, error)
- func (c *Crowd) InvalidateSession(token string) error
- func (c *Crowd) NewSession(user string, pass string, address string) (Session, error)
- func (c *Crowd) SearchUsers(restriction string) ([]string, error)
- func (c *Crowd) ValidateSession(token string, clientaddr string) (Session, error)
- type Error
- type Group
- type GroupInfo
- type Link
- type Session
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CookieConfig ¶
type CookieConfig struct {
XMLName struct{} `xml:"cookie-config"`
Domain string `xml:"domain"`
Secure bool `xml:"secure"`
Name string `xml:"name"`
}
CookieConfig holds configuration values needed to set a Crowd SSO cookie.
type Crowd ¶
Crowd represents your Crowd (client) Application settings
func (*Crowd) Authenticate ¶
Authenticate a user & password against Crowd. Returns error on failure or account lockout. Success is a populated User with nil error.
func (*Crowd) CreateGroup ¶
CreateGroup creates a new group
func (*Crowd) GetCookieConfig ¶
func (c *Crowd) GetCookieConfig() (CookieConfig, error)
GetCookieConfig returns settings needed to set a Crowd SSO cookie.
func (*Crowd) GetDirectGroups ¶
GetDirectGroups retrieves a list of groups of which a user is a direct member
func (*Crowd) GetGroups ¶
GetGroups retrieves a list of groups of which a user is a direct (and nested if donested is true) member.
func (*Crowd) GetNestedGroups ¶
GetNestedGroups retrieves a list of groups of which a user is a direct or nested member
func (*Crowd) GetSession ¶
GetSession gets SSO session information by token
func (*Crowd) GetUserByEmail ¶
GetUserByEmail searches for a user by email
func (*Crowd) InvalidateSession ¶
InvalidateSession invalidates SSO session token. Returns error on failure.
func (*Crowd) NewSession ¶
NewSession authenticates a user and starts a SSO session if valid.
func (*Crowd) SearchUsers ¶
SearchUsers retrieves a slice of user names that match the given search restriction (as Crowd Query Language)
type Error ¶
type Error struct {
XMLName struct{} `xml:"error"`
Reason string `xml:"reason"`
Message string `xml:"message"`
}
Error represents a error response from Crowd. Error reasons are documented at https://developer.atlassian.com/display/CROWDDEV/Using+the+Crowd+REST+APIs#UsingtheCrowdRESTAPIs-HTTPResponseCodesandErrorResponses
type GroupInfo ¶
type GroupInfo struct {
Expand string `json:"expand"`
Link struct {
Href string `json:"href"`
Rel string `json:"rel"`
} `json:"link"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
Active bool `json:"active"`
Attributes struct {
Attributes []interface{} `json:"attributes"`
Link struct {
Href string `json:"href"`
Rel string `json:"rel"`
} `json:"link"`
} `json:"attributes"`
}
GroupInfo returns information about a group
type Session ¶
type Session struct {
XMLName struct{} `xml:"session"`
Expand string `xml:"expand,attr"`
Token string `xml:"token"`
User User `xml:"user,omitempty"`
Created time.Time `xml:"created-date"`
Expires time.Time `xml:"expiry-date"`
}
Session represents a single sign-on (SSO) session in Crowd
type User ¶
type User struct {
XMLName struct{} `xml:"user"`
UserName string `xml:"name,attr"`
FirstName string `xml:"first-name"`
LastName string `xml:"last-name"`
DisplayName string `xml:"display-name"`
Email string `xml:"email"`
Active bool `xml:"active"`
Key string `xml:"key"`
}
User represents a user in Crowd
Directories
¶
| Path | Synopsis |
|---|---|
|
Package crowdauth provides middleware for Crowd SSO logins Goals: 1) drop-in authentication against Crowd SSO 2) make it easy to use Crowd SSO as part of your own auth flow
|
Package crowdauth provides middleware for Crowd SSO logins Goals: 1) drop-in authentication against Crowd SSO 2) make it easy to use Crowd SSO as part of your own auth flow |
