@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.
@@ -10,7 +10,7 @@ entity:
10
10
  type: object
11
11
  properties: &properties
12
12
  authority: { type: string }
13
- username: { type: string }
13
+ username: { type: string, minLength: 1, maxLength: 256 }
14
14
  identity: *id
15
15
  required: [authority, username]
16
16
  index:
@@ -25,9 +25,10 @@ operations:
25
25
  <<: *properties
26
26
  identity: *id
27
27
  lifetime: &lifetime
28
+ description: OTP expiration time in seconds
28
29
  type: number
29
30
  minimum: 1
30
- maximum: 36000 # 10 hours
31
+ maximum: 3600
31
32
  required: [authority, username]
32
33
  authenticate:
33
34
  input:
@@ -49,7 +50,20 @@ configuration:
49
50
  schema:
50
51
  properties:
51
52
  lifetime:
53
+ description: OTP expiration time in seconds
52
54
  <<: *lifetime
53
55
  default: 300
54
56
 
55
57
  stash: ~
58
+
59
+ exposition:
60
+ /:identity:
61
+ auth:id: identity
62
+ auth:role: system:identity:otp
63
+ POST:
64
+ io:input: []
65
+ io:output: [code]
66
+ map:authority: authority
67
+ map:segments:
68
+ username: identity
69
+ endpoint: issue
@@ -21,7 +21,7 @@ async function effect(input, context) {
21
21
  });
22
22
  if (entry === null)
23
23
  return ERR_NOT_FOUND;
24
- const id = entry.identity ?? entry.id;
24
+ const id = entry.identity ?? entry.id; // identity inception
25
25
  return { identity: { id } };
26
26
  }
27
27
  exports.effect = effect;
@@ -1 +1 @@
1
- {"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../source/authenticate.ts"],"names":[],"mappings":";;;AAAA,6CAAiC;AAG1B,KAAK,UAAU,MAAM,CAAE,KAAY,EAAE,OAAgB;IAC1D,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IACxC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,EA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