Skip to content

Commit

Permalink
feat(oob): set connection alias when creating invitation
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Koci <jakub.koci@gmail.com>
  • Loading branch information
jakubkoci committed Oct 6, 2022
1 parent 0d14a71 commit 505436a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export class DidExchangeProtocol {
protocol: HandshakeProtocol.DidExchange,
role: DidExchangeRole.Responder,
state: DidExchangeState.RequestReceived,
alias: outOfBandRecord.alias,
theirDid: message.did,
theirLabel: message.label,
threadId: message.threadId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export class ConnectionService {
protocol: HandshakeProtocol.Connections,
role: DidExchangeRole.Responder,
state: DidExchangeState.RequestReceived,
alias: outOfBandRecord.alias,
theirLabel: message.label,
imageUrl: message.imageUrl,
outOfBandId: outOfBandRecord.id,
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/modules/oob/OutOfBandModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const didCommProfiles = ['didcomm/aip1', 'didcomm/aip2;env=rfc19']

export interface CreateOutOfBandInvitationConfig {
label?: string
alias?: string
alias?: string // alias for a connection record to be created
imageUrl?: string
goalCode?: string
goal?: string
Expand All @@ -60,7 +60,7 @@ export interface CreateOutOfBandInvitationConfig {

export interface CreateLegacyInvitationConfig {
label?: string
alias?: string
alias?: string // alias for a connection record to be created
imageUrl?: string
multiUseInvitation?: boolean
autoAcceptConnection?: boolean
Expand Down Expand Up @@ -207,6 +207,7 @@ export class OutOfBandModule {
mediatorId: routing.mediatorId,
role: OutOfBandRole.Sender,
state: OutOfBandState.AwaitResponse,
alias: config.alias,
outOfBandInvitation: outOfBandInvitation,
reusable: multiUseInvitation,
autoAcceptConnection,
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/modules/oob/repository/OutOfBandRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface OutOfBandRecordProps {
outOfBandInvitation: OutOfBandInvitation
role: OutOfBandRole
state: OutOfBandState
alias?: string
autoAcceptConnection?: boolean
reusable?: boolean
mediatorId?: string
Expand All @@ -38,6 +39,7 @@ export class OutOfBandRecord extends BaseRecord<DefaultOutOfBandRecordTags, Cust
public outOfBandInvitation!: OutOfBandInvitation
public role!: OutOfBandRole
public state!: OutOfBandState
public alias?: string
public reusable!: boolean
public autoAcceptConnection?: boolean
public mediatorId?: string
Expand All @@ -55,6 +57,7 @@ export class OutOfBandRecord extends BaseRecord<DefaultOutOfBandRecordTags, Cust
this.outOfBandInvitation = props.outOfBandInvitation
this.role = props.role
this.state = props.state
this.alias = props.alias
this.autoAcceptConnection = props.autoAcceptConnection
this.reusable = props.reusable ?? false
this.mediatorId = props.mediatorId
Expand Down
Loading

0 comments on commit 505436a

Please sign in to comment.