This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add secret rotation schemas (#15)
* chore: upgrade dependencies * feat: add apigateway schemas * feat: add eventbridge schemas * feat: add firehose schemas * feat: add lambda schemas * feat: add kinesis schemas * feat: add s3 schemas * feat: add s3 batch schemas * feat: add secret rotation schemas
- Loading branch information
1 parent
7a8982a
commit a969285
Showing
5 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './secret-rotation.type' |
5 changes: 5 additions & 0 deletions
5
src/lib/aws/secret-rotation/schemas/secret-rotation-event.schema.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { $validator, $object, $string, $enum } from '@skyleague/therefore' | ||
|
||
export const secretRotationEvent = $validator( | ||
$object({ | ||
Step: $enum(['createSecret', 'finishSecret', 'setSecret', 'testSecret']), | ||
SecretId: $string, | ||
ClientRequestToken: $string, | ||
}) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { SecretRotationEvent } from './secret-rotation.type' | ||
|
||
import type { SecretsManagerRotationEvent as LambdaSecretRotationEvent } from 'aws-lambda' | ||
|
||
test('type is compatible', () => { | ||
const _test: SecretRotationEvent = {} as unknown as LambdaSecretRotationEvent | ||
const _test2: LambdaSecretRotationEvent = {} as unknown as SecretRotationEvent | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Generated by @skyleague/therefore@v1.0.0-local | ||
* Do not manually touch this | ||
*/ | ||
/* eslint-disable */ | ||
import AjvValidator from 'ajv' | ||
import type { ValidateFunction } from 'ajv' | ||
|
||
export interface SecretRotationEvent { | ||
Step: 'createSecret' | 'finishSecret' | 'setSecret' | 'testSecret' | ||
SecretId: string | ||
ClientRequestToken: string | ||
} | ||
|
||
export const SecretRotationEvent = { | ||
validate: require('./schemas/secret-rotation-event.schema.js') as ValidateFunction<SecretRotationEvent>, | ||
get schema() { | ||
return SecretRotationEvent.validate.schema | ||
}, | ||
get errors() { | ||
return SecretRotationEvent.validate.errors ?? undefined | ||
}, | ||
is: (o: unknown): o is SecretRotationEvent => SecretRotationEvent.validate(o) === true, | ||
assert: (o: unknown) => { | ||
if (!SecretRotationEvent.validate(o)) { | ||
throw new AjvValidator.ValidationError(SecretRotationEvent.errors ?? []) | ||
} | ||
}, | ||
} as const |