Skip to content

Commit

Permalink
chore: Fix import, prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Feb 25, 2022
1 parent 45cea11 commit f1e08f7
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 68 deletions.
8 changes: 0 additions & 8 deletions packages/did-auth-siop-op-authenticator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @sphereon/ssi-sdk-did-auth-siop-authenticator





# [0.5.0](https://github.com/Sphereon-Opensource/SSI-SDK/compare/v0.4.0...v0.5.0) (2022-02-23)

**Note:** Version bump only for package @sphereon/ssi-sdk-did-auth-siop-authenticator





# [0.4.0](https://github.com/Sphereon-Opensource/SSI-SDK/compare/v0.3.4...v0.4.0) (2022-02-11)

**Note:** Version bump only for package @sphereon/ssi-sdk-did-auth-siop-authenticator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ export class DidAuthSiopOpAuthenticator implements IAgentPlugin {
return Promise.reject(new Error(`Session with id: ${args.sessionId} already present`))
}

const session = new OpSession({ sessionId, identifier: args.identifier, expiresIn: args.expiresIn, supportedDidMethods: args.supportedDidMethods, context })
const session = new OpSession({
sessionId,
identifier: args.identifier,
expiresIn: args.expiresIn,
supportedDidMethods: args.supportedDidMethods,
context,
})
await session.init()
this.sessions[sessionId] = session

Expand Down
17 changes: 8 additions & 9 deletions packages/did-auth-siop-op-authenticator/src/session/OpSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ import {
IOpsVerifySiopAuthenticationRequestUriArgs,
IAuthRequestDetails,
IMatchedPresentationDefinition,
IRequiredContext, ProvidedDidResolver,
IRequiredContext,
ProvidedDidResolver,
} from '../types/IDidAuthSiopOpAuthenticator'
import { Resolvable } from 'did-resolver'

const fetch = require('cross-fetch')


export class OpSession {
public readonly id: string
public readonly identifier: IIdentifier
Expand Down Expand Up @@ -79,7 +78,7 @@ export class OpSession {
}

public async getSiopAuthenticationRequestFromRP(args: IOpsGetSiopAuthenticationRequestFromRpArgs): Promise<SIOP.ParsedAuthenticationRequestURI> {
const url = args.stateId ?`${args.redirectUrl}?stateId=${args.stateId}` : args.redirectUrl
const url = args.stateId ? `${args.redirectUrl}?stateId=${args.stateId}` : args.redirectUrl
return fetch(url)
.then(async (response: Response) =>
response.status >= 400 ? Promise.reject(new Error(await response.text())) : this.op!.parseAuthenticationRequestURI(await response.text())
Expand Down Expand Up @@ -134,9 +133,9 @@ export class OpSession {
public async sendSiopAuthenticationResponse(args: IOpsSendSiopAuthenticationResponseArgs): Promise<Response> {
const verification = {
mode: SIOP.VerificationMode.INTERNAL,
resolveOpts: {
didMethods: [...this.supportedDidMethods, parseDid(this.identifier.did).method]
}
resolveOpts: {
didMethods: [...this.supportedDidMethods, parseDid(this.identifier.did).method],
},
}
return this.op!.createAuthenticationResponse(args.verifiedAuthenticationRequest, { vp: args.verifiablePresentationResponse, verification })
.then((authResponse) => this.op!.submitAuthenticationResponse(authResponse))
Expand Down Expand Up @@ -236,10 +235,10 @@ export class OpSession {
.registrationBy(SIOP.PassBy.VALUE)
.response(SIOP.ResponseMode.POST)
if (supportedDidMethods) {
supportedDidMethods.forEach(method => builder.addDidMethod(method))
supportedDidMethods.forEach((method) => builder.addDidMethod(method))
}
if (providedDidResolvers) {
providedDidResolvers.forEach(providedResolver => builder.addResolver(providedResolver.didMethod, providedResolver.resolver))
providedDidResolvers.forEach((providedResolver) => builder.addResolver(providedResolver.didMethod, providedResolver.resolver))
}

return builder.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface IDidAuthSiopOpAuthenticator extends IPluginMethodMap {
removeCustomApprovalForSiop(args: IRemoveCustomApprovalForSiopArgs, context: IRequiredContext): Promise<boolean>
}
export interface ProvidedDidResolver {
didMethod: string,
didMethod: string
resolver: Resolvable
}

Expand Down
4 changes: 0 additions & 4 deletions packages/factom-did-provider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @sphereon/ssi-sdk-factom-did-provider





# [0.4.0](https://github.com/Sphereon-OpenSource/ssi-sdk/compare/v0.3.4...v0.4.0) (2022-02-11)

**Note:** Version bump only for package @sphereon/ssi-sdk-factom-did-provider
Expand Down
4 changes: 0 additions & 4 deletions packages/lto-did-provider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @sphereon/ssi-sdk-lto-did-provider





# [0.4.0](https://github.com/Sphereon-OpenSource/ssi-sdk/compare/v0.3.4...v0.4.0) (2022-02-11)

**Note:** Version bump only for package @sphereon/ssi-sdk-lto-did-provider
Expand Down
4 changes: 0 additions & 4 deletions packages/mnemonic-seed-manager/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @sphereon/ssi-sdk-mnemonic-seed-manager





# [0.4.0](https://github.com/Sphereon-Opensource/SSI-SDK/compare/v0.3.4...v0.4.0) (2022-02-11)

**Note:** Version bump only for package @sphereon/ssi-sdk-mnemonic-seed-manager
Expand Down
4 changes: 0 additions & 4 deletions packages/ssi-sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @sphereon/ssi-sdk-core





# [0.4.0](https://github.com/Sphereon-OpenSource/ssi-sdk/compare/v0.3.4...v0.4.0) (2022-02-11)

**Note:** Version bump only for package @sphereon/ssi-sdk-core
Expand Down
4 changes: 0 additions & 4 deletions packages/vc-api-issuer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @sphereon/ssi-sdk-vc-api-issuer





# [0.4.0](https://github.com/Sphereon-Opensource/SSI-SDK/compare/v0.3.4...v0.4.0) (2022-02-11)

**Note:** Version bump only for package @sphereon/ssi-sdk-vc-api-issuer
Expand Down
4 changes: 0 additions & 4 deletions packages/vc-api-verifier/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @sphereon/ssi-sdk-vc-api-verifier





# [0.4.0](https://github.com/Sphereon-Opensource/SSI-SDK/compare/v0.3.4...v0.4.0) (2022-02-11)

**Note:** Version bump only for package @sphereon/ssi-sdk-vc-api-verifier
Expand Down
4 changes: 0 additions & 4 deletions packages/vc-handler-ld-local/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @sphereon/ssi-sdk-vc-handler-ld-local





# [0.4.0](https://github.com/Sphereon-Opensource/SSI-SDK/compare/v0.3.4...v0.4.0) (2022-02-11)

**Note:** Version bump only for package @sphereon/ssi-sdk-vc-handler-ld-local
Expand Down
7 changes: 1 addition & 6 deletions packages/waci-pex-qr-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

# [0.5.0](https://github.com/Sphereon-Opensource/SSI-SDK/compare/v0.4.0...v0.5.0) (2022-02-23)


### Features

* Update waci pex implementation as it was serializing a SIOP Auth request including all options like private keys, not conforming to WACI-PEX ([90a1cba](https://github.com/Sphereon-Opensource/SSI-SDK/commit/90a1cba359b7a946951ef0d47746d01b3cbc225e))




- Update waci pex implementation as it was serializing a SIOP Auth request including all options like private keys, not conforming to WACI-PEX ([90a1cba](https://github.com/Sphereon-Opensource/SSI-SDK/commit/90a1cba359b7a946951ef0d47746d01b3cbc225e))

# [0.4.0](https://github.com/Sphereon-Opensource/SSI-SDK/compare/v0.3.4...v0.4.0) (2022-02-11)

Expand Down
23 changes: 9 additions & 14 deletions packages/waci-pex-qr-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ possible `accept` value may be:
#### Importing the plugin

```typescript
import { WaciQrCodeProvider } from "@sphereon/ssi-sdk-waci-pex-qr-react";
import { WaciQrCodeProvider } from '@sphereon/ssi-sdk-waci-pex-qr-react'

// Include in the interface
// const agent = createAgent<... WaciQrCodeProvider>
Expand All @@ -68,15 +68,14 @@ plugins: [
#### Export for the function

```typescript
export const createSsiQrCode = agent.ssiQrCode;
export const createSsiQrCode = agent.ssiQrCode
```

The function declared in agent can be imported for usage like below:

```typescript
import { createSsiQrCode } from '../agent';
import { QRContent, QRType } from "@sphereon/ssi-sdk-waci-pex-qr-react";

import { createSsiQrCode } from '../agent'
import { QRContent, QRType } from '@sphereon/ssi-sdk-waci-pex-qr-react'
```

#### Inside the component we can declare or get the values to pass to QR Code plugin
Expand Down Expand Up @@ -122,9 +121,7 @@ On generate gives the following (example) output
"from": "did:key:zrfdjkgfjgfdjk",
"body": {
"goal-code": "streamlined-vp",
"accept": [
"siopv2+oidc4vp"
]
"accept": ["siopv2+oidc4vp"]
}
}
```
Expand All @@ -135,16 +132,14 @@ If you want to create the payload manually and want to do serialization yourself
const payload = OutOfBandMessage.createPayload(getOobQrCodeProps())
const encoded = OutOfBandMessage.urlEncode(payload)
const url = oobQRProps.oobBaseUrl + encoded
console.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19
console.log(url) // https://example.com/?oob=eyJ0eXBlIjoic2lvcHYyIiwiaWQiOiI1OTlmMzYzOC1iNTYzLTQ5MzctOTQ4Ny1kZmU1NTA5OWQ5MDAiLCJmcm9tIjoiZGlkOmtleTp6cmZkamtnZmpnZmRqayIsImJvZHkiOnsiZ29hbC1jb2RlIjoic3RyZWFtbGluZWQtdnAiLCJhY2NlcHQiOlsic2lvcHYyK29pZGM0dnAiXX19
```

#### For rendering add to the view

```jsx
<View>
<View>
//...
{
this.delegateCreateOobQRCode()
}
</View>
{this.delegateCreateOobQRCode()}
</View>
```
1 change: 0 additions & 1 deletion packages/waci-pex-qr-react/src/types/WaciTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export enum StatusCode {
CREATED = 'CREATED',
}


/*
TODO: See whether we need this. Not in the spec currently
export interface WebRedirect {
Expand Down

0 comments on commit f1e08f7

Please sign in to comment.