Skip to content

Commit

Permalink
Trinsic Authenticator: Backend Spike, iOS + Android apps (#3025) (#160)
Browse files Browse the repository at this point in the history
* Generated code and changes from branch main, commit SHA 180308aa

* Apply automatic changes

---------

Co-authored-by: geel9 <geel9@users.noreply.github.com>
Co-authored-by: mewmba <mewmba@users.noreply.github.com>
3 people authored Nov 21, 2023
1 parent d5a9889 commit f8a9b3f
Showing 4 changed files with 103 additions and 8 deletions.
6 changes: 6 additions & 0 deletions Sources/Trinsic/WalletService.swift
Original file line number Diff line number Diff line change
@@ -93,6 +93,12 @@ public class WalletService: ServiceBase {
.wait()
}

public func getWalletFromExternalIdentity(request: Services_Universalwallet_V1_GetWalletFromExternalIdentityRequest) throws -> Services_Universalwallet_V1_GetWalletFromExternalIdentityResponse {
return try client!.GetWalletFromExternalIdentity(request, callOptions: try buildMetadata(request))
.response
.wait()
}

public func generateAuthToken(request: Services_Universalwallet_V1_GenerateAuthTokenRequest) throws -> Services_Universalwallet_V1_GenerateAuthTokenResponse {
return try client!.GenerateAuthToken(request, callOptions: try buildMetadata(request))
.response
84 changes: 79 additions & 5 deletions proto/services/connect/v1/connect.proto
Original file line number Diff line number Diff line change
@@ -148,8 +148,43 @@ message Verification {
// by the user -- or `0` if not yet begun.
fixed64 begun = 6;

// The unix timestamp, in seconds, when this verification last changed state -- o
// The unix timestamp, in seconds, when this verification last changed state -- or `0` if it has not yet
// begun.
fixed64 updated = 7;

// The Government ID options for this Verification.
// Only set if this Verification is of type `GOVERNMENT_ID`.
optional GovernmentIDOptions government_id_options = 8;

// Normalized output for manual parsing and usage for this verification
// Only set if this Verification is of type `GOVERNMENT_ID` and has succeeded.
optional NormalizedGovernmentIdData normalized_government_id_data = 9;
}

message NormalizedGovernmentIdData {
// The ID number of the underlying identity document
optional string id_number = 1 [json_name = "idNumber"];

// Given ("first") name of the document holder
optional string given_name = 2 [json_name = "givenName"];

// Family ("last") name of the document holder
optional string family_name = 3 [json_name = "familyName"];

// Full address of the document holder
optional string address = 4 [json_name = "address"];

// Date of birth of the document holder
optional string date_of_birth = 5 [json_name = "dateOfBirth"];

// ISO3 country code of the document
optional string country = 6 [json_name = "country"];

// Issuance date of the document
optional string issue_date = 7 [json_name = "issueDate"];

// Expiration date date of the document
optional string expiration_date = 8 [json_name = "expirationDate"];
}

// Request to create an Identity Verification Session
@@ -162,6 +197,45 @@ message CreateSessionRequest {
message RequestedVerification {
// The type of verification to perform
VerificationType type = 1;

oneof options {
// Options for a Verification of type `GOVERNMENT_ID`
GovernmentIDOptions government_id_options = 2;
}
}

// Options for a Verification of type `GOVERNMENT_ID`
message GovernmentIDOptions {
// The fields to retrieve from the Government ID.
// If this object is not set, all fields will be retrieved.
GovernmentIDFields fields = 1;
}

// Selection of fields to retrieve from a Government ID. All fields default to `false` unless explicitly set to `true`.
message GovernmentIDFields {
// ID number of the underlying identity document
bool id_number = 1;

// Given ("first") name of the document holder
bool given_name = 2;

// Family ("last") name of the document holder
bool family_name = 3;

// Full address of the document holder
bool address = 4;

// Date of birth of the document holder
bool date_of_birth = 5;

// ISO3 country code of the document
bool country = 6;

// Issuance date of the document
bool issue_date = 7;

// Expiration date date of the document
bool expiration_date = 8;
}

// Response to `CreateIDVSessionRequest`
@@ -209,7 +283,7 @@ message ListSessionsRequest {
optional int32 page_size = 3;

// The page index of results to return.
// Starts at `1`.
// Starts at `1`.
// Defaults to `1`.
optional int32 page = 4;
}
@@ -231,10 +305,10 @@ message ListSessionsResponse {
enum SessionOrdering {
// Order sessions according to when they were created
CREATED = 0;

// Order sessions according to when they last changed state
UPDATED = 1;

// Order sessions according to their numerical state
STATE = 2;
}
@@ -249,7 +323,7 @@ service Connect {

// Get an IDVSession
rpc GetSession(GetSessionRequest) returns (GetSessionResponse);

// List IDVSessions created by the calling wallet
rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse);
}
2 changes: 2 additions & 0 deletions proto/services/provider/v1/provider.proto
Original file line number Diff line number Diff line change
@@ -143,6 +143,8 @@ enum IdentityProvider {
Phone = 2;
// Identity provider is passkey (WebAuthn) -- for Trinsic internal use only
Passkey = 3;
// Identity provider is passkey using Trinsic Authenticator for mobile phones
TrinsicAuthenticator = 4;
}

// Options for creation of DID on the ION network
19 changes: 16 additions & 3 deletions proto/services/universal-wallet/v1/universal-wallet.proto
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ message CreateWalletRequest {
// such as email, phone, internal ID, or anything you'd like to associate
// with this wallet. This field is searchable.
optional string description = 2 [(options.optional) = true];
// Optional identity to add to the wallet (email or sms).
// Optional identity to add to the wallet (email or sms).
// Use this field when inviting participants into an ecosystem.
// If this field is set, an auth token will not be sent in the response.
optional ExternalIdentity identity = 3 [(options.optional) = true];
@@ -188,6 +188,16 @@ message ListWalletsResponse{
repeated services.provider.v1.WalletConfiguration wallets = 1;
}

message GetWalletFromExternalIdentityRequest {
services.provider.v1.WalletExternalIdentity identity = 1;
}

// Response to `GetWalletFromExternalIdentityRequest`
message GetWalletFromExternalIdentityResponse {
// Wallet configuration
services.provider.v1.WalletConfiguration wallet = 1;
}

// Service for managing wallets
service UniversalWallet {
// Retrieve an item from the wallet with a given item identifier
@@ -215,6 +225,9 @@ service UniversalWallet {
option (options.sdk_template_option).no_arguments = true;
}

// Retrieve information from an ecosystem wallet by searching for its external identity (email or phone)
rpc GetWalletFromExternalIdentity(GetWalletFromExternalIdentityRequest) returns (GetWalletFromExternalIdentityResponse);

// Generate new token for a given wallet and add it to the collection of known auth tokens.
// This endpoint requires authentication and will return a new token ID and auth token.
// Use this endpoint if you want to authorize another device, without having to share your
@@ -315,7 +328,7 @@ message AuthenticateConfirmResponse {
string auth_token = 1;
}

// Request to list templates by
// Request to list templates by
message ListByVerificationTemplateRequest {
// ID of verification template to list matching credentials
string verification_template_id = 1;
@@ -335,4 +348,4 @@ message ListByVerificationTemplateResponse {

// Token to fetch next set of results via `ListByVerificationTemplateRequest`
string continuation_token = 3;
}
}

0 comments on commit f8a9b3f

Please sign in to comment.