webui

package
v0.0.0-...-5f8c1fa Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: BSD-2-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbortIfError

func AbortIfError(c *gin.Context, err error) bool

AbortIfError stops request processing and displays an error page if param err is not nil. This returns true if it actually did have to abort. When it returns true, the caller should return to ensure that no further processing of the request occurs. If this returns false, there was no error, and the caller can continue processing.

func AlertIndex

func AlertIndex(c *gin.Context)

AlertIndex shows list of alerts for the logged-in user, unless that user is sys admin, who can see all alerts. GET /alerts

func AlertMarkAllAsRead

func AlertMarkAllAsRead(c *gin.Context)

AlertsMarkAllAsRead marks all of a user's unread alerts as read.

Because this method acts only on alerts belonging to the current user, it's impossible for one user to mark another user's alerts as read. (Unless the user logs in under someone else's account.)

POST /alerts/mark_all_as_read

func AlertMarkAsReadXHR

func AlertMarkAsReadXHR(c *gin.Context)

AlertsMarkAsReadXHR handles an AJAX request to mark alerts as read. The PUT body should contain a csrf token and param called "id__in" whose value is a list of alert ids. This will mark each of those alerts as read by the current user.

Because this method acts only on alerts belonging to the current user, it's impossible for one user to mark another user's alerts as read. (Unless the user logs in under someone else's account.)

PUT /alerts/mark_as_read

func AlertMarkAsUnreadXHR

func AlertMarkAsUnreadXHR(c *gin.Context)

AlertsMarkAsUnreadXHR handles an AJAX request to mark alerts as unread. The PUT body should contain a csrf token and param called "id__in" whose value is a list of alert ids. This will mark each of those alerts as unread by the current user.

Because this method acts only on alerts belonging to the current user, it's impossible for one user to mark another user's alerts as unread. (Unless the user logs in under someone else's account.)

PUT /alerts/mark_as_unread

func AlertShow

func AlertShow(c *gin.Context)

AlertShow shows the AlertView with the specified id for the specified user. Note that the AlertView table contains multiple entries for each Alert ID. But each alert goes only once to each recipient, so the combination of AlertID + UserID (recipient) is unique. GET /alerts/show/:id

func BillingReportShow

func BillingReportShow(c *gin.Context)

GET /reports/billing

func ComponentsIndex

func ComponentsIndex(c *gin.Context)

GET /ui_components

func CreateNewAccountAlert

func CreateNewAccountAlert(req *Request, newUser *pgmodels.User, token string) (*pgmodels.Alert, error)

CreateNewAccountAlert creates an alert telling a newly added user that they now have an APTrust account. The alert includes a link for the user to set a custom password.

func CreatePasswordChangedAlert

func CreatePasswordChangedAlert(req *Request, userToEdit *pgmodels.User) (*pgmodels.Alert, error)

CreatePasswordChangedAlert creates an alert telling a user that their password has been changed. It should say who changed the password, from where (IP address) and when.

func CreatePasswordResetAlert

func CreatePasswordResetAlert(req *Request, userToEdit *pgmodels.User, token string) (*pgmodels.Alert, error)

CreatePasswordResetAlert creates an alert telling a user to reset their password. The alert's email body includes a link with a password-reset token. These alerts should be generated when a user clicks the "Forgot Password" link on the login page and when an admin creates a new user account. In each case, the user clicks the email link and then has to set a new password.

Note that the token in the URL is random but unencrypted. The one in the DB is encrypted, so stealing it will do an attacker no good.

func DashboardShow

func DashboardShow(c *gin.Context)

func DeletionRequestApprove

func DeletionRequestApprove(c *gin.Context)

DeletionRequestApprove handles the case where an institutional admin approves a deletion request. Note that the token comes in through the post form here, not through the URL.

POST /deletions/approve/:id

func DeletionRequestCancel

func DeletionRequestCancel(c *gin.Context)

DeletionRequestCancel handles the case where an institutional admin cancels (rejects) a file deletion request. Token comes in through post form, not query string.

POST /deletions/cancel/:id

func DeletionRequestIndex

func DeletionRequestIndex(c *gin.Context)

DeletionRequestIndex shows list of deletion requests. GET /deletions

func DeletionRequestReview

func DeletionRequestReview(c *gin.Context)

DeletionRequestReview displays a page on which an institutional admin can review a requested file deletion and choose whether to approve or cancel it.

GET /deletions/review/:id?token=<token>

func DeletionRequestShow

func DeletionRequestShow(c *gin.Context)

DeletionRequestShow shows the deletion request with the specified id.

Note that this shows a read-only view of the request. It does not include the Approve/Cancel buttons. This read-only view may be available to users who do not have permission to initiate, approve, or cancel deletion requests but who still need a read-only view of the requests that have been submitted.

Deletions apply to files and/or intellectual objects. The methods for initiating, approving and rejecting deletion requests are in the Generic Files Controller (for files) and the Intellectual Objects Controller (for objects).

GET /deletions/show/:id

func DepositReportShow

func DepositReportShow(c *gin.Context)

DepositReportShow shows the deposits report.

Note that this does not follow the usual pattern for list/show pages, where most of the work is done by Request or Request.LoadResourceList because this is a reporting query that is not running against a basic table or view. The query in pgmodels.DepositStats is more complex, so we do a little more manual work here.

GET /reports/deposits

func ErrorShow

func ErrorShow(c *gin.Context)

func ErrorShowModal

func ErrorShowModal(c *gin.Context)

func GenericFileIndex

func GenericFileIndex(c *gin.Context)

GenericFileIndex shows list of objects. GET /files

func GenericFileInitDelete

func GenericFileInitDelete(c *gin.Context)

GenericFileInitDelete occurs when user clicks the button confirming they want to delete a file. This creates a deletion confirmation message, which will be emailed to institutional admins for approval.

POST /files/init_delete/:id

func GenericFileInitRestore

func GenericFileInitRestore(c *gin.Context)

GenericFileInitRestore creates a file restoration request, which is really just a WorkItem that gets queued. Restoration can take seconds or hours, depending on where the file is stored and how big it is. POST /files/init_restore/:id

func GenericFileRequestDelete

func GenericFileRequestDelete(c *gin.Context)

GenericFileRequestDelete shows a message asking if user really wants to delete a file. DELETE /files/request_delete/:id

func GenericFileRequestRestore

func GenericFileRequestRestore(c *gin.Context)

GenericFileRequestRestore shows a message asking whether user really wants to restore a file. GET /files/request_restore/:id

func GenericFileShow

func GenericFileShow(c *gin.Context)

GenericFileShow returns the object with the specified id. GET /files/show/:id

func InitObjectRestoration

func InitObjectRestoration(obj *pgmodels.IntellectualObject, user *pgmodels.User) (*pgmodels.WorkItem, error)

func InstitutionCreate

func InstitutionCreate(c *gin.Context)

InstitutionCreate a new institution. Handles submission of new institution form. POST /institutions/new

func InstitutionDelete

func InstitutionDelete(c *gin.Context)

InstitutionDelete deletes a user. DELETE /institutions/delete/:id GET /institutions/delete/:id

func InstitutionEdit

func InstitutionEdit(c *gin.Context)

InstitutionEdit shows a form to edit an exiting institution. GET /institutions/edit/:id

func InstitutionEditPrefs

func InstitutionEditPrefs(c *gin.Context)

InstitutionEditPrefs shows a form to edit institutional preferences. GET /institutions/edit_preferences/:id

func InstitutionIndex

func InstitutionIndex(c *gin.Context)

InstitutionIndex shows list of institutions. GET /institutions

func InstitutionNew

func InstitutionNew(c *gin.Context)

InstitutionNew returns a blank form for the institution to create a new institution. GET /institutions/new

func InstitutionShow

func InstitutionShow(c *gin.Context)

InstitutionShow returns the institution with the specified id. GET /institutions/show/:id

func InstitutionUndelete

func InstitutionUndelete(c *gin.Context)

InstitutionUndelete reactivates an institution. GET /institutions/undelete/:id

func InstitutionUpdate

func InstitutionUpdate(c *gin.Context)

InstitutionUpdate saves changes to an exiting institution. PUT /institutions/edit/:id

func InstitutionUpdatePrefs

func InstitutionUpdatePrefs(c *gin.Context)

InstitutionUpdatePrefs saves institutional preferences. PUT /institutions/edit_preferences/:id

func IntellectualObjectEvents

func IntellectualObjectEvents(c *gin.Context)

This is called when user pages through events on the intellectual object detail page. This returns an HTML fragment, not an entire page.

GET /objects/events/:id (intellectual object id)

func IntellectualObjectFiles

func IntellectualObjectFiles(c *gin.Context)

This is called when user pages through files on the intellectual object detail page. This returns an HTML fragment, not an entire page.

GET /objects/files/:id (intellectual object id)

func IntellectualObjectIndex

func IntellectualObjectIndex(c *gin.Context)

IntellectualObjectIndex shows list of objects. GET /objects

func IntellectualObjectInitDelete

func IntellectualObjectInitDelete(c *gin.Context)

IntellectualObjectInitDelete creates an object deletion request. This request must be approved by an administrator at the depositing institution before the deletion will actually be queued.

POST /objects/init_delete/:id

func IntellectualObjectInitRestore

func IntellectualObjectInitRestore(c *gin.Context)

IntellectualObjectInitRestore creates an object restoration request, which is really just a WorkItem that gets queued. Restoration can take seconds or hours, depending on where the object is stored and how big it is. POST /objects/init_restore/:id

func IntellectualObjectRequestDelete

func IntellectualObjectRequestDelete(c *gin.Context)

IntellectualObjectRequestDelete shows a message asking if the user really wants to delete this object. GET /objects/request_delete/:id

func IntellectualObjectRequestRestore

func IntellectualObjectRequestRestore(c *gin.Context)

IntellectualObjectRequestRestore shows a message asking if the user really wants to delete this object. GET /objects/request_restore/:id

func IntellectualObjectShow

func IntellectualObjectShow(c *gin.Context)

IntellectualObjectShow returns the object with the specified id. GET /objects/show/:id

func InternalMetadataIndex

func InternalMetadataIndex(c *gin.Context)

InternalDataIndex returns data from the schema_migrations and ar_internal_metadata tables. GET /internal_metadata

func NsqAdmin

func NsqAdmin(c *gin.Context)

NsqAdmin executes administrative actions against nsqd.

POST /nsq/admind

func NsqInit

func NsqInit(c *gin.Context)

NsqInit creates the initial NSQ topics and channels, so we'll have somthing to look at. Outside of our dev and test machines, these topics and channels are created by the queue workers that push items into NSQ.

func NsqShow

func NsqShow(c *gin.Context)

NsqShow returns NSQ stats.

GET /nsq

func OTPTokenIsExpired

func OTPTokenIsExpired(tokenSentAt time.Time) bool

func PremisEventIndex

func PremisEventIndex(c *gin.Context)

PremisEventIndex shows list of objects. GET /events

func PremisEventShow

func PremisEventShow(c *gin.Context)

PremisEventShow returns the object with the specified id. GET /events/show/:id

func PremisEventShowXHR

func PremisEventShowXHR(c *gin.Context)

PremisEventShowXHR returns the PREMIS event with the specified ID as an HTML fragment suitable for loading into a modal dialog or other existing HTML element. This does not return a full page with header and footer.

GET /events/show_xhr/:id

func ShowOpenSubMenu

func ShowOpenSubMenu(auth *middleware.ResourceAuthorization) bool

func SignInUser

func SignInUser(c *gin.Context) (int, string, error)

SignInUser signs the user in with email and password. If user has two-factor auth, this is the first step of login.

func StatusCodeForError

func StatusCodeForError(err error) (status int)

StatusCodeForError returns the http.StatusCode for the specified error. If the error doesn't map to a code, this returns 500 by default.

func UserAuthyRegister

func UserAuthyRegister(req *Request) error

UserRegisterWithAuthy registers a user with Authy.

func UserChangePassword

func UserChangePassword(c *gin.Context)

UserChangePassword changes a user's password. The user gets to specify what the new password will be.

POST /users/change_password/:id

func UserComplete2FASetup

func UserComplete2FASetup(c *gin.Context)

UserComplete2FASetup receives a form from UserInit2FASetup. If user chooses SMS, we need to send them a code via SMS and have them enter it here to confirm. If they choose Authy, we need to register them if they're not already registered.

POST /users/2fa_setup

func UserCompletePasswordReset

func UserCompletePasswordReset(c *gin.Context)

UserCompletePasswordReset allows a user to complete the password reset process. Note that this is one of the few pages that does not require a login.

POST /users/complete_password_reset/:id

func UserCompleteSMSSetup

func UserCompleteSMSSetup(req *Request) error

func UserConfirmPhone

func UserConfirmPhone(c *gin.Context)

UserConfirmPhone accepts the form from UserComplete2FASetup.

POST /users/confirm_phone

func UserCreate

func UserCreate(c *gin.Context)

UserCreate a new user. Handles submission of new user form. POST /users/new

func UserDelete

func UserDelete(c *gin.Context)

UserDelete deletes a user. DELETE or POST /users/delete/:id

func UserEdit

func UserEdit(c *gin.Context)

UserEdit shows a form to edit an exiting user. GET /users/edit/:id

func UserGenerateBackupCodes

func UserGenerateBackupCodes(c *gin.Context)

UserGenerateBackupCodes generates a set of five new, random backup codes and displays them to the user.

POST /users/backup_codes

func UserGetAPIKey

func UserGetAPIKey(c *gin.Context)

UserGetAPIKey issues a new API key for the user, which replaces the user's existing API key. This key will be displayed once only.

POST /users/get_api_key/:id

func UserIndex

func UserIndex(c *gin.Context)

UserIndex shows list of users. GET /users

func UserInit2FASetup

func UserInit2FASetup(c *gin.Context)

UserInit2FASetup shows a page on which a user chooses their preferred two-factor auth method (or they can choose None and turn off two-factor).

GET /users/2fa_setup

func UserInitPasswordReset

func UserInitPasswordReset(c *gin.Context)

UserInitPasswordReset resets a user's password to something random and sends them an email with a link that has an embedded login token. When they follow the link, they'll be automatically logged in and will have to choose a new password.

TODO: This should be POST or PUT, not GET

GET /users/init_password_reset/:id

func UserMyAccount

func UserMyAccount(c *gin.Context)

UserMyAccount displays the user's account info. From this page, they can see account details, change their password, and get an API key.

GET /users/my_account

func UserNew

func UserNew(c *gin.Context)

UserNew returns a blank form for the user to create a new user. GET /users/new

func UserSendForgotPasswordMessage

func UserSendForgotPasswordMessage(c *gin.Context)

POST /users/forgot_password

func UserShow

func UserShow(c *gin.Context)

UserShow returns the user with the specified id. GET /users/show/:id

func UserShowChangePassword

func UserShowChangePassword(c *gin.Context)

UserShowChangePassword displays the change password page for the user with the specified ID.

GET /users/change_password/:id

func UserShowForgotPasswordForm

func UserShowForgotPasswordForm(c *gin.Context)

GET /users/forgot_password

func UserSignIn

func UserSignIn(c *gin.Context)

UserSignIn signs the user in. POST /users/sign_in

func UserSignInShow

func UserSignInShow(c *gin.Context)

UserSignInShow shows the user sign-in form. GET /users/sign_in

func UserSignOut

func UserSignOut(c *gin.Context)

UserSignOut signs the user out. GET /users/sign_out

func UserStartPasswordReset

func UserStartPasswordReset(c *gin.Context)

UserCompletePasswordReset allows a user to enter a token to reset their password. Why not embed the password in the URL? Because https://bit.ly/3u9GWEn.

Note that this is one of the few pages that does not require a login.

GET /users/complete_password_reset/:id

func UserTwoFactorBackup

func UserTwoFactorBackup(c *gin.Context)

UserTwoFactorBackup shows the form on which the user can enter a backup code to complete two-factor authentication.

GET /users/2fa_backup/

func UserTwoFactorChoose

func UserTwoFactorChoose(c *gin.Context)

UserTwoFactorChoose shows a list of radio button options so a user can choose their two-factor auth method (Authy, Backup Code, SMS). We show this page after a user has entered their email and password, if they have two-factor enabled. This is part of the login process, not part of the setup process.

GET /users/2fa_choose/

func UserTwoFactorGenerateSMS

func UserTwoFactorGenerateSMS(c *gin.Context)

UserTwoFactorGenerateSMS generates an OTP and sends it via SMS the user.

POST /users/2fa_sms

func UserTwoFactorPush

func UserTwoFactorPush(c *gin.Context)

UserTwoFactorPush initiates a push request to the user's authentication app asking them to approve the login. This method waits for a response from the authentication service. It's a POST to avoid GET spam. POST form includes CSRF token.

POST /users/2fa_push/

func UserTwoFactorVerify

func UserTwoFactorVerify(c *gin.Context)

UserTwoFactorVerify verifies the SMS or backup code that the user entered on TwoFactorEnter.

POST /users/2fa_verify/

func UserUndelete

func UserUndelete(c *gin.Context)

UserUndelete reactivates a user. POST or PUT /users/undelete/:id

func UserUpdate

func UserUpdate(c *gin.Context)

UserUpdate saves changes to an exiting user. PUT /users/edit/:id

func UserUpdateXHR

func UserUpdateXHR(c *gin.Context)

UserUpdateXHR handles updates to individual properties of the User object. These come from inline forms on the user view and user list pages. This allows edits to only the following fields:

Name, Email, Phone, Password, Role, Status, and OTPRequiredForLogin.

Note: Unlike most calls in this package, this one returns JSON, not HTML. This is a late addition based on UI mockups.

PUT /users/edit_xhr/:id

func WorkItemEdit

func WorkItemEdit(c *gin.Context)

WorkItemEdit shows a form to edit an exiting work item. GET /work_items/edit/:id

func WorkItemIndex

func WorkItemIndex(c *gin.Context)

WorkItemIndex shows list of work items. GET /work_items

func WorkItemRedisDelete

func WorkItemRedisDelete(c *gin.Context)

WorkItemRedisDelete deletes a WorkItem's Redis record. This is an admin-only feature.

PUT or POST /work_items/redis_delete/:id

func WorkItemRedisIndex

func WorkItemRedisIndex(c *gin.Context)

WorkItemRedisIndex shows a list of WorkItems that have records in Redis. This is an admin-only feature.

GET /work_items/redis_list

func WorkItemRequeue

func WorkItemRequeue(c *gin.Context)

WorkItemRequeue requeues a WorkItem. This is an admin-only feature typically used to recover from system errors.

PUT or POST /work_items/requeue/:id

func WorkItemShow

func WorkItemShow(c *gin.Context)

WorkItemShow returns the work item with the specified id. GET /work_items/show/:id

func WorkItemUpdate

func WorkItemUpdate(c *gin.Context)

WorkItemUpdate saves changes to an exiting work item. This is an admin-only feature. PUT /work_items/edit/:id

Types

type AlertReadResult

type AlertReadResult struct {
	Succeeded []int64 `json:"succeeded"`
	Failed    []int64 `json:"failed"`
	Error     string  `json:"error"`
}

func NewAlertReadResult

func NewAlertReadResult() *AlertReadResult

type Deletion

type Deletion struct {
	// DeletionRequest is the DeletionRequest.
	DeletionRequest *pgmodels.DeletionRequest

	// InstAdmins is the list of institutional admins to be alerted
	// about this DeletionRequest. One of these admins has to approve
	// or cancel the request before we move forward.
	InstAdmins []*pgmodels.User
	// contains filtered or unexported fields
}

Deletion is a helper object for web requests involving the review, approval, and cancellation of deletion requests. This object simply encapsulates a lot of the grunt work required by the GenericFilesController and the IntellectualObjectsController.

func NewDeletionForFile

func NewDeletionForFile(genericFileID int64, currentUser *pgmodels.User, baseURL string) (*Deletion, error)

NewDeletionForFile creates a new DeletionRequest for a GenericFile and returns the Deletion object. This constructor is only for initializing new DeletionRequests, not for reviewing, approving or cancelling existing requests.

func NewDeletionForObject

func NewDeletionForObject(objID int64, currentUser *pgmodels.User, baseURL string) (*Deletion, error)

NewDeletionForObject creates a new DeletionRequest for an IntellectualObject and returns the Deletion object. This constructor is only for initializing new DeletionRequests, not for reviewing, approving or cancelling existing requests.

func NewDeletionForReview

func NewDeletionForReview(deletionRequestID int64, currentUser *pgmodels.User, baseURL, token string) (*Deletion, error)

NewDeletionForReview pulls up information about an existing deletion request that an institutional admin will review before deciding whether to approve or cancel the request.

func (*Deletion) CreateAndQueueWorkItem

func (del *Deletion) CreateAndQueueWorkItem() (*pgmodels.WorkItem, error)

CreateAndQueueWorkItem creates and queues a deletion WorkItem. We call this only if the admin approves the DeletionRequest.

func (*Deletion) CreateApprovalAlert

func (del *Deletion) CreateApprovalAlert() (*pgmodels.Alert, error)

CreateApprovalAlert creates an alert saying that an admin has approved a deletion. This alert goes via email to all admins at the institution that owns the file or object to be deleted.

func (*Deletion) CreateCancellationAlert

func (del *Deletion) CreateCancellationAlert() (*pgmodels.Alert, error)

CreateCancellationAlert creates an alert saying that an admin has rejected a deletion request. This alert goes via email to all admins at the institution that owns the file or object to be deleted.

func (*Deletion) CreateRequestAlert

func (del *Deletion) CreateRequestAlert() (*pgmodels.Alert, error)

CreateRequestAlert creates an alert saying that a user has requested a deletion. This alert goes via email to all admins at the institution that owns the file or object to be deleted. This method is supported only for new deletion requests. If you try to call this on a deletion request you retrieved from the DB, you'll get "operation not supported" because we don't have access to the plaintext confirmation token for the review URL.

func (*Deletion) CreateWorkItem

func (del *Deletion) CreateWorkItem() (*pgmodels.WorkItem, error)

CreateWorkItem creates a WorkItem describing this deletion. We call this only if the admin approves the deletion.

func (*Deletion) QueueWorkItem

func (del *Deletion) QueueWorkItem() error

QueueWorkItem sends the WorkItem.ID into the appropriate NSQ topic. We call this after calling CreateWorkItem, and only if the admin approves the deletion.

func (*Deletion) ReadOnlyURL

func (del *Deletion) ReadOnlyURL() string

ReadOnlyURL returns a URL that displays info about the deletion request but does not include buttons to approve or cancel. This view is for the depositor's historical/auditing purposes.

func (*Deletion) ReviewURL

func (del *Deletion) ReviewURL() (string, error)

ReviewURL returns the URL for an institutional admin to review this deletion request. Note that the DeletionRequest has a plaintext ConfirmationToken ONLY when created, not when we retrieve it from the database. If you call this method after retrieving a DeletionRequest, you'll get common.ErrNotSupported, because we no longer have access to the plaintext ConfirmationToken. This works only after calling initFileDeletionRequest or initObjectDeletionRequest.

func (*Deletion) WorkItemURL

func (del *Deletion) WorkItemURL() (string, error)

WorkItemURL returns the URL for the WorkItem for this DeletionRequest. If you call this on a cancelled or not-yet-approved request, there is no WorkItem and you'll get common.ErrNotSupported.

type DepositReportParams

type DepositReportParams struct {
	ChartMetric   string
	InstitutionID int64
	StorageOption string
	ReportType    string
	StartDate     time.Time
	EndDate       time.Time
}

type Request

type Request struct {
	PathAndQuery string
	CurrentUser  *pgmodels.User
	GinContext   *gin.Context
	Auth         *middleware.ResourceAuthorization
	TemplateData gin.H
	Error        error
}

func NewRequest

func NewRequest(c *gin.Context) *Request

func (*Request) BaseURL

func (req *Request) BaseURL() string

BaseURL returns the base of param _url. The base includes the scheme, optional port, and hostname. In other words, the URL stripped of path and query.

func (*Request) GetFilterCollection

func (req *Request) GetFilterCollection() *pgmodels.FilterCollection

GetFilterCollection returns a collection of filters the user wants to apply to an index/list request. These come from the query string. Call the ToQuery() method of the returned FilterCollection to translate query string params to SQL.

func (*Request) LoadResourceList

func (req *Request) LoadResourceList(items interface{}, orderByColumn, direction string, ffConstructor forms.FilterFormConstructor) error

LoadResourceList loads a list of resources for an index page. Param items should be a pointer to a slice of the type of item you want to load (GenericFile, Institution, etc.). Params orderByColumn and direction indicate a default sort order to be applied if the request did not explicitly include a sort order. (I.e. no sort=column__direction on the query string.)

type TwoFactorPreferences

type TwoFactorPreferences struct {
	OldPhone  string
	NewPhone  string
	OldMethod string
	NewMethod string
	User      *pgmodels.User
}

func NewTwoFactorPreferences

func NewTwoFactorPreferences(req *Request) (*TwoFactorPreferences, error)

func (*TwoFactorPreferences) DoNotUseTwoFactor

func (p *TwoFactorPreferences) DoNotUseTwoFactor() bool

func (*TwoFactorPreferences) MethodChanged

func (p *TwoFactorPreferences) MethodChanged() bool

func (*TwoFactorPreferences) NeedsAuthyConfirmation

func (p *TwoFactorPreferences) NeedsAuthyConfirmation() bool

func (*TwoFactorPreferences) NeedsAuthyRegistration

func (p *TwoFactorPreferences) NeedsAuthyRegistration() bool

func (*TwoFactorPreferences) NeedsConfirmation

func (p *TwoFactorPreferences) NeedsConfirmation() bool

func (*TwoFactorPreferences) NeedsSMSConfirmation

func (p *TwoFactorPreferences) NeedsSMSConfirmation() bool

func (*TwoFactorPreferences) NothingChanged

func (p *TwoFactorPreferences) NothingChanged() bool

func (*TwoFactorPreferences) PhoneChanged

func (p *TwoFactorPreferences) PhoneChanged() bool

func (*TwoFactorPreferences) UseAuthy

func (p *TwoFactorPreferences) UseAuthy() bool

func (*TwoFactorPreferences) UseSMS

func (p *TwoFactorPreferences) UseSMS() bool

Jump to

Keyboard shortcuts

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