prow-authority 3.6.3
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/.claude/settings.local.json +11 -0
- package/.dockerignore +11 -0
- package/.github/workflows/_deploy.yml +191 -0
- package/.github/workflows/deploy-dev.yml +30 -0
- package/.github/workflows/deploy-prod.yml +34 -0
- package/CLAUDE.md +114 -0
- package/Dockerfile +61 -0
- package/Dockerfile.dev +24 -0
- package/README.md +1 -0
- package/package.json +61 -0
- package/src/App.ts +40 -0
- package/src/helpers/api-error.ts +21 -0
- package/src/helpers/authority.ts +216 -0
- package/src/helpers/config.ts +4 -0
- package/src/helpers/holded.ts +105 -0
- package/src/helpers/mysql.ts +15 -0
- package/src/helpers/notifications.ts +55 -0
- package/src/helpers/random.ts +18 -0
- package/src/helpers/s3.ts +43 -0
- package/src/helpers/stripe.ts +8 -0
- package/src/index.ts +47 -0
- package/src/v1/common-types.ts +12 -0
- package/src/v1/controllers/admin/accounting-seat-controller.ts +148 -0
- package/src/v1/controllers/admin/billing-cycle-controller.ts +171 -0
- package/src/v1/controllers/admin/invoice-controller.ts +222 -0
- package/src/v1/controllers/admin/license-controller.ts +190 -0
- package/src/v1/controllers/admin/license-limit-controller.ts +160 -0
- package/src/v1/controllers/admin/notification-controller.ts +115 -0
- package/src/v1/controllers/admin/organization-controller.ts +210 -0
- package/src/v1/controllers/admin/organization-license-controller.ts +224 -0
- package/src/v1/controllers/admin/organization-license-limit-controller.ts +196 -0
- package/src/v1/controllers/admin/organization-usage-controller.ts +167 -0
- package/src/v1/controllers/admin/payment-method-controller.ts +173 -0
- package/src/v1/controllers/admin/policy-controller.ts +138 -0
- package/src/v1/controllers/admin/policy-version-controller.ts +143 -0
- package/src/v1/controllers/admin/schedule-controller.ts +181 -0
- package/src/v1/controllers/admin/service-controller.ts +206 -0
- package/src/v1/controllers/admin/service-notification-controller.ts +166 -0
- package/src/v1/controllers/admin/user-controller.ts +282 -0
- package/src/v1/controllers/admin/user-organization-controller.ts +172 -0
- package/src/v1/controllers/admin/user-policy-controller.ts +164 -0
- package/src/v1/controllers/auth/@deprecated oauth-controller.ts +191 -0
- package/src/v1/controllers/auth/identity-token-controller.ts +286 -0
- package/src/v1/controllers/auth/organization-token-controller.ts +277 -0
- package/src/v1/controllers/auth/temp-code-controller.ts +60 -0
- package/src/v1/controllers/billing/billing-controller.ts +805 -0
- package/src/v1/controllers/organizations/public-organization-controller.ts +1796 -0
- package/src/v1/controllers/policies/public-policy-controller.ts +68 -0
- package/src/v1/controllers/services/public-service-controller.ts +177 -0
- package/src/v1/controllers/services/service-controller.ts +474 -0
- package/src/v1/controllers/users/public-user-controller.ts +471 -0
- package/src/v1/daos/@deprecated auth-dao.ts +173 -0
- package/src/v1/daos/accounting-seat-dao.ts +111 -0
- package/src/v1/daos/billing-cycle-dao.ts +107 -0
- package/src/v1/daos/invoice-dao.ts +131 -0
- package/src/v1/daos/license-dao.ts +152 -0
- package/src/v1/daos/license-limit-dao.ts +120 -0
- package/src/v1/daos/organization-dao.ts +109 -0
- package/src/v1/daos/organization-license-dao.ts +117 -0
- package/src/v1/daos/organization-license-limit-dao.ts +157 -0
- package/src/v1/daos/organization-usage-dao.ts +115 -0
- package/src/v1/daos/payment-method-dao.ts +110 -0
- package/src/v1/daos/policy-dao.ts +105 -0
- package/src/v1/daos/policy-version-dao.ts +112 -0
- package/src/v1/daos/redis-dao.ts +38 -0
- package/src/v1/daos/schema.sql +462 -0
- package/src/v1/daos/service-dao.ts +118 -0
- package/src/v1/daos/service-notification-dao.ts +120 -0
- package/src/v1/daos/user-dao.ts +127 -0
- package/src/v1/daos/user-organization-dao.ts +123 -0
- package/src/v1/daos/user-policy-dao.ts +109 -0
- package/src/v1/middlewares/auth/identity-token-middleware.ts +51 -0
- package/src/v1/middlewares/auth/organization-token-middleware.ts +73 -0
- package/src/v1/middlewares/auth/service-token-middleware.ts +167 -0
- package/src/v1/middlewares/authority-middleware.ts +97 -0
- package/src/v1/middlewares/organizations/organization-middleware.ts +94 -0
- package/src/v1/middlewares/static/static-middleware.ts +41 -0
- package/src/v1/middlewares/users/user-middleware.ts +41 -0
- package/src/v1/routes/admin/accounting-seat-router.ts +89 -0
- package/src/v1/routes/admin/admin-router.ts +61 -0
- package/src/v1/routes/admin/billing-cycle-router.ts +89 -0
- package/src/v1/routes/admin/invoice-router.ts +89 -0
- package/src/v1/routes/admin/license-limit-router.ts +89 -0
- package/src/v1/routes/admin/license-router.ts +89 -0
- package/src/v1/routes/admin/notification-router.ts +61 -0
- package/src/v1/routes/admin/organization-license-limit-router.ts +89 -0
- package/src/v1/routes/admin/organization-license-router.ts +89 -0
- package/src/v1/routes/admin/organization-router.ts +89 -0
- package/src/v1/routes/admin/payment-method-router.ts +89 -0
- package/src/v1/routes/admin/policy-router.ts +89 -0
- package/src/v1/routes/admin/policy-version-router.ts +89 -0
- package/src/v1/routes/admin/schedule-router.ts +75 -0
- package/src/v1/routes/admin/service-notification-router.ts +98 -0
- package/src/v1/routes/admin/service-router.ts +89 -0
- package/src/v1/routes/admin/user-organization-router.ts +89 -0
- package/src/v1/routes/admin/user-policy-router.ts +89 -0
- package/src/v1/routes/admin/user-router.ts +89 -0
- package/src/v1/routes/auth/@deprecated auth-router.ts +199 -0
- package/src/v1/routes/auth/identity-token-router.ts +147 -0
- package/src/v1/routes/auth/organization-token-router.ts +70 -0
- package/src/v1/routes/billing/billing-router.ts +227 -0
- package/src/v1/routes/organizations/invoices-router.ts +48 -0
- package/src/v1/routes/organizations/payments-router.ts +104 -0
- package/src/v1/routes/organizations/public-organization-router.ts +319 -0
- package/src/v1/routes/organizations/users-router.ts +139 -0
- package/src/v1/routes/policies/public-policy-router.ts +50 -0
- package/src/v1/routes/services/public-service-router.ts +89 -0
- package/src/v1/routes/services/service-router.ts +197 -0
- package/src/v1/routes/users/public-user-router.ts +230 -0
- package/src/v1/routes/v1-router.ts +50 -0
- package/src/v1/schemas/admin/accounting-seat-schemas.ts +22 -0
- package/src/v1/schemas/admin/billing-cycle-schemas.ts +20 -0
- package/src/v1/schemas/admin/invoice-schemas.ts +41 -0
- package/src/v1/schemas/admin/license-limit-schemas.ts +25 -0
- package/src/v1/schemas/admin/license-schemas.ts +30 -0
- package/src/v1/schemas/admin/organization-license-limit-schemas.ts +29 -0
- package/src/v1/schemas/admin/organization-license-schemas.ts +43 -0
- package/src/v1/schemas/admin/organization-schemas.ts +67 -0
- package/src/v1/schemas/admin/organization-usage-schemas.ts +15 -0
- package/src/v1/schemas/admin/payment-method-schemas.ts +40 -0
- package/src/v1/schemas/admin/policy-schemas.ts +31 -0
- package/src/v1/schemas/admin/service-notification-schemas.ts +23 -0
- package/src/v1/schemas/admin/service-schemas.ts +56 -0
- package/src/v1/schemas/admin/user-organization-schemas.ts +24 -0
- package/src/v1/schemas/admin/user-policy-schemas.ts +17 -0
- package/src/v1/schemas/admin/user-schemas.ts +52 -0
- package/src/v1/schemas/auth/auth-schemas.ts +55 -0
- package/src/v1/schemas/billing/billing-schemas.ts +32 -0
- package/src/v1/schemas/organizations/public-organization-schemas.ts +77 -0
- package/src/v1/schemas/payments/payment-method-schemas.ts +0 -0
- package/src/v1/schemas/services/public-service-schemas.ts +5 -0
- package/src/v1/schemas/services/service-schemas.ts +27 -0
- package/src/v1/schemas/users/public-user-schemas.ts +73 -0
- package/src/v1/types/admin/accounting-seat-types.ts +16 -0
- package/src/v1/types/admin/billing-cycle-types.ts +14 -0
- package/src/v1/types/admin/invoice-types.ts +39 -0
- package/src/v1/types/admin/license-limit-types.ts +16 -0
- package/src/v1/types/admin/license-types.ts +29 -0
- package/src/v1/types/admin/organization-license-limit-types.ts +13 -0
- package/src/v1/types/admin/organization-license-types.ts +21 -0
- package/src/v1/types/admin/organization-types.ts +60 -0
- package/src/v1/types/admin/organization-usage-types.ts +17 -0
- package/src/v1/types/admin/payment-method-types.ts +30 -0
- package/src/v1/types/admin/policy-types.ts +9 -0
- package/src/v1/types/admin/policy-version-types.ts +12 -0
- package/src/v1/types/admin/service-notification-types.ts +20 -0
- package/src/v1/types/admin/service-types.ts +36 -0
- package/src/v1/types/admin/user-organization-types.ts +31 -0
- package/src/v1/types/admin/user-types.ts +44 -0
- package/src/v1/types/auth/@deprecated auth-types.ts +26 -0
- package/src/v1/types/auth/common-types.ts +7 -0
- package/src/v1/types/auth/confirmation-types.ts +5 -0
- package/src/v1/types/auth/identity-token-types.ts +8 -0
- package/src/v1/types/auth/organization-token-types.ts +23 -0
- package/src/v1/types/auth/otp-types.ts +12 -0
- package/src/v1/types/billing/billing-types.ts +37 -0
- package/src/v1/types/billing/ue-types.ts +29 -0
- package/src/v1/types/organizations/public-organization-types.ts +76 -0
- package/src/v1/types/policies/public-policy-types.ts +7 -0
- package/src/v1/types/services/public-service-types.ts +20 -0
- package/src/v1/types/services/service-types.ts +43 -0
- package/src/v1/types/users/public-user-types.ts +15 -0
- package/src/v1/types/users/user-policy-types.ts +11 -0
- package/static/error.html +55 -0
- package/static/grant.html +117 -0
- package/static/login.html +54 -0
- package/static/oauth-client-logo.webp +0 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OrganizationLicense } from "../admin/organization-license-types";
|
|
2
|
+
import { Organization } from "../admin/organization-types";
|
|
3
|
+
import { UserOrganization } from "../admin/user-organization-types";
|
|
4
|
+
import { User } from "../admin/user-types";
|
|
5
|
+
|
|
6
|
+
export type OrganizationAccessInformation = {
|
|
7
|
+
user: number,
|
|
8
|
+
access: number,
|
|
9
|
+
organization: number,
|
|
10
|
+
license: number,
|
|
11
|
+
pair: string,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type OrganizationRefreshInformation = OrganizationAccessInformation & {
|
|
15
|
+
access_token: string,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type Environment = {
|
|
19
|
+
user: User,
|
|
20
|
+
access: UserOrganization,
|
|
21
|
+
organization: Organization,
|
|
22
|
+
license: OrganizationLicense,
|
|
23
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AccountingSeat } from "../admin/accounting-seat-types";
|
|
2
|
+
import { Invoice, InvoiceStatus } from "../admin/invoice-types";
|
|
3
|
+
import { PublicOrganization } from "../organizations/public-organization-types";
|
|
4
|
+
|
|
5
|
+
export type Billing_PendingLicenses_Params = {
|
|
6
|
+
current_date?: string,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type Billing_GetInvoices_Params = {
|
|
10
|
+
status: InvoiceStatus,
|
|
11
|
+
current_date?: string,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type Billing_InvoiceEmitted_Params = {
|
|
15
|
+
invoice: string,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type Billing_InvoicePaid_Params = {
|
|
19
|
+
payment: string,
|
|
20
|
+
method: string,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type Billing_UpdateInvoice_Params = {
|
|
24
|
+
metadata: Record<string, any>,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type Billing_GetAccountingSeats_Params = {
|
|
28
|
+
done: boolean,
|
|
29
|
+
current_date?: string,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type PublicInvoice = Pick<Invoice, `uuid` | `amount` | `tax` | `base` | `tax_code` | `tax_percentage` | `concepts` | `billing` | `date` | `invoice` | `number` | `payment` | `method` | `status` | `metadata`>
|
|
33
|
+
& { organization: PublicOrganization };
|
|
34
|
+
|
|
35
|
+
export type PublicAccountingSeat = Pick<AccountingSeat, `uuid` | `date` | `amount` | `done` | `metadata`>
|
|
36
|
+
& { invoice: PublicInvoice };
|
|
37
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type UE_Country = {
|
|
2
|
+
id: number,
|
|
3
|
+
name: string,
|
|
4
|
+
defaultCountryCode: string,
|
|
5
|
+
alternativeContryCode?: string,
|
|
6
|
+
email: string,
|
|
7
|
+
defaultCurrency: {
|
|
8
|
+
id: number,
|
|
9
|
+
isoCode: string,
|
|
10
|
+
description: string,
|
|
11
|
+
},
|
|
12
|
+
cnCodesCompliant: boolean,
|
|
13
|
+
cpaCodesCompliant: boolean,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type UE_VAT_Item = {
|
|
17
|
+
taxId: number,
|
|
18
|
+
versionDate: number,
|
|
19
|
+
genericName: string,
|
|
20
|
+
englishName: string,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type UE_VAT = {
|
|
24
|
+
vatRateStructure: {
|
|
25
|
+
standardRate: {
|
|
26
|
+
rate: { value: string },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Invoice } from "../admin/invoice-types";
|
|
2
|
+
import { License } from "../admin/license-types";
|
|
3
|
+
import { OrganizationLicenseLimit } from "../admin/organization-license-limit-types";
|
|
4
|
+
import { OrganizationLicense } from "../admin/organization-license-types";
|
|
5
|
+
import { Organization } from "../admin/organization-types";
|
|
6
|
+
import { PaymentMethod } from "../admin/payment-method-types";
|
|
7
|
+
import { UserOrganization } from "../admin/user-organization-types";
|
|
8
|
+
import { PublicService } from "../services/public-service-types";
|
|
9
|
+
import { PublicAccess, PublicUser } from "../users/public-user-types";
|
|
10
|
+
|
|
11
|
+
export type PublicOrganization = Omit<Organization, `id` | `internal`>;
|
|
12
|
+
|
|
13
|
+
export type PublicOrganizationUser = {
|
|
14
|
+
user: PublicUser,
|
|
15
|
+
access: PublicAccess,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type UpdateUserAccess =
|
|
19
|
+
Partial<Pick<UserOrganization, `role` | `enabled` | `metadata`>>;
|
|
20
|
+
|
|
21
|
+
export type UpdateUserOrganization =
|
|
22
|
+
Partial<Pick<UserOrganization, `preferences` | `metadata`>>;
|
|
23
|
+
|
|
24
|
+
export type InviteUser =
|
|
25
|
+
Pick<UserOrganization, `role` | `enabled` | `metadata`>
|
|
26
|
+
& { email: string };
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export type PublicOrganizationLicense =
|
|
30
|
+
Omit<OrganizationLicense, `id` | `organization` | `service` | `internal` | `associated` | `original`>
|
|
31
|
+
& {
|
|
32
|
+
associated: string,
|
|
33
|
+
service: PublicService,
|
|
34
|
+
limits: Omit<OrganizationLicenseLimit, `id` | `organization` | `license`>[],
|
|
35
|
+
current_billing_start_date: string,
|
|
36
|
+
current_billing_end_date: string,
|
|
37
|
+
current_billing_trial: boolean,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type LicenseParams = {
|
|
41
|
+
enabled?: `true` | `false`,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type ActivateLicense = {
|
|
45
|
+
license: License[`uuid`],
|
|
46
|
+
billing: OrganizationLicense[`billing`],
|
|
47
|
+
renew: boolean,
|
|
48
|
+
scheduled?: boolean,
|
|
49
|
+
metadata: OrganizationLicense[`metadata`],
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type ActivatePowerUp = {
|
|
53
|
+
license: License[`uuid`],
|
|
54
|
+
billing: OrganizationLicense[`billing`],
|
|
55
|
+
renew?: boolean,
|
|
56
|
+
metadata: OrganizationLicense[`metadata`],
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type PublicPaymentMethod = Omit<PaymentMethod, `id` | `organization` | `internal`>;
|
|
60
|
+
|
|
61
|
+
export type AddPaymentMethod = {
|
|
62
|
+
payment_method_id: string,
|
|
63
|
+
enabled: boolean,
|
|
64
|
+
properties?: {
|
|
65
|
+
alias?: string,
|
|
66
|
+
},
|
|
67
|
+
metadata?: Record<string, any>,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type UpdatePaymentMethod = Partial<Omit<AddPaymentMethod, `payment_method_id`>>;
|
|
71
|
+
|
|
72
|
+
export type PublicInvoice = Omit<Invoice, `id` | `organization` | `tax_code` | `internal` | `invoice` | `payment` | `method`>
|
|
73
|
+
& {
|
|
74
|
+
method: PublicPaymentMethod,
|
|
75
|
+
invoice: boolean,
|
|
76
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Policy } from "../admin/policy-types";
|
|
2
|
+
import { PolicyVersion } from "../admin/policy-version-types";
|
|
3
|
+
|
|
4
|
+
export type PublicPolicy = Omit<Policy, 'id' | `internal`>
|
|
5
|
+
& { current_version: Omit<PolicyVersion, 'id' | 'policy' | `internal`> | null };
|
|
6
|
+
|
|
7
|
+
export type AcceptPolicies = { uuids?: string[] };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LicenseLimit } from "../admin/license-limit-types";
|
|
2
|
+
import { License } from "../admin/license-types";
|
|
3
|
+
import { Service } from "../admin/service-types";
|
|
4
|
+
|
|
5
|
+
export type PublicService = Omit<Service, `id` | `token` | `enabled` | `internal`>;
|
|
6
|
+
|
|
7
|
+
export type ListLicenseParams = Partial<Pick<License, `metadata`>>;
|
|
8
|
+
|
|
9
|
+
export type PublicLicense =
|
|
10
|
+
Omit<License, `id` | `service` | `public` | `enabled` | `associated`>
|
|
11
|
+
& {
|
|
12
|
+
associated: string,
|
|
13
|
+
limits: Omit<LicenseLimit, `id` | `license`>[],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export type PublicServiceInformation = {
|
|
18
|
+
service: PublicService,
|
|
19
|
+
information: any[],
|
|
20
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { OrganizationLicenseLimit } from "../admin/organization-license-limit-types";
|
|
2
|
+
import { OrganizationLicense } from "../admin/organization-license-types";
|
|
3
|
+
import { Organization } from "../admin/organization-types";
|
|
4
|
+
import { Service } from "../admin/service-types";
|
|
5
|
+
|
|
6
|
+
export type ServiceEnvironment = {
|
|
7
|
+
organization: Organization,
|
|
8
|
+
service: Service,
|
|
9
|
+
licenses: OrganizationLicense[],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type QuotaParams = {
|
|
13
|
+
date?: string,
|
|
14
|
+
name?: string[],
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type Quota = {
|
|
18
|
+
name: OrganizationLicenseLimit[`name`],
|
|
19
|
+
period: OrganizationLicenseLimit[`period`],
|
|
20
|
+
limit: OrganizationLicenseLimit[`limit`],
|
|
21
|
+
overconsume: OrganizationLicenseLimit[`overconsume`],
|
|
22
|
+
used: number,
|
|
23
|
+
resets?: string,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type QuotaUsage = {
|
|
27
|
+
name: string,
|
|
28
|
+
count: number,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type NotificationContext = Record<string, string | number>;
|
|
32
|
+
|
|
33
|
+
export type SendNotificationData = {
|
|
34
|
+
event: string,
|
|
35
|
+
locale?: string,
|
|
36
|
+
data?: Record<string, any>,
|
|
37
|
+
context?: NotificationContext,
|
|
38
|
+
attachments?: {
|
|
39
|
+
name: string,
|
|
40
|
+
type: string,
|
|
41
|
+
content: string,
|
|
42
|
+
}[],
|
|
43
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UserOrganization } from "../admin/user-organization-types";
|
|
2
|
+
import { User } from "../admin/user-types";
|
|
3
|
+
import { PublicOrganization } from "../organizations/public-organization-types";
|
|
4
|
+
|
|
5
|
+
export type PublicUser = Omit<User, `id` | `password` | `utm` | `referrer`> & { password: boolean };
|
|
6
|
+
|
|
7
|
+
export type PublicUserOrganization = {
|
|
8
|
+
organization: PublicOrganization,
|
|
9
|
+
access: PublicAccess,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type PublicAccess = Omit<UserOrganization, `id` | `organization` | `user` | `invited_by`>
|
|
13
|
+
& {
|
|
14
|
+
invited_by: PublicUser,
|
|
15
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" data-bs-theme="dark">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>OAuth2 · Error</title>
|
|
8
|
+
|
|
9
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
10
|
+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
|
12
|
+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
|
13
|
+
crossorigin="anonymous"></script>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body class="bg-dark-subtle">
|
|
17
|
+
<div class="vh-100 vw-100 d-flex justify-content-center align-items-center">
|
|
18
|
+
<div style="width: 900px;">
|
|
19
|
+
<div class="card">
|
|
20
|
+
<div class="card-body p-5">
|
|
21
|
+
<div class="row g-3">
|
|
22
|
+
<div class="col">
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
<h2>Invalid OAuth integration</h2>
|
|
26
|
+
<div>The authentication request could not be processed due to a misconfiguration or invalid parameters in
|
|
27
|
+
the OAuth integration.</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="col">
|
|
30
|
+
<div class="small">
|
|
31
|
+
<p>
|
|
32
|
+
Possible Causes:
|
|
33
|
+
|
|
34
|
+
<ul>
|
|
35
|
+
<li>The client ID or redirect URI provided is incorrect or not registered.</li>
|
|
36
|
+
<li>The authorization server does not recognize the client application.</li>
|
|
37
|
+
<li>The integration does not adhere to the OAuth2 protocol requirements.</li>
|
|
38
|
+
</ul>
|
|
39
|
+
|
|
40
|
+
</p>
|
|
41
|
+
<p>
|
|
42
|
+
Received error message: <br />
|
|
43
|
+
<i>{{error}}</i>
|
|
44
|
+
</p>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
</body>
|
|
54
|
+
|
|
55
|
+
</html>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" data-bs-theme="dark">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>OAuth2 · Grant access</title>
|
|
8
|
+
|
|
9
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
10
|
+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
|
12
|
+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
|
13
|
+
crossorigin="anonymous"></script>
|
|
14
|
+
|
|
15
|
+
<script src="https://kit.fontawesome.com/16ac55b614.js" crossorigin="anonymous"></script>
|
|
16
|
+
</head>
|
|
17
|
+
|
|
18
|
+
<body class="bg-dark-subtle">
|
|
19
|
+
<div class="vh-100 vw-100 d-flex justify-content-center align-items-center">
|
|
20
|
+
<div style="width: 900px;">
|
|
21
|
+
<div class="card">
|
|
22
|
+
<div class="card-body p-5">
|
|
23
|
+
<div class="row g-3">
|
|
24
|
+
<div class="col">
|
|
25
|
+
{{#if client.image}}
|
|
26
|
+
<img src="{{client.image}}" alt="{{client.name}}" width="48" class="rounded mb-3">
|
|
27
|
+
{{/if}}
|
|
28
|
+
|
|
29
|
+
<h2><b>{{client.name}}</b> wants to access your FakeCRM Account</h2>
|
|
30
|
+
<div>
|
|
31
|
+
<form action="/auth/account" method="post">
|
|
32
|
+
<input type="hidden" name="token" value="{{token}}">
|
|
33
|
+
<button type="submit" class="btn btn-sm border fw-bold">@{{user.username}}</button>
|
|
34
|
+
</form>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="col">
|
|
38
|
+
<div class="mb-3">
|
|
39
|
+
<div>This will allow <b>{{client.name}}</b> to:</div>
|
|
40
|
+
|
|
41
|
+
<div class="d-flex align-items-top p-2">
|
|
42
|
+
<div class="me-3 text-muted">
|
|
43
|
+
<i class="fa fa-user fa-fw text-center"></i>
|
|
44
|
+
</div>
|
|
45
|
+
<div>
|
|
46
|
+
<div>See your user information</div>
|
|
47
|
+
<div class="small text-muted">
|
|
48
|
+
Allows the client to access your basic profile information, such as
|
|
49
|
+
your name,
|
|
50
|
+
email, and profile picture.
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div class="d-flex align-items-top p-2">
|
|
56
|
+
<div class="me-3 text-muted">
|
|
57
|
+
<i class="fa fa-shopping-cart fa-fw text-center"></i>
|
|
58
|
+
</div>
|
|
59
|
+
<div>
|
|
60
|
+
<div>Read your orders</div>
|
|
61
|
+
<div class="small text-muted">
|
|
62
|
+
Grants the client permission to view a list of your past and current
|
|
63
|
+
orders.
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="d-flex align-items-top p-2">
|
|
69
|
+
<div class="me-3 text-muted">
|
|
70
|
+
<i class="fa fa-shopping-cart fa-fw text-center"></i>
|
|
71
|
+
</div>
|
|
72
|
+
<div>
|
|
73
|
+
<div>Read your clients</div>
|
|
74
|
+
<div class="small text-muted">
|
|
75
|
+
Grants the client permission to retrieve information about your
|
|
76
|
+
associated clients or contacts.
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div class="small mb-5">
|
|
84
|
+
<p>By continuing, FakeCRM will share this information with {{client.name}}.</p>
|
|
85
|
+
<p>
|
|
86
|
+
<i>This is a demo environment created to showcase and test the
|
|
87
|
+
OAuth2 authentication process. No real data will be stored or shared beyond this test
|
|
88
|
+
environment.</i>
|
|
89
|
+
</p>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div class="row g-2">
|
|
93
|
+
<div class="col">
|
|
94
|
+
<form method="post" action="/auth/account/cancel">
|
|
95
|
+
<input type="hidden" name="token" value="{{token}}">
|
|
96
|
+
<button type="submit" class="btn border w-100">Cancel</button>
|
|
97
|
+
</form>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div class="col">
|
|
101
|
+
<form method="post" action="/auth/account/grant">
|
|
102
|
+
<input type="hidden" name="token" value="{{token}}">
|
|
103
|
+
<button type="submit" class="btn btn-primary w-100">Grant</button>
|
|
104
|
+
</form>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
</body>
|
|
116
|
+
|
|
117
|
+
</html>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" data-bs-theme="dark">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Login</title>
|
|
8
|
+
|
|
9
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
10
|
+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
|
12
|
+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
|
13
|
+
crossorigin="anonymous"></script>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body class="bg-dark-subtle">
|
|
17
|
+
<div class="vh-100 vw-100 d-flex justify-content-center align-items-center">
|
|
18
|
+
<div style="width: 900px;">
|
|
19
|
+
<div class="card">
|
|
20
|
+
<div class="card-body p-5">
|
|
21
|
+
<div class="row g-3">
|
|
22
|
+
<div class="col">
|
|
23
|
+
{{#if client.image}}
|
|
24
|
+
<img src="{{client.image}}" alt="{{client.name}}" width="48" class="rounded mb-3">
|
|
25
|
+
{{/if}}
|
|
26
|
+
|
|
27
|
+
<h2>Log In</h2>
|
|
28
|
+
<div>to continue to <b>{{client.name}}</b></div>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="col">
|
|
31
|
+
<form action="/auth/account/check" method="post">
|
|
32
|
+
<div class="mb-3">
|
|
33
|
+
<label for="username" class="form-label">Username</label>
|
|
34
|
+
<input type="text" name="username" class="form-control">
|
|
35
|
+
</div>
|
|
36
|
+
<div class="mb-3">
|
|
37
|
+
<label for="password" class="form-label">Password</label>
|
|
38
|
+
<input type="password" name="password" class="form-control">
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<input type="hidden" name="token" value="{{token}}">
|
|
42
|
+
|
|
43
|
+
<button class="btn btn-primary w-100" type="submit">Continue</button>
|
|
44
|
+
</form>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
</body>
|
|
53
|
+
|
|
54
|
+
</html>
|
|
Binary file
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"experimentalDecorators": true,
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"removeComments": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"resolveJsonModule": true
|
|
11
|
+
},
|
|
12
|
+
"include": [
|
|
13
|
+
"src/**/*.ts",
|
|
14
|
+
],
|
|
15
|
+
"exclude": [
|
|
16
|
+
"./test",
|
|
17
|
+
"node_modules",
|
|
18
|
+
"dist/**/*.js"
|
|
19
|
+
]
|
|
20
|
+
}
|