@punch-in/strapi-admin 1.2.6 → 1.2.8
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.
|
@@ -142,20 +142,20 @@ const GlobalStyle = createGlobalStyle`
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
::-webkit-scrollbar-track {
|
|
145
|
-
background-color:
|
|
145
|
+
background-color: transparent;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
::-webkit-scrollbar-track:hover {
|
|
149
|
-
background-color:
|
|
149
|
+
background-color: transparent;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
::-webkit-scrollbar-thumb {
|
|
153
|
-
background-color: #
|
|
153
|
+
background-color: #c0c4cc;
|
|
154
154
|
border-radius: 0.5rem;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
::-webkit-scrollbar-thumb:hover {
|
|
158
|
-
background-color: #
|
|
158
|
+
background-color: #a6acb8;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
::-webkit-scrollbar-button {
|
|
@@ -165,7 +165,7 @@ const GlobalStyle = createGlobalStyle`
|
|
|
165
165
|
/* firefox scrollbar */
|
|
166
166
|
/* stylelint-disable */
|
|
167
167
|
* {
|
|
168
|
-
scrollbar-color: #
|
|
168
|
+
scrollbar-color: #c0c4cc transparent;
|
|
169
169
|
scrollbar-width: thin;
|
|
170
170
|
}
|
|
171
171
|
/* stylelint-enable */
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"HomePage.community": "Join Punch-in Community",
|
|
55
55
|
"HomePage.greetings": "Hi {name}!",
|
|
56
56
|
"HomePage.helmet.title": "Homepage",
|
|
57
|
-
"HomePage.punchIn.title": "
|
|
57
|
+
"HomePage.punchIn.title": "Attendance recorded",
|
|
58
58
|
"HomePage.punchIn.subtitle": "{count} {count, plural, one {person} other {people}} clocked in · grouped by site",
|
|
59
59
|
"HomePage.punchIn.loading": "Loading today's punch-ins…",
|
|
60
60
|
"HomePage.punchIn.empty": "No one has punched in yet today.",
|
|
@@ -4,6 +4,16 @@ const passport = require('koa-passport');
|
|
|
4
4
|
const compose = require('koa-compose');
|
|
5
5
|
const crypto = require('crypto');
|
|
6
6
|
const axios = require('axios');
|
|
7
|
+
const { LambdaClient, InvokeCommand } = require('@aws-sdk/client-lambda');
|
|
8
|
+
|
|
9
|
+
// Tenant Lambdas run inside a VPC with no internet route (required for the
|
|
10
|
+
// EFS mount - see CLAUDE.md). Reaching the central stripe-charge Lambda
|
|
11
|
+
// therefore goes through the VPC Interface Endpoint for the Lambda service
|
|
12
|
+
// (infra/shared-networking-stack.yaml) via a direct SDK invoke, not HTTPS.
|
|
13
|
+
// See features/API-REDESIGN.md Phase 1. The SDK v3 client-lambda package is
|
|
14
|
+
// preinstalled by the Node.js 18+ Lambda managed runtime, so it does not
|
|
15
|
+
// need to be bundled in strapi-lambda-layer.
|
|
16
|
+
const lambdaClient = new LambdaClient({});
|
|
7
17
|
|
|
8
18
|
const {
|
|
9
19
|
validateRegistrationInput,
|
|
@@ -190,6 +200,14 @@ module.exports = {
|
|
|
190
200
|
// against *this* tenant's admin_users - never creating one.
|
|
191
201
|
|
|
192
202
|
async ssoProviders(ctx) {
|
|
203
|
+
// SSO_PROVIDERS_MODE=invoke is the new path (see features/API-REDESIGN.md
|
|
204
|
+
// Phase 1); anything else keeps the old HTTPS call so this can be rolled
|
|
205
|
+
// back per-tenant without a redeploy while the invoke path is verified.
|
|
206
|
+
if (process.env.SSO_PROVIDERS_MODE === 'invoke') {
|
|
207
|
+
ctx.body = await fetchSsoProvidersViaInvoke();
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
|
|
193
211
|
try {
|
|
194
212
|
const { data } = await axios.get(`${getCentralApiBase()}/sso/auth/providers`, {
|
|
195
213
|
timeout: 5000,
|
|
@@ -252,6 +270,38 @@ function getCentralApiBase() {
|
|
|
252
270
|
return (process.env.PUNCHIN_INTEGRATIONS_API_BASE || 'https://api.punch-in.co.uk').replace(/\/$/, '');
|
|
253
271
|
}
|
|
254
272
|
|
|
273
|
+
// SsoProvidersFunction (stripe-charge/template.yaml) is also wired behind
|
|
274
|
+
// API Gateway via sso.js, so its handler returns an API-Gateway-proxy-shaped
|
|
275
|
+
// object ({ statusCode, headers, body: JSON.stringify(...) }) rather than
|
|
276
|
+
// the raw provider array - that shape is unchanged whether API Gateway or a
|
|
277
|
+
// direct InvokeCommand calls it, so it has to be unwrapped here.
|
|
278
|
+
async function fetchSsoProvidersViaInvoke() {
|
|
279
|
+
const functionName = process.env.SSO_PROVIDERS_FUNCTION_NAME;
|
|
280
|
+
if (!functionName) {
|
|
281
|
+
strapi.log.error('SSO_PROVIDERS_FUNCTION_NAME is not configured');
|
|
282
|
+
return [];
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
try {
|
|
286
|
+
const response = await lambdaClient.send(
|
|
287
|
+
new InvokeCommand({
|
|
288
|
+
FunctionName: functionName,
|
|
289
|
+
InvocationType: 'RequestResponse',
|
|
290
|
+
})
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
if (response.FunctionError) {
|
|
294
|
+
throw new Error(`SsoProvidersFunction returned ${response.FunctionError}`);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const gatewayResponse = JSON.parse(Buffer.from(response.Payload).toString('utf8'));
|
|
298
|
+
return JSON.parse(gatewayResponse.body);
|
|
299
|
+
} catch (err) {
|
|
300
|
+
strapi.log.error(`Failed to invoke SsoProvidersFunction: ${err.message}`);
|
|
301
|
+
return [];
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
255
305
|
function secretsMatch(provided, expected) {
|
|
256
306
|
if (!provided || !expected) return false;
|
|
257
307
|
const a = Buffer.from(provided);
|
package/package.json
CHANGED