@greensecurity/javascript-sdk 0.45.0-beta.15 → 0.45.0-beta.17
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/dist/commonjs/__tests__/vendors.test.js +1 -1
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +5 -6
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +2 -27
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/reportsGetFullReport.d.ts +3 -3
- package/dist/commonjs/funcs/reportsGetFullReport.js +3 -3
- package/dist/commonjs/funcs/usersPostAuthenticate.d.ts +37 -0
- package/dist/commonjs/funcs/usersPostAuthenticate.d.ts.map +1 -1
- package/dist/commonjs/funcs/usersPostAuthenticate.js +37 -0
- package/dist/commonjs/funcs/usersPostAuthenticate.js.map +1 -1
- package/dist/commonjs/funcs/validateWebhook.d.ts +1 -1
- package/dist/commonjs/funcs/validateWebhook.d.ts.map +1 -1
- package/dist/commonjs/funcs/validateWebhook.js +3 -0
- package/dist/commonjs/funcs/validateWebhook.js.map +1 -1
- package/dist/commonjs/funcs/vendorsSendDownloadCode.js +1 -1
- package/dist/commonjs/funcs/vendorsSendDownloadCode.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/authenticatesuccessresponse.d.ts +91 -0
- package/dist/commonjs/models/components/authenticatesuccessresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/authenticatesuccessresponse.js +100 -0
- package/dist/commonjs/models/components/authenticatesuccessresponse.js.map +1 -0
- package/dist/commonjs/models/components/fullreport.d.ts +107 -0
- package/dist/commonjs/models/components/fullreport.d.ts.map +1 -0
- package/dist/commonjs/models/components/fullreport.js +125 -0
- package/dist/commonjs/models/components/fullreport.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +3 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +3 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/loginemailandpassword.d.ts +34 -0
- package/dist/commonjs/models/components/loginemailandpassword.d.ts.map +1 -1
- package/dist/commonjs/models/components/loginemailandpassword.js +2 -0
- package/dist/commonjs/models/components/loginemailandpassword.js.map +1 -1
- package/dist/commonjs/models/components/loginrequirementsfromemail.d.ts +34 -0
- package/dist/commonjs/models/components/loginrequirementsfromemail.d.ts.map +1 -1
- package/dist/commonjs/models/components/loginrequirementsfromemail.js +2 -0
- package/dist/commonjs/models/components/loginrequirementsfromemail.js.map +1 -1
- package/dist/commonjs/models/components/mfarequiredresponse.d.ts +33 -0
- package/dist/commonjs/models/components/mfarequiredresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/mfarequiredresponse.js +2 -0
- package/dist/commonjs/models/components/mfarequiredresponse.js.map +1 -1
- package/dist/commonjs/models/components/passwordnotsetresponse.d.ts +34 -1
- package/dist/commonjs/models/components/passwordnotsetresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/passwordnotsetresponse.js +2 -0
- package/dist/commonjs/models/components/passwordnotsetresponse.js.map +1 -1
- package/dist/commonjs/models/components/passwordrequiredresponse.d.ts +33 -0
- package/dist/commonjs/models/components/passwordrequiredresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/passwordrequiredresponse.js +6 -0
- package/dist/commonjs/models/components/passwordrequiredresponse.js.map +1 -1
- package/dist/commonjs/models/components/samlloginrequiredresponse.d.ts +33 -0
- package/dist/commonjs/models/components/samlloginrequiredresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/samlloginrequiredresponse.js +2 -0
- package/dist/commonjs/models/components/samlloginrequiredresponse.js.map +1 -1
- package/dist/commonjs/models/components/ssocontinuation.d.ts +44 -0
- package/dist/commonjs/models/components/ssocontinuation.d.ts.map +1 -0
- package/dist/commonjs/models/components/ssocontinuation.js +56 -0
- package/dist/commonjs/models/components/ssocontinuation.js.map +1 -0
- package/dist/commonjs/models/components/webhooksubscription.d.ts +3 -0
- package/dist/commonjs/models/components/webhooksubscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/webhooksubscription.js +3 -0
- package/dist/commonjs/models/components/webhooksubscription.js.map +1 -1
- package/dist/commonjs/models/components/webhooksubscriptiondetail.d.ts +1 -0
- package/dist/commonjs/models/components/webhooksubscriptiondetail.d.ts.map +1 -1
- package/dist/commonjs/models/components/webhooksubscriptiondetail.js +1 -0
- package/dist/commonjs/models/components/webhooksubscriptiondetail.js.map +1 -1
- package/dist/commonjs/models/operations/postauthenticate.d.ts +1 -1
- package/dist/commonjs/models/operations/postauthenticate.d.ts.map +1 -1
- package/dist/commonjs/models/operations/postauthenticate.js +1 -1
- package/dist/commonjs/models/operations/postauthenticate.js.map +1 -1
- package/dist/commonjs/models/webhooks/index.d.ts +3 -0
- package/dist/commonjs/models/webhooks/index.d.ts.map +1 -1
- package/dist/commonjs/models/webhooks/index.js +3 -0
- package/dist/commonjs/models/webhooks/index.js.map +1 -1
- package/dist/commonjs/models/webhooks/sendfullreportcreated.d.ts +42 -0
- package/dist/commonjs/models/webhooks/sendfullreportcreated.d.ts.map +1 -0
- package/dist/commonjs/models/webhooks/sendfullreportcreated.js +85 -0
- package/dist/commonjs/models/webhooks/sendfullreportcreated.js.map +1 -0
- package/dist/commonjs/models/webhooks/sendfullreportdestroyed.d.ts +42 -0
- package/dist/commonjs/models/webhooks/sendfullreportdestroyed.d.ts.map +1 -0
- package/dist/commonjs/models/webhooks/sendfullreportdestroyed.js +85 -0
- package/dist/commonjs/models/webhooks/sendfullreportdestroyed.js.map +1 -0
- package/dist/commonjs/models/webhooks/sendfullreportupdated.d.ts +42 -0
- package/dist/commonjs/models/webhooks/sendfullreportupdated.d.ts.map +1 -0
- package/dist/commonjs/models/webhooks/sendfullreportupdated.js +85 -0
- package/dist/commonjs/models/webhooks/sendfullreportupdated.js.map +1 -0
- package/dist/commonjs/react-query/reportsGetFullReport.d.ts +6 -6
- package/dist/commonjs/react-query/reportsGetFullReport.js +6 -6
- package/dist/commonjs/react-query/usersPostAuthenticate.d.ts +37 -0
- package/dist/commonjs/react-query/usersPostAuthenticate.d.ts.map +1 -1
- package/dist/commonjs/react-query/usersPostAuthenticate.js +37 -0
- package/dist/commonjs/react-query/usersPostAuthenticate.js.map +1 -1
- package/dist/commonjs/sdk/reports.d.ts +3 -3
- package/dist/commonjs/sdk/reports.js +3 -3
- package/dist/commonjs/sdk/sdk.d.ts +1 -1
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/users.d.ts +37 -0
- package/dist/commonjs/sdk/users.d.ts.map +1 -1
- package/dist/commonjs/sdk/users.js +37 -0
- package/dist/commonjs/sdk/users.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +1 -1
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +5 -6
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +2 -27
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/reportsGetFullReport.d.ts +3 -3
- package/dist/esm/funcs/reportsGetFullReport.js +3 -3
- package/dist/esm/funcs/usersPostAuthenticate.d.ts +37 -0
- package/dist/esm/funcs/usersPostAuthenticate.d.ts.map +1 -1
- package/dist/esm/funcs/usersPostAuthenticate.js +37 -0
- package/dist/esm/funcs/usersPostAuthenticate.js.map +1 -1
- package/dist/esm/funcs/validateWebhook.d.ts +1 -1
- package/dist/esm/funcs/validateWebhook.d.ts.map +1 -1
- package/dist/esm/funcs/validateWebhook.js +3 -0
- package/dist/esm/funcs/validateWebhook.js.map +1 -1
- package/dist/esm/funcs/vendorsSendDownloadCode.js +1 -1
- package/dist/esm/funcs/vendorsSendDownloadCode.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/authenticatesuccessresponse.d.ts +91 -0
- package/dist/esm/models/components/authenticatesuccessresponse.d.ts.map +1 -0
- package/dist/esm/models/components/authenticatesuccessresponse.js +61 -0
- package/dist/esm/models/components/authenticatesuccessresponse.js.map +1 -0
- package/dist/esm/models/components/fullreport.d.ts +107 -0
- package/dist/esm/models/components/fullreport.d.ts.map +1 -0
- package/dist/esm/models/components/fullreport.js +87 -0
- package/dist/esm/models/components/fullreport.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +3 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +3 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/loginemailandpassword.d.ts +34 -0
- package/dist/esm/models/components/loginemailandpassword.d.ts.map +1 -1
- package/dist/esm/models/components/loginemailandpassword.js +2 -0
- package/dist/esm/models/components/loginemailandpassword.js.map +1 -1
- package/dist/esm/models/components/loginrequirementsfromemail.d.ts +34 -0
- package/dist/esm/models/components/loginrequirementsfromemail.d.ts.map +1 -1
- package/dist/esm/models/components/loginrequirementsfromemail.js +2 -0
- package/dist/esm/models/components/loginrequirementsfromemail.js.map +1 -1
- package/dist/esm/models/components/mfarequiredresponse.d.ts +33 -0
- package/dist/esm/models/components/mfarequiredresponse.d.ts.map +1 -1
- package/dist/esm/models/components/mfarequiredresponse.js +2 -0
- package/dist/esm/models/components/mfarequiredresponse.js.map +1 -1
- package/dist/esm/models/components/passwordnotsetresponse.d.ts +34 -1
- package/dist/esm/models/components/passwordnotsetresponse.d.ts.map +1 -1
- package/dist/esm/models/components/passwordnotsetresponse.js +2 -0
- package/dist/esm/models/components/passwordnotsetresponse.js.map +1 -1
- package/dist/esm/models/components/passwordrequiredresponse.d.ts +33 -0
- package/dist/esm/models/components/passwordrequiredresponse.d.ts.map +1 -1
- package/dist/esm/models/components/passwordrequiredresponse.js +6 -0
- package/dist/esm/models/components/passwordrequiredresponse.js.map +1 -1
- package/dist/esm/models/components/samlloginrequiredresponse.d.ts +33 -0
- package/dist/esm/models/components/samlloginrequiredresponse.d.ts.map +1 -1
- package/dist/esm/models/components/samlloginrequiredresponse.js +2 -0
- package/dist/esm/models/components/samlloginrequiredresponse.js.map +1 -1
- package/dist/esm/models/components/ssocontinuation.d.ts +44 -0
- package/dist/esm/models/components/ssocontinuation.d.ts.map +1 -0
- package/dist/esm/models/components/ssocontinuation.js +19 -0
- package/dist/esm/models/components/ssocontinuation.js.map +1 -0
- package/dist/esm/models/components/webhooksubscription.d.ts +3 -0
- package/dist/esm/models/components/webhooksubscription.d.ts.map +1 -1
- package/dist/esm/models/components/webhooksubscription.js +3 -0
- package/dist/esm/models/components/webhooksubscription.js.map +1 -1
- package/dist/esm/models/components/webhooksubscriptiondetail.d.ts +1 -0
- package/dist/esm/models/components/webhooksubscriptiondetail.d.ts.map +1 -1
- package/dist/esm/models/components/webhooksubscriptiondetail.js +1 -0
- package/dist/esm/models/components/webhooksubscriptiondetail.js.map +1 -1
- package/dist/esm/models/operations/postauthenticate.d.ts +1 -1
- package/dist/esm/models/operations/postauthenticate.d.ts.map +1 -1
- package/dist/esm/models/operations/postauthenticate.js +1 -1
- package/dist/esm/models/operations/postauthenticate.js.map +1 -1
- package/dist/esm/models/webhooks/index.d.ts +3 -0
- package/dist/esm/models/webhooks/index.d.ts.map +1 -1
- package/dist/esm/models/webhooks/index.js +3 -0
- package/dist/esm/models/webhooks/index.js.map +1 -1
- package/dist/esm/models/webhooks/sendfullreportcreated.d.ts +42 -0
- package/dist/esm/models/webhooks/sendfullreportcreated.d.ts.map +1 -0
- package/dist/esm/models/webhooks/sendfullreportcreated.js +47 -0
- package/dist/esm/models/webhooks/sendfullreportcreated.js.map +1 -0
- package/dist/esm/models/webhooks/sendfullreportdestroyed.d.ts +42 -0
- package/dist/esm/models/webhooks/sendfullreportdestroyed.d.ts.map +1 -0
- package/dist/esm/models/webhooks/sendfullreportdestroyed.js +47 -0
- package/dist/esm/models/webhooks/sendfullreportdestroyed.js.map +1 -0
- package/dist/esm/models/webhooks/sendfullreportupdated.d.ts +42 -0
- package/dist/esm/models/webhooks/sendfullreportupdated.d.ts.map +1 -0
- package/dist/esm/models/webhooks/sendfullreportupdated.js +47 -0
- package/dist/esm/models/webhooks/sendfullreportupdated.js.map +1 -0
- package/dist/esm/react-query/reportsGetFullReport.d.ts +6 -6
- package/dist/esm/react-query/reportsGetFullReport.js +6 -6
- package/dist/esm/react-query/usersPostAuthenticate.d.ts +37 -0
- package/dist/esm/react-query/usersPostAuthenticate.d.ts.map +1 -1
- package/dist/esm/react-query/usersPostAuthenticate.js +37 -0
- package/dist/esm/react-query/usersPostAuthenticate.js.map +1 -1
- package/dist/esm/sdk/reports.d.ts +3 -3
- package/dist/esm/sdk/reports.js +3 -3
- package/dist/esm/sdk/sdk.d.ts +1 -1
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/users.d.ts +37 -0
- package/dist/esm/sdk/users.d.ts.map +1 -1
- package/dist/esm/sdk/users.js +37 -0
- package/dist/esm/sdk/users.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/vendors.test.ts +1 -1
- package/src/__tests__/webhooks.test.ts +5 -6
- package/src/__tests__/zones.test.ts +2 -27
- package/src/funcs/reportsGetFullReport.ts +3 -3
- package/src/funcs/usersPostAuthenticate.ts +37 -0
- package/src/funcs/validateWebhook.ts +6 -0
- package/src/funcs/vendorsSendDownloadCode.ts +1 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/authenticatesuccessresponse.ts +189 -0
- package/src/models/components/fullreport.ts +193 -0
- package/src/models/components/index.ts +3 -0
- package/src/models/components/loginemailandpassword.ts +36 -0
- package/src/models/components/loginrequirementsfromemail.ts +36 -0
- package/src/models/components/mfarequiredresponse.ts +35 -0
- package/src/models/components/passwordnotsetresponse.ts +36 -1
- package/src/models/components/passwordrequiredresponse.ts +39 -0
- package/src/models/components/samlloginrequiredresponse.ts +35 -0
- package/src/models/components/ssocontinuation.ts +71 -0
- package/src/models/components/webhooksubscription.ts +3 -0
- package/src/models/components/webhooksubscriptiondetail.ts +1 -0
- package/src/models/operations/postauthenticate.ts +2 -2
- package/src/models/webhooks/index.ts +3 -0
- package/src/models/webhooks/sendfullreportcreated.ts +104 -0
- package/src/models/webhooks/sendfullreportdestroyed.ts +104 -0
- package/src/models/webhooks/sendfullreportupdated.ts +104 -0
- package/src/react-query/reportsGetFullReport.ts +6 -6
- package/src/react-query/usersPostAuthenticate.ts +37 -0
- package/src/sdk/reports.ts +3 -3
- package/src/sdk/sdk.ts +3 -0
- package/src/sdk/users.ts +37 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export type SendFullReportUpdatedRequest = {
|
|
14
|
+
/**
|
|
15
|
+
* `t=<unix seconds>,v1=<hex hmac>`, one `v1` per active secret. Each is
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* `HMAC-SHA256(secret, "<t>.<raw body>")`. Compare with a constant-time function and
|
|
19
|
+
* reject a timestamp that is not recent.
|
|
20
|
+
*/
|
|
21
|
+
greenSecuritySignature: string;
|
|
22
|
+
/**
|
|
23
|
+
* The event this delivery belongs to. Route on it when one URL serves several events.
|
|
24
|
+
*/
|
|
25
|
+
greenSecurityEvent: string;
|
|
26
|
+
/**
|
|
27
|
+
* Stable per delivery, including across retries. Key your de-duplication on it.
|
|
28
|
+
*/
|
|
29
|
+
greenSecurityIdempotencyKey: string;
|
|
30
|
+
/**
|
|
31
|
+
* The entity in the body.
|
|
32
|
+
*/
|
|
33
|
+
greenWebhookId: string;
|
|
34
|
+
fullReport: components.FullReport;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const SendFullReportUpdatedRequest$inboundSchema: z.ZodType<
|
|
39
|
+
SendFullReportUpdatedRequest,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
unknown
|
|
42
|
+
> = z.object({
|
|
43
|
+
"Green-Security-Signature": types.string(),
|
|
44
|
+
"Green-Security-Event": types.string(),
|
|
45
|
+
"Green-Security-Idempotency-Key": types.string(),
|
|
46
|
+
"Green-Webhook-Id": types.string(),
|
|
47
|
+
FullReport: components.FullReport$inboundSchema,
|
|
48
|
+
}).transform((v) => {
|
|
49
|
+
return remap$(v, {
|
|
50
|
+
"Green-Security-Signature": "greenSecuritySignature",
|
|
51
|
+
"Green-Security-Event": "greenSecurityEvent",
|
|
52
|
+
"Green-Security-Idempotency-Key": "greenSecurityIdempotencyKey",
|
|
53
|
+
"Green-Webhook-Id": "greenWebhookId",
|
|
54
|
+
"FullReport": "fullReport",
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
/** @internal */
|
|
58
|
+
export type SendFullReportUpdatedRequest$Outbound = {
|
|
59
|
+
"Green-Security-Signature": string;
|
|
60
|
+
"Green-Security-Event": string;
|
|
61
|
+
"Green-Security-Idempotency-Key": string;
|
|
62
|
+
"Green-Webhook-Id": string;
|
|
63
|
+
FullReport: components.FullReport$Outbound;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const SendFullReportUpdatedRequest$outboundSchema: z.ZodType<
|
|
68
|
+
SendFullReportUpdatedRequest$Outbound,
|
|
69
|
+
z.ZodTypeDef,
|
|
70
|
+
SendFullReportUpdatedRequest
|
|
71
|
+
> = z.object({
|
|
72
|
+
greenSecuritySignature: z.string(),
|
|
73
|
+
greenSecurityEvent: z.string(),
|
|
74
|
+
greenSecurityIdempotencyKey: z.string(),
|
|
75
|
+
greenWebhookId: z.string(),
|
|
76
|
+
fullReport: components.FullReport$outboundSchema,
|
|
77
|
+
}).transform((v) => {
|
|
78
|
+
return remap$(v, {
|
|
79
|
+
greenSecuritySignature: "Green-Security-Signature",
|
|
80
|
+
greenSecurityEvent: "Green-Security-Event",
|
|
81
|
+
greenSecurityIdempotencyKey: "Green-Security-Idempotency-Key",
|
|
82
|
+
greenWebhookId: "Green-Webhook-Id",
|
|
83
|
+
fullReport: "FullReport",
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export function sendFullReportUpdatedRequestToJSON(
|
|
88
|
+
sendFullReportUpdatedRequest: SendFullReportUpdatedRequest,
|
|
89
|
+
): string {
|
|
90
|
+
return JSON.stringify(
|
|
91
|
+
SendFullReportUpdatedRequest$outboundSchema.parse(
|
|
92
|
+
sendFullReportUpdatedRequest,
|
|
93
|
+
),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
export function sendFullReportUpdatedRequestFromJSON(
|
|
97
|
+
jsonString: string,
|
|
98
|
+
): SafeParseResult<SendFullReportUpdatedRequest, SDKValidationError> {
|
|
99
|
+
return safeParse(
|
|
100
|
+
jsonString,
|
|
101
|
+
(x) => SendFullReportUpdatedRequest$inboundSchema.parse(JSON.parse(x)),
|
|
102
|
+
`Failed to parse 'SendFullReportUpdatedRequest' from JSON`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
@@ -72,9 +72,9 @@ export type ReportsGetFullReportQueryError =
|
|
|
72
72
|
* | `404` | No such run, or it is outside your access scope. | Stop. |
|
|
73
73
|
* | `403` | Your account is locked, or lacks the `scheduled_reports` view permission. | Stop. |
|
|
74
74
|
*
|
|
75
|
-
* **Bound your polling.** A `409` is not a promise that the run will finish.
|
|
76
|
-
*
|
|
77
|
-
*
|
|
75
|
+
* **Bound your polling.** A `409` is not a promise that the run will finish. A run that fails
|
|
76
|
+
* while generating is now recorded as `failed` and answers `422`, but a run whose worker died
|
|
77
|
+
* outright still stays in `processing` and keeps answering `409` indefinitely. Apply your own
|
|
78
78
|
* timeout or maximum attempt count and treat exhaustion as a failure; do not retry forever.
|
|
79
79
|
*
|
|
80
80
|
* Access control: the URL's `full_report_id` must be in the caller's read scope for
|
|
@@ -122,9 +122,9 @@ export function useReportsGetFullReport(
|
|
|
122
122
|
* | `404` | No such run, or it is outside your access scope. | Stop. |
|
|
123
123
|
* | `403` | Your account is locked, or lacks the `scheduled_reports` view permission. | Stop. |
|
|
124
124
|
*
|
|
125
|
-
* **Bound your polling.** A `409` is not a promise that the run will finish.
|
|
126
|
-
*
|
|
127
|
-
*
|
|
125
|
+
* **Bound your polling.** A `409` is not a promise that the run will finish. A run that fails
|
|
126
|
+
* while generating is now recorded as `failed` and answers `422`, but a run whose worker died
|
|
127
|
+
* outright still stays in `processing` and keeps answering `409` indefinitely. Apply your own
|
|
128
128
|
* timeout or maximum attempt count and treat exhaustion as a failure; do not retry forever.
|
|
129
129
|
*
|
|
130
130
|
* Access control: the URL's `full_report_id` must be in the caller's read scope for
|
|
@@ -81,6 +81,43 @@ export type UsersPostAuthenticateMutationError =
|
|
|
81
81
|
* 3. Site redirects to your selected `return_url`
|
|
82
82
|
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
83
83
|
* 5. Fetch the user object from `/users/me` using the token
|
|
84
|
+
*
|
|
85
|
+
* ## Finishing a "Login with Green Security" flow
|
|
86
|
+
*
|
|
87
|
+
* Green Security is also a SAML2 **identity provider**. When a third-party service provider sends a user to
|
|
88
|
+
* `/saml/idp/sso` to sign in with their Green Security account, the user lands on a Green Security login screen
|
|
89
|
+
* carrying an `sso_state` query string parameter. That parameter is a signed, five-minute record of which service
|
|
90
|
+
* provider is waiting, where its assertion consumer service lives, and what `RelayState` it sent.
|
|
91
|
+
*
|
|
92
|
+
* Authentication itself is unchanged - the user may still need a password, an MFA code, a magic link or a round trip
|
|
93
|
+
* to their own SAML IdP, and every `requires` value above applies as normal. The only difference is that you must
|
|
94
|
+
* echo `sso_state` back on **every** call in the sequence, unchanged, including the follow-up that carries the
|
|
95
|
+
* `mfa_code`.
|
|
96
|
+
*
|
|
97
|
+
* Each `202` response carries the verified blob back to you in its own top-level `sso_state` field. Send back the
|
|
98
|
+
* value from the response you just received rather than the one you started with. The two are normally the same
|
|
99
|
+
* string, but re-sending your original copy is how a blob the server has already rejected gets resent, and it forces
|
|
100
|
+
* you to hold login state you would otherwise not need.
|
|
101
|
+
*
|
|
102
|
+
* 1. Read `sso_state` from the query string of the login screen you were sent to
|
|
103
|
+
* 2. Run the login exactly as you would otherwise, adding `sso_state` to each request body and taking the value for
|
|
104
|
+
* the next request from the previous `202` response
|
|
105
|
+
* 3. On the `200` response, read `sso.continue_url`
|
|
106
|
+
* 4. Navigate the browser to `sso.continue_url` - a full page navigation, not a background fetch. It answers with a
|
|
107
|
+
* self-submitting form that delivers the signed `SAMLResponse` and the original `RelayState` to the service
|
|
108
|
+
* provider
|
|
109
|
+
* 5. The service provider validates the assertion and the user is signed in on their side
|
|
110
|
+
*
|
|
111
|
+
* On the `password_reset` leg the blob is **also** appended to `redirect_url` as a query parameter, alongside
|
|
112
|
+
* `return_url`. The browser follows that redirect and leaves the JSON body behind, so anything the remaining legs of
|
|
113
|
+
* the login still need has to ride the URL. Preserve the query string exactly as given.
|
|
114
|
+
*
|
|
115
|
+
* An invalid `sso_state` never fails a login. A forged, edited or expired blob is silently dropped and the request is
|
|
116
|
+
* then treated as an ordinary login, so valid credentials still return `200` - just with no `sso` object. Check for
|
|
117
|
+
* `sso` explicitly rather than reading `200` as proof the hand-off survived. When it is absent, do not retry with the
|
|
118
|
+
* same blob; the user has to start again from the service provider. See the
|
|
119
|
+
* [Login with Green Security](https://greensecurity.apidocumentation.com/guides/sso-login-with-green-security)
|
|
120
|
+
* guide for the service provider half of this flow.
|
|
84
121
|
*/
|
|
85
122
|
export function useUsersPostAuthenticateMutation(
|
|
86
123
|
options?: MutationHookOptions<
|
package/src/sdk/reports.ts
CHANGED
|
@@ -62,9 +62,9 @@ export class Reports extends ClientSDK {
|
|
|
62
62
|
* | `404` | No such run, or it is outside your access scope. | Stop. |
|
|
63
63
|
* | `403` | Your account is locked, or lacks the `scheduled_reports` view permission. | Stop. |
|
|
64
64
|
*
|
|
65
|
-
* **Bound your polling.** A `409` is not a promise that the run will finish.
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* **Bound your polling.** A `409` is not a promise that the run will finish. A run that fails
|
|
66
|
+
* while generating is now recorded as `failed` and answers `422`, but a run whose worker died
|
|
67
|
+
* outright still stays in `processing` and keeps answering `409` indefinitely. Apply your own
|
|
68
68
|
* timeout or maximum attempt count and treat exhaustion as a failure; do not retry forever.
|
|
69
69
|
*
|
|
70
70
|
* Access control: the URL's `full_report_id` must be in the caller's read scope for
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -140,6 +140,9 @@ export class GreenSecurity extends ClientSDK {
|
|
|
140
140
|
} | Request;
|
|
141
141
|
secret: string;
|
|
142
142
|
}): Promise<
|
|
143
|
+
| webhooks.SendFullReportCreatedRequest
|
|
144
|
+
| webhooks.SendFullReportUpdatedRequest
|
|
145
|
+
| webhooks.SendFullReportDestroyedRequest
|
|
143
146
|
| webhooks.SendVendorCreatedRequest
|
|
144
147
|
| webhooks.SendVendorUpdatedRequest
|
|
145
148
|
| webhooks.SendVendorDestroyedRequest
|
package/src/sdk/users.ts
CHANGED
|
@@ -148,6 +148,43 @@ export class Users extends ClientSDK {
|
|
|
148
148
|
* 3. Site redirects to your selected `return_url`
|
|
149
149
|
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
150
150
|
* 5. Fetch the user object from `/users/me` using the token
|
|
151
|
+
*
|
|
152
|
+
* ## Finishing a "Login with Green Security" flow
|
|
153
|
+
*
|
|
154
|
+
* Green Security is also a SAML2 **identity provider**. When a third-party service provider sends a user to
|
|
155
|
+
* `/saml/idp/sso` to sign in with their Green Security account, the user lands on a Green Security login screen
|
|
156
|
+
* carrying an `sso_state` query string parameter. That parameter is a signed, five-minute record of which service
|
|
157
|
+
* provider is waiting, where its assertion consumer service lives, and what `RelayState` it sent.
|
|
158
|
+
*
|
|
159
|
+
* Authentication itself is unchanged - the user may still need a password, an MFA code, a magic link or a round trip
|
|
160
|
+
* to their own SAML IdP, and every `requires` value above applies as normal. The only difference is that you must
|
|
161
|
+
* echo `sso_state` back on **every** call in the sequence, unchanged, including the follow-up that carries the
|
|
162
|
+
* `mfa_code`.
|
|
163
|
+
*
|
|
164
|
+
* Each `202` response carries the verified blob back to you in its own top-level `sso_state` field. Send back the
|
|
165
|
+
* value from the response you just received rather than the one you started with. The two are normally the same
|
|
166
|
+
* string, but re-sending your original copy is how a blob the server has already rejected gets resent, and it forces
|
|
167
|
+
* you to hold login state you would otherwise not need.
|
|
168
|
+
*
|
|
169
|
+
* 1. Read `sso_state` from the query string of the login screen you were sent to
|
|
170
|
+
* 2. Run the login exactly as you would otherwise, adding `sso_state` to each request body and taking the value for
|
|
171
|
+
* the next request from the previous `202` response
|
|
172
|
+
* 3. On the `200` response, read `sso.continue_url`
|
|
173
|
+
* 4. Navigate the browser to `sso.continue_url` - a full page navigation, not a background fetch. It answers with a
|
|
174
|
+
* self-submitting form that delivers the signed `SAMLResponse` and the original `RelayState` to the service
|
|
175
|
+
* provider
|
|
176
|
+
* 5. The service provider validates the assertion and the user is signed in on their side
|
|
177
|
+
*
|
|
178
|
+
* On the `password_reset` leg the blob is **also** appended to `redirect_url` as a query parameter, alongside
|
|
179
|
+
* `return_url`. The browser follows that redirect and leaves the JSON body behind, so anything the remaining legs of
|
|
180
|
+
* the login still need has to ride the URL. Preserve the query string exactly as given.
|
|
181
|
+
*
|
|
182
|
+
* An invalid `sso_state` never fails a login. A forged, edited or expired blob is silently dropped and the request is
|
|
183
|
+
* then treated as an ordinary login, so valid credentials still return `200` - just with no `sso` object. Check for
|
|
184
|
+
* `sso` explicitly rather than reading `200` as proof the hand-off survived. When it is absent, do not retry with the
|
|
185
|
+
* same blob; the user has to start again from the service provider. See the
|
|
186
|
+
* [Login with Green Security](https://greensecurity.apidocumentation.com/guides/sso-login-with-green-security)
|
|
187
|
+
* guide for the service provider half of this flow.
|
|
151
188
|
*/
|
|
152
189
|
async postAuthenticate(
|
|
153
190
|
request: operations.PostAuthenticateRequestBody,
|