@toa.io/extensions.exposition 1.0.0-alpha.217 → 1.0.0-alpha.219
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/identity.bans/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.keys/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.otp/manifest.toa.yaml +16 -2
- package/components/identity.otp/operations/authenticate.js +1 -1
- package/components/identity.otp/operations/authenticate.js.map +1 -1
- package/components/identity.otp/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.otp/source/authenticate.ts +1 -1
- package/components/identity.passkeys/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.roles/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.tokens/operations/tsconfig.tsbuildinfo +1 -1
- package/features/identity.otp.feature +30 -0
- package/features/steps/Captures.ts +12 -0
- package/features/steps/HTTP.ts +1 -0
- package/package.json +6 -6
- package/transpiled/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/operations/lib/Context.d.ts +0 -7
- package/components/identity.federation/operations/lib/Context.js +0 -3
- package/components/identity.federation/operations/lib/Context.js.map +0 -1
|
@@ -69,3 +69,33 @@ Feature: OTP authentication
|
|
|
69
69
|
"""
|
|
70
70
|
401 Unauthorized
|
|
71
71
|
"""
|
|
72
|
+
|
|
73
|
+
Scenario: Generate own OTP
|
|
74
|
+
Given transient identity bob
|
|
75
|
+
When the following request is received:
|
|
76
|
+
"""
|
|
77
|
+
POST /identity/otp/${{ bob.id }}/ HTTP/1.1
|
|
78
|
+
host: nex.toa.io
|
|
79
|
+
authorization: Token ${{ bob.token }}
|
|
80
|
+
accept: application/yaml
|
|
81
|
+
"""
|
|
82
|
+
Then the following reply is sent:
|
|
83
|
+
"""
|
|
84
|
+
201 Created
|
|
85
|
+
|
|
86
|
+
code: '${{ bob.code }}'
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
When the following request is received:
|
|
90
|
+
"""
|
|
91
|
+
GET /identity/ HTTP/1.1
|
|
92
|
+
host: nex.toa.io
|
|
93
|
+
authorization: OTP #{{ otp bob }}
|
|
94
|
+
accept: application/yaml
|
|
95
|
+
"""
|
|
96
|
+
Then the following reply is sent:
|
|
97
|
+
"""
|
|
98
|
+
200 OK
|
|
99
|
+
|
|
100
|
+
id: ${{ bob.id }}
|
|
101
|
+
"""
|
|
@@ -3,4 +3,16 @@ import { binding } from 'cucumber-tsflow'
|
|
|
3
3
|
|
|
4
4
|
@binding()
|
|
5
5
|
export class Captures extends http.Captures {
|
|
6
|
+
public constructor () {
|
|
7
|
+
super(functions)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const functions: http.Functions = {
|
|
12
|
+
otp: function (this: Captures, value: string, arg: string): string {
|
|
13
|
+
const identity = this.get(arg + '.id')
|
|
14
|
+
const code = this.get(arg + '.code')
|
|
15
|
+
|
|
16
|
+
return Buffer.from(`${identity}:${code}`).toString('base64')
|
|
17
|
+
}
|
|
6
18
|
}
|
package/features/steps/HTTP.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.exposition",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.219",
|
|
4
4
|
"description": "Toa Exposition",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@aws-sdk/protocol-http": "3.370.0",
|
|
21
21
|
"@simplewebauthn/server": "13.1.1",
|
|
22
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
23
|
-
"@toa.io/generic": "1.0.0-alpha.
|
|
24
|
-
"@toa.io/schemas": "1.0.0-alpha.
|
|
22
|
+
"@toa.io/core": "1.0.0-alpha.219",
|
|
23
|
+
"@toa.io/generic": "1.0.0-alpha.219",
|
|
24
|
+
"@toa.io/schemas": "1.0.0-alpha.219",
|
|
25
25
|
"bcryptjs": "2.4.3",
|
|
26
26
|
"content-type": "1.0.5",
|
|
27
27
|
"error-value": "0.4.2",
|
|
28
28
|
"jose": "5.10.0",
|
|
29
|
-
"js-yaml": "4.
|
|
29
|
+
"js-yaml": "4.2.0",
|
|
30
30
|
"lru-cache": "11.2.7",
|
|
31
31
|
"matchacho": "0.3.5",
|
|
32
32
|
"minimatch": "10.2.4",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
},
|
|
65
65
|
"testEnvironment": "node"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "c9f3ec1d4b3a17bbe445315f255e589267956eb0"
|
|
68
68
|
}
|