organization

package
v0.0.0-...-d3d53d6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_ORGANIZATIONS_PER_USER              = 1000
	MAX_AMOUNT_INVITATIONS_PER_ORGANIZATION = 10000
)

Variables

This section is empty.

Functions

func OrganizationsInterfaceRoutes

func OrganizationsInterfaceRoutes(r *mux.Router, i OrganizationsInterface)

OrganizationsInterfaceRoutes is routing for /organizations root endpoint

func SearchUser

func SearchUser(r *http.Request, searchString string) (usr *user.User, err1 error)

Types

type APIKey

type APIKey struct {
	CallbackURL                string `json:"callbackURL,omitempty" validate:"min=5,max=250,nonzero"`
	ClientCredentialsGrantType bool   `json:"clientCredentialsGrantType,omitempty" validate:"nonzero"`
	Label                      string `json:"label" validate:"min=2,max=50"`
	Secret                     string `json:"secret,omitempty" validate:"max=250,nonzero"`
}

func FromOAuthClient

func FromOAuthClient(client *oauthservice.Oauth2Client) APIKey

FromOAuthClient creates an APIKey instance from an oauthservice.Oauth2Client

type Membership

type Membership struct {
	Username string `json:"username"`
	Role     string `json:"role"`
}

type Oauth2oauth_2_0Middleware

type Oauth2oauth_2_0Middleware struct {
	security.OAuth2Middleware
}

Oauth2oauth_2_0Middleware is oauth2 middleware for oauth_2_0

func (*Oauth2oauth_2_0Middleware) CheckScopes

func (om *Oauth2oauth_2_0Middleware) CheckScopes(scopes []string) bool

CheckScopes checks whether user has needed scopes

func (*Oauth2oauth_2_0Middleware) Handler

Handler return HTTP handler representation of this middleware

type OrganizationTreeItem

type OrganizationTreeItem struct {
	Children []*OrganizationTreeItem `json:"children"`
	GlobalID string                  `json:"globalid"`
}

type OrganizationsAPI

type OrganizationsAPI struct {
}

OrganizationsAPI is the implementation for /organizations root endpoint

func (OrganizationsAPI) AddOrganizationMember

func (api OrganizationsAPI) AddOrganizationMember(w http.ResponseWriter, r *http.Request)

AddOrganizationMember Assign a member to organization It is handler for POST /organizations/{globalid}/members

func (OrganizationsAPI) AddOrganizationOwner

func (api OrganizationsAPI) AddOrganizationOwner(w http.ResponseWriter, r *http.Request)

AddOrganizationOwner It is handler for POST /organizations/{globalid}/owners

func (OrganizationsAPI) AddOrganizationRegistryEntry

func (api OrganizationsAPI) AddOrganizationRegistryEntry(w http.ResponseWriter, r *http.Request)

AddOrganizationRegistryEntry is the handler for POST /organizations/{globalid}/registry Adds a RegistryEntry to the organization's registry, if the key is already used, it is overwritten.

func (OrganizationsAPI) CreateDns

func (api OrganizationsAPI) CreateDns(w http.ResponseWriter, r *http.Request)

func (OrganizationsAPI) CreateNewAPIKey

func (api OrganizationsAPI) CreateNewAPIKey(w http.ResponseWriter, r *http.Request)

CreateNewAPIKey is the handler for POST /organizations/{globalid}/apikeys Create a new API Key, a secret itself should not be provided, it will be generated serverside.

func (OrganizationsAPI) CreateNewOrganization

func (api OrganizationsAPI) CreateNewOrganization(w http.ResponseWriter, r *http.Request)

CreateNewOrganization is the handler for POST /organizations Create a new organization. 1 user should be in the owners list. Validation is performed to check if the securityScheme allows management on this user.

func (OrganizationsAPI) CreateNewSubOrganization

func (api OrganizationsAPI) CreateNewSubOrganization(w http.ResponseWriter, r *http.Request)

CreateNewSubOrganization is the handler for POST /organizations/{globalid}/suborganizations Create a new suborganization.

func (OrganizationsAPI) DeleteAPIKey

func (api OrganizationsAPI) DeleteAPIKey(w http.ResponseWriter, r *http.Request)

DeleteAPIKey is the handler for DELETE /organizations/{globalid}/apikeys/{label} Removes an API key

func (OrganizationsAPI) DeleteDns

func (api OrganizationsAPI) DeleteDns(w http.ResponseWriter, r *http.Request)

func (OrganizationsAPI) DeleteOrgMember

func (api OrganizationsAPI) DeleteOrgMember(w http.ResponseWriter, r *http.Request)

DeleteOrgMember is the handler for Delete /organizations/globalid/orgmember/globalid2 Removes an organization as a member of this one.

func (OrganizationsAPI) DeleteOrgOwner

func (api OrganizationsAPI) DeleteOrgOwner(w http.ResponseWriter, r *http.Request)

DeleteOrgOwner is the handler for Delete /organizations/globalid/orgowner/globalid2 Removes an organization as an owner of this one.

func (OrganizationsAPI) DeleteOrganization

func (api OrganizationsAPI) DeleteOrganization(w http.ResponseWriter, r *http.Request)

DeleteOrganization is the handler for DELETE /organizations/{globalid} Deletes an organization and all data linked to it (join-organization-invitations, oauth_access_tokens, oauth_clients, authorizations)

func (api OrganizationsAPI) DeleteOrganizationLogo(w http.ResponseWriter, r *http.Request)

DeleteOrganizationLogo is the handler for DELETE /organizations/globalid/logo Removes the Logo from an organization

func (OrganizationsAPI) DeleteOrganizationRegistryEntry

func (api OrganizationsAPI) DeleteOrganizationRegistryEntry(w http.ResponseWriter, r *http.Request)

DeleteOrganizationRegistryEntry is the handler for DELETE /organizations/{username}/globalid/{key} Removes a RegistryEntry from the organization's registry

func (OrganizationsAPI) Get2faValidityTime

func (api OrganizationsAPI) Get2faValidityTime(w http.ResponseWriter, r *http.Request)

Get2faValidityTime is the handler for GET /organizations/globalid/2fa/validity Get the 2fa validity time for the organization, in seconds

func (OrganizationsAPI) GetAPIKey

func (api OrganizationsAPI) GetAPIKey(w http.ResponseWriter, r *http.Request)

GetAPIKey is the handler for GET /organizations/{globalid}/apikeys/{label}

func (OrganizationsAPI) GetAPIKeyLabels

func (api OrganizationsAPI) GetAPIKeyLabels(w http.ResponseWriter, r *http.Request)

GetAPIKeyLabels is the handler for GET /organizations/{globalid}/apikeys Get the list of active api keys. The secrets themselves are not included.

func (OrganizationsAPI) GetContracts

func (api OrganizationsAPI) GetContracts(w http.ResponseWriter, r *http.Request)

GetContracts is the handler for GET /organizations/{globalid}/contracts Get the contracts where the organization is 1 of the parties. Order descending by date.

func (OrganizationsAPI) GetOrganization

func (api OrganizationsAPI) GetOrganization(w http.ResponseWriter, r *http.Request)

GetOrganization Get organization info It is handler for GET /organizations/{globalid}

func (api OrganizationsAPI) GetOrganizationLogo(w http.ResponseWriter, r *http.Request)

GetOrganizationLogo is the handler for GET /organizations/globalid/logo Get the Logo from an organization

func (OrganizationsAPI) GetOrganizationRegistryEntry

func (api OrganizationsAPI) GetOrganizationRegistryEntry(w http.ResponseWriter, r *http.Request)

GetOrganizationRegistryEntry is the handler for GET /organizations/{username}/globalid/{key} Get a RegistryEntry from the organization's registry.

func (OrganizationsAPI) GetOrganizationTree

func (api OrganizationsAPI) GetOrganizationTree(w http.ResponseWriter, r *http.Request)

GetOrganizationTree is the handler for GET /organizations/{globalid}/tree Get organization tree.

func (OrganizationsAPI) GetPendingInvitations

func (api OrganizationsAPI) GetPendingInvitations(w http.ResponseWriter, r *http.Request)

GetPendingInvitations is the handler for GET /organizations/{globalid}/invitations Get the list of pending invitations for users to join this organization.

func (OrganizationsAPI) ListOrganizationRegistry

func (api OrganizationsAPI) ListOrganizationRegistry(w http.ResponseWriter, r *http.Request)

ListOrganizationRegistry is the handler for GET /organizations/{globalid}/registry Lists the Registry entries

func (OrganizationsAPI) RegisterNewContract

func (api OrganizationsAPI) RegisterNewContract(w http.ResponseWriter, r *http.Request)

RegisterNewContract is handler for GET /organizations/{globalId}/contracts

func (OrganizationsAPI) RemoveOrganizationMember

func (api OrganizationsAPI) RemoveOrganizationMember(w http.ResponseWriter, r *http.Request)

RemoveOrganizationMember Remove a member from organization It is handler for DELETE /organizations/{globalid}/members/{username}

func (OrganizationsAPI) RemoveOrganizationOwner

func (api OrganizationsAPI) RemoveOrganizationOwner(w http.ResponseWriter, r *http.Request)

RemoveOrganizationOwner Remove a member from organization It is handler for DELETE /organizations/{globalid}/owners/{username}

func (OrganizationsAPI) RemovePendingInvitation

func (api OrganizationsAPI) RemovePendingInvitation(w http.ResponseWriter, r *http.Request)

RemovePendingInvitation is the handler for DELETE /organizations/{globalid}/invitations/{username} Cancel a pending invitation.

func (OrganizationsAPI) Set2faValidityTime

func (api OrganizationsAPI) Set2faValidityTime(w http.ResponseWriter, r *http.Request)

Set2faValidityTime is the handler for PUT /organizations/globalid/2fa/validity Sets the 2fa validity time for the organization, in days

func (OrganizationsAPI) SetOrgMember

func (api OrganizationsAPI) SetOrgMember(w http.ResponseWriter, r *http.Request)

SetOrgMember is the handler for POST /organizations/globalid/orgmember Sets an organization as a member of this one.

func (OrganizationsAPI) SetOrgOwner

func (api OrganizationsAPI) SetOrgOwner(w http.ResponseWriter, r *http.Request)

SetOrgOwner is the handler for POST /organizations/globalid/orgowner Sets an organization as an owner of this one.

func (api OrganizationsAPI) SetOrganizationLogo(w http.ResponseWriter, r *http.Request)

SetOrganizationLogo is the handler for PUT /organizations/globalid/logo Set the organization Logo for the organization

func (OrganizationsAPI) UpdateAPIKey

func (api OrganizationsAPI) UpdateAPIKey(w http.ResponseWriter, r *http.Request)

UpdateAPIKey is the handler for PUT /organizations/{globalid}/apikeys/{label} Updates the label or other properties of a key.

func (OrganizationsAPI) UpdateDns

func (api OrganizationsAPI) UpdateDns(w http.ResponseWriter, r *http.Request)

func (OrganizationsAPI) UpdateOrganization

func (api OrganizationsAPI) UpdateOrganization(w http.ResponseWriter, r *http.Request)

UpdateOrganization Updates organization info It is handler for PUT /organizations/{globalid}

func (OrganizationsAPI) UpdateOrganizationMemberShip

func (api OrganizationsAPI) UpdateOrganizationMemberShip(w http.ResponseWriter, r *http.Request)

func (OrganizationsAPI) UpdateOrganizationOrgMemberShip

func (api OrganizationsAPI) UpdateOrganizationOrgMemberShip(w http.ResponseWriter, r *http.Request)

type OrganizationsInterface

type OrganizationsInterface interface {
	// Create a new organization. 1 user should be in the owners list. Validation is performed
	// to check if the securityScheme allows management on this user.
	CreateNewOrganization(http.ResponseWriter, *http.Request)
	// GetOrganization is the handler for GET /organizations/{globalid}
	// Get organization info
	GetOrganization(http.ResponseWriter, *http.Request)
	// CreateNewSubOrganization is the handler for POST /organizations/{globalid}/suborganizations
	// Create a new suborganization.
	CreateNewSubOrganization(http.ResponseWriter, *http.Request)
	// UpdateOrganization is the handler for PUT /organizations/{globalid}
	// Update organization info
	UpdateOrganization(http.ResponseWriter, *http.Request)
	// DeleteOrganization is the handler for DELETE /organizations/{globalid}
	// Removes an organization and all associated data.
	DeleteOrganization(http.ResponseWriter, *http.Request)
	// GetAPIKeyLabels is the handler for GET /organizations/{globalid}/apikeys
	// Get the list of active api keys. The secrets themselves are not included.
	GetAPIKeyLabels(http.ResponseWriter, *http.Request)
	// CreateNewAPIKey is the handler for POST /organizations/{globalid}/apikeys
	// Create a new API Key, a secret itself should not be provided, it will be generated
	// serverside.
	CreateNewAPIKey(http.ResponseWriter, *http.Request)
	// GetAPIKey is the handler for GET /organizations/{globalid}/apikeys/{label}
	GetAPIKey(http.ResponseWriter, *http.Request)
	// UpdateAPIKey is the handler for PUT /organizations/{globalid}/apikeys/{label}
	// Updates the label or other properties of a key.
	UpdateAPIKey(http.ResponseWriter, *http.Request)
	// DeleteAPIKey is the handler for DELETE /organizations/{globalid}/apikeys/{label}
	// Removes an API key
	DeleteAPIKey(http.ResponseWriter, *http.Request)
	// GetOrganizationTree is the handler for GET /organizations/{globalid}/tree
	GetOrganizationTree(http.ResponseWriter, *http.Request)
	// UpdateOrganizationMemberShip is the handler for PUT /organizations/{globalid}/members
	UpdateOrganizationMemberShip(http.ResponseWriter, *http.Request)
	// AddOrganizationMember is the handler for POST /organizations/{globalid}/members
	// Assign a member to organization.
	AddOrganizationMember(http.ResponseWriter, *http.Request)
	// RemoveOrganizationMember is the handler for DELETE /organizations/{globalid}/members/{username}
	// Remove a member from organization
	RemoveOrganizationMember(http.ResponseWriter, *http.Request)
	// AddOrganizationOwner is the handler for POST /organizations/{globalid}/owners
	// Invite a user to become owner of an organization.
	AddOrganizationOwner(http.ResponseWriter, *http.Request)
	// RemoveOrganizationOwner is the handler for DELETE /organizations/{globalid}/owners/{username}
	// Remove an owner from organization
	RemoveOrganizationOwner(http.ResponseWriter, *http.Request)
	// GetContracts is the handler for GET /organizations/{globalid}/contracts
	// Get the contracts where the organization is 1 of the parties. Order descending by
	// date.
	GetContracts(http.ResponseWriter, *http.Request)
	// GetPendingInvitations is the handler for GET /organizations/{globalid}/invitations
	// Get the list of pending invitations for users to join this organization.
	GetPendingInvitations(http.ResponseWriter, *http.Request)
	// RemovePendingInvitation is the handler for DELETE /organizations/{globalid}/invitations/{username}
	// Cancel a pending invitation.
	RemovePendingInvitation(http.ResponseWriter, *http.Request)
	// CreateDns is the handler for POST /organizations/{globalid}/dns
	// Creates a new DNS name associated with an organization
	CreateDns(http.ResponseWriter, *http.Request)
	// UpdateDns is the handler for PUT /organizations/{globalid}/dns/{dnsname}
	// Updates an existing DNS name associated with an organization
	UpdateDns(http.ResponseWriter, *http.Request)
	// DeleteDNS is the handler for DELETE /organizations/{globalid}/dns/{dnsname}
	// Removes a DNS name
	DeleteDns(http.ResponseWriter, *http.Request)

	// ListOrganizationRegistry is the handler for GET /organizations/{globalid}/registry
	// Lists the Registry entries
	ListOrganizationRegistry(http.ResponseWriter, *http.Request)
	// AddOrganizationRegistryEntry is the handler for POST /organizations/{globalid}/registry
	// Adds a RegistryEntry to the organization's registry, if the key is already used, it is overwritten.
	AddOrganizationRegistryEntry(http.ResponseWriter, *http.Request)
	// GetOrganizationRegistryEntry is the handler for GET /organizations/{username}/globalid/{key}
	// Get a RegistryEntry from the organization's registry.
	GetOrganizationRegistryEntry(http.ResponseWriter, *http.Request)
	// DeleteOrganizationRegistryEntry is the handler for DELETE /organizations/{username}/globalid/{key}
	// Removes a RegistryEntry from the organization's registry
	DeleteOrganizationRegistryEntry(http.ResponseWriter, *http.Request)
	// Set the organization Logo for the organization
	SetOrganizationLogo(http.ResponseWriter, *http.Request)
	// Get the Logo from an organization
	GetOrganizationLogo(http.ResponseWriter, *http.Request)
	// Removes the Logo from an organization
	DeleteOrganizationLogo(http.ResponseWriter, *http.Request)
	// Get2faValidityTime is the handler for GET /organizations/globalid/2fa/validity
	// Get the 2fa validity time for the organization, in seconds
	Get2faValidityTime(w http.ResponseWriter, r *http.Request)
	// Set2faValidityTime is the handler for PUT /organizations/globalid/2fa/validity
	// Sets the 2fa validity time for the organization, in seconds
	Set2faValidityTime(w http.ResponseWriter, r *http.Request)
	// SetOrgMember is the handler for POST /organizations/globalid/orgmembers
	// Sets an organization as a member of this one.
	SetOrgMember(w http.ResponseWriter, r *http.Request)
	// SetOrgOwner is the handler for POST /organizations/globalid/orgowners
	// Sets an organization as an owner of this one.
	SetOrgOwner(w http.ResponseWriter, r *http.Request)
	// DeleteOrgMember is the handler for Delete /organizations/globalid/orgmembers/globalid2
	// Removes an organization as a member of this one.
	DeleteOrgMember(w http.ResponseWriter, r *http.Request)
	// DeleteOrgOwner is the handler for Delete /organizations/globalid/orgowners/globalid2
	// Removes an organization as an owner of this one.
	DeleteOrgOwner(w http.ResponseWriter, r *http.Request)
	// UpdateOrganizationOrgMemberShip is the handler for Put /organizations/globalid/orgmembers
	// Updates an organizations membership as part of another organization
	UpdateOrganizationOrgMemberShip(w http.ResponseWriter, r *http.Request)
}

OrganizationsInterface is interface for /organizations root endpoint

Jump to

Keyboard shortcuts

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