Skip to content

Commit

Permalink
handles new json format and apply changes
Browse files Browse the repository at this point in the history
  • Loading branch information
joaovictor3g committed Apr 18, 2024
1 parent 10d7cc3 commit 76c3a56
Show file tree
Hide file tree
Showing 11 changed files with 213 additions and 134 deletions.
20 changes: 10 additions & 10 deletions web/assets/css/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

.vap__tabs {
.tabs {
--purple: #8447d1;
--purple-dark: #ab75f0;
--tab-button-width: 150px;
Expand All @@ -23,7 +23,7 @@
align-items: center;
}

.vap__tabs::after {
.tabs::after {
content: "";
width: var(--tab-button-width);
height: 2px;
Expand All @@ -36,7 +36,7 @@
transition: transform 300ms;
}

.vap__tabs button {
.tabs button {
background-color: transparent;
border: none;
width: var(--tab-button-width);
Expand All @@ -53,30 +53,30 @@
cursor: pointer;
}

.dark .vap__tabs button {
.dark .tabs button {
color: white;
}

.vap__tabs button:not(.active):hover {
.tabs button:not(.active):hover {
background-color: rgba(132, 71, 209, 0.08);
color: var(--purple);
padding: 4px 8px;
border-radius: 4px;
}

.dark .vap__tabs button:not(.active):hover {
.dark .tabs button:not(.active):hover {
color: var(--purple-dark);
}

.vap__tabs button.active {
.tabs button.active {
color: var(--purple);
}

.dark .vap__tabs button.active {
.dark .tabs button.active {
color: var(--purple-dark);
}

/* .vap__tabs button.active::after {
/* .tabs button.active::after {
content: "";
width: 150px;
height: 2px;
Expand All @@ -87,6 +87,6 @@
bottom: 0;
} */

.dark .vap__tabs button.active::after {
.dark .tabs button.active::after {
background-color: var(--purple-dark);
}
28 changes: 14 additions & 14 deletions web/assets/examples/cel.json

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions web/assets/examples/vap.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dataUpdated": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n labels:\n app: kubernetes-bootcamp\n name: kubernetes-bootcamp\n namespace: default\nspec:\n progressDeadlineSeconds: 600\n replicas: 3\n revisionHistoryLimit: 10\n selector:\n matchLabels:\n app: kubernetes-bootcamp\n strategy:\n rollingUpdate:\n maxSurge: 25%\n maxUnavailable: 25%\n type: RollingUpdate\n template:\n metadata:\n creationTimestamp: null\n labels:\n app: kubernetes-bootcamp\n spec:\n containers:\n - image: gcr.io/google-samples/kubernetes-bootcamp:v1\n imagePullPolicy: IfNotPresent\n name: kubernetes-bootcamp\n resources: {}\n terminationMessagePath: /dev/termination-log\n terminationMessagePolicy: File\n dnsPolicy: ClusterFirst\n restartPolicy: Always\n schedulerName: default-scheduler\n securityContext: {}\n terminationGracePeriodSeconds: 30\n",
"dataNamespace": "",
"dataRequest": "",
"dataAuthorizer": ""
"dataAuthorizer": "",
"category": "Validation"
},
{
"name": "Variables in Validation",
Expand All @@ -16,7 +17,8 @@
"dataUpdated": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n labels:\n app: kubernetes-bootcamp\n exempt: false\n name: kubernetes-bootcamp\n namespace: default\nspec:\n progressDeadlineSeconds: 600\n replicas: 3\n revisionHistoryLimit: 10\n selector:\n matchLabels:\n app: kubernetes-bootcamp\n strategy:\n rollingUpdate:\n maxSurge: 25%\n maxUnavailable: 25%\n type: RollingUpdate\n template:\n metadata:\n creationTimestamp: null\n labels:\n app: kubernetes-bootcamp\n spec:\n containers:\n - image: prod.policy.example.com/google-samples/kubernetes-bootcamp:v1\n imagePullPolicy: IfNotPresent\n name: kubernetes-bootcamp\n resources: {}\n terminationMessagePath: /dev/termination-log\n terminationMessagePolicy: File\n dnsPolicy: ClusterFirst\n restartPolicy: Always\n schedulerName: default-scheduler\n securityContext: {}\n terminationGracePeriodSeconds: 30\n",
"dataNamespace": "apiVersion: v1\nkind: Namespace\nmetadata:\n creationTimestamp: \"2023-03-10T13:50:03Z\"\n labels:\n kubernetes.io/metadata.name: default\n environment: prod\n name: default\n resourceVersion: \"5932\"\n uid: 01d428dd-9515-4e9c-98a3-d8a278ee0125\nspec:\n finalizers:\n - kubernetes\nstatus:\n phase: Active\n",
"dataRequest": "",
"dataAuthorizer": ""
"dataAuthorizer": "",
"category": "Validation"
},
{
"name": "Match Conditions",
Expand All @@ -25,7 +27,8 @@
"dataUpdated": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n labels:\n app: kubernetes-bootcamp\n environment: prod\n exempt: false\n name: kubernetes-bootcamp\n namespace: default\nspec:\n progressDeadlineSeconds: 600\n replicas: 3\n revisionHistoryLimit: 10\n selector:\n matchLabels:\n app: kubernetes-bootcamp\n strategy:\n rollingUpdate:\n maxSurge: 25%\n maxUnavailable: 25%\n type: RollingUpdate\n template:\n metadata:\n creationTimestamp: null\n labels:\n app: kubernetes-bootcamp\n spec:\n containers:\n - image: prod.registry.io/google-samples/kubernetes-bootcamp:v1\n imagePullPolicy: IfNotPresent\n name: kubernetes-bootcamp\n resources: {}\n terminationMessagePath: /dev/termination-log\n terminationMessagePolicy: File\n dnsPolicy: ClusterFirst\n restartPolicy: Always\n schedulerName: default-scheduler\n securityContext: {}\n terminationGracePeriodSeconds: 30\n",
"dataNamespace": "",
"dataRequest": "uid: 705ab4f5-6393-11e8-b7cc-42010a800002\nkind:\n group: apps\n version: v1\n resource: deployments\nresource:\n group: apps\n version: v1\n resource: deployments\nrequestKind:\n group: apps\n version: v1\n resource: deployments\nrequestResource:\n group: apps\n version: v1\n resource: deployments\nname: kubernetes-bootcamp\nnamespace: default\noperation: CREATE\nuserInfo:\n username: admin\n uid: 014fbff9a07c\n groups:\n - system:authenticated\n - my-admin-group\n extra:\n some-key:\n - some-value1\n - some-value2\n",
"dataAuthorizer": ""
"dataAuthorizer": "",
"category": "Conditions"
},
{
"name": "Audit Annotations",
Expand All @@ -34,7 +37,8 @@
"dataUpdated": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n labels:\n app: kubernetes-bootcamp\n environment: prod\n exempt: false\n name: kubernetes-bootcamp\n namespace: default\nspec:\n progressDeadlineSeconds: 600\n replicas: 3\n revisionHistoryLimit: 10\n selector:\n matchLabels:\n app: kubernetes-bootcamp\n strategy:\n rollingUpdate:\n maxSurge: 25%\n maxUnavailable: 25%\n type: RollingUpdate\n template:\n metadata:\n creationTimestamp: null\n labels:\n app: kubernetes-bootcamp\n spec:\n containers:\n - image: prod.registry.io/google-samples/kubernetes-bootcamp:v1\n imagePullPolicy: IfNotPresent\n name: kubernetes-bootcamp\n resources: {}\n terminationMessagePath: /dev/termination-log\n terminationMessagePolicy: File\n dnsPolicy: ClusterFirst\n restartPolicy: Always\n schedulerName: default-scheduler\n securityContext: {}\n terminationGracePeriodSeconds: 30\n",
"dataNamespace": "",
"dataRequest": "",
"dataAuthorizer": ""
"dataAuthorizer": "",
"category": "Audit"
}
],
"versions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,44 @@
"dataOriginal": "",
"dataUpdated": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n labels:\n app: kubernetes-bootcamp\n name: kubernetes-bootcamp\n namespace: default\nspec:\n progressDeadlineSeconds: 600\n replicas: 1\n revisionHistoryLimit: 10\n selector:\n matchLabels:\n app: kubernetes-bootcamp\n strategy:\n rollingUpdate:\n maxSurge: 25%\n maxUnavailable: 25%\n type: RollingUpdate\n template:\n metadata:\n creationTimestamp: null\n labels:\n app: kubernetes-bootcamp\n spec:\n containers:\n - image: gcr.io/google-samples/kubernetes-bootcamp:v1\n imagePullPolicy: IfNotPresent\n name: kubernetes-bootcamp\n resources: {}\n terminationMessagePath: /dev/termination-log\n terminationMessagePolicy: File\n dnsPolicy: ClusterFirst\n restartPolicy: Always\n schedulerName: default-scheduler\n securityContext: {}\n terminationGracePeriodSeconds: 30\n",
"dataRequest": "uid: 705ab4f5-6393-11e8-b7cc-42010a800002\nkind:\n group: apps\n version: v1\n resource: deployments\nresource:\n group: apps\n version: v1\n resource: deployments\nrequestKind:\n group: apps\n version: v1\n resource: deployments\nrequestResource:\n group: apps\n version: v1\n resource: deployments\nname: kubernetes-bootcamp\nnamespace: default\noperation: CREATE\nuserInfo:\n username: admin\n uid: 014fbff9a07c\n groups:\n - system:authenticated\n - my-admin-group\n extra:\n some-key:\n - some-value1\n - some-value2\n",
"dataAuthorizer": ""
"dataAuthorizer": "",
"category": "Request"
},
{
"name": "Request Ignore Leases",
"webhooks": "apiVersion: admissionregistration.k8s.io/v1\nkind: ValidatingWebhookConfiguration\nwebhooks:\n - name: my-webhook.example.com\n matchPolicy: Equivalent\n rules:\n - operations: ['CREATE','UPDATE']\n apiGroups: ['*']\n apiVersions: ['*']\n resources: ['*']\n failurePolicy: 'Ignore' # Fail-open (optional)\n sideEffects: None\n clientConfig:\n service:\n namespace: my-namespace\n name: my-webhook\n caBundle: 'PGNhYnVuZGxlPgo='\n # You can have up to 64 matchConditions per webhook\n matchConditions:\n - name: 'exclude-leases' # Each match condition must have a unique name\n expression: '!(request.resource.group == \"coordination.k8s.io\" && request.resource.resource == \"leases\")' # Match non-lease resources.\n - name: 'exclude-kubelet-requests'\n expression: '!(\"system:nodes\" in request.userInfo.groups)' # Match requests made by non-node users.\n",
"dataOriginal": "",
"dataUpdated": "apiVersion: coordination.k8s.io/v1\nkind: Lease\nmetadata:\n name: ingress-nginx-leader\n namespace: ingress-nginx\nspec:\n acquireTime: \"2023-11-24T16:51:02.229818Z\"\n holderIdentity: ingress-nginx-controller-6597456577-s5h9w\n leaseDurationSeconds: 30\n leaseTransitions: 7\n renewTime: \"2024-04-09T21:59:30.694589Z\"\n",
"dataRequest": "uid: 705ab4f5-6393-11e8-b7cc-42010a800002\nkind:\n group: coordination.k8s.io\n version: v1\n resource: leases\nresource:\n group: coordination.k8s.io\n version: v1\n resource: leases\nrequestKind:\n group: coordination.k8s.io\n version: v1\n resource: leases\nrequestResource:\n group: coordination.k8s.io\n version: v1\n resource: leases\nname: ingress-nginx-leader\nnamespace: ingress-nginx\noperation: CREATE\nuserInfo:\n username: admin\n uid: 014fbff9a07c\n groups:\n - system:authenticated\n - my-admin-group\n extra:\n some-key:\n - some-value1\n - some-value2\n",
"dataAuthorizer": ""
"dataAuthorizer": "",
"category": "Request"
},
{
"name": "Request Ignore Kubelet",
"webhooks": "apiVersion: admissionregistration.k8s.io/v1\nkind: ValidatingWebhookConfiguration\nwebhooks:\n - name: my-webhook.example.com\n matchPolicy: Equivalent\n rules:\n - operations: ['CREATE','UPDATE']\n apiGroups: ['*']\n apiVersions: ['*']\n resources: ['*']\n failurePolicy: 'Ignore' # Fail-open (optional)\n sideEffects: None\n clientConfig:\n service:\n namespace: my-namespace\n name: my-webhook\n caBundle: 'PGNhYnVuZGxlPgo='\n # You can have up to 64 matchConditions per webhook\n matchConditions:\n - name: 'exclude-leases' # Each match condition must have a unique name\n expression: '!(request.resource.group == \"coordination.k8s.io\" && request.resource.resource == \"leases\")' # Match non-lease resources.\n - name: 'exclude-kubelet-requests'\n expression: '!(\"system:nodes\" in request.userInfo.groups)' # Match requests made by non-node users.\n",
"dataOriginal": "",
"dataUpdated": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n labels:\n app: kubernetes-bootcamp\n name: kubernetes-bootcamp\n namespace: default\nspec:\n progressDeadlineSeconds: 600\n replicas: 1\n revisionHistoryLimit: 10\n selector:\n matchLabels:\n app: kubernetes-bootcamp\n strategy:\n rollingUpdate:\n maxSurge: 25%\n maxUnavailable: 25%\n type: RollingUpdate\n template:\n metadata:\n creationTimestamp: null\n labels:\n app: kubernetes-bootcamp\n spec:\n containers:\n - image: gcr.io/google-samples/kubernetes-bootcamp:v1\n imagePullPolicy: IfNotPresent\n name: kubernetes-bootcamp\n resources: {}\n terminationMessagePath: /dev/termination-log\n terminationMessagePolicy: File\n dnsPolicy: ClusterFirst\n restartPolicy: Always\n schedulerName: default-scheduler\n securityContext: {}\n terminationGracePeriodSeconds: 30\n",
"dataRequest": "uid: 705ab4f5-6393-11e8-b7cc-42010a800002\nkind:\n group: apps\n version: v1\n resource: deployments\nresource:\n group: apps\n version: v1\n resource: deployments\nrequestKind:\n group: apps\n version: v1\n resource: deployments\nrequestResource:\n group: apps\n version: v1\n resource: deployments\nname: kubernetes-bootcamp\nnamespace: default\noperation: CREATE\nuserInfo:\n username: node1\n uid: 014fbff9a07c\n groups:\n - system:nodes\n extra:\n some-key:\n - some-value1\n - some-value2\n",
"dataAuthorizer": ""
"dataAuthorizer": "",
"category": "Request"
},
{
"name": "Authorizer Accept",
"webhooks": "apiVersion: admissionregistration.k8s.io/v1\nkind: ValidatingWebhookConfiguration\nwebhooks:\n - name: rbac.my-webhook.example.com\n matchPolicy: Equivalent\n rules:\n - operations: ['CREATE','UPDATE']\n apiGroups: ['apps']\n apiVersions: ['*']\n resources: ['*']\n failurePolicy: 'Fail' # Fail-closed (the default)\n sideEffects: None\n clientConfig:\n service:\n namespace: my-namespace\n name: my-webhook\n caBundle: 'PGNhYnVuZGxlPgo='\n # You can have up to 64 matchConditions per webhook\n matchConditions:\n - name: 'breakglass'\n # Skip requests made by users authorized to 'breakglass' on this webhook.\n # The 'breakglass' API verb does not need to exist outside this check.\n expression: '!authorizer.group(\"admissionregistration.k8s.io\").resource(\"validatingwebhookconfigurations\").name(\"rbac.my-webhook.example.com\").check(\"breakglass\").allowed()'\n",
"dataOriginal": "",
"dataUpdated": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n labels:\n app: kubernetes-bootcamp\n name: kubernetes-bootcamp\n namespace: default\nspec:\n progressDeadlineSeconds: 600\n replicas: 1\n revisionHistoryLimit: 10\n selector:\n matchLabels:\n app: kubernetes-bootcamp\n strategy:\n rollingUpdate:\n maxSurge: 25%\n maxUnavailable: 25%\n type: RollingUpdate\n template:\n metadata:\n creationTimestamp: null\n labels:\n app: kubernetes-bootcamp\n spec:\n containers:\n - image: gcr.io/google-samples/kubernetes-bootcamp:v1\n imagePullPolicy: IfNotPresent\n name: kubernetes-bootcamp\n resources: {}\n terminationMessagePath: /dev/termination-log\n terminationMessagePolicy: File\n dnsPolicy: ClusterFirst\n restartPolicy: Always\n schedulerName: default-scheduler\n securityContext: {}\n terminationGracePeriodSeconds: 30\n",
"dataRequest": "uid: 705ab4f5-6393-11e8-b7cc-42010a800002\nkind:\n group: apps\n version: v1\n resource: deployments\nresource:\n group: apps\n version: v1\n resource: deployments\nrequestKind:\n group: apps\n version: v1\n resource: deployments\nrequestResource:\n group: apps\n version: v1\n resource: deployments\nname: kubernetes-bootcamp\nnamespace: default\noperation: CREATE\nuserInfo:\n username: admin\n uid: 014fbff9a07c\n groups:\n - system:authenticated\n - my-admin-group\n extra:\n some-key:\n - some-value1\n - some-value2\n",
"dataAuthorizer": "paths:\ngroups:\nserviceAccounts:\n"
"dataAuthorizer": "paths:\ngroups:\nserviceAccounts:\n",
"category": "Authorizer"
},
{
"name": "Authorizer Ignore breakglass",
"webhooks": "apiVersion: admissionregistration.k8s.io/v1\nkind: ValidatingWebhookConfiguration\nwebhooks:\n - name: rbac.my-webhook.example.com\n matchPolicy: Equivalent\n rules:\n - operations: ['CREATE','UPDATE']\n apiGroups: ['apps']\n apiVersions: ['*']\n resources: ['*']\n failurePolicy: 'Fail' # Fail-closed (the default)\n sideEffects: None\n clientConfig:\n service:\n namespace: my-namespace\n name: my-webhook\n caBundle: 'PGNhYnVuZGxlPgo='\n # You can have up to 64 matchConditions per webhook\n matchConditions:\n - name: 'breakglass'\n # Skip requests made by users authorized to 'breakglass' on this webhook.\n # The 'breakglass' API verb does not need to exist outside this check.\n expression: '!authorizer.group(\"admissionregistration.k8s.io\").resource(\"validatingwebhookconfigurations\").name(\"rbac.my-webhook.example.com\").check(\"breakglass\").allowed()'\n",
"dataOriginal": "",
"dataUpdated": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n labels:\n app: kubernetes-bootcamp\n name: kubernetes-bootcamp\n namespace: default\nspec:\n progressDeadlineSeconds: 600\n replicas: 1\n revisionHistoryLimit: 10\n selector:\n matchLabels:\n app: kubernetes-bootcamp\n strategy:\n rollingUpdate:\n maxSurge: 25%\n maxUnavailable: 25%\n type: RollingUpdate\n template:\n metadata:\n creationTimestamp: null\n labels:\n app: kubernetes-bootcamp\n spec:\n containers:\n - image: gcr.io/google-samples/kubernetes-bootcamp:v1\n imagePullPolicy: IfNotPresent\n name: kubernetes-bootcamp\n resources: {}\n terminationMessagePath: /dev/termination-log\n terminationMessagePolicy: File\n dnsPolicy: ClusterFirst\n restartPolicy: Always\n schedulerName: default-scheduler\n securityContext: {}\n terminationGracePeriodSeconds: 30\n",
"dataRequest": "uid: 705ab4f5-6393-11e8-b7cc-42010a800002\nkind:\n group: apps\n version: v1\n resource: deployments\nresource:\n group: apps\n version: v1\n resource: deployments\nrequestKind:\n group: apps\n version: v1\n resource: deployments\nrequestResource:\n group: apps\n version: v1\n resource: deployments\nname: kubernetes-bootcamp\nnamespace: default\noperation: CREATE\nuserInfo:\n username: admin\n uid: 014fbff9a07c\n groups:\n - system:authenticated\n - my-admin-group\n extra:\n some-key:\n - some-value1\n - some-value2\n",
"dataAuthorizer": "paths:\ngroups:\n admissionregistration.k8s.io:\n resources:\n validatingwebhookconfigurations:\n checks:\n \"\":\n rbac.my-webhook.example.com:\n breakglass:\n decision: allow\nserviceAccounts:\n"
"dataAuthorizer": "paths:\ngroups:\n admissionregistration.k8s.io:\n resources:\n validatingwebhookconfigurations:\n checks:\n \"\":\n rbac.my-webhook.example.com:\n breakglass:\n decision: allow\nserviceAccounts:\n",
"category": "Authorizer"
}
],
"versions": {
Expand Down
15 changes: 15 additions & 0 deletions web/assets/js/StorageValues.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const KEY = "values";

export class StorageValues {
constructor() {
this.values = JSON.parse(localStorage.getItem(KEY));
}

setValues(values) {
localStorage.setItem(KEY, JSON.stringify(values));
}

getValues() {
return this.values;
}
}
Loading

0 comments on commit 76c3a56

Please sign in to comment.