Skip to content

Commit cfa4db5

Browse files
feat: Open id connect resource view (#3739)
* Add initial extension * change category * add yaml * yaml corrected * Correct info and link for openidconnect * Extend yaml * Additional info added * PR correction * PR correction * PR correction * PR corrections * update documentation * Update documentation * Update documentation * Update documentation
1 parent 988a0a8 commit cfa4db5

File tree

7 files changed

+127
-28
lines changed

7 files changed

+127
-28
lines changed

docs/extensibility/120-resource-extensions.md

Lines changed: 27 additions & 25 deletions
Large diffs are not rendered by default.

kyma/environments/dev/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
{
1212
"source": "extensions/configuration"
1313
},
14+
{
15+
"source": "extensions/configuration-cluster"
16+
},
1417
{
1518
"source": "https://raw.githubusercontent.com/kyma-project/eventing-manager/main/config/ui-extensions/subscriptions/subscriptions.yaml"
1619
},

kyma/environments/prod/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
{
99
"source": "extensions/configuration"
1010
},
11+
{
12+
"source": "extensions/configuration-cluster"
13+
},
1114
{
1215
"source": "extensions/service-management"
1316
},

kyma/environments/stage/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
{
99
"source": "extensions/configuration"
1010
},
11+
{
12+
"source": "extensions/configuration-cluster"
13+
},
1114
{
1215
"source": "extensions/service-management"
1316
},
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
kind: ConfigMap
2+
apiVersion: v1
3+
metadata:
4+
name: openidconnect
5+
namespace: kube-public
6+
labels:
7+
app.kubernetes.io/name: openidconnect
8+
busola.io/extension: resource
9+
busola.io/extension-version: '0.5'
10+
data:
11+
general: |
12+
resource:
13+
kind: OpenIDConnect
14+
group: authentication.gardener.cloud
15+
version: v1alpha1
16+
name: OpenID Connect
17+
category: Configuration
18+
urlPath: openidconnects
19+
scope: cluster
20+
features:
21+
actions:
22+
disableEdit: metadata.labels."operator.kyma-project.io/managed-by" = "infrastructure-manager"
23+
description: >-
24+
{{[OpenID Connect](https://gardener.cloud/docs/extensions/others/gardener-extension-shoot-oidc-service/openidconnects/)}}
25+
is an open standard authentication protocol built on top of the OAuth 2.0 framework. It provides a secure and flexible way to authenticate and authorize users within applications and systems.
26+
details: |-
27+
body:
28+
- widget: Panel
29+
name: Specification
30+
children:
31+
- source: spec.supportedSigningAlgs
32+
widget: JoinedArray
33+
name: Supported signing algorithms
34+
- source: spec.issuerURL
35+
name: Issuer
36+
- source: spec.usernameClaim
37+
name: Username Claim
38+
- source: spec.groupsClaim
39+
name: Groups Claim
40+
- source: spec.clientID
41+
name: Client ID
42+
- source: spec.jwks.distributedClaims
43+
name: Distributed Claims
44+
list: |-
45+
- name: Issuer
46+
source: spec.issuerURL
47+
- name: Username Claim
48+
source: spec.usernameClaim
49+
- name: Groups Claim
50+
source: spec.groupsClaim
51+
- name: Client ID
52+
source: spec.clientID
53+
form: |-
54+
- path: spec.issuerURL
55+
widget: Text
56+
placeholder: Issuer
57+
- path: spec.usernameClaim
58+
widget: Text
59+
placeholder: Username Claim
60+
- path: spec.groupsClaim
61+
widget: Text
62+
placeholder: Groups Claim
63+
- path: spec.clientID
64+
widget: Text
65+
placeholder: Client ID
66+
- path: spec.jwks.distributedClaims
67+
enum:
68+
- true
69+
- false
70+
- path: spec.supportedSigningAlgs
71+
widget: SimpleList
72+
defaultExpanded: true
73+
children:
74+
- path: '[]'
75+
description: ''

src/components/Extensibility/ExtensibilityDetails.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,18 @@ export const ExtensibilityDetailsCore = ({
8686
return { visible, error };
8787
};
8888

89+
const prepareDisableEdit = resource => {
90+
if (disableEdit && typeof disableEdit === 'string') {
91+
const [isDisabled] = jsonata(disableEdit, { resource });
92+
return typeof isDisabled === 'boolean' ? isDisabled : false;
93+
}
94+
return disableEdit;
95+
};
96+
8997
return (
9098
<ResourceDetails
9199
layoutCloseCreateUrl={layoutCloseCreateUrl}
92-
disableEdit={disableEdit}
100+
disableEdit={prepareDisableEdit}
93101
disableDelete={disableDelete}
94102
resourceTitle={resourceTitle}
95103
headerActions={headerActions}

src/shared/components/ResourceDetails/ResourceDetails.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ResourceDetails.propTypes = {
5959
windowTitle: PropTypes.string,
6060
resourceGraphConfig: PropTypes.object,
6161
resourceSchema: PropTypes.object,
62-
disableEdit: PropTypes.bool,
62+
disableEdit: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
6363
disableDelete: PropTypes.bool,
6464
showYamlTab: PropTypes.bool,
6565
layoutCloseCreateUrl: PropTypes.string,
@@ -119,12 +119,17 @@ function ResourceDetailsRenderer(props) {
119119
<>
120120
{resource && (
121121
<Resource
122+
{...props}
122123
key={resource.metadata.name}
123124
deleteResourceMutation={deleteResourceMutation}
124125
updateResourceMutation={updateResourceMutation}
125126
silentRefetch={silentRefetch}
126127
resource={resource}
127-
{...props}
128+
disableEdit={
129+
typeof props.disableEdit === 'function'
130+
? props.disableEdit(resource)
131+
: props.disableEdit
132+
}
128133
/>
129134
)}
130135
</>

0 commit comments

Comments
 (0)