types

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserTypeUser        = "user"
	UserTypeServiceUser = "service-user"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthnChallengeRequest

type AuthnChallengeRequest struct {
	ChallengeToken  string `json:"challenge_token"`
	ChallengeAnswer string `json:"challenge_answer"`
}

type AuthnChallengeRequiredResponse

type AuthnChallengeRequiredResponse struct {
	ChallengeToken string `json:"challenge_token"`
	ChallengeType  string `json:"challenge_type"`
}

func (*AuthnChallengeRequiredResponse) Error

type AutoGenerated

type AutoGenerated []struct {
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type BackupKey

type BackupKey struct {
	UUID      string `json:"uuid"`
	Title     string `json:"title"`
	Key       string `json:"key"`
	Type      string `json:"type"`
	Workspace string `json:"workspace"`
}

type BackupKeyReq

type BackupKeyReq struct {
	Title string `json:"title"`
	Key   string `json:"key" validate:"required"`
}

type BepaResponseError

type BepaResponseError struct {
	Status  string `json:"status"`
	Code    int    `json:"code"`
	Reason  string `json:"reason"`
	Message struct {
		Detail string `json:"detail"`
	} `json:"message"`
	Detail string `json:"detail"`
}

type ChangePasswordReq

type ChangePasswordReq struct {
	Password string `json:"password" validate:"required,min=8"`
}

type Group

type Group struct {
	UUID               *uuid.UUID             `json:"uuid" faker:"uuidObject"`
	Name               string                 `json:"name"`
	Description        string                 `json:"description"`
	Workspace          Workspace              `json:"workspace"`
	CreatedAt          time.Time              `json:"created_at"`
	UpdatedAt          time.Time              `json:"updated_at"`
	UsersNumber        int                    `json:"users_number,omitempty"`
	ServiceUsersNumber int                    `json:"service_users_number,omitempty"`
	Roles              []RoleCompactWorkspace `json:"roles,omitempty"`
}

type GroupReq

type GroupReq struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Workspace   string `json:"workspace"`
}

type GroupRes

type GroupRes struct {
	UUID          *uuid.UUID `json:"uuid" faker:"uuidObject"`
	Name          string     `json:"name"`
	WorkspaceUUID string     `json:"workspace"`
	Description   string     `json:"description"`
}

type GroupServiceUser

type GroupServiceUser struct {
	Group       *Group       `json:"group"`
	ServiceUser *ServiceUser `json:"service_user"`
}

type GroupUpdateReq

type GroupUpdateReq struct {
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Workspace   WorkspaceUpdateReq `json:"workspace"`
}

type GroupUser

type GroupUser struct {
	User  *User  `json:"user"`
	Group *Group `json:"group"`
}

type GroupUserRes

type GroupUserRes struct {
	Group string `json:"group"`
	User  string `json:"user"`
}

type HealthCheckResponse

type HealthCheckResponse struct {
	ServerUrl string
	Err       error
}

func (*HealthCheckResponse) String

func (hcr *HealthCheckResponse) String() string

type IdentifyAndAuthorizeReq

type IdentifyAndAuthorizeReq struct {
	Token  string `json:"user_token"`
	Object string `json:"object"`
	Action string `json:"action"`
}

type InvitationInfo

type InvitationInfo struct {
	Token string `json:"invitation_token"`
}

type InviteUserReq

type InviteUserReq struct {
	Email string `json:"email" validate:"required,email"`
}

type KiseSecret

type KiseSecret struct {
	UUID        string `json:"uuid"`
	Title       string `json:"title"`
	Secret      string `json:"secret"`
	User        string `json:"user"`
	ServiceUser string `json:"service_user,omitempty"`
}

type OpenIDToken

type OpenIDToken struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token,omitempty"`
	Scope        string `json:"scope,omitempty"`
}

type Organization

type Organization struct {
	UUID           *uuid.UUID `json:"uuid" faker:"uuidObject"`
	Name           string     `json:"name_en"`
	EnterpriseName string     `json:"enterprise_name"`
	EconomicCode   string     `json:"economic_code"`
	NationalId     string     `json:"national_id"`
}

type PublicKey

type PublicKey struct {
	UUID      string    `json:"uuid"`
	Title     string    `json:"title"`
	Key       string    `json:"key"`
	User      string    `json:"user"`
	CreatedAt time.Time `json:"created_at"`
	DeletedAt any       `json:"deleted_at"`
	Type      string    `json:"type"`
	PublicKey string    `json:"public_key"`
}

type PublicKeyReq

type PublicKeyReq struct {
	Title string `json:"title"`
	Key   string `json:"key" validate:"required"`
}

type PublicKeyVerifyReq

type PublicKeyVerifyReq struct {
	Key            string
	KeyType        string
	Workspace_uuid string `json:"workspace_uuid"`
	Hostname       string `json:"hostname"`
	Email          string `json:"email"`
}

type RequestExecutionError

type RequestExecutionError struct {
	Err        error
	StatusCode int
	Data       []byte
}

func (*RequestExecutionError) Error

func (ree *RequestExecutionError) Error() string

type ResetPasswordReq

type ResetPasswordReq struct {
	Email string `json:"email" validate:"required,email"`
}

type ResponseError

type ResponseError struct {
	Error    string   `json:"message"`
	Invalids []string `json:"invalids,omitempty"`
}

type Role

type Role struct {
	UUID          *uuid.UUID `json:"uuid" faker:"uuidObject"`
	DescriptionFa string     `json:"description_fa"`
	DescriptionEn string     `json:"description_en"`
	Workspace     *Workspace `json:"workspace"`
	Name          string     `json:"name"`
	CreatedAt     time.Time  `json:"created_at"`
	UpdatedAt     time.Time  `json:"updated_at"`
	Items         []any      `json:"items"`
}

type RoleBinding

type RoleBinding struct {
	RoleName  string      `json:"name"`
	UserUUID  *uuid.UUID  `json:"user_uuid" faker:"uuidObject"`
	Workspace *Workspace  `json:"workspace"`
	Items     interface{} `json:"items,omitempty"`
}

type RoleBindingReq

type RoleBindingReq struct {
	Items map[string]string `json:"items,omitempty"`
}

type RoleBindingRes

type RoleBindingRes struct {
	Items []map[string]string `json:"items,omitempty"`
}

type RoleCompactWorkspace

type RoleCompactWorkspace struct {
	UUID          *uuid.UUID `json:"uuid" faker:"uuidObject"`
	DescriptionFa string     `json:"description_fa"`
	DescriptionEn string     `json:"description_en"`
	Workspace     *uuid.UUID `json:"workspace"`
	Name          string     `json:"name"`
	CreatedAt     time.Time  `json:"created_at"`
	UpdatedAt     time.Time  `json:"updated_at"`
	Items         []any      `json:"items"`
}

type RoleReq

type RoleReq struct {
	Description string `json:"description_fa"`
	Name        string `json:"name" validate:"required"`
	Workspace   string `json:"workspace" validate:"required"`
}

type RoleRes

type RoleRes struct {
	UUID      *uuid.UUID `json:"uuid" faker:"uuidObject"`
	Name      string     `json:"name" validate:"required"`
	Workspace *Workspace `json:"workspace"`
}

type RoleWithCompactWorkspace

type RoleWithCompactWorkspace struct {
	UUID          *uuid.UUID `json:"uuid" faker:"uuidObject"`
	DescriptionFa string     `json:"description_fa"`
	DescriptionEn string     `json:"description_en"`
	Workspace     *uuid.UUID `json:"workspace"`
	Name          string     `json:"name"`
	CreatedAt     time.Time  `json:"created_at"`
	UpdatedAt     time.Time  `json:"updated_at"`
	Items         []any      `json:"items"`
}

type RoleWithItems

type RoleWithItems struct {
	RoleUUID string              `json:"role_uuid"`
	Items    []map[string]string `json:"items_list"`
}

type Rule

type Rule struct {
	UUID          *uuid.UUID `json:"uuid" faker:"uuidObject"`
	WorkspaceUUID *uuid.UUID `json:"workspace" faker:"uuidObject"`
	Name          string     `json:"name"`
	Actions       []string   `json:"actions" validate:"required,gte=1"`
	Object        string     `json:"object" validate:"required"`
	Deny          bool       `json:"deny"`
}

type RuleReq

type RuleReq struct {
	Name    string   `json:"name" validate:"required"`
	Actions []string `json:"actions" validate:"required,gte=1"`
	Object  string   `json:"object" validate:"required"`
	Deny    bool     `json:"deny"`
}

type Service

type Service struct {
	Name    string   `json:"name"`
	Actions []string `json:"actions"`
}

type ServiceUser

type ServiceUser struct {
	UUID        *uuid.UUID  `json:"uuid" faker:"uuidObject"`
	Groups      []Group     `json:"groups"`
	Description string      `json:"description"`
	ThirdParty  *ThirdParty `json:"third_party,omitempty"`
	Name        string      `json:"name"`
	Workspace   *uuid.UUID  `json:"workspace"`
	CreatedAt   string      `json:"created_at,omitempty"`
	UpdatedAt   string      `json:"updated_at,omitempty"`
	Roles       []*Role     `json:"roles,omitempty"`
}

type ServiceUserPublicKey

type ServiceUserPublicKey struct {
	UUID        *uuid.UUID `json:"uuid" faker:"uuidObject"`
	ServiceUser string     `json:"service_user"`
	PublicKey   string     `json:"public_key"`
	Name        string     `json:"name"`
	CreatedAt   string     `json:"created_at,omitempty"`
	Title       string     `json:"title"`
	DeletedAt   *time.Time `json:"deleted_at"`
	Key         string     `json:"key"`
	Type        string     `json:"type"`
}

type ServiceUserReq

type ServiceUserReq struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Workspace   string `json:"workspace"`
}

type ServiceUserToken

type ServiceUserToken struct {
	UUID        *uuid.UUID `json:"uuid" faker:"uuidObject"`
	ServiceUser string     `json:"service_user"`
	Secret      string     `json:"secret"`
	Name        string     `json:"name"`
	IsHashed    bool       `json:"is_hashed"`
	CreatedAt   time.Time  `json:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at"`
	ExpiresAt   *time.Time `json:"expires_at"`
}

type ServiceUserUpdateReq

type ServiceUserUpdateReq struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type ServiceUserWithCompactRole

type ServiceUserWithCompactRole struct {
	UUID        *uuid.UUID              `json:"uuid" faker:"uuidObject"`
	Groups      []Group                 `json:"groups"`
	Description string                  `json:"description"`
	ThirdParty  *ThirdParty             `json:"third_party,omitempty"`
	Name        string                  `json:"name"`
	Workspace   *uuid.UUID              `json:"workspace"`
	CreatedAt   string                  `json:"created_at,omitempty"`
	UpdatedAt   string                  `json:"updated_at,omitempty"`
	Roles       []*RoleCompactWorkspace `json:"roles,omitempty"`
}

type ThirdParty

type ThirdParty struct {
	UUID string `json:"uuid"`
	Tag  string `json:"tag"`
}

type ThirdPartyAccessToken

type ThirdPartyAccessToken struct {
	UUID             string     `json:"uuid"`
	AccessToken      string     `json:"access_token"`
	ExpiresAt        *time.Time `json:"expires_at,omitempty"`
	CreatedAt        time.Time  `json:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at"`
	ThirdPartyUUID   string     `json:"third_party_uuid"`
	OrganizationUUID string     `json:"organization_uuid"`
}

type ThirdPartyBulkRefreshToken

type ThirdPartyBulkRefreshToken struct {
	UUID            string     `json:"uuid"`
	RefreshToken    string     `json:"refresh_token"`
	ExpiresAt       *time.Time `json:"expires_at,omitempty"`
	CreatedAt       time.Time  `json:"created_at"`
	UpdatedAt       time.Time  `json:"updated_at"`
	ServiceUserUUID string     `json:"service_user_uuid"`
	ThirdPartyUUID  string     `json:"third_party_uuid"`
	WorkspaceUUID   string     `json:"workspace_uuid"`
}

type User

type User struct {
	UUID                *uuid.UUID `json:"uuid" faker:"uuidObject"`
	Name                string     `json:"name"`
	Email               string     `json:"email"`
	InvitationToken     string     `json:"invitation_token,omitempty"`
	Groups              []Group    `json:"groups"`
	Roles               []Role     `json:"roles"`
	EmailVerified       bool       `json:"email_verified"`
	PhoneNumber         string     `json:"phone_number,omitempty"`
	PhoneNumberVerified bool       `json:"phone_number_verified"`
	FirstName           string     `json:"first_name,omitempty"`
	LastName            string     `json:"last_name,omitempty"`
	Birthday            string     `json:"birthday,omitempty"`
	IsSuspended         bool       `json:"is_suspended"`
	CreatedAt           time.Time  `json:"created_at"`
	UpdatedAt           time.Time  `json:"updated_at"`
	UserType            string     `json:"user_type"`
	IsOtpEnabled        bool       `json:"is_otp_enabled"`
}

type UserAcceptInvitationReq

type UserAcceptInvitationReq struct {
	Name     string `json:"name" validate:"required"`
	Password string `json:"password" validate:"required,min=8"`
}

type UserCanReq

type UserCanReq struct {
	Path string `json:"path" validate:"required"`
}

type UserOtp

type UserOtp struct {
	UUID      *uuid.UUID `json:"uuid" faker:"uuidObject"`
	User      string     `json:"user"`
	Secret    string     `json:"secret,omitempty"`
	CreatedAt string     `json:"created_at,omitempty"`
	UpdatedAt string     `json:"updated_at,omitempty"`
}

type UserReq

type UserReq struct {
	Name     string `json:"name" validate:"required"`
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required,min=8"`
}

type UserRes

type UserRes struct {
	UUID            string              `json:"uuid"`
	Name            string              `json:"name"`
	Email           string              `json:"email"`
	UserType        string              `json:"user_type"`
	IsSuspended     bool                `json:"is_suspended"`
	Workspaces      []string            `json:"workspaces"`
	CreatedAt       time.Time           `json:"created_at,omitempty"`
	UpdatedAt       time.Time           `json:"updated_at,omitempty"`
	InvitationToken string              `json:"invitation_token,omitempty"`
	Items           []map[string]string `json:"items,omitempty"`
	ThirdParty      ThirdParty          `json:"third_party,omitempty"`
}

type UserSecret

type UserSecret struct {
	Secret string `json:"secret"`
}

type UserSecretRes

type UserSecretRes struct {
	Secret string `json:"secret"`
}

type UserToken

type UserToken struct {
	UUID         string     `json:"uuid"`
	Name         string     `json:"name"`
	User         string     `json:"user"`
	Secret       string     `json:"secret"`
	IsHashed     bool       `json:"is_hashed"`
	Active       bool       `json:"active"`
	LastAccessAt *time.Time `json:"last_access_at"`
	CreatedAt    time.Time  `json:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at"`
	DeletedAt    *time.Time `json:"deleted_at"`
	ExpiresAt    *time.Time `json:"expires_at"`
}

type UserTokenByCredsReq

type UserTokenByCredsReq struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required,min=8"`
}

type UserTokenReq

type UserTokenReq struct {
	Name      string     `json:"name"`
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	Secret    string     `json:"secret" validate:"required"`
	UserType  string     `json:"user_type"`
}

type UserUpdateReq

type UserUpdateReq struct {
	Name     string `json:"name"`
	Email    string `json:"email" validate:"omitempty,email"`
	Password string `json:"password" validate:"omitempty,min=8"`
}

type UserWithCompactRole

type UserWithCompactRole struct {
	UUID                *uuid.UUID             `json:"uuid" faker:"uuidObject"`
	Name                string                 `json:"name"`
	Email               string                 `json:"email"`
	InvitationToken     string                 `json:"invitation_token,omitempty"`
	Groups              []Group                `json:"groups"`
	Roles               []RoleCompactWorkspace `json:"roles"`
	EmailVerified       bool                   `json:"email_verified"`
	PhoneNumber         string                 `json:"phone_number,omitempty"`
	PhoneNumberVerified bool                   `json:"phone_number_verified"`
	FirstName           string                 `json:"first_name,omitempty"`
	LastName            string                 `json:"last_name,omitempty"`
	Birthday            string                 `json:"birthday,omitempty"`
	IsSuspended         bool                   `json:"is_suspended"`
	CreatedAt           time.Time              `json:"created_at"`
	UpdatedAt           time.Time              `json:"updated_at"`
	UserType            string                 `json:"user_type"`
	IsOtpEnabled        bool                   `json:"is_otp_enabled"`
}

type VerifRes

type VerifRes struct {
	Message string `json:"message"`
}

type WebhookUser

type WebhookUser struct {
	UUID                  uuid.UUID `json:"uuid"`
	Name                  string    `json:"name"`
	Email                 string    `json:"email"`
	IsEmailVerified       bool      `json:"email_verified"`
	PhoneNumber           string    `json:"phone_number"`
	IsPhoneNumberVerified bool      `json:"phone_number_verified"`
	FirstName             string    `json:"first_name"`
	LastName              string    `json:"last_name"`
	Birthday              string    `json:"birthday"`
	IsSuspended           bool      `json:"is_suspended"`
}

type WebhookUserWorkspaceRelation

type WebhookUserWorkspaceRelation struct {
	UserUUID      uuid.UUID `json:"user_uuid"`
	WorkspaceUUID uuid.UUID `json:"workspace_uuid"`
	IsSuspended   bool      `json:"is_suspended"`
}

type WebhookWorkspace

type WebhookWorkspace struct {
	UUID         uuid.UUID    `json:"uuid"`
	Name         string       `json:"name"`
	IsSuspended  bool         `json:"is_suspended"`
	Organization Organization `json:"organization"`
}

type WebhookWorkspaceOrganization

type WebhookWorkspaceOrganization struct {
	UUID uuid.UUID `json:"uuid"`
	Name string    `json:"name"`
}

type Workspace

type Workspace struct {
	UUID         *uuid.UUID `json:"uuid" faker:"uuidObject"`
	Name         string     `json:"name"`
	Namespace    string     `json:"namespace"`
	CreatedAt    time.Time  `json:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at"`
	Organization *uuid.UUID `json:"organization" faker:"uuidObject"`
	IsSuspended  bool       `json:"is_suspended"`
}

type WorkspaceReq

type WorkspaceReq struct {
	Name string `json:"name" validate:"required,rfc1123_label"`
}

type WorkspaceUpdateReq

type WorkspaceUpdateReq struct {
	Name         string `json:"name"`
	Namespace    string `json:"namespace"`
	Organization string `json:"organization"`
	IsSuspended  bool   `json:"is_suspended"`
}

type WorkspaceWithOrganization

type WorkspaceWithOrganization struct {
	UUID         *uuid.UUID    `json:"uuid" faker:"uuidObject"`
	Name         string        `json:"name"`
	Namespace    string        `json:"namespace"`
	Organization *Organization `json:"organization"`
	CreatedAt    time.Time     `json:"created_at"`
	UpdatedAt    time.Time     `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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