Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e840509
add state to ERD and add new migration
jakedoublev Feb 12, 2024
0f36899
add real uuids to fixtures for readability
jakedoublev Feb 12, 2024
971d063
fix namespaces GET and LIST queries to only return id and name but no…
jakedoublev Feb 12, 2024
9b4f973
add indexes on state column
jakedoublev Feb 12, 2024
0e7de50
Merge branch 'main' into issue-96/state
jakedoublev Feb 12, 2024
6b2e38c
add state to namespaces fixtures
jakedoublev Feb 12, 2024
60ef44a
add function and trigger definitions to new migration sql
jakedoublev Feb 12, 2024
a866acc
add soft-delete to namespaces, then support list filtering based on s…
jakedoublev Feb 12, 2024
b6e71ef
prove out triggers working as expected in update cascade from namespaces
jakedoublev Feb 12, 2024
312cd40
demonstrate it can still be found when inactive
jakedoublev Feb 12, 2024
091bd29
add state enum to namespaces, attributes, attribute values protos and…
jakedoublev Feb 14, 2024
b762b6e
generated sdk code from protos
jakedoublev Feb 14, 2024
77a2d4e
add support for state in the db functions that message handlers call
jakedoublev Feb 14, 2024
c9f3a76
add debug logs, clean up naming from soft-delete to deactivation, mak…
jakedoublev Feb 14, 2024
faf14f5
cleanup
jakedoublev Feb 15, 2024
f4dbba3
cleanup
jakedoublev Feb 15, 2024
bbee6b9
rename schema ERD files and preserve timestamped schemas per migration
jakedoublev Feb 15, 2024
592d14e
update proto state type active enum, regenerate protos, and match gen…
jakedoublev Feb 16, 2024
09cc5df
Merge branch 'main' into issue-96/state
jakedoublev Feb 16, 2024
cf2981c
use Tables struct and fields provided instead of tableField func for …
jakedoublev Feb 16, 2024
9e8238e
remove unused tableField func
jakedoublev Feb 16, 2024
fe83e1a
Merge branch 'main' into issue-96/state
jakedoublev Feb 16, 2024
de308d6
change state enum to active bool column in schema migration/erd
jakedoublev Feb 16, 2024
45263de
allow clients to use a string enum active/inactive/any/unspecified in…
jakedoublev Feb 16, 2024
5c07e8c
add more integration tests, update tests, and add deactivated state t…
jakedoublev Feb 16, 2024
22af346
Merge branch 'main' into issue-96/state
jakedoublev Feb 16, 2024
28a6092
Merge branch 'main' into issue-96/state
jakedoublev Feb 16, 2024
18cf018
update protos and generated code
jakedoublev Feb 16, 2024
4e334e6
handle active response as boolean
jakedoublev Feb 16, 2024
c080c4e
update example grpcurls to reflect new response active field instead …
jakedoublev Feb 16, 2024
44a0af1
introduced google protobuf boolean wrapper to handle marshaling false…
jakedoublev Feb 16, 2024
388d6eb
consume wrapper type for active state
jakedoublev Feb 16, 2024
2905053
fix tests to account for new bool wrapper and make sure to scan into …
jakedoublev Feb 16, 2024
7ca58bc
Merge branch 'main' into issue-96/state
jakedoublev Feb 16, 2024
d80f19b
Merge branch 'main' into issue-96/state
jrschumacher Feb 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
313 changes: 242 additions & 71 deletions docs/grpc/index.html

Large diffs are not rendered by default.

39 changes: 31 additions & 8 deletions docs/openapi/attributes/attributes.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"paths": {
"/attributes": {
"post": {
"summary": "Create Attribute\nExample:\n grpcurl -plaintext -d '{\"attribute\": {\"namespace_id\": \"namespace_id\", \"name\": \"attribute_name\", \"rule\": \"ATTRIBUTE_RULE_TYPE_ENUM_ALL_OF\"}}' localhost:8080 attributes.AttributesService/CreateAttribute",
"summary": "Create Attribute\nRequest:\ngrpcurl -plaintext -d '{\"attribute\": {\"namespace_id\": \"namespace_id\", \"name\": \"attribute_name\", \"rule\": \"ATTRIBUTE_RULE_TYPE_ENUM_ALL_OF\"}}' localhost:9000 attributes.AttributesService/CreateAttribute\nResponse\n{\n\"attribute\": {\n\"id\": \"e06f067b-d158-44bc-a814-1aa3f968dcf0\",\n\"metadata\": {\n\"createdAt\": \"2024-02-14T20:24:23.057404Z\",\n\"updatedAt\": \"2024-02-14T20:24:23.057404Z\"\n},\n\"namespace\": {\n\"id\": \"namespace_id\"\n},\n\"name\": \"attribute_name\",\n\"rule\": \"ATTRIBUTE_RULE_TYPE_ENUM_ALL_OF\",\n\"active\": true\n}\n}",
"operationId": "AttributesService_CreateAttribute",
"responses": {
"200": {
Expand Down Expand Up @@ -80,12 +80,12 @@
]
},
"delete": {
"operationId": "AttributesService_DeleteAttributeValue",
"operationId": "AttributesService_DeactivateAttributeValue",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/attributesDeleteAttributeValueResponse"
"$ref": "#/definitions/attributesDeactivateAttributeValueResponse"
}
},
"default": {
Expand Down Expand Up @@ -246,7 +246,7 @@
},
"/attributes/{attributeId}/values": {
"post": {
"summary": "Create Attribute Value\nExample:\n grpcurl -plaintext -d '{\"attribute_id\": \"attribute_id\", \"value\": {\"value\": \"value\"}}' localhost:8080 attributes.AttributesService/CreateValue",
"summary": "Create Attribute Value\nExample:\n grpcurl -plaintext -d '{\"attribute_id\": \"attribute_id\", \"value\": {\"value\": \"value\"}}' localhost:8080 attributes.AttributesService/CreateAttributeValue",
"operationId": "AttributesService_CreateAttributeValue",
"responses": {
"200": {
Expand Down Expand Up @@ -357,12 +357,12 @@
]
},
"delete": {
"operationId": "AttributesService_DeleteAttribute",
"operationId": "AttributesService_DeactivateAttribute",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/attributesDeleteAttributeResponse"
"$ref": "#/definitions/attributesDeactivateAttributeResponse"
}
},
"default": {
Expand Down Expand Up @@ -474,6 +474,10 @@
"type": "object",
"$ref": "#/definitions/kasregistryKeyAccessServer"
}
},
"active": {
"type": "boolean",
"title": "active by default until explicitly deactivated"
}
}
},
Expand Down Expand Up @@ -544,15 +548,15 @@
}
}
},
"attributesDeleteAttributeResponse": {
"attributesDeactivateAttributeResponse": {
"type": "object",
"properties": {
"attribute": {
"$ref": "#/definitions/attributesAttribute"
}
}
},
"attributesDeleteAttributeValueResponse": {
"attributesDeactivateAttributeValueResponse": {
"type": "object",
"properties": {
"value": {
Expand Down Expand Up @@ -662,6 +666,10 @@
"$ref": "#/definitions/kasregistryKeyAccessServer"
},
"title": "list of key access servers"
},
"active": {
"type": "boolean",
"title": "active by default until explicitly deactivated"
}
}
},
Expand Down Expand Up @@ -694,6 +702,17 @@
}
}
},
"commonActiveStateEnum": {
"type": "string",
"enum": [
"ACTIVE_STATE_ENUM_UNSPECIFIED",
"ACTIVE_STATE_ENUM_ACTIVE",
"ACTIVE_STATE_ENUM_INACTIVE",
"ACTIVE_STATE_ENUM_ANY"
],
"default": "ACTIVE_STATE_ENUM_UNSPECIFIED",
"title": "buflint ENUM_VALUE_PREFIX: to make sure that C++ scoping rules aren't violated when users add new enum values to an enum in a given package"
},
"commonMetadata": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -779,6 +798,10 @@
"name": {
"type": "string",
"title": "used to partition Attribute Definitions, support by namespace AuthN and enable federation"
},
"active": {
"type": "boolean",
"title": "active by default until explicitly deactivated"
}
}
},
Expand Down
40 changes: 37 additions & 3 deletions docs/openapi/namespaces/namespaces.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"paths": {
"/attributes/namespaces": {
"get": {
"summary": "NOTE: ACTIVE state by default, INACTIVE or ANY when specified\nRequest: \ngrpcurl -plaintext localhost:9000 namespaces.NamespaceService/ListNamespaces\nResponse:\n{\n\"namespaces\": [\n{\n\"id\": \"namespace-id\",\n\"name\": \"namespace-name\",\n\"active\": true\n}\n]\n}",
"operationId": "NamespaceService_ListNamespaces",
"responses": {
"200": {
Expand All @@ -33,11 +34,28 @@
}
}
},
"parameters": [
{
"name": "state",
"description": "ACTIVE by default when not specified",
"in": "query",
"required": false,
"type": "string",
"enum": [
"ACTIVE_STATE_ENUM_UNSPECIFIED",
"ACTIVE_STATE_ENUM_ACTIVE",
"ACTIVE_STATE_ENUM_INACTIVE",
"ACTIVE_STATE_ENUM_ANY"
],
"default": "ACTIVE_STATE_ENUM_UNSPECIFIED"
}
],
"tags": [
"NamespaceService"
]
},
"post": {
"summary": "Request: \ngrpcurl -plaintext -d '{\"name\": \"namespace-name\"}' localhost:9000 namespaces.NamespaceService/CreateNamespace\nResponse:\n{ \"namespace\": { \"id\": \"namespace-id\", \"active\": true } }",
"operationId": "NamespaceService_CreateNamespace",
"responses": {
"200": {
Expand Down Expand Up @@ -68,6 +86,7 @@
},
"/attributes/namespaces/{id}": {
"get": {
"summary": "Request: \ngrpcurl -plaintext -d '{\"id\": \"namespace-id\"}' localhost:9000 namespaces.NamespaceService/GetNamespace\nResponse:\n{\n\"namespace\": {\n\"id\": \"namespace-id\",\n\"name\": \"namespace-name\",\n\"active\": true\n}\n}",
"operationId": "NamespaceService_GetNamespace",
"responses": {
"200": {
Expand Down Expand Up @@ -96,12 +115,12 @@
]
},
"delete": {
"operationId": "NamespaceService_DeleteNamespace",
"operationId": "NamespaceService_DeactivateNamespace",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/namespacesDeleteNamespaceResponse"
"$ref": "#/definitions/namespacesDeactivateNamespaceResponse"
}
},
"default": {
Expand Down Expand Up @@ -160,6 +179,17 @@
}
},
"definitions": {
"commonActiveStateEnum": {
"type": "string",
"enum": [
"ACTIVE_STATE_ENUM_UNSPECIFIED",
"ACTIVE_STATE_ENUM_ACTIVE",
"ACTIVE_STATE_ENUM_INACTIVE",
"ACTIVE_STATE_ENUM_ANY"
],
"default": "ACTIVE_STATE_ENUM_UNSPECIFIED",
"title": "buflint ENUM_VALUE_PREFIX: to make sure that C++ scoping rules aren't violated when users add new enum values to an enum in a given package"
},
"namespacesCreateNamespaceResponse": {
"type": "object",
"properties": {
Expand All @@ -168,7 +198,7 @@
}
}
},
"namespacesDeleteNamespaceResponse": {
"namespacesDeactivateNamespaceResponse": {
"type": "object"
},
"namespacesGetNamespaceResponse": {
Expand Down Expand Up @@ -201,6 +231,10 @@
"name": {
"type": "string",
"title": "used to partition Attribute Definitions, support by namespace AuthN and enable federation"
},
"active": {
"type": "boolean",
"title": "active by default until explicitly deactivated"
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions docs/openapi/resourcemapping/resource_mapping.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@
"$ref": "#/definitions/kasregistryKeyAccessServer"
},
"title": "list of key access servers"
},
"active": {
"type": "boolean",
"title": "active by default until explicitly deactivated"
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions docs/openapi/subjectmapping/subject_mapping.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@
"$ref": "#/definitions/kasregistryKeyAccessServer"
},
"title": "list of key access servers"
},
"active": {
"type": "boolean",
"title": "active by default until explicitly deactivated"
}
}
},
Expand Down
Loading