shufti

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestPending            = "request.pending"
	RequestInvalid            = "request.invalid"
	VerificationCancelled     = "verification.cancelled"
	RequestTimeout            = "request.timeout"
	RequestUnauthorized       = "request.unauthorized"
	VerificationAccepted      = "verification.accepted"
	VerificationDeclined      = "verification.declined"
	VerificationStatusChanged = "verification.status.changed"
	RequestDeleted            = "request.deleted"
	RequestReceived           = "request.received"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackResponse

type CallbackResponse struct {
	Reference      string   `json:"reference"`
	Event          string   `json:"event"`
	DeclinedReason string   `json:"declined_reason,omitempty"`
	DeclinedCodes  []string `json:"declined_codes,omitempty"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config) (*Client, error)

func (*Client) GetVerificationUrl

func (c *Client) GetVerificationUrl(reference, email, redirectUrl string) (string, error)

func (*Client) GetVerificationUrlTtl

func (c *Client) GetVerificationUrlTtl() int

type Config

type Config struct {
	Host               string `yaml:"host" json:"host" mapstructure:"host" validate:"required"`
	ClientId           string `yaml:"client_id" json:"client_id" mapstructure:"client_id" validate:"required"`
	Secret             string `yaml:"secret" json:"secret" mapstructure:"secret" validate:"required"`
	CallbackUrl        string `yaml:"callback_url" json:"callback_url" mapstructure:"callback_url"`
	VerificationUrlTtl int    `yaml:"verification_url_ttl" json:"verification_url_ttl" mapstructure:"verification_url_ttl" validate:"required"` // The ttl for the verificaiton url in minutes
}

type DocumentVerification

type DocumentVerification struct {
	Proof             string   `json:"proof"`
	SupportedTypes    []string `json:"supported_types"`
	Name              string   `json:"name"`
	Dob               string   `json:"dob"`
	IssueDate         string   `json:"issue_date"`
	ExpiryDate        string   `json:"expiry_date"`
	DocumentNumber    string   `json:"document_number"`
	FetchEnhancedData string   `json:"fetch_enhanced_data"`
	Gender            string   `json:"gender"`
	PlaceOfIssue      string   `json:"place_of_issue"`
}

type ShuftiAuthMiddleware

type ShuftiAuthMiddleware struct {
	// contains filtered or unexported fields
}

func NewShuftiAuthMiddleware

func NewShuftiAuthMiddleware(config *Config) (*ShuftiAuthMiddleware, error)

func (*ShuftiAuthMiddleware) VerifySignature

func (s *ShuftiAuthMiddleware) VerifySignature() gin.HandlerFunc

type VerificationRequest

type VerificationRequest struct {
	Reference         string               `json:"reference"`
	CallbackUrl       string               `json:"callback_url"`
	RedirectUrl       string               `json:"redirect_url"`
	Email             string               `json:"email"`
	Country           string               `json:"country"`
	VerificationMode  string               `json:"verification_mode"`
	Language          string               `json:"language,omitempty"`
	AllowOffline      string               `json:"allow_offline"`
	AllowOnline       string               `json:"allow_online"`
	AllowRetry        string               `json:"allow_retry"`
	ShowPrivacyPolicy string               `json:"show_privacy_policy"`
	ShowResults       string               `json:"show_results"`
	ShowConsent       string               `json:"show_consent"`
	ShowFeedbackForm  string               `json:"show_feedback_form"`
	Ttl               int                  `json:"ttl"`
	Document          DocumentVerification `json:"document"`
}

type VerificationResponse

type VerificationResponse struct {
	Reference       string `json:"reference"`
	Event           string `json:"event"`
	Error           string `json:"error"`
	VerificationUrl string `json:"verification_url"`
}

Jump to

Keyboard shortcuts

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