Skip to content

Commit 2b500f1

Browse files
committed
fix: update dependencies
1 parent 890adef commit 2b500f1

19 files changed

+5658
-5716
lines changed

.github/workflows/test-and-release.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ env:
1717
JSII_SILENCE_WARNING_UNTESTED_NODE_VERSION: 1
1818
REGISTRY: ghcr.io
1919

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
2024
jobs:
2125
unit-tests:
2226
runs-on: ubuntu-24.04

cdk/backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { IAMClient } from '@aws-sdk/client-iam'
33
import { ensureGitHubOIDCProvider } from '@bifravst/ci'
44
import { fromEnv } from '@bifravst/from-env'
55
import { getCertificateArnForDomain } from '../aws/acm.ts'
6-
import pJSON from '../package.json' assert { type: 'json' }
6+
import pJSON from '../package.json' with { type: 'json' }
77
import { BackendApp } from './BackendApp.ts'
88
import { pack as packBaseLayer } from './baseLayer.ts'
99
import { pack as packCDKLayer } from './cdkLayer.ts'

cdk/baseLayer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
packLayer,
33
type PackedLayer,
44
} from '@bifravst/aws-cdk-lambda-helpers/layer'
5-
import pJson from '../package.json' assert { type: 'json' }
5+
import pJson from '../package.json' with { type: 'json' }
66

77
const dependencies: Array<keyof (typeof pJson)['dependencies']> = [
88
'@bifravst/from-env',

cdk/cdkLayer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
packLayer,
33
type PackedLayer,
44
} from '@bifravst/aws-cdk-lambda-helpers/layer'
5-
import pJson from '../package.json' assert { type: 'json' }
5+
import pJson from '../package.json' with { type: 'json' }
66

77
const dependencies: Array<keyof (typeof pJson)['devDependencies']> = [
88
'cfn-response',

cdk/jwtLayer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
packLayer,
33
type PackedLayer,
44
} from '@bifravst/aws-cdk-lambda-helpers/layer'
5-
import pJson from '../package.json' assert { type: 'json' }
5+
import pJson from '../package.json' with { type: 'json' }
66

77
const dependencies: Array<keyof (typeof pJson)['dependencies']> = [
88
'jsonwebtoken',

cdk/resources/containers/buildOpenSSLLambdaImage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type { logFn } from '../../../cli/log.ts'
1616
const __filename = fileURLToPath(import.meta.url)
1717
const __dirname = path.dirname(__filename)
1818

19-
import pJSON from '../../../package.json' assert { type: 'json' }
19+
import pJSON from '../../../package.json' with { type: 'json' }
2020

2121
export const buildOpenSSLLambdaImage = async (
2222
builder: ImageBuilder,

cli/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { program } from 'commander'
1010
import { env } from '../aws/env.ts'
1111
import type { StackOutputs } from '../cdk/BackendStack.ts'
1212
import { STACK_NAME } from '../cdk/stackConfig.ts'
13-
import psjon from '../package.json' assert { type: 'json' }
13+
import psjon from '../package.json' with { type: 'json' }
1414
import type { CommandDefinition } from './commands/CommandDefinition.ts'
1515
import { buildContainersCommand } from './commands/build-container.ts'
1616
import { configureHelloCommand } from './commands/configure-hello.ts'

lambda/deviceJwt.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ import { fromEnv } from '@bifravst/from-env'
44
import { aResponse } from '@hello.nrfcloud.com/lambda-helpers/aResponse'
55
import { addVersionHeader } from '@hello.nrfcloud.com/lambda-helpers/addVersionHeader'
66
import { corsOPTIONS } from '@hello.nrfcloud.com/lambda-helpers/corsOPTIONS'
7-
import {
8-
ProblemDetailError,
9-
problemResponse,
10-
} from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
7+
import { problemResponse } from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
118
import { requestLogger } from '@hello.nrfcloud.com/lambda-helpers/requestLogger'
129
import {
1310
validateInput,
1411
type ValidInput,
1512
} from '@hello.nrfcloud.com/lambda-helpers/validateInput'
1613
import { Context, PublicDeviceId } from '@hello.nrfcloud.com/proto-map/api'
14+
import { ProblemDetailError } from '@hello.nrfcloud.com/proto/hello'
1715
import middy from '@middy/core'
1816
import { Type } from '@sinclair/typebox'
1917
import type {

lambda/extendDeviceSharing.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ import { fromEnv } from '@bifravst/from-env'
55
import { addVersionHeader } from '@hello.nrfcloud.com/lambda-helpers/addVersionHeader'
66
import { aResponse } from '@hello.nrfcloud.com/lambda-helpers/aResponse'
77
import { corsOPTIONS } from '@hello.nrfcloud.com/lambda-helpers/corsOPTIONS'
8-
import {
9-
ProblemDetailError,
10-
problemResponse,
11-
} from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
8+
import { problemResponse } from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
129
import { requestLogger } from '@hello.nrfcloud.com/lambda-helpers/requestLogger'
1310
import {
1411
validateInput,
1512
type ValidInput,
1613
} from '@hello.nrfcloud.com/lambda-helpers/validateInput'
1714
import { PublicDeviceId } from '@hello.nrfcloud.com/proto-map/api'
15+
import { ProblemDetailError } from '@hello.nrfcloud.com/proto/hello'
1816
import middy from '@middy/core'
1917
import { Type } from '@sinclair/typebox'
2018
import type {

lambda/middleware/withUser.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { ProblemDetailError } from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
2-
import { HttpStatusCode } from '@hello.nrfcloud.com/proto/hello'
1+
import {
2+
HttpStatusCode,
3+
ProblemDetailError,
4+
} from '@hello.nrfcloud.com/proto/hello'
35
import type { MiddlewareObj } from '@middy/core'
46
import type {
57
APIGatewayProxyEventV2,

lambda/openSSL.ts

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,50 @@ import path from 'node:path'
1111
/**
1212
* Allows to use OpenSSL
1313
*/
14-
const h = async (event: {
15-
id: string
16-
email: string
17-
}): Promise<{
18-
privateKey: string
19-
certificate: string
20-
} | null> => {
21-
const { id, email } = event
22-
if (id === undefined || email === undefined) {
23-
console.debug(`Missing email and id.`)
24-
return null
25-
}
26-
27-
console.log(`Creating certificate for email ${email} and id ${id} ...`)
14+
export const handler = middy<
15+
{
16+
id: string
17+
email: string
18+
},
19+
{
20+
privateKey: string
21+
certificate: string
22+
} | null
23+
>()
24+
.use(requestLogger())
25+
.use(problemResponse())
26+
.handler(async (event) => {
27+
const { id, email } = event
28+
if (id === undefined || email === undefined) {
29+
console.debug(`Missing email and id.`)
30+
return null
31+
}
2832

29-
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'certs-'))
30-
const caCertificates = await createCA(tempDir, 'Device', email)
31-
const deviceCertificates = await createDeviceCertificate({
32-
dest: tempDir,
33-
caCertificates,
34-
deviceId: id,
35-
})
33+
console.log(`Creating certificate for email ${email} and id ${id} ...`)
3634

37-
console.log(
38-
await run({
39-
command: 'openssl',
40-
args: ['x509', '-in', deviceCertificates.signedCert, '-text', '-noout'],
41-
}),
42-
)
35+
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'certs-'))
36+
const caCertificates = await createCA(tempDir, 'Device', email)
37+
const deviceCertificates = await createDeviceCertificate({
38+
dest: tempDir,
39+
caCertificates,
40+
deviceId: id,
41+
})
4342

44-
const [privateKey, certificate] = (await Promise.all(
45-
[deviceCertificates.privateKey, deviceCertificates.signedCert].map(
46-
async (f) => fs.readFile(f, 'utf-8'),
47-
),
48-
)) as [string, string]
43+
console.log(
44+
await run({
45+
command: 'openssl',
46+
args: ['x509', '-in', deviceCertificates.signedCert, '-text', '-noout'],
47+
}),
48+
)
4949

50-
return {
51-
privateKey,
52-
certificate,
53-
}
54-
}
50+
const [privateKey, certificate] = (await Promise.all(
51+
[deviceCertificates.privateKey, deviceCertificates.signedCert].map(
52+
async (f) => fs.readFile(f, 'utf-8'),
53+
),
54+
)) as [string, string]
5555

56-
export const handler = middy()
57-
.use(requestLogger())
58-
.use(problemResponse())
59-
.handler(h)
56+
return {
57+
privateKey,
58+
certificate,
59+
}
60+
})

lambda/requestToken.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ import { aResponse } from '@hello.nrfcloud.com/lambda-helpers/aResponse'
1010
import { addVersionHeader } from '@hello.nrfcloud.com/lambda-helpers/addVersionHeader'
1111
import { corsOPTIONS } from '@hello.nrfcloud.com/lambda-helpers/corsOPTIONS'
1212
import { metricsForComponent } from '@hello.nrfcloud.com/lambda-helpers/metrics'
13-
import {
14-
ProblemDetailError,
15-
problemResponse,
16-
} from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
13+
import { problemResponse } from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
1714
import { requestLogger } from '@hello.nrfcloud.com/lambda-helpers/requestLogger'
1815
import {
1916
validateInput,
2017
type ValidInput,
2118
} from '@hello.nrfcloud.com/lambda-helpers/validateInput'
2219
import { Email } from '@hello.nrfcloud.com/proto-map/api'
20+
import { ProblemDetailError } from '@hello.nrfcloud.com/proto/hello'
2321
import middy from '@middy/core'
2422
import { Type } from '@sinclair/typebox'
2523
import type {

lambda/shareDevice.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import { aResponse } from '@hello.nrfcloud.com/lambda-helpers/aResponse'
1010
import { addVersionHeader } from '@hello.nrfcloud.com/lambda-helpers/addVersionHeader'
1111
import { corsOPTIONS } from '@hello.nrfcloud.com/lambda-helpers/corsOPTIONS'
1212
import { metricsForComponent } from '@hello.nrfcloud.com/lambda-helpers/metrics'
13-
import {
14-
ProblemDetailError,
15-
problemResponse,
16-
} from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
13+
import { problemResponse } from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
1714
import { requestLogger } from '@hello.nrfcloud.com/lambda-helpers/requestLogger'
1815
import {
1916
validateInput,
@@ -25,6 +22,7 @@ import {
2522
type PublicDevice,
2623
} from '@hello.nrfcloud.com/proto-map/api'
2724
import { fingerprintRegExp } from '@hello.nrfcloud.com/proto/fingerprint'
25+
import { ProblemDetailError } from '@hello.nrfcloud.com/proto/hello'
2826
import middy from '@middy/core'
2927
import { Type, type Static } from '@sinclair/typebox'
3028
import type {

lambda/sharingStatus.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import { fromEnv } from '@bifravst/from-env'
33
import { aResponse } from '@hello.nrfcloud.com/lambda-helpers/aResponse'
44
import { addVersionHeader } from '@hello.nrfcloud.com/lambda-helpers/addVersionHeader'
55
import { corsOPTIONS } from '@hello.nrfcloud.com/lambda-helpers/corsOPTIONS'
6-
import {
7-
ProblemDetailError,
8-
problemResponse,
9-
} from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
6+
import { problemResponse } from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
107
import { requestLogger } from '@hello.nrfcloud.com/lambda-helpers/requestLogger'
118
import {
129
validateInput,
1310
type ValidInput,
1411
} from '@hello.nrfcloud.com/lambda-helpers/validateInput'
1512
import { Context, DeviceId } from '@hello.nrfcloud.com/proto-map/api'
13+
import { ProblemDetailError } from '@hello.nrfcloud.com/proto/hello'
1614
import middy from '@middy/core'
1715
import { Type } from '@sinclair/typebox'
1816
import type {

lambda/sharingStatusFingerprint.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ import { fromEnv } from '@bifravst/from-env'
44
import { aResponse } from '@hello.nrfcloud.com/lambda-helpers/aResponse'
55
import { addVersionHeader } from '@hello.nrfcloud.com/lambda-helpers/addVersionHeader'
66
import { corsOPTIONS } from '@hello.nrfcloud.com/lambda-helpers/corsOPTIONS'
7-
import {
8-
ProblemDetailError,
9-
problemResponse,
10-
} from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
7+
import { problemResponse } from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
118
import { requestLogger } from '@hello.nrfcloud.com/lambda-helpers/requestLogger'
129
import {
1310
validateInput,
1411
type ValidInput,
1512
} from '@hello.nrfcloud.com/lambda-helpers/validateInput'
1613
import { Context } from '@hello.nrfcloud.com/proto-map/api'
1714
import { fingerprintRegExp } from '@hello.nrfcloud.com/proto/fingerprint'
15+
import { ProblemDetailError } from '@hello.nrfcloud.com/proto/hello'
1816
import middy from '@middy/core'
1917
import { Type } from '@sinclair/typebox'
2018
import type {

lambda/stopDeviceSharing.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ import { fromEnv } from '@bifravst/from-env'
55
import { addVersionHeader } from '@hello.nrfcloud.com/lambda-helpers/addVersionHeader'
66
import { aResponse } from '@hello.nrfcloud.com/lambda-helpers/aResponse'
77
import { corsOPTIONS } from '@hello.nrfcloud.com/lambda-helpers/corsOPTIONS'
8-
import {
9-
ProblemDetailError,
10-
problemResponse,
11-
} from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
8+
import { problemResponse } from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
129
import { requestLogger } from '@hello.nrfcloud.com/lambda-helpers/requestLogger'
1310
import {
1411
validateInput,
1512
type ValidInput,
1613
} from '@hello.nrfcloud.com/lambda-helpers/validateInput'
1714
import { PublicDeviceId } from '@hello.nrfcloud.com/proto-map/api'
15+
import { ProblemDetailError } from '@hello.nrfcloud.com/proto/hello'
1816
import middy from '@middy/core'
1917
import { Type } from '@sinclair/typebox'
2018
import type {

lambda/userJwt.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ import { fromEnv } from '@bifravst/from-env'
44
import { aResponse } from '@hello.nrfcloud.com/lambda-helpers/aResponse'
55
import { addVersionHeader } from '@hello.nrfcloud.com/lambda-helpers/addVersionHeader'
66
import { corsOPTIONS } from '@hello.nrfcloud.com/lambda-helpers/corsOPTIONS'
7-
import {
8-
ProblemDetailError,
9-
problemResponse,
10-
} from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
7+
import { problemResponse } from '@hello.nrfcloud.com/lambda-helpers/problemResponse'
118
import { requestLogger } from '@hello.nrfcloud.com/lambda-helpers/requestLogger'
129
import {
1310
validateInput,
1411
type ValidInput,
1512
} from '@hello.nrfcloud.com/lambda-helpers/validateInput'
1613
import { Context, Email, type UserJWT } from '@hello.nrfcloud.com/proto-map/api'
14+
import { ProblemDetailError } from '@hello.nrfcloud.com/proto/hello'
1715
import middy from '@middy/core'
1816
import { Type, type Static } from '@sinclair/typebox'
1917
import type {

0 commit comments

Comments
 (0)