Skip to content

Commit

Permalink
feat(audit_trail): add Kubernetes ACL resource (#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Nov 29, 2024
1 parent 9a2b6da commit 83483b8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/clients/src/api/audit_trail/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export { API } from './api.gen'
export type {
Event,
EventPrincipal,
KubernetesACLInfo,
KubernetesClusterInfo,
KubernetesNodeInfo,
KubernetesPoolInfo,
Expand Down
14 changes: 14 additions & 0 deletions packages/clients/src/api/audit_trail/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import type {
Event,
EventPrincipal,
KubernetesACLInfo,
KubernetesClusterInfo,
KubernetesNodeInfo,
KubernetesPoolInfo,
Expand All @@ -19,6 +20,16 @@ import type {
SecretManagerSecretVersionInfo,
} from './types.gen'

const unmarshalKubernetesACLInfo = (data: unknown): KubernetesACLInfo => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'KubernetesACLInfo' failed as data isn't a dictionary.`,
)
}

return {} as KubernetesACLInfo
}

const unmarshalKubernetesClusterInfo = (
data: unknown,
): KubernetesClusterInfo => {
Expand Down Expand Up @@ -108,6 +119,9 @@ export const unmarshalResource = (data: unknown): Resource => {
createdAt: unmarshalDate(data.created_at),
deletedAt: unmarshalDate(data.deleted_at),
id: data.id,
kubeAclInfo: data.kube_acl_info
? unmarshalKubernetesACLInfo(data.kube_acl_info)
: undefined,
kubeClusterInfo: data.kube_cluster_info
? unmarshalKubernetesClusterInfo(data.kube_cluster_info)
: undefined,
Expand Down
24 changes: 19 additions & 5 deletions packages/clients/src/api/audit_trail/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export type ResourceType =
| 'kube_cluster'
| 'kube_pool'
| 'kube_node'
| 'kube_acl'

export interface KubernetesACLInfo {}

export interface KubernetesClusterInfo {}

Expand Down Expand Up @@ -45,29 +48,40 @@ export interface Resource {
name?: string
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo' could be set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
*/
secmSecretInfo?: SecretManagerSecretInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo' could be set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
*/
secmSecretVersionInfo?: SecretManagerSecretVersionInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo' could be set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
*/
kubeClusterInfo?: KubernetesClusterInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo' could be set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
*/
kubePoolInfo?: KubernetesPoolInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo' could be set.
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
*/
kubeNodeInfo?: KubernetesNodeInfo
/**
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
* set.
*/
kubeAclInfo?: KubernetesACLInfo
}

export interface Event {
Expand Down

0 comments on commit 83483b8

Please sign in to comment.