Documentation
¶
Index ¶
- Variables
- func CanReadRepository(actor domain.Actor, repositoryID string) bool
- func CreatePlatformInvitation(ctx context.Context, db *store.Store, orgName, email, rawSlug string) (string, error)
- func NormaliseSlug(raw string) (string, bool)
- func RevokePlatformInvitation(ctx context.Context, db *store.Store, id string) error
- func ValidID(id string) bool
- type Config
- type CreatedOrgOIDCInvitation
- type Membership
- type OrgOIDCInput
- type OrgOIDCInvitation
- type OrgOIDCInvitationInput
- type OrgOIDCSettings
- type PendingInvitation
- type ProbeCooldownError
- type RepositoryResolver
- type Service
- func (s *Service) ActivateOrgOIDC(ctx context.Context, session Session, orgID string, expected int64, ...) error
- func (s *Service) ActorTx(ctx context.Context, tx pgx.Tx, session Session, org string) (domain.Actor, error)
- func (s *Service) Authenticate(ctx context.Context, token string) (Session, error)
- func (s *Service) BeginOrgOIDCInvitation(ctx context.Context, w http.ResponseWriter, token string) (string, error)
- func (s *Service) Bootstrap(ctx context.Context, session Session, token, name, requestID string) (domain.Organisation, error)
- func (s *Service) Callback(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (s *Service) CheckInvitationRequest(r *http.Request) error
- func (s *Service) CheckRequest(r *http.Request, csrf string) error
- func (s *Service) ClearJoin(w http.ResponseWriter)
- func (s *Service) ClearSession(w http.ResponseWriter)
- func (s *Service) CookieName() string
- func (s *Service) CreateMemberInvitation(ctx context.Context, session Session, orgID, email string, role domain.Role, ...) (string, string, error)
- func (s *Service) CreateOrgOIDCInvitation(ctx context.Context, session Session, orgID string, ...) (CreatedOrgOIDCInvitation, error)
- func (s *Service) DeleteMember(ctx context.Context, session Session, orgID, userID string, expected int64, ...) error
- func (s *Service) DeleteTeam(ctx context.Context, session Session, orgID, teamID string, expected int64, ...) error
- func (s *Service) DisableOrgOIDC(ctx context.Context, session Session, orgID string, expected int64, ...) (OrgOIDCSettings, error)
- func (s *Service) Join(r *http.Request) string
- func (s *Service) Login(ctx context.Context, w http.ResponseWriter, orgIDs ...string) (string, error)
- func (s *Service) Logout(ctx context.Context, session Session) error
- func (s *Service) MemberInvitations(ctx context.Context, session Session, orgID string) ([]PendingInvitation, error)
- func (s *Service) Members(ctx context.Context, session Session, orgID string, limit int, cursor string) (domain.Page[Membership], error)
- func (s *Service) OrgForSlug(ctx context.Context, raw string) (string, error)
- func (s *Service) OrgOIDC(ctx context.Context, session Session, orgID string) (OrgOIDCSettings, error)
- func (s *Service) OrgOIDCInvitations(ctx context.Context, session Session, orgID string, limit int, cursor string) (domain.Page[OrgOIDCInvitation], error)
- func (s *Service) ProbeOrgOIDC(ctx context.Context, session Session, orgID string, expected int64, ...) (OrgOIDCSettings, error)
- func (s *Service) PutMember(ctx context.Context, session Session, orgID, userID string, input Membership, ...) (Membership, error)
- func (s *Service) PutOrgOIDC(ctx context.Context, session Session, orgID string, input OrgOIDCInput, ...) (OrgOIDCSettings, error)
- func (s *Service) PutTeam(ctx context.Context, session Session, orgID, teamID string, input Team, ...) (Team, error)
- func (s *Service) RedeemPlatformInvitation(ctx context.Context, session Session, token, requestID string) (domain.Organisation, error)
- func (s *Service) RequestToken(r *http.Request) string
- func (s *Service) RequireRepository(ctx context.Context, session Session, orgID, repositoryID string) (domain.Actor, error)
- func (s *Service) ResolveActor(ctx context.Context, session Session, orgID string) (domain.Actor, error)
- func (s *Service) ResolveRepository(ctx context.Context, session Session, orgID, objectID string, ...) (domain.Actor, error)
- func (s *Service) RevokeMemberInvitation(ctx context.Context, session Session, orgID, id, requestID string) error
- func (s *Service) RevokeOrgOIDCInvitation(ctx context.Context, session Session, orgID, invitationID, requestID string) error
- func (s *Service) RevokeSessions(ctx context.Context, session Session) error
- func (s *Service) SetJoin(w http.ResponseWriter, token string)
- func (s *Service) SetOrgOIDCVault(vault *secrets.Vault)
- func (s *Service) SetOrganisationSlug(ctx context.Context, session Session, orgID, raw, requestID string) (string, error)
- func (s *Service) SetSession(w http.ResponseWriter, token string)
- func (s *Service) SignedOutURL() string
- func (s *Service) Teams(ctx context.Context, session Session, orgID string, limit int, cursor string) (domain.Page[Team], error)
- func (s *Service) WithActor(ctx context.Context, session Session, orgID string, ...) error
- func (s *Service) WithMutation(ctx context.Context, session Session, orgID string, ...) error
- type Session
- type Team
- type Tenant
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOIDCProbe = errors.New("OIDC issuer could not be verified") ErrOIDCActivation = errors.New("organisation OIDC requires current issuer verification before activation") ErrOIDCProbeCooldown = errors.New("OIDC issuer probe cooldown active") ErrOIDCProbeBusy = errors.New("OIDC issuer probe capacity reached") )
View Source
var ( ErrUnauthenticated = errors.New("authentication required") ErrForbidden = errors.New("access denied") ErrConflict = errors.New("version conflict") ErrInvalid = errors.New("invalid request") )
View Source
var ErrInvitationAccepted = fmt.Errorf("invitation already accepted: %w", ErrConflict)
View Source
var ErrSlugTaken = fmt.Errorf("short name already in use: %w", ErrConflict)
Functions ¶
func CreatePlatformInvitation ¶ added in v0.2.11
func NormaliseSlug ¶ added in v0.2.19
func RevokePlatformInvitation ¶ added in v0.2.14
Types ¶
type Config ¶
type CreatedOrgOIDCInvitation ¶
type CreatedOrgOIDCInvitation struct {
OrgOIDCInvitation
RedemptionURL string `json:"redemption_url"`
}
type Membership ¶
type OrgOIDCInput ¶
type OrgOIDCInvitation ¶
type OrgOIDCInvitationInput ¶
type OrgOIDCSettings ¶
type OrgOIDCSettings struct {
Configured bool `json:"configured"`
SecretPresent bool `json:"secret_present"`
Issuer string `json:"issuer,omitempty"`
ClientID string `json:"client_id,omitempty"`
Status string `json:"status"`
Version int64 `json:"version"`
VerifiedAt *time.Time `json:"verified_at,omitempty"`
Verified bool `json:"verified"`
ActivationAvailable bool `json:"activation_available"`
ActivationBlocked string `json:"activation_blocked,omitempty"`
}
type PendingInvitation ¶ added in v0.2.14
type PendingInvitation struct {
ID string `json:"id"`
Email string `json:"email"`
OrgName string `json:"org_name"`
Role domain.Role `json:"role"`
ExpiresAt time.Time `json:"expires_at"`
}
func PlatformInvitations ¶ added in v0.2.14
type ProbeCooldownError ¶
type ProbeCooldownError struct {
RetryAfter int
}
func (*ProbeCooldownError) Error ¶
func (e *ProbeCooldownError) Error() string
func (*ProbeCooldownError) Is ¶
func (e *ProbeCooldownError) Is(target error) bool
type RepositoryResolver ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ActivateOrgOIDC ¶
func (*Service) Authenticate ¶
func (*Service) BeginOrgOIDCInvitation ¶
func (*Service) CheckInvitationRequest ¶
func (*Service) ClearJoin ¶ added in v0.2.11
func (s *Service) ClearJoin(w http.ResponseWriter)
func (*Service) ClearSession ¶
func (s *Service) ClearSession(w http.ResponseWriter)
func (*Service) CookieName ¶
func (*Service) CreateMemberInvitation ¶ added in v0.2.14
func (*Service) CreateOrgOIDCInvitation ¶
func (s *Service) CreateOrgOIDCInvitation(ctx context.Context, session Session, orgID string, input OrgOIDCInvitationInput, requestID string) (CreatedOrgOIDCInvitation, error)
func (*Service) DeleteMember ¶
func (*Service) DeleteTeam ¶
func (*Service) DisableOrgOIDC ¶
func (*Service) MemberInvitations ¶ added in v0.2.14
func (*Service) OrgForSlug ¶ added in v0.2.19
func (*Service) OrgOIDCInvitations ¶
func (*Service) ProbeOrgOIDC ¶
func (*Service) PutMember ¶
func (s *Service) PutMember(ctx context.Context, session Session, orgID, userID string, input Membership, expected int64, requestID string) (Membership, error)
func (*Service) PutOrgOIDC ¶
func (s *Service) PutOrgOIDC(ctx context.Context, session Session, orgID string, input OrgOIDCInput, expected int64, requestID string) (OrgOIDCSettings, error)
func (*Service) RedeemPlatformInvitation ¶ added in v0.2.11
func (*Service) RequireRepository ¶
func (*Service) ResolveActor ¶
func (*Service) ResolveRepository ¶
func (*Service) RevokeMemberInvitation ¶ added in v0.2.14
func (*Service) RevokeOrgOIDCInvitation ¶
func (*Service) RevokeSessions ¶
func (*Service) SetJoin ¶ added in v0.2.11
func (s *Service) SetJoin(w http.ResponseWriter, token string)
func (*Service) SetOrgOIDCVault ¶
func (*Service) SetOrganisationSlug ¶ added in v0.2.19
func (*Service) SetSession ¶
func (s *Service) SetSession(w http.ResponseWriter, token string)
func (*Service) SignedOutURL ¶ added in v0.2.17
type Session ¶
type Session struct {
ID string `json:"-"`
OrganizationID string `json:"-"`
OIDCConfigID string `json:"-"`
OIDCConfigVersion int64 `json:"-"`
User User `json:"user"`
Organisations []domain.Organisation `json:"organisations"`
Memberships []Membership `json:"memberships"`
CSRFToken string `json:"csrf_token"`
// contains filtered or unexported fields
}
func NewAutomationSession ¶
func (Session) AutomationID ¶
func (Session) AutomationRepositories ¶ added in v0.2.38
Click to show internal directories.
Click to hide internal directories.