Skip to content

Commit

Permalink
intents: support for the proposed auth changes
Browse files Browse the repository at this point in the history
  • Loading branch information
patrislav committed May 22, 2024
1 parent b855971 commit 2f46a49
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 25 deletions.
51 changes: 42 additions & 9 deletions intents/intent.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 41 additions & 9 deletions intents/intent.gen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable */
// sequence-waas-intents v0.1.0 7ab7a9ad425b7f572331c5b85eda53436264c646
// sequence-waas-intents v0.1.0 abad0ae15a75bd1b90311a0358745e4e4e311cdd
// --
// Code generated by [email protected].6 with typescript generator. DO NOT EDIT.
// Code generated by [email protected].7 with typescript generator. DO NOT EDIT.
//
// webrpc-gen -schema=intent.ridl -target=typescript -client -out=./intent.gen.ts

Expand All @@ -12,14 +12,15 @@ export const WebRPCVersion = "v1"
export const WebRPCSchemaVersion = "v0.1.0"

// Schema hash generated from your RIDL schema
export const WebRPCSchemaHash = "7ab7a9ad425b7f572331c5b85eda53436264c646"
export const WebRPCSchemaHash = "abad0ae15a75bd1b90311a0358745e4e4e311cdd"

//
// Types
//


export enum IntentName {
initiateAuth = 'initiateAuth',
openSession = 'openSession',
closeSession = 'closeSession',
validateSession = 'validateSession',
Expand All @@ -33,7 +34,8 @@ export enum IntentName {
getTransactionReceipt = 'getTransactionReceipt',
federateAccount = 'federateAccount',
removeAccount = 'removeAccount',
listAccounts = 'listAccounts'
listAccounts = 'listAccounts',
getIdToken = 'getIdToken'
}

export enum TransactionType {
Expand All @@ -45,6 +47,7 @@ export enum TransactionType {
}

export enum IntentResponseCode {
authInitiated = 'authInitiated',
sessionOpened = 'sessionOpened',
sessionClosed = 'sessionClosed',
sessionList = 'sessionList',
Expand All @@ -59,7 +62,8 @@ export enum IntentResponseCode {
getSessionResponse = 'getSessionResponse',
accountList = 'accountList',
accountFederated = 'accountFederated',
accountRemoved = 'accountRemoved'
accountRemoved = 'accountRemoved',
idToken = 'idToken'
}

export enum FeeTokenType {
Expand All @@ -71,7 +75,8 @@ export enum FeeTokenType {
export enum IdentityType {
None = 'None',
Guest = 'Guest',
OIDC = 'OIDC'
OIDC = 'OIDC',
Email = 'Email'
}

export interface Intent {
Expand All @@ -88,11 +93,19 @@ export interface Signature {
signature: string
}

export interface IntentDataInitiateAuth {
sessionId: string
identityType: IdentityType
verifier: string
}

export interface IntentDataOpenSession {
sessionId: string
verifier?: string
challenge?: string
forceCreateAccount?: boolean
email?: string
idToken?: string
forceCreateAccount?: boolean
}

export interface IntentDataCloseSession {
Expand Down Expand Up @@ -157,7 +170,8 @@ export interface IntentDataGetTransactionReceipt {
export interface IntentDataFederateAccount {
sessionId: string
wallet: string
idToken: string
email?: string
challenge?: string
}

export interface IntentDataListAccounts {
Expand All @@ -169,6 +183,12 @@ export interface IntentDataRemoveAccount {
accountId: string
}

export interface IntentDataGetIdToken {
sessionId: string
wallet: string
nonce?: string
}

export interface TransactionRaw {
type: string
to: string
Expand Down Expand Up @@ -217,6 +237,13 @@ export interface IntentResponse {
data: any
}

export interface IntentResponseAuthInitiated {
sessionId: string
identityType: IdentityType
expiresIn: number
challenge?: string
}

export interface IntentResponseSessionOpened {
sessionId: string
wallet: string
Expand Down Expand Up @@ -312,10 +339,15 @@ export interface IntentResponseAccountFederated {
export interface IntentResponseAccountRemoved {
}

export interface IntentResponseIdToken {
idToken: string
expiresIn: number
}

export interface Account {
id: string
type: IdentityType
issuer: string
issuer?: string
email?: string
}

Expand Down
55 changes: 48 additions & 7 deletions intents/intent.ridl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ struct Signature
+ go.field.name = SessionID
- signature: string

enum IntentName: string
enum IntentName: string
- initiateAuth
- openSession
- closeSession
- validateSession
Expand All @@ -32,17 +33,31 @@ struct Signature
- federateAccount
- removeAccount
- listAccounts
- getIdToken

struct IntentDataInitiateAuth
- sessionId: string
+ go.field.name = SessionID
- identityType: IdentityType
- verifier: string

struct IntentDataOpenSession
- sessionId: string
+ go.field.name = SessionID
- verifier?: string
+ go.field.type = string
+ go.tag.json = verifier,omitempty
- challenge?: string
+ go.field.type = string
+ go.tag.json = challenge,omitempty
- forceCreateAccount?: bool
+ go.field.type = bool
+ go.tag.json = forceCreateAccount,omitempty
# Deprecated
- email?: string
+ go.tag.json = email,omitempty
- idToken?: string
+ go.tag.json = idToken,omitempty
- forceCreateAccount?: bool
+ go.field.type = bool
+ go.tag.json = forceCreateAccount,omitempty

struct IntentDataCloseSession
- sessionId: string
Expand Down Expand Up @@ -104,8 +119,12 @@ struct IntentDataFederateAccount
- sessionId: string
+ go.field.name = SessionID
- wallet: string
- idToken: string
+ go.tag.json = idToken,omitempty
- email?: string
+ go.field.type = string
+ go.tag.json = email,omitempty
- challenge?: string
+ go.field.type = string
+ go.tag.json = challenge,omitempty

struct IntentDataListAccounts
- wallet: string
Expand All @@ -115,6 +134,13 @@ struct IntentDataRemoveAccount
- accountId: string
+ go.field.name = AccountID

struct IntentDataGetIdToken
- sessionId: string
+ go.field.name = SessionID
- wallet: string
- nonce?: string
+ go.field.type = string

struct TransactionRaw
- type: string
- to: string
Expand Down Expand Up @@ -166,6 +192,7 @@ struct IntentResponse
- data: any

enum IntentResponseCode: string
- authInitiated
- sessionOpened
- sessionClosed
- sessionList
Expand All @@ -181,6 +208,14 @@ enum IntentResponseCode: string
- accountList
- accountFederated
- accountRemoved
- idToken

struct IntentResponseAuthInitiated
- sessionId: string
+ go.field.name = SessionID
- identityType: IdentityType
- expiresIn: int
- challenge?: string

struct IntentResponseSessionOpened
- sessionId: string
Expand Down Expand Up @@ -270,16 +305,22 @@ struct IntentResponseAccountFederated

struct IntentResponseAccountRemoved

struct IntentResponseIdToken
- idToken: string
- expiresIn: int

enum IdentityType: string
- None
- Guest
- OIDC
- Email

struct Account
- id: string
+ go.field.name = ID
- type: IdentityType
+ go.field.type = IdentityType
- issuer: string
- issuer?: string
+ go.tag.json = issuer,omitempty
- email?: string
+ go.tag.json = email,omitempty

0 comments on commit 2f46a49

Please sign in to comment.