profile

package
v3.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	AttrConstApplicationName           = "application_name"
	AttrConstApplicationURL            = "application_url"
	AttrConstApplicationReceiptBGColor = "application_receipt_bgcolor"
)

Attribute names for application attributes

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityDetails

type ActivityDetails struct {
	UserProfile UserProfile

	ApplicationProfile ApplicationProfile
	// contains filtered or unexported fields
}

ActivityDetails represents the result of an activity between a user and the application.

func GetActivityDetails

func GetActivityDetails(httpClient requests.HttpClient, token, clientSdkId, apiUrl string, key *rsa.PrivateKey) (activity ActivityDetails, err error)

GetActivityDetails requests information about a Yoti user using the one time use token generated by the Yoti login process. Don't call this directly, use yoti.GetActivityDetails

func (ActivityDetails) ExtraData

func (a ActivityDetails) ExtraData() *extra.Data

ExtraData represents extra pieces information on the receipt

func (ActivityDetails) ParentRememberMeID

func (a ActivityDetails) ParentRememberMeID() string

ParentRememberMeID is a unique, stable identifier for a user in the context of an organisation. You can use it to identify returning users. This value is consistent for a given user across different applications belonging to a single organisation.

func (ActivityDetails) ReceiptID

func (a ActivityDetails) ReceiptID() string

ReceiptID identifies a completed activity

func (ActivityDetails) RememberMeID

func (a ActivityDetails) RememberMeID() string

RememberMeID is a unique, stable identifier for a user in the context of an application. You can use it to identify returning users. This value will be different for the same user in different applications.

func (ActivityDetails) Timestamp

func (a ActivityDetails) Timestamp() time.Time

Timestamp is the Time and date of the sharing activity

type ApplicationProfile

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

ApplicationProfile is the profile of an application with convenience methods to access well-known attributes.

func (p ApplicationProfile) ApplicationLogo() *attribute.ImageAttribute

ApplicationLogo is the logo of the application that will be displayed to those users that perform a share with it.

func (ApplicationProfile) ApplicationName

func (p ApplicationProfile) ApplicationName() *attribute.StringAttribute

ApplicationName is the name of the application

func (ApplicationProfile) ApplicationReceiptBgColor

func (p ApplicationProfile) ApplicationReceiptBgColor() *attribute.StringAttribute

ApplicationReceiptBgColor is the background colour that will be displayed on each receipt the user gets as a result of a share with the application.

func (ApplicationProfile) ApplicationURL

func (p ApplicationProfile) ApplicationURL() *attribute.StringAttribute

ApplicationURL is the URL where the application is available at

func (ApplicationProfile) GetAttribute

func (p ApplicationProfile) GetAttribute(attributeName string) *attribute.GenericAttribute

GetAttribute retrieve an attribute by name on the Yoti profile. Will return nil if attribute is not present.

func (ApplicationProfile) GetAttributeByID added in v3.6.0

func (p ApplicationProfile) GetAttributeByID(attributeID string) *attribute.GenericAttribute

GetAttributeByID retrieve an attribute by ID on the Yoti profile. Will return nil if attribute is not present.

func (ApplicationProfile) GetAttributes added in v3.6.0

func (p ApplicationProfile) GetAttributes(attributeName string) []*attribute.GenericAttribute

GetAttributes retrieve a list of attributes by name on the Yoti profile. Will return an empty list of attribute is not present.

func (ApplicationProfile) GetImageAttribute

func (p ApplicationProfile) GetImageAttribute(attributeName string) *attribute.ImageAttribute

GetImageAttribute retrieves an image attribute by name. Will return nil if attribute is not present.

func (ApplicationProfile) GetJSONAttribute

func (p ApplicationProfile) GetJSONAttribute(attributeName string) (*attribute.JSONAttribute, error)

GetJSONAttribute retrieves a JSON attribute by name. Will return nil if attribute is not present.

func (ApplicationProfile) GetStringAttribute

func (p ApplicationProfile) GetStringAttribute(attributeName string) *attribute.StringAttribute

GetStringAttribute retrieves a string attribute by name. Will return nil if attribute is not present.

type UserProfile

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

UserProfile represents the details retrieved for a particular user. Consists of Yoti attributes: a small piece of information about a Yoti user such as a photo of the user or the user's date of birth.

func (UserProfile) Address

func (p UserProfile) Address() *attribute.StringAttribute

Address represents the user's address. Will be nil if not provided by Yoti.

func (UserProfile) AgeVerifications

func (p UserProfile) AgeVerifications() (out []attribute.AgeVerification, err error)

AgeVerifications returns a slice of age verifications for the user. Will be an empty slice if not provided by Yoti.

func (UserProfile) DateOfBirth

func (p UserProfile) DateOfBirth() (*attribute.DateAttribute, error)

DateOfBirth represents the user's date of birth. Will be nil if not provided by Yoti. Has an err value which will be filled if there is an error parsing the date.

func (UserProfile) DocumentDetails

func (p UserProfile) DocumentDetails() (*attribute.DocumentDetailsAttribute, error)

DocumentDetails represents information extracted from a document provided by the user. Will be nil if not provided by Yoti.

func (UserProfile) DocumentImages

func (p UserProfile) DocumentImages() (*attribute.ImageSliceAttribute, error)

DocumentImages returns a slice of document images cropped from the image in the capture page. There can be multiple images as per the number of regions in the capture in this attribute. Will be nil if not provided by Yoti.

func (UserProfile) EmailAddress

func (p UserProfile) EmailAddress() *attribute.StringAttribute

EmailAddress represents the user's verified email address. Will be nil if not provided by Yoti.

func (UserProfile) FamilyName

func (p UserProfile) FamilyName() *attribute.StringAttribute

FamilyName corresponds to primary name in passport, and surname in English. Will be nil if not provided by Yoti.

func (UserProfile) FullName

func (p UserProfile) FullName() *attribute.StringAttribute

FullName represents the user's full name. If family_name/given_names are present, the value will be equal to the string 'given_names + " " family_name'. Will be nil if not provided by Yoti.

func (UserProfile) Gender

Gender corresponds to the gender in the registered document; the value will be one of the strings "MALE", "FEMALE", "TRANSGENDER" or "OTHER". Will be nil if not provided by Yoti.

func (UserProfile) GetAttribute

func (p UserProfile) GetAttribute(attributeName string) *attribute.GenericAttribute

GetAttribute retrieve an attribute by name on the Yoti profile. Will return nil if attribute is not present.

func (UserProfile) GetAttributeByID added in v3.6.0

func (p UserProfile) GetAttributeByID(attributeID string) *attribute.GenericAttribute

GetAttributeByID retrieve an attribute by ID on the Yoti profile. Will return nil if attribute is not present.

Example
userProfile := getUserProfile()
fullNameAttribute := userProfile.GetAttributeByID("full-name-id-123")
value := fullNameAttribute.Value().(string)

fmt.Println(value)
Output:

John Smith

func (UserProfile) GetAttributes added in v3.6.0

func (p UserProfile) GetAttributes(attributeName string) []*attribute.GenericAttribute

GetAttributes retrieve a list of attributes by name on the Yoti profile. Will return an empty list of attribute is not present.

func (UserProfile) GetDocumentImagesAttributeByID added in v3.6.0

func (p UserProfile) GetDocumentImagesAttributeByID(attributeID string) (*attribute.ImageSliceAttribute, error)

GetDocumentImagesAttributeByID retrieve a Document Images attribute by ID on the Yoti profile. This attribute consists of a slice of document images cropped from the image in the capture page. There can be multiple images as per the number of regions in the capture in this attribute. Will return nil if attribute is not present.

Example
userProfile := getUserProfile()
documentImagesAttribute, err := userProfile.GetDocumentImagesAttributeByID("document-images-attribute-id-123")
if err != nil {
	fmt.Printf("error: %s", err.Error())
	return
}

fmt.Println(*documentImagesAttribute.ID())
Output:

document-images-attribute-id-123

func (UserProfile) GetImageAttribute

func (p UserProfile) GetImageAttribute(attributeName string) *attribute.ImageAttribute

GetImageAttribute retrieves an image attribute by name. Will return nil if attribute is not present.

func (UserProfile) GetJSONAttribute

func (p UserProfile) GetJSONAttribute(attributeName string) (*attribute.JSONAttribute, error)

GetJSONAttribute retrieves a JSON attribute by name. Will return nil if attribute is not present.

func (UserProfile) GetSelfieAttributeByID added in v3.6.0

func (p UserProfile) GetSelfieAttributeByID(attributeID string) (*attribute.ImageAttribute, error)

GetSelfieAttributeByID retrieve a Selfie attribute by ID on the Yoti profile. This attribute is a photograph of the user. Will return nil if attribute is not present.

Example
userProfile := getUserProfile()
selfieAttribute, err := userProfile.GetSelfieAttributeByID("selfie-attribute-id-123")
if err != nil {
	fmt.Printf("error: %s", err.Error())
	return
}

fmt.Println(*selfieAttribute.ID())
Output:

selfie-attribute-id-123

func (UserProfile) GetStringAttribute

func (p UserProfile) GetStringAttribute(attributeName string) *attribute.StringAttribute

GetStringAttribute retrieves a string attribute by name. Will return nil if attribute is not present.

func (UserProfile) GivenNames

func (p UserProfile) GivenNames() *attribute.StringAttribute

GivenNames corresponds to secondary names in passport, and first/middle names in English. Will be nil if not provided by Yoti.

func (UserProfile) IdentityProfileReport added in v3.6.0

func (p UserProfile) IdentityProfileReport() (*attribute.JSONAttribute, error)

IdentityProfileReport represents the JSON object containing identity assertion and the verification report. Will be nil if not provided by Yoti.

func (UserProfile) MobileNumber

func (p UserProfile) MobileNumber() *attribute.StringAttribute

MobileNumber represents the user's mobile phone number, as verified at registration time. The value will be a number in E.164 format (i.e. '+' for international prefix and no spaces, e.g. "+447777123456"). Will be nil if not provided by Yoti.

func (UserProfile) Nationality

func (p UserProfile) Nationality() *attribute.StringAttribute

Nationality corresponds to the nationality in the passport. The value is an ISO-3166-1 alpha-3 code with ICAO9303 (passport) extensions. Will be nil if not provided by Yoti.

func (UserProfile) Selfie

func (p UserProfile) Selfie() *attribute.ImageAttribute

Selfie is a photograph of the user. Will be nil if not provided by Yoti.

func (UserProfile) StructuredPostalAddress

func (p UserProfile) StructuredPostalAddress() (*attribute.JSONAttribute, error)

StructuredPostalAddress represents the user's address in a JSON format. Will be nil if not provided by Yoti. This can be accessed as a map[string]string{} using a type assertion, e.g.: structuredPostalAddress := structuredPostalAddressAttribute.Value().(map[string]string{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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