crowd

package module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2021 License: MIT Imports: 9 Imported by: 1

README

crowd-go

A Golang library to access Atlassian Crowd REST API

Documentation

Index

Constants

View Source
const (
	VERSION = "0.3.0"
	NAME    = "crowd-go"
)

Variables

View Source
var (
	ErrorGeneralEmptyURL         = errors.New("You must set the crowd base URL")
	ErrorGeneralEmptyApplication = errors.New("You must set the crowd application name")
	ErrorGeneralEmptyPassword    = errors.New("You must set a password to access the crowd application")
	ErrorGeneralNoPermissions    = errors.New("Your application has no permission to perform the desired request")
)
View Source
var (
	ErrorUserAlreadyInGroup          = errors.New("User is already a direct member of the group")
	ErrorUserNotFound                = errors.New("User could not be found")
	ErrorInvalidUserDataOrUserExists = errors.New("Invalid user data, for example missing password or the user already exists")
	ErrorInvalidUserDataOrMismatch   = errors.New("Invalid user data, for example the usernames in the body and the uri don't match")
)
View Source
var (
	ErrorGroupNotFound                     = errors.New("Group could not be found")
	ErrorGroupAlreadyExists                = errors.New("Group already exists")
	ErrorGroupNotFoundOrCircularDependency = errors.New("Child group could not be found, or adding the membership would result in a circular dependency.")
)

Functions

This section is empty.

Types

type API

type API struct {
	Client    *fasthttp.Client
	Url       string
	BasicAuth string
}

func NewAPI added in v0.2.0

func NewAPI(url, application, applicationPassword string, skipTlsVerify bool) (*API, error)

func (*API) AddChildGroupMembership added in v0.3.0

func (api *API) AddChildGroupMembership(parentGroupName, childGroupName string) error

Add a new child group membership.

func (*API) AddParentGroupMembership added in v0.3.0

func (api *API) AddParentGroupMembership(parentGroupName, childGroupName string) error

Add a new parent group membership.

func (*API) AddUser added in v0.3.0

func (api *API) AddUser(userName, userPassword, userFirstName, userLastName, userDisplayName, userEmail string, isActive bool) error

Add a new crowd user.

func (*API) AddUserToGroup

func (api *API) AddUserToGroup(userName, groupName string) error

Add a user to an existing group.

func (*API) CreateGroup added in v0.3.0

func (api *API) CreateGroup(groupName, description string, isActive bool) error

Create a new group.

func (*API) GetUser added in v0.3.0

func (api *API) GetUser(userName string) (*User, error)

Get details of a crowd user.

func (*API) GetUserAttributes added in v0.3.0

func (api *API) GetUserAttributes(userName string) (*Attributes, error)

Get the attributes of a crowd user.

func (*API) RemoveGroup added in v0.3.0

func (api *API) RemoveGroup(groupName string) error

Remove a group.

func (*API) RemoveUser added in v0.3.0

func (api *API) RemoveUser(userName string) error

Remove a crowd user.

func (*API) RemoveUserAttribute added in v0.3.0

func (api *API) RemoveUserAttribute(userName, attributeName string) error

Remove attributes from a crowd user.

func (*API) RemoveUserFromGroup added in v0.3.0

func (api *API) RemoveUserFromGroup(userName, groupName string) error

Remove a user from a group.

func (*API) StoreUserAttributes added in v0.3.0

func (api *API) StoreUserAttributes(userName string, attributes *Attributes) error

Store (new) attributes for a crowd user.

func (*API) UpdateUser added in v0.3.0

func (api *API) UpdateUser(userName, userFirstName, userLastName, userDisplayName, userEmail string, isActive bool) error

Update details of a crowd user.

type Attribute added in v0.3.0

type Attribute struct {
	Name   string   `json:"name"`
	Values []string `json:"values"`
}

type Attributes added in v0.3.0

type Attributes struct {
	Attributes []*Attribute `json:"attributes,omitempty"`
}

type Group added in v0.3.0

type Group struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
	Active      bool   `json:"active,omitempty"`
}

type GroupAttributes added in v0.3.0

type GroupAttributes struct {
	Name       string       `json:"attributes"`
	Attributes []*Attribute `json:"attribute"`
}

type GroupName added in v0.3.0

type GroupName struct {
	Name string `json:"name"`
}

type PasswordValue added in v0.3.0

type PasswordValue struct {
	Value string `json:"value,omitempty"`
}

type User added in v0.3.0

type User struct {
	Name        string        `json:"name"`
	FirstName   string        `json:"first-name"`
	LastName    string        `json:"last-name"`
	DisplayName string        `json:"display-name"`
	Email       string        `json:"email"`
	Key         string        `json:"key,omitempty"`
	IsActive    bool          `json:"active"`
	Password    PasswordValue `json:"password,omitempty"`
	Attributes  Attributes    `json:"attributes,omitempty"`
}

type UserRename added in v0.3.0

type UserRename struct {
	NewName string `json:"new-name"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL