yclient

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

ydentifi-client

A client for the Ydentifi MFA API

Documentation

Overview

yclient provides an interface for communicating with the Ydentifi MFA API

Index

Constants

View Source
const GetServerChallengeUrl string = "/get-auth-challenge"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticateEmailAndPasswordPayload

type AuthenticateEmailAndPasswordPayload struct {
	UserEmail          string
	PasswordPlaintext  string
	IdentityProofToken string
}

AuthenticateEmailAndPasswordPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type AuthenticateOobCodePayload added in v0.7.12

type AuthenticateOobCodePayload struct {
	UserEmail          string
	OobCode            string
	IdentityProofToken string
}

AuthenticateOobCodePayload defines the required payload structure for the respective endpoints in the Ydentifi API

type AuthenticateTotpPayload added in v0.7.5

type AuthenticateTotpPayload struct {
	UserEmail          string
	Totp               string
	IdentityProofToken string
}

AuthenticateTotpPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type CreateMobile2faUserPayload

type CreateMobile2faUserPayload struct {
	UserEmail       string
	UserPhoneNumber string
	UserDisplayName string
}

CreateMobile2faUserPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type CreateRelyingPartyPayload added in v0.8.0

type CreateRelyingPartyPayload struct {
	Name           string
	EncPubKeyPem   string
	SignPubKeyPem  string
	AuthPolicy     string
	QuotasPlan     string
	UserLimitsPlan string
}

CreateRelyingPartyPayload defines the necessary content for invoking the Ydentifi API create-relying-party admin endpoint

type CreateUserPayload added in v0.2.0

type CreateUserPayload struct {
	UserEmail          string
	Password           string
	IdentityProofToken string
}

CreateUserPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type DeleteUserPayload

type DeleteUserPayload struct {
	UserEmail string
}

DeleteUserPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type EnrollSoftToken2faPayload

type EnrollSoftToken2faPayload struct {
	UserEmail          string
	IdentityProofToken string
}

EnrollSoftToken2faPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type IdToken added in v0.7.8

type IdToken struct {
	Claims    IdTokenClaims `json:"claims"`
	Signature string        `json:"signature"`
}

IdToken is a type containing proof of identity claims for a particular user

type IdTokenClaims added in v0.7.8

type IdTokenClaims struct {
	Nonce  string                 `json:"nonce"`
	Iss    string                 `json:"iss"`
	Aud    string                 `json:"aud"`
	Iat    time.Time              `json:"iat"`
	Exp    time.Time              `json:"exp"`
	Ctx    []string               `json:"ctx"`
	Uid    string                 `json:"uid"`
	Custom map[string]interface{} `json:"custom"`
}

IdTokenClaims contains the claims payload of an IdToken

type IssueUserOobTokenPayload added in v0.7.15

type IssueUserOobTokenPayload struct {
	UserEmail string
}

IssueUserOobTokenPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type MfaIdentityPayload added in v0.7.20

type MfaIdentityPayload struct {
	UserEmail          string
	IdentityProofToken string
}

MfaIdentityPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type ResetPasswordPayload added in v0.7.17

type ResetPasswordPayload struct {
	UserEmail          string
	NewPassword        string
	IdentityProofToken string
	OobRecovery        bool // Whether the IdentityProofToken oncludes an oob proof of ID
}

ResetPasswordPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type SendEmailVerificationCodePayload added in v0.7.7

type SendEmailVerificationCodePayload struct {
	UserEmail string
}

SendEmailVerificationCodePayload defines the required payload structure for the respective endpoints in the Ydentifi API

type ServerAuthorizationPayload added in v0.4.0

type ServerAuthorizationPayload struct {
	Token        string
	EncryptedKey string // Encrypted AES or ChaCha20 compatible key used for envelope encryption
}

ServerAuthorization contains credentials for calling the API endpoints

type ServerChallenge added in v0.4.0

type ServerChallenge struct {
	AuthorizationChallenge    string
	ServerPublicEncryptionKey string
}

ServerChallenge defines the content of the the server challenge payload

type ServerChallengeResponse added in v0.2.0

type ServerChallengeResponse struct {
	Challenge string
	Signature string
}

ServerChallengeResponse contains a signature on the server challenge

type UnlockUserPayload added in v0.5.0

type UnlockUserPayload struct {
	UserEmail string
}

UnlockUserPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type UpdatePublicKeysPayload added in v0.3.0

type UpdatePublicKeysPayload struct {
	NewEncryptionPublicKey string
	NewSigningPublicKey    string
}

UpdatePublicKeysPayload defines the required payload structure for the respective endpoints in the Ydentifi API

Note: keys are expected in PEM format

type UserRecordData

type UserRecordData struct {
	UserEmail       string
	PhoneNumber     string
	UserDisplayName string
	EmailVerified   bool
	Disabled        bool
}

UserRecordData defines the payload structure for sharing client data with the frontend in the Ydentifi API

type VerifyEmailPayload added in v0.7.6

type VerifyEmailPayload struct {
	UserEmail          string
	VerificationCode   string
	IdentityProofToken string
}

VerifyEmailPayload defines the required payload structure for the respective endpoints in the Ydentifi API

type YdentifiClient

type YdentifiClient struct {
	RelyingPartyId string
	ApiBaseUrl     string
}

YdentfiClient is the default intermediary between a consumer application and the Ydentifi API.

ClientAppId - the unique ID of your app provided by the Ydentifi service/API ApiBaseUrl - the schema and the URL location of the Ydentifi API (e.g. https://where-ydentifi-is-hosted.com).

func (*YdentifiClient) KeyPack

func (y *YdentifiClient) KeyPack() (string, string, string, string, string, error)

KeyPack initiates all the secrets necessary to communicate with the Ydentifi API

Jump to

Keyboard shortcuts

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