@webda/auth 4.0.0-beta.11 → 4.0.0-beta.13
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/lib/authentication.service.d.ts +17 -4
- package/lib/authentication.service.d.ts.map +1 -1
- package/lib/authentication.service.js +53 -8
- package/lib/authentication.service.js.map +1 -1
- package/lib/certificate/certificate.service.d.ts.map +1 -1
- package/lib/certificate/certificate.service.js.map +1 -1
- package/lib/compat/upgrade.d.ts.map +1 -1
- package/lib/compat/upgrade.js.map +1 -1
- package/lib/email/emailpassword.service.d.ts +15 -3
- package/lib/email/emailpassword.service.d.ts.map +1 -1
- package/lib/email/emailpassword.service.js +33 -5
- package/lib/email/emailpassword.service.js.map +1 -1
- package/lib/email/tokens.d.ts.map +1 -1
- package/lib/email/tokens.js.map +1 -1
- package/lib/errors.d.ts +6 -1
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +8 -1
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/mfa/secondfactor.service.d.ts.map +1 -1
- package/lib/mfa/secondfactor.service.js.map +1 -1
- package/lib/mfa/sms.service.d.ts +99 -0
- package/lib/mfa/sms.service.d.ts.map +1 -0
- package/lib/mfa/sms.service.js +164 -0
- package/lib/mfa/sms.service.js.map +1 -0
- package/lib/mfa/totp.service.d.ts.map +1 -1
- package/lib/mfa/totp.service.js.map +1 -1
- package/lib/oauth/oauth.service.d.ts +2 -0
- package/lib/oauth/oauth.service.d.ts.map +1 -1
- package/lib/oauth/oauth.service.js +2 -0
- package/lib/oauth/oauth.service.js.map +1 -1
- package/lib/provider.d.ts.map +1 -1
- package/lib/provider.js.map +1 -1
- package/lib/test/authtest.d.ts.map +1 -1
- package/lib/test/authtest.js.map +1 -1
- package/lib/test/emailtest.d.ts.map +1 -1
- package/lib/test/emailtest.js.map +1 -1
- package/lib/test/fakeoauth.service.d.ts.map +1 -1
- package/lib/test/fakeoauth.service.js.map +1 -1
- package/lib/test/mfauser.fixture.model.d.ts.map +1 -1
- package/lib/test/mfauser.fixture.model.js.map +1 -1
- package/lib/test/stubprovider.d.ts.map +1 -1
- package/lib/test/stubprovider.js.map +1 -1
- package/lib/test/v3.d.ts.map +1 -1
- package/lib/test/v3.js.map +1 -1
- package/lib/throttle.d.ts.map +1 -1
- package/lib/throttle.js.map +1 -1
- package/package.json +17 -17
- package/webda.module.json +279 -14
package/webda.module.json
CHANGED
|
@@ -255,6 +255,10 @@
|
|
|
255
255
|
},
|
|
256
256
|
"type": "array"
|
|
257
257
|
},
|
|
258
|
+
"baseUrl": {
|
|
259
|
+
"description": "Optional canonical origin (e.g. \"https://api.example.com\") used to build emailed verification and recovery links\ninstead of trusting the request Host header",
|
|
260
|
+
"type": "string"
|
|
261
|
+
},
|
|
258
262
|
"mailer": {
|
|
259
263
|
"default": "Mailer",
|
|
260
264
|
"description": "Mailer service name",
|
|
@@ -327,6 +331,91 @@
|
|
|
327
331
|
},
|
|
328
332
|
"Configuration": "lib/email/emailpassword.service:EmailPasswordParameters"
|
|
329
333
|
},
|
|
334
|
+
"Webda/SmsMfaService": {
|
|
335
|
+
"Import": "lib/mfa/sms.service:SmsMfaService",
|
|
336
|
+
"Schema": {
|
|
337
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
338
|
+
"additionalProperties": false,
|
|
339
|
+
"definitions": {
|
|
340
|
+
"ThrottleParameters": {
|
|
341
|
+
"additionalProperties": false,
|
|
342
|
+
"description": "Throttle configuration options",
|
|
343
|
+
"properties": {
|
|
344
|
+
"failedBeforeDelay": {
|
|
345
|
+
"description": "Failures allowed before lockout engages",
|
|
346
|
+
"type": "number"
|
|
347
|
+
},
|
|
348
|
+
"lockout": {
|
|
349
|
+
"description": "Lockout duration in milliseconds",
|
|
350
|
+
"type": "number"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"type": "object"
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"description": "Parameters for the SMS second factor",
|
|
357
|
+
"properties": {
|
|
358
|
+
"app": {
|
|
359
|
+
"description": "Application name in the message (defaults to the application package name)",
|
|
360
|
+
"type": "string"
|
|
361
|
+
},
|
|
362
|
+
"digits": {
|
|
363
|
+
"description": "Number of digits of a code",
|
|
364
|
+
"maximum": 10,
|
|
365
|
+
"minimum": 4,
|
|
366
|
+
"type": "number"
|
|
367
|
+
},
|
|
368
|
+
"message": {
|
|
369
|
+
"default": "{code} is your {app} verification code",
|
|
370
|
+
"description": "Message template, `{code}` and `{app}` are replaced",
|
|
371
|
+
"type": "string"
|
|
372
|
+
},
|
|
373
|
+
"recoveryCodes": {
|
|
374
|
+
"description": "Number of recovery codes generated (default 10, 0 disables recovery codes)",
|
|
375
|
+
"type": "number"
|
|
376
|
+
},
|
|
377
|
+
"resendDelay": {
|
|
378
|
+
"default": "60s",
|
|
379
|
+
"description": "Minimum delay between two codes sent to the same factor: seconds or a duration string such as \"60s\"",
|
|
380
|
+
"type": [
|
|
381
|
+
"string",
|
|
382
|
+
"number"
|
|
383
|
+
]
|
|
384
|
+
},
|
|
385
|
+
"sender": {
|
|
386
|
+
"default": "SmsSender",
|
|
387
|
+
"description": "Name of the {@link SmsSender} service delivering the codes",
|
|
388
|
+
"type": "string"
|
|
389
|
+
},
|
|
390
|
+
"throttle": {
|
|
391
|
+
"$ref": "#/definitions/ThrottleParameters",
|
|
392
|
+
"description": "Throttle config for failed attempts"
|
|
393
|
+
},
|
|
394
|
+
"ttl": {
|
|
395
|
+
"default": "5m",
|
|
396
|
+
"description": "Lifetime of a code: seconds or a duration string such as \"5m\"",
|
|
397
|
+
"type": [
|
|
398
|
+
"string",
|
|
399
|
+
"number"
|
|
400
|
+
]
|
|
401
|
+
},
|
|
402
|
+
"type": {
|
|
403
|
+
"description": "Type of the service",
|
|
404
|
+
"type": "string"
|
|
405
|
+
},
|
|
406
|
+
"openapi": {
|
|
407
|
+
"type": "object",
|
|
408
|
+
"additionalProperties": true
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
"required": [
|
|
412
|
+
"type"
|
|
413
|
+
],
|
|
414
|
+
"type": "object",
|
|
415
|
+
"title": "SmsMfaService"
|
|
416
|
+
},
|
|
417
|
+
"Configuration": "lib/mfa/sms.service:SmsMfaParameters"
|
|
418
|
+
},
|
|
330
419
|
"Webda/TotpService": {
|
|
331
420
|
"Import": "lib/mfa/totp.service:TotpService",
|
|
332
421
|
"Schema": {
|
|
@@ -474,7 +563,14 @@
|
|
|
474
563
|
},
|
|
475
564
|
"Authentication.providers.input": {
|
|
476
565
|
"type": "object",
|
|
477
|
-
"properties": {}
|
|
566
|
+
"properties": {},
|
|
567
|
+
"x-webda-rest": {
|
|
568
|
+
"method": "get",
|
|
569
|
+
"template": "auth/providers",
|
|
570
|
+
"path": [],
|
|
571
|
+
"query": [],
|
|
572
|
+
"body": []
|
|
573
|
+
}
|
|
478
574
|
},
|
|
479
575
|
"Authentication.providers.output": {
|
|
480
576
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -516,14 +612,28 @@
|
|
|
516
612
|
},
|
|
517
613
|
"Authentication.me.input": {
|
|
518
614
|
"type": "object",
|
|
519
|
-
"properties": {}
|
|
615
|
+
"properties": {},
|
|
616
|
+
"x-webda-rest": {
|
|
617
|
+
"method": "get",
|
|
618
|
+
"template": "auth/me",
|
|
619
|
+
"path": [],
|
|
620
|
+
"query": [],
|
|
621
|
+
"body": []
|
|
622
|
+
}
|
|
520
623
|
},
|
|
521
624
|
"Authentication.me.output": {
|
|
522
625
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
523
626
|
},
|
|
524
627
|
"Authentication.logout.input": {
|
|
525
628
|
"type": "object",
|
|
526
|
-
"properties": {}
|
|
629
|
+
"properties": {},
|
|
630
|
+
"x-webda-rest": {
|
|
631
|
+
"method": "post",
|
|
632
|
+
"template": "auth/logout",
|
|
633
|
+
"path": [],
|
|
634
|
+
"query": [],
|
|
635
|
+
"body": []
|
|
636
|
+
}
|
|
527
637
|
},
|
|
528
638
|
"Authentication.logout.output": {
|
|
529
639
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -538,7 +648,16 @@
|
|
|
538
648
|
},
|
|
539
649
|
"required": [
|
|
540
650
|
"refreshToken"
|
|
541
|
-
]
|
|
651
|
+
],
|
|
652
|
+
"x-webda-rest": {
|
|
653
|
+
"method": "post",
|
|
654
|
+
"template": "auth/refresh",
|
|
655
|
+
"path": [],
|
|
656
|
+
"query": [],
|
|
657
|
+
"body": [
|
|
658
|
+
"refreshToken"
|
|
659
|
+
]
|
|
660
|
+
}
|
|
542
661
|
},
|
|
543
662
|
"Authentication.refresh.output": {
|
|
544
663
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -564,7 +683,14 @@
|
|
|
564
683
|
},
|
|
565
684
|
"Authentication.idents.input": {
|
|
566
685
|
"type": "object",
|
|
567
|
-
"properties": {}
|
|
686
|
+
"properties": {},
|
|
687
|
+
"x-webda-rest": {
|
|
688
|
+
"method": "get",
|
|
689
|
+
"template": "auth/idents",
|
|
690
|
+
"path": [],
|
|
691
|
+
"query": [],
|
|
692
|
+
"body": []
|
|
693
|
+
}
|
|
568
694
|
},
|
|
569
695
|
"Authentication.idents.output": {
|
|
570
696
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -615,7 +741,17 @@
|
|
|
615
741
|
"required": [
|
|
616
742
|
"provider",
|
|
617
743
|
"providerUid"
|
|
618
|
-
]
|
|
744
|
+
],
|
|
745
|
+
"x-webda-rest": {
|
|
746
|
+
"method": "post",
|
|
747
|
+
"template": "auth/idents/unlink",
|
|
748
|
+
"path": [],
|
|
749
|
+
"query": [],
|
|
750
|
+
"body": [
|
|
751
|
+
"provider",
|
|
752
|
+
"providerUid"
|
|
753
|
+
]
|
|
754
|
+
}
|
|
619
755
|
},
|
|
620
756
|
"Authentication.unlink.output": {
|
|
621
757
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -623,7 +759,14 @@
|
|
|
623
759
|
},
|
|
624
760
|
"CertificateProvider.link.input": {
|
|
625
761
|
"type": "object",
|
|
626
|
-
"properties": {}
|
|
762
|
+
"properties": {},
|
|
763
|
+
"x-webda-rest": {
|
|
764
|
+
"method": "post",
|
|
765
|
+
"template": "auth/certificate/link",
|
|
766
|
+
"path": [],
|
|
767
|
+
"query": [],
|
|
768
|
+
"body": []
|
|
769
|
+
}
|
|
627
770
|
},
|
|
628
771
|
"CertificateProvider.link.output": {
|
|
629
772
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -711,7 +854,17 @@
|
|
|
711
854
|
"required": [
|
|
712
855
|
"email",
|
|
713
856
|
"password"
|
|
714
|
-
]
|
|
857
|
+
],
|
|
858
|
+
"x-webda-rest": {
|
|
859
|
+
"method": "post",
|
|
860
|
+
"template": "auth/email/login",
|
|
861
|
+
"path": [],
|
|
862
|
+
"query": [],
|
|
863
|
+
"body": [
|
|
864
|
+
"email",
|
|
865
|
+
"password"
|
|
866
|
+
]
|
|
867
|
+
}
|
|
715
868
|
},
|
|
716
869
|
"EmailPasswordProvider.login.output": {
|
|
717
870
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -788,7 +941,19 @@
|
|
|
788
941
|
"required": [
|
|
789
942
|
"email",
|
|
790
943
|
"password"
|
|
791
|
-
]
|
|
944
|
+
],
|
|
945
|
+
"x-webda-rest": {
|
|
946
|
+
"method": "post",
|
|
947
|
+
"template": "auth/email/register",
|
|
948
|
+
"path": [],
|
|
949
|
+
"query": [],
|
|
950
|
+
"body": [
|
|
951
|
+
"email",
|
|
952
|
+
"password",
|
|
953
|
+
"token",
|
|
954
|
+
"profile"
|
|
955
|
+
]
|
|
956
|
+
}
|
|
792
957
|
},
|
|
793
958
|
"EmailPasswordProvider.register.output": {
|
|
794
959
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
@@ -802,7 +967,16 @@
|
|
|
802
967
|
},
|
|
803
968
|
"required": [
|
|
804
969
|
"email"
|
|
805
|
-
]
|
|
970
|
+
],
|
|
971
|
+
"x-webda-rest": {
|
|
972
|
+
"method": "post",
|
|
973
|
+
"template": "auth/email/verification",
|
|
974
|
+
"path": [],
|
|
975
|
+
"query": [],
|
|
976
|
+
"body": [
|
|
977
|
+
"email"
|
|
978
|
+
]
|
|
979
|
+
}
|
|
806
980
|
},
|
|
807
981
|
"EmailPasswordProvider.startVerification.output": {
|
|
808
982
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -817,7 +991,16 @@
|
|
|
817
991
|
},
|
|
818
992
|
"required": [
|
|
819
993
|
"token"
|
|
820
|
-
]
|
|
994
|
+
],
|
|
995
|
+
"x-webda-rest": {
|
|
996
|
+
"method": "post",
|
|
997
|
+
"template": "auth/email/verify",
|
|
998
|
+
"path": [],
|
|
999
|
+
"query": [],
|
|
1000
|
+
"body": [
|
|
1001
|
+
"token"
|
|
1002
|
+
]
|
|
1003
|
+
}
|
|
821
1004
|
},
|
|
822
1005
|
"EmailPasswordProvider.verify.output": {
|
|
823
1006
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -842,7 +1025,16 @@
|
|
|
842
1025
|
},
|
|
843
1026
|
"required": [
|
|
844
1027
|
"email"
|
|
845
|
-
]
|
|
1028
|
+
],
|
|
1029
|
+
"x-webda-rest": {
|
|
1030
|
+
"method": "post",
|
|
1031
|
+
"template": "auth/password/recovery",
|
|
1032
|
+
"path": [],
|
|
1033
|
+
"query": [],
|
|
1034
|
+
"body": [
|
|
1035
|
+
"email"
|
|
1036
|
+
]
|
|
1037
|
+
}
|
|
846
1038
|
},
|
|
847
1039
|
"EmailPasswordProvider.startRecovery.output": {
|
|
848
1040
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -861,7 +1053,17 @@
|
|
|
861
1053
|
"required": [
|
|
862
1054
|
"token",
|
|
863
1055
|
"password"
|
|
864
|
-
]
|
|
1056
|
+
],
|
|
1057
|
+
"x-webda-rest": {
|
|
1058
|
+
"method": "post",
|
|
1059
|
+
"template": "auth/password/recover",
|
|
1060
|
+
"path": [],
|
|
1061
|
+
"query": [],
|
|
1062
|
+
"body": [
|
|
1063
|
+
"token",
|
|
1064
|
+
"password"
|
|
1065
|
+
]
|
|
1066
|
+
}
|
|
865
1067
|
},
|
|
866
1068
|
"EmailPasswordProvider.recover.output": {
|
|
867
1069
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -875,12 +1077,75 @@
|
|
|
875
1077
|
},
|
|
876
1078
|
"next": {
|
|
877
1079
|
"type": "string"
|
|
1080
|
+
},
|
|
1081
|
+
"escrow": {
|
|
1082
|
+
"additionalProperties": false,
|
|
1083
|
+
"description": "Keyring key wrapped by a KDF-derived KEK (AES-GCM), the parameters are stored so they can evolve\n\n`kid` is the active key the keyring was encrypted for when the escrow was made, in clear and outside the AAD: the\nserver refuses an escrow made for another key than its active one (a device that missed a rotation).",
|
|
1084
|
+
"properties": {
|
|
1085
|
+
"ct": {
|
|
1086
|
+
"type": "string"
|
|
1087
|
+
},
|
|
1088
|
+
"iv": {
|
|
1089
|
+
"type": "string"
|
|
1090
|
+
},
|
|
1091
|
+
"kdf": {
|
|
1092
|
+
"description": "Supported password KDFs",
|
|
1093
|
+
"enum": [
|
|
1094
|
+
"argon2id",
|
|
1095
|
+
"pbkdf2-sha256"
|
|
1096
|
+
],
|
|
1097
|
+
"type": "string"
|
|
1098
|
+
},
|
|
1099
|
+
"kdfParams": {
|
|
1100
|
+
"type": "object"
|
|
1101
|
+
},
|
|
1102
|
+
"kid": {
|
|
1103
|
+
"description": "Active key id when the escrow was created",
|
|
1104
|
+
"type": "string"
|
|
1105
|
+
},
|
|
1106
|
+
"kind": {
|
|
1107
|
+
"enum": [
|
|
1108
|
+
"password",
|
|
1109
|
+
"recovery"
|
|
1110
|
+
],
|
|
1111
|
+
"type": "string"
|
|
1112
|
+
},
|
|
1113
|
+
"salt": {
|
|
1114
|
+
"type": "string"
|
|
1115
|
+
},
|
|
1116
|
+
"v": {
|
|
1117
|
+
"const": 1,
|
|
1118
|
+
"type": "number"
|
|
1119
|
+
}
|
|
1120
|
+
},
|
|
1121
|
+
"required": [
|
|
1122
|
+
"ct",
|
|
1123
|
+
"iv",
|
|
1124
|
+
"kdf",
|
|
1125
|
+
"kdfParams",
|
|
1126
|
+
"kid",
|
|
1127
|
+
"kind",
|
|
1128
|
+
"salt",
|
|
1129
|
+
"v"
|
|
1130
|
+
],
|
|
1131
|
+
"type": "object"
|
|
878
1132
|
}
|
|
879
1133
|
},
|
|
880
1134
|
"required": [
|
|
881
1135
|
"current",
|
|
882
1136
|
"next"
|
|
883
|
-
]
|
|
1137
|
+
],
|
|
1138
|
+
"x-webda-rest": {
|
|
1139
|
+
"method": "post",
|
|
1140
|
+
"template": "auth/password/change",
|
|
1141
|
+
"path": [],
|
|
1142
|
+
"query": [],
|
|
1143
|
+
"body": [
|
|
1144
|
+
"current",
|
|
1145
|
+
"next",
|
|
1146
|
+
"escrow"
|
|
1147
|
+
]
|
|
1148
|
+
}
|
|
884
1149
|
},
|
|
885
1150
|
"EmailPasswordProvider.changePassword.output": {
|
|
886
1151
|
"$schema": "http://json-schema.org/draft-07/schema#",
|