Documentation ¶
Index ¶
- type Actionable
- type AddNewComment
- type AssignUnassignTag
- type ChangeUserEmail
- func (action *ChangeUserEmail) GetEmail() string
- func (action *ChangeUserEmail) GetKind() enum.EmailVerificationKind
- func (action *ChangeUserEmail) GetName() string
- func (action *ChangeUserEmail) GetUser() *entity.User
- func (action *ChangeUserEmail) IsAuthorized(ctx context.Context, user *entity.User) bool
- func (action *ChangeUserEmail) Validate(ctx context.Context, user *entity.User) *validate.Result
- type ChangeUserRole
- type CompleteProfile
- type CreateEditOAuthConfig
- type CreateEditTag
- type CreateNewPost
- type CreateTenant
- func (action *CreateTenant) GetEmail() string
- func (action *CreateTenant) GetKind() enum.EmailVerificationKind
- func (action *CreateTenant) GetName() string
- func (action *CreateTenant) GetUser() *entity.User
- func (action *CreateTenant) IsAuthorized(ctx context.Context, user *entity.User) bool
- func (action *CreateTenant) Validate(ctx context.Context, user *entity.User) *validate.Result
- type CreateUser
- type DeleteComment
- type DeletePost
- type DeleteTag
- type EditComment
- type InviteUsers
- type PreExecuteAction
- type SetResponse
- type SignInByEmail
- func (action *SignInByEmail) GetEmail() string
- func (action *SignInByEmail) GetKind() enum.EmailVerificationKind
- func (action *SignInByEmail) GetName() string
- func (action *SignInByEmail) GetUser() *entity.User
- func (action *SignInByEmail) IsAuthorized(ctx context.Context, user *entity.User) bool
- func (action *SignInByEmail) Validate(ctx context.Context, user *entity.User) *validate.Result
- type UpdatePost
- type UpdateTenantAdvancedSettings
- type UpdateTenantEmailAuthAllowed
- type UpdateTenantPrivacy
- type UpdateTenantSettings
- type UpdateUserSettings
- type UserInvitation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actionable ¶
type Actionable interface { IsAuthorized(ctx context.Context, user *entity.User) bool Validate(ctx context.Context, user *entity.User) *validate.Result }
Actionable is any action that the user can perform using the web app
type AddNewComment ¶
type AddNewComment struct { Number int `route:"number"` Content string `json:"content"` Attachments []*dto.ImageUpload `json:"attachments"` }
AddNewComment represents a new comment to be added
func (*AddNewComment) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type AssignUnassignTag ¶ added in v0.8.0
type AssignUnassignTag struct { Slug string `route:"slug"` Number int `route:"number"` Tag *entity.Tag Post *entity.Post }
AssignUnassignTag is used to assign or remove a tag to/from an post
func (*AssignUnassignTag) IsAuthorized ¶ added in v0.8.0
IsAuthorized returns true if current user is authorized to perform this action
type ChangeUserEmail ¶ added in v0.9.0
type ChangeUserEmail struct { Email string `json:"email" format:"lower"` VerificationKey string Requestor *entity.User }
ChangeUserEmail is the action used to change current user's email
func NewChangeUserEmail ¶ added in v0.19.0
func NewChangeUserEmail() *ChangeUserEmail
func (*ChangeUserEmail) GetEmail ¶ added in v0.19.0
func (action *ChangeUserEmail) GetEmail() string
GetEmail returns the email being verified
func (*ChangeUserEmail) GetKind ¶ added in v0.19.0
func (action *ChangeUserEmail) GetKind() enum.EmailVerificationKind
GetKind returns EmailVerificationKindSignIn
func (*ChangeUserEmail) GetName ¶ added in v0.19.0
func (action *ChangeUserEmail) GetName() string
GetName returns empty for this kind of process
func (*ChangeUserEmail) GetUser ¶ added in v0.19.0
func (action *ChangeUserEmail) GetUser() *entity.User
GetUser returns the current user performing this action
func (*ChangeUserEmail) IsAuthorized ¶ added in v0.9.0
IsAuthorized returns true if current user is authorized to perform this action
type ChangeUserRole ¶ added in v0.7.0
ChangeUserRole is the input model change role of an user
func (*ChangeUserRole) IsAuthorized ¶ added in v0.7.0
IsAuthorized returns true if current user is authorized to perform this action
type CompleteProfile ¶ added in v0.6.0
CompleteProfile happens when users completes their profile during first time sign in
func (*CompleteProfile) IsAuthorized ¶ added in v0.6.0
IsAuthorized returns true if current user is authorized to perform this action
type CreateEditOAuthConfig ¶ added in v0.15.0
type CreateEditOAuthConfig struct { ID int Logo *dto.ImageUpload `json:"logo"` Provider string `json:"provider"` Status int `json:"status"` DisplayName string `json:"displayName"` ClientID string `json:"clientID"` ClientSecret string `json:"clientSecret"` AuthorizeURL string `json:"authorizeURL"` TokenURL string `json:"tokenURL"` Scope string `json:"scope"` ProfileURL string `json:"profileURL"` JSONUserIDPath string `json:"jsonUserIDPath"` JSONUserNamePath string `json:"jsonUserNamePath"` JSONUserEmailPath string `json:"jsonUserEmailPath"` }
CreateEditOAuthConfig is used to create/edit OAuth config
func NewCreateEditOAuthConfig ¶ added in v0.19.0
func NewCreateEditOAuthConfig() *CreateEditOAuthConfig
func (*CreateEditOAuthConfig) IsAuthorized ¶ added in v0.15.0
IsAuthorized returns true if current user is authorized to perform this action
type CreateEditTag ¶ added in v0.8.0
type CreateEditTag struct { Slug string `route:"slug"` Name string `json:"name"` Color string `json:"color" format:"upper"` IsPublic bool `json:"isPublic"` Tag *entity.Tag }
CreateEditTag is used to create a new tag or edit existing
func (*CreateEditTag) IsAuthorized ¶ added in v0.8.0
IsAuthorized returns true if current user is authorized to perform this action
type CreateNewPost ¶ added in v0.15.0
type CreateNewPost struct { Title string `json:"title"` Description string `json:"description"` Attachments []*dto.ImageUpload `json:"attachments"` }
CreateNewPost is used to create a new post
func (*CreateNewPost) IsAuthorized ¶ added in v0.15.0
IsAuthorized returns true if current user is authorized to perform this action
type CreateTenant ¶
type CreateTenant struct { Token string `json:"token"` Name string `json:"name"` Email string `json:"email" format:"lower"` VerificationKey string TenantName string `json:"tenantName"` LegalAgreement bool `json:"legalAgreement"` Subdomain string `json:"subdomain" format:"lower"` UserClaims *jwt.OAuthClaims }
CreateTenant is the input model used to create a tenant
func NewCreateTenant ¶ added in v0.19.0
func NewCreateTenant() *CreateTenant
func (*CreateTenant) GetEmail ¶ added in v0.19.0
func (action *CreateTenant) GetEmail() string
GetEmail returns the email being verified
func (*CreateTenant) GetKind ¶ added in v0.19.0
func (action *CreateTenant) GetKind() enum.EmailVerificationKind
GetKind returns EmailVerificationKindSignUp
func (*CreateTenant) GetName ¶ added in v0.19.0
func (action *CreateTenant) GetName() string
GetName returns the name of the email owner
func (*CreateTenant) GetUser ¶ added in v0.19.0
func (action *CreateTenant) GetUser() *entity.User
GetUser returns the current user performing this action
func (*CreateTenant) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type CreateUser ¶ added in v0.16.0
type CreateUser struct { Name string `json:"name"` Email string `json:"email"` Reference string `json:"reference"` }
CreateUser is the action to create a new user
func (*CreateUser) IsAuthorized ¶ added in v0.16.0
IsAuthorized returns true if current user is authorized to perform this action
type DeleteComment ¶ added in v0.16.0
DeleteComment represents the action of deleting an existing comment
func (*DeleteComment) IsAuthorized ¶ added in v0.16.0
IsAuthorized returns true if current user is authorized to perform this action
type DeletePost ¶ added in v0.15.0
DeletePost represents the action of an administrator deleting an existing Post
func (*DeletePost) IsAuthorized ¶ added in v0.15.0
IsAuthorized returns true if current user is authorized to perform this action
type DeleteTag ¶ added in v0.8.0
DeleteTag is used to delete an existing tag
func (*DeleteTag) IsAuthorized ¶ added in v0.8.0
IsAuthorized returns true if current user is authorized to perform this action
type EditComment ¶ added in v0.11.0
type EditComment struct { PostNumber int `route:"number"` ID int `route:"id"` Content string `json:"content"` Attachments []*dto.ImageUpload `json:"attachments"` Post *entity.Post Comment *entity.Comment }
EditComment represents the action to update an existing comment
func (*EditComment) IsAuthorized ¶ added in v0.11.0
IsAuthorized returns true if current user is authorized to perform this action
type InviteUsers ¶ added in v0.12.0
type InviteUsers struct { Subject string `json:"subject"` Message string `json:"message"` Recipients []string `json:"recipients" format:"lower"` IsSampleInvite bool Invitations []*UserInvitation }
InviteUsers is used to invite new users into Fider
func (*InviteUsers) IsAuthorized ¶ added in v0.12.0
IsAuthorized returns true if current user is authorized to perform this action
type PreExecuteAction ¶ added in v0.19.0
PreExecuteAction can add custom pre processing logic for any action OnPreExecute is executed before IsAuthorized and Validate
type SetResponse ¶
type SetResponse struct { Number int `route:"number"` Status enum.PostStatus `json:"status"` Text string `json:"text"` OriginalNumber int `json:"originalNumber"` Original *entity.Post }
SetResponse represents the action to update an post response
func (*SetResponse) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type SignInByEmail ¶ added in v0.6.0
SignInByEmail happens when user request to sign in by email
func NewSignInByEmail ¶ added in v0.19.0
func NewSignInByEmail() *SignInByEmail
func (*SignInByEmail) GetEmail ¶ added in v0.19.0
func (action *SignInByEmail) GetEmail() string
GetEmail returns the email being verified
func (*SignInByEmail) GetKind ¶ added in v0.19.0
func (action *SignInByEmail) GetKind() enum.EmailVerificationKind
GetKind returns EmailVerificationKindSignIn
func (*SignInByEmail) GetName ¶ added in v0.19.0
func (action *SignInByEmail) GetName() string
GetName returns empty for this kind of process
func (*SignInByEmail) GetUser ¶ added in v0.19.0
func (action *SignInByEmail) GetUser() *entity.User
GetUser returns the current user performing this action
func (*SignInByEmail) IsAuthorized ¶ added in v0.6.0
IsAuthorized returns true if current user is authorized to perform this action
type UpdatePost ¶ added in v0.15.0
type UpdatePost struct { Number int `route:"number"` Title string `json:"title"` Description string `json:"description"` Attachments []*dto.ImageUpload `json:"attachments"` Post *entity.Post }
UpdatePost is used to edit an existing new post
func (*UpdatePost) IsAuthorized ¶ added in v0.15.0
IsAuthorized returns true if current user is authorized to perform this action
func (*UpdatePost) OnPreExecute ¶ added in v0.19.0
func (input *UpdatePost) OnPreExecute(ctx context.Context) error
OnPreExecute prefetches Post for later use
type UpdateTenantAdvancedSettings ¶ added in v0.13.0
type UpdateTenantAdvancedSettings struct {
CustomCSS string `json:"customCSS"`
}
UpdateTenantAdvancedSettings is the input model used to update tenant advanced settings
func (*UpdateTenantAdvancedSettings) IsAuthorized ¶ added in v0.13.0
func (action *UpdateTenantAdvancedSettings) IsAuthorized(ctx context.Context, user *entity.User) bool
IsAuthorized returns true if current user is authorized to perform this action
type UpdateTenantEmailAuthAllowed ¶ added in v0.19.0
type UpdateTenantEmailAuthAllowed struct {
IsEmailAuthAllowed bool `json:"isEmailAuthAllowed"`
}
UpdateTenantEmailAuthAllowed is the input model used to update tenant privacy settings
func (*UpdateTenantEmailAuthAllowed) IsAuthorized ¶ added in v0.19.0
func (action *UpdateTenantEmailAuthAllowed) IsAuthorized(ctx context.Context, user *entity.User) bool
IsAuthorized returns true if current user is authorized to perform this action
type UpdateTenantPrivacy ¶ added in v0.12.0
type UpdateTenantPrivacy struct {
IsPrivate bool `json:"isPrivate"`
}
UpdateTenantPrivacy is the input model used to update tenant privacy settings
func (*UpdateTenantPrivacy) IsAuthorized ¶ added in v0.12.0
IsAuthorized returns true if current user is authorized to perform this action
type UpdateTenantSettings ¶
type UpdateTenantSettings struct { Logo *dto.ImageUpload `json:"logo"` Title string `json:"title"` Invitation string `json:"invitation"` WelcomeMessage string `json:"welcomeMessage"` Locale string `json:"locale"` CNAME string `json:"cname" format:"lower"` }
UpdateTenantSettings is the input model used to update tenant settings
func NewUpdateTenantSettings ¶ added in v0.19.0
func NewUpdateTenantSettings() *UpdateTenantSettings
func (*UpdateTenantSettings) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type UpdateUserSettings ¶ added in v0.6.0
type UpdateUserSettings struct { Name string `json:"name"` AvatarType enum.AvatarType `json:"avatarType"` Avatar *dto.ImageUpload `json:"avatar"` Settings map[string]string `json:"settings"` }
UpdateUserSettings happens when users updates their settings
func NewUpdateUserSettings ¶ added in v0.19.0
func NewUpdateUserSettings() *UpdateUserSettings
func (*UpdateUserSettings) IsAuthorized ¶ added in v0.6.0
IsAuthorized returns true if current user is authorized to perform this action
type UserInvitation ¶ added in v0.19.0
UserInvitation is the model used to register an invite sent to an user
func (*UserInvitation) GetEmail ¶ added in v0.19.0
func (e *UserInvitation) GetEmail() string
GetEmail returns the invited user's email
func (*UserInvitation) GetKind ¶ added in v0.19.0
func (e *UserInvitation) GetKind() enum.EmailVerificationKind
GetKind returns EmailVerificationKindUserInvitation
func (*UserInvitation) GetName ¶ added in v0.19.0
func (e *UserInvitation) GetName() string
GetName returns empty for this kind of process
func (*UserInvitation) GetUser ¶ added in v0.19.0
func (e *UserInvitation) GetUser() *entity.User
GetUser returns the current user performing this action