v1beta1connect

package
v0.75.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 77 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IdempotencyReplyHeader = "X-Idempotency-Replayed"
	HttpChunkSize          = 204800 // 200KB
)

Variables

View Source
var (
	ErrBadRequest              = errors.New("invalid syntax in body")
	ErrInvalidMetadata         = errors.New("metadata schema validation failed")
	ErrOperationUnsupported    = errors.New("operation not supported")
	ErrInternalServerError     = errors.New("internal server error")
	ErrUnauthenticated         = errors.New("not authenticated")
	ErrUnauthorized            = errors.New("not authorized")
	ErrNotFound                = errors.New("not found")
	ErrInvalidEmail            = errors.New("Invalid email")
	ErrUserNotExist            = errors.New("user doesn't exist")
	ErrInvalidNamesapceOrID    = errors.New("namespace and ID cannot be empty")
	ErrConflictRequest         = errors.New("already exist")
	ErrBadBodyMetaSchemaError  = errors.New(ErrBadRequest.Error() + " : " + ErrInvalidMetadata.Error())
	ErrInvalidActorType        = errors.New("invalid actor type")
	ErrActivityRequired        = errors.New("activity is required")
	ErrStatusRequired          = errors.New("status is required")
	ErrProspectIdRequired      = errors.New("prospect ID is required")
	ErrProspectNotFound        = errors.New("record not found for the given input")
	ErrRQLParse                = errors.New("error parsing RQL query")
	ErrOrgDisabled             = errors.New("org is disabled. Please contact your administrator to enable it")
	ErrRoleFilter              = errors.New("cannot use role filters and with_roles together")
	ErrMinAdminCount           = errors.New("org must have at least one admin, consider adding another admin before removing")
	ErrDomainNotFound          = errors.New("domain whitelist request doesn't exist")
	ErrDomainAlreadyExists     = errors.New("domain name already exists for that organization")
	ErrInvalidHost             = errors.New("invalid domain, no such host found")
	ErrTXTRecordNotFound       = errors.New("required TXT record not found for domain verification")
	ErrDomainMismatch          = errors.New("user and org's whitelisted domains doesn't match")
	ErrInvitationNotFound      = errors.New("invitation not found")
	ErrInvitationExpired       = errors.New("invitation expired")
	ErrAlreadyMember           = errors.New("user is already a member of the organization")
	ErrEmptyEmailID            = errors.New("email id is empty")
	ErrEmailConflict           = errors.New("user email can't be updated")
	ErrCustomerNotFound        = errors.New("customer doesn't exist")
	ErrServiceUserNotFound     = errors.New("service user not found")
	ErrServiceUserCredNotFound = errors.New("service user credentials not found")
)
View Source
var (
	ErrNamespaceSplitNotation = errors.New("subject/object should be provided as 'namespace:uuid'")
)

Functions

func ExtractLogger added in v0.69.0

func ExtractLogger(ctx context.Context) *zap.Logger

func TransformAuditRecordToPB added in v0.74.0

func TransformAuditRecordToPB(record auditrecord.AuditRecord) (*frontierv1beta1.CreateAuditRecordResponse, error)

Types

type AuditRecordService added in v0.74.0

type AuditRecordService interface {
	Create(ctx context.Context, record auditrecord.AuditRecord) (auditrecord.AuditRecord, bool, error)
	List(ctx context.Context, query *rql.Query) (auditrecord.AuditRecordsList, error)
	Export(ctx context.Context, query *rql.Query) (io.Reader, string, error)
}

type BootstrapService added in v0.74.0

type BootstrapService interface {
	AppendSchema(ctx context.Context, definition schema.ServiceDefinition) error
}

type CheckoutService added in v0.74.0

type CheckoutService interface {
	Create(ctx context.Context, ch checkout.Checkout) (checkout.Checkout, error)
	GetByID(ctx context.Context, id string) (checkout.Checkout, error)
	List(ctx context.Context, filter checkout.Filter) ([]checkout.Checkout, error)
	Apply(ctx context.Context, ch checkout.Checkout) (*subscription.Subscription, *product.Product, error)
	CreateSessionForPaymentMethod(ctx context.Context, ch checkout.Checkout) (checkout.Checkout, error)
	CreateSessionForCustomerPortal(ctx context.Context, ch checkout.Checkout) (checkout.Checkout, error)
}

type ConnectHandler

type ConnectHandler struct {
	frontierv1beta1connect.UnimplementedAdminServiceHandler
	frontierv1beta1connect.UnimplementedFrontierServiceHandler
	// contains filtered or unexported fields
}

func NewConnectHandler

func NewConnectHandler(deps api.Deps, authConf authenticate.Config) *ConnectHandler

func (*ConnectHandler) AuthCallback added in v0.69.0

func (*ConnectHandler) AuthLogout added in v0.69.0

func (*ConnectHandler) AuthToken added in v0.69.0

func (*ConnectHandler) Authenticate added in v0.69.0

func (*ConnectHandler) CheckPlanEntitlement added in v0.69.0

func (h *ConnectHandler) CheckPlanEntitlement(ctx context.Context, obj relation.Object) error

CheckPlanEntitlement is only currently used to restrict seat based plans

func (*ConnectHandler) CreateProspect added in v0.75.0

func (*ConnectHandler) CreateRole added in v0.74.0

func (*ConnectHandler) CreateUser added in v0.75.0

func (*ConnectHandler) DeleteProspect added in v0.75.0

func (*ConnectHandler) DeleteRole added in v0.74.0

func (*ConnectHandler) DeleteUser added in v0.75.0

func (*ConnectHandler) DisableUser added in v0.75.0

func (*ConnectHandler) EnableUser added in v0.75.0

func (*ConnectHandler) ExportAuditRecords added in v0.75.0

func (*ConnectHandler) ExportOrganizationProjects added in v0.73.0

func (*ConnectHandler) ExportOrganizationTokens added in v0.73.0

func (*ConnectHandler) ExportOrganizationUsers added in v0.73.0

func (*ConnectHandler) ExportOrganizations added in v0.71.0

func (*ConnectHandler) ExportUsers added in v0.73.0

func (*ConnectHandler) GetCurrentUser added in v0.75.0

func (*ConnectHandler) GetLoggedInPrincipal added in v0.69.0

func (h *ConnectHandler) GetLoggedInPrincipal(ctx context.Context, via ...authenticate.ClientAssertion) (authenticate.Principal, error)

func (*ConnectHandler) GetProspect added in v0.75.0

func (*ConnectHandler) GetRawCheckout added in v0.69.0

func (h *ConnectHandler) GetRawCheckout(ctx context.Context, id string) (checkout.Checkout, error)

func (*ConnectHandler) GetServiceUser added in v0.69.0

func (*ConnectHandler) GetUser added in v0.75.0

func (*ConnectHandler) IsAuthorized added in v0.69.0

func (h *ConnectHandler) IsAuthorized(ctx context.Context, object relation.Object, permission string) error

func (*ConnectHandler) IsSuperUser added in v0.69.0

func (h *ConnectHandler) IsSuperUser(ctx context.Context) error

func (*ConnectHandler) ListGroups added in v0.74.0

func (*ConnectHandler) ListPlatformPreferences added in v0.69.0

func (h *ConnectHandler) ListPlatformPreferences(ctx context.Context) (map[string]string, error)

func (*ConnectHandler) ListProjects added in v0.74.0

func (*ConnectHandler) ListProspects added in v0.75.0

func (*ConnectHandler) ListRelations added in v0.74.0

func (*ConnectHandler) ListResources added in v0.74.0

func (*ConnectHandler) ListSessions added in v0.75.0

SDK APIs Returns a list of all sessions for the current authenticated user.

func (*ConnectHandler) ListUserGroups added in v0.75.0

func (*ConnectHandler) ListUserSessions added in v0.75.0

Admin APIs Returns a list of all sessions for a specific user.

func (*ConnectHandler) PingUserSession added in v0.75.0

Ping user current active session.

func (*ConnectHandler) RevokeSession added in v0.75.0

Revoke a specific session for the current authenticated user.

func (*ConnectHandler) RevokeUserSession added in v0.75.0

Revoke a specific session for a specific user (admin only).

func (*ConnectHandler) SearchInvoices added in v0.74.0

func (*ConnectHandler) SearchUsers added in v0.73.0

func (*ConnectHandler) UpdatePermission added in v0.74.0

UpdatePermission should only be used to update permission metadata at the moment

func (*ConnectHandler) UpdateProspect added in v0.75.0

func (*ConnectHandler) UpdateRole added in v0.74.0

func (*ConnectHandler) UpdateUser added in v0.75.0

type CreditService added in v0.75.0

type CreditService interface {
	GetBalance(ctx context.Context, id string) (int64, error)
}

type CustomerService added in v0.74.0

type CustomerService interface {
	GetByID(ctx context.Context, id string) (customer.Customer, error)
	Create(ctx context.Context, customer customer.Customer, offline bool) (customer.Customer, error)
	List(ctx context.Context, filter customer.Filter) ([]customer.Customer, error)
	Update(ctx context.Context, customer customer.Customer) (customer.Customer, error)
	Delete(ctx context.Context, id string) error
	RegisterToProviderIfRequired(ctx context.Context, customerID string) (customer.Customer, error)
	Disable(ctx context.Context, id string) error
	Enable(ctx context.Context, id string) error
	UpdateCreditMinByID(ctx context.Context, customerID string, limit int64) (customer.Details, error)
	GetDetails(ctx context.Context, customerID string) (customer.Details, error)
	ListPaymentMethods(ctx context.Context, id string) ([]customer.PaymentMethod, error)
	UpdateDetails(ctx context.Context, customerID string, details customer.Details) (customer.Details, error)
}

type InvoiceService added in v0.74.0

type InvoiceService interface {
	List(ctx context.Context, filter invoice.Filter) ([]invoice.Invoice, error)
	ListAll(ctx context.Context, filter invoice.Filter) ([]invoice.Invoice, error)
	GetUpcoming(ctx context.Context, customerID string) (invoice.Invoice, error)
	TriggerCreditOverdraftInvoices(ctx context.Context) error
	SearchInvoices(ctx context.Context, rqlQuery *rql.Query) ([]invoice.InvoiceWithOrganization, error)
}

type JsonWebKeySet added in v0.75.0

type JsonWebKeySet struct {
	Keys []*frontierv1beta1.JSONWebKey `json:"keys"`
}

type KycService added in v0.73.0

type KycService interface {
	GetKyc(context.Context, string) (kyc.KYC, error)
	SetKyc(context.Context, kyc.KYC) (kyc.KYC, error)
	ListKycs(context.Context) ([]kyc.KYC, error)
}

type OrgBillingService added in v0.71.0

type OrgBillingService interface {
	Search(ctx context.Context, query *rql.Query) (orgbilling.OrgBilling, error)
	Export(ctx context.Context) ([]byte, string, error)
}

type OrgInvoicesService added in v0.71.0

type OrgInvoicesService interface {
	Search(ctx context.Context, id string, query *rql.Query) (orginvoices.OrganizationInvoices, error)
}

type OrgProjectsService added in v0.71.0

type OrgProjectsService interface {
	Search(ctx context.Context, id string, query *rql.Query) (orgprojects.OrgProjects, error)
	Export(ctx context.Context, orgID string) ([]byte, string, error)
}

type OrgServiceUserCredentialsService added in v0.71.0

type OrgServiceUserCredentialsService interface {
	Search(ctx context.Context, id string, query *rql.Query) (svc.OrganizationServiceUserCredentials, error)
}

type OrgServiceUserService added in v0.75.0

type OrgServiceUserService interface {
	Search(ctx context.Context, orgID string, query *rql.Query) (orgserviceuser.OrganizationServiceUsers, error)
}

type OrgTokensService added in v0.71.0

type OrgTokensService interface {
	Search(ctx context.Context, id string, query *rql.Query) (svc.OrganizationTokens, error)
	Export(ctx context.Context, orgID string) ([]byte, string, error)
}

type OrgUsersService added in v0.71.0

type OrgUsersService interface {
	Search(ctx context.Context, id string, query *rql.Query) (orgusers.OrgUsers, error)
	Export(ctx context.Context, orgID string) ([]byte, string, error)
}

type PermissionService added in v0.74.0

type PermissionService interface {
	Get(ctx context.Context, id string) (permission.Permission, error)
	List(ctx context.Context, filter permission.Filter) ([]permission.Permission, error)
	Upsert(ctx context.Context, perm permission.Permission) (permission.Permission, error)
	Update(ctx context.Context, perm permission.Permission) (permission.Permission, error)
}

type ProjectUsersService added in v0.74.0

type ProjectUsersService interface {
	Search(ctx context.Context, id string, query *rql.Query) (projectusers.ProjectUsers, error)
}

type ProspectService added in v0.75.0

type ProspectService interface {
	Create(ctx context.Context, prospect prospect.Prospect) (prospect.Prospect, error)
	List(ctx context.Context, query *rql.Query) (prospect.ListProspects, error)
	Get(ctx context.Context, prospectId string) (prospect.Prospect, error)
	Update(ctx context.Context, prospect prospect.Prospect) (prospect.Prospect, error)
	Delete(ctx context.Context, prospectId string) error
}

type RelationService added in v0.74.0

type RelationService interface {
	Get(ctx context.Context, id string) (relation.Relation, error)
	Create(ctx context.Context, rel relation.Relation) (relation.Relation, error)
	List(ctx context.Context, f relation.Filter) ([]relation.Relation, error)
	Delete(ctx context.Context, rel relation.Relation) error
}

type RoleService added in v0.74.0

type RoleService interface {
	Get(ctx context.Context, id string) (role.Role, error)
	Upsert(ctx context.Context, toCreate role.Role) (role.Role, error)
	List(ctx context.Context, f role.Filter) ([]role.Role, error)
	Update(ctx context.Context, toUpdate role.Role) (role.Role, error)
	Delete(ctx context.Context, id string) error
}

type UsageService added in v0.74.0

type UsageService interface {
	Report(ctx context.Context, usages []usage.Usage) error
	Revert(ctx context.Context, accountID, usageID string, amount int64) error
}

type UserOrgsService added in v0.73.0

type UserOrgsService interface {
	Search(ctx context.Context, id string, query *rql.Query) (userorgs.UserOrgs, error)
}

type UserProjectsService added in v0.73.0

type UserProjectsService interface {
	Search(ctx context.Context, userId string, orgId string, query *rql.Query) (userprojects.UserProjects, error)
}

type WebhookService added in v0.75.0

type WebhookService interface {
	CreateEndpoint(ctx context.Context, endpoint webhook.Endpoint) (webhook.Endpoint, error)
	UpdateEndpoint(ctx context.Context, endpoint webhook.Endpoint) (webhook.Endpoint, error)
	DeleteEndpoint(ctx context.Context, id string) error
	ListEndpoints(ctx context.Context, filter webhook.EndpointFilter) ([]webhook.Endpoint, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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