@soft-stech/spiffe
Version:
156 lines (155 loc) • 4.83 kB
JavaScript
import { addSchema } from "@soft-stech/apimachinery/_schemas/IoK8sApimachineryPkgApisMetaV1ObjectMeta";
import { Model, setSchema, createTypeMetaGuard } from "@soft-stech/base";
import { register } from "@soft-stech/validate";
const schemaId = "spiffeid.spiffe.io.v1beta1.SpiffeID";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"spiffeid.spiffe.io/v1beta1"
]
},
"kind": {
"type": "string",
"enum": [
"SpiffeID"
]
},
"metadata": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#"
},
{
"type": "null"
}
]
},
"spec": {
"properties": {
"dnsNames": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"federatesWith": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"parentId": {
"type": "string"
},
"downstream": {
"type": "boolean",
"nullable": true
},
"selector": {
"properties": {
"arbitrary": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"containerImage": {
"type": "string",
"nullable": true
},
"containerName": {
"type": "string",
"nullable": true
},
"namespace": {
"type": "string",
"nullable": true
},
"nodeName": {
"type": "string",
"nullable": true
},
"podLabel": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"properties": {},
"nullable": true
},
"podName": {
"type": "string",
"nullable": true
},
"podUid": {
"type": "string",
"nullable": true
},
"serviceAccount": {
"type": "string",
"nullable": true
},
"cluster": {
"type": "string",
"nullable": true
},
"agent_node_uid": {
"type": "string",
"nullable": true
}
},
"type": "object"
},
"spiffeId": {
"type": "string"
}
},
"required": [
"parentId",
"selector",
"spiffeId"
],
"type": "object",
"nullable": true
},
"status": {
"properties": {
"entryId": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"apiVersion",
"kind"
]
};
/**
* SpiffeID is the Schema for the spiffeid API
*/
export class SpiffeID extends Model {
constructor(data) {
super({
apiVersion: SpiffeID.apiVersion,
kind: SpiffeID.kind,
...data
});
}
}
SpiffeID.apiVersion = "spiffeid.spiffe.io/v1beta1";
SpiffeID.kind = "SpiffeID";
SpiffeID.is = createTypeMetaGuard(SpiffeID);
setSchema(SpiffeID, schemaId, () => {
addSchema();
register(schemaId, schema);
});