@contember/create 2.2.0-alpha.20 → 2.2.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@contember/create",
3
- "version": "2.2.0-alpha.20",
3
+ "version": "2.2.0-alpha.21",
4
4
  "license": "Apache-2.0",
5
5
  "bin": "dist/production/run.js",
6
6
  "dependencies": {
7
- "@contember/cli-common": "2.2.0-alpha.20",
7
+ "@contember/cli-common": "2.2.0-alpha.21",
8
8
  "js-yaml": "^4.1.1"
9
9
  },
10
10
  "engines": {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { useState } from 'react'
3
- import { Button, Loader, Table, TableCell, TableHead, TableHeader, TableRow } from '~/lib'
3
+ import { Button, Loader, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, TableWrapper } from '~/lib'
4
4
  import { useIdentityProvidersQuery, useTenantQueryLoader } from '@contember/react-client-tenant'
5
5
  import { dict } from '../dict.js'
6
6
  import { formatConfigValue, ManagedByCliNote, renderConfigQueryState } from './common.js'
@@ -13,6 +13,17 @@ export interface IdentityProviderListProps {
13
13
  controller?: { current?: IdentityProviderListController }
14
14
  }
15
15
 
16
+ /** Only the built-in `oidc` handler acts on `strictResponseType` (apple and facebook accept and ignore it); absent means off. */
17
+ const formatStrictResponseType = (type: string, configuration: unknown): string => {
18
+ if (type !== 'oidc') {
19
+ return dict.tenant.identityProviderList.notApplicable
20
+ }
21
+ const value = typeof configuration === 'object' && configuration !== null && 'strictResponseType' in configuration
22
+ ? configuration.strictResponseType
23
+ : undefined
24
+ return formatConfigValue(value === true)
25
+ }
26
+
16
27
  /**
17
28
  * `IdentityProviderList` shows the identity providers configured on the tenant, read-only.
18
29
  *
@@ -55,58 +66,65 @@ export const IdentityProviderList = ({ controller }: IdentityProviderListProps)
55
66
  {query.state !== 'success' && <Loader position="absolute" />}
56
67
  <ManagedByCliNote />
57
68
 
58
- <Table>
59
- <TableHeader>
60
- <TableRow>
61
- <TableHead>{dict.tenant.identityProviderList.slug}</TableHead>
62
- <TableHead>{dict.tenant.identityProviderList.type}</TableHead>
63
- <TableHead>{dict.tenant.identityProviderList.status}</TableHead>
64
- <TableHead>{dict.tenant.identityProviderList.autoSignUp}</TableHead>
65
- <TableHead>{dict.tenant.identityProviderList.exclusive}</TableHead>
66
- <TableHead>{dict.tenant.identityProviderList.configuration}</TableHead>
67
- </TableRow>
68
- </TableHeader>
69
- {providers.length === 0 && (
70
- <TableRow>
71
- <TableCell colSpan={6}>{dict.tenant.identityProviderList.noResults}</TableCell>
72
- </TableRow>
73
- )}
74
- {providers.map(provider => (
75
- <React.Fragment key={provider.slug}>
69
+ <TableWrapper>
70
+ {/* Seven columns: the default cell padding would push the table past the card at desktop widths. */}
71
+ <Table className="[&_td]:px-3 [&_th]:px-3">
72
+ <TableHeader>
76
73
  <TableRow>
77
- <TableCell className="font-medium">{provider.slug}</TableCell>
78
- <TableCell className="font-mono text-xs">{provider.type}</TableCell>
79
- <TableCell>
80
- {provider.disabledAt
81
- ? <span className="text-destructive">{dict.tenant.configView.disabled}</span>
82
- : <span>{dict.tenant.configView.enabled}</span>}
83
- </TableCell>
84
- <TableCell>{formatConfigValue(provider.options.autoSignUp)}</TableCell>
85
- <TableCell>{formatConfigValue(provider.options.exclusive)}</TableCell>
86
- <TableCell>
87
- <Button
88
- variant="outline"
89
- size="sm"
90
- onClick={() => setExpanded(expanded === provider.slug ? null : provider.slug)}
91
- >
92
- {expanded === provider.slug
93
- ? dict.tenant.identityProviderList.hideConfiguration
94
- : dict.tenant.identityProviderList.showConfiguration}
95
- </Button>
96
- </TableCell>
74
+ <TableHead>{dict.tenant.identityProviderList.slug}</TableHead>
75
+ <TableHead>{dict.tenant.identityProviderList.type}</TableHead>
76
+ <TableHead>{dict.tenant.identityProviderList.status}</TableHead>
77
+ <TableHead>{dict.tenant.identityProviderList.autoSignUp}</TableHead>
78
+ <TableHead>{dict.tenant.identityProviderList.exclusive}</TableHead>
79
+ <TableHead>{dict.tenant.identityProviderList.strictResponseType}</TableHead>
80
+ <TableHead>{dict.tenant.identityProviderList.configuration}</TableHead>
97
81
  </TableRow>
98
- {expanded === provider.slug && (
82
+ </TableHeader>
83
+ <TableBody>
84
+ {providers.length === 0 && (
99
85
  <TableRow>
100
- <TableCell colSpan={6}>
101
- <pre className="overflow-x-auto text-xs bg-gray-50 p-3 rounded">
102
- {JSON.stringify(provider.configuration, null, 2)}
103
- </pre>
104
- </TableCell>
86
+ <TableCell colSpan={7}>{dict.tenant.identityProviderList.noResults}</TableCell>
105
87
  </TableRow>
106
88
  )}
107
- </React.Fragment>
108
- ))}
109
- </Table>
89
+ {providers.map(provider => (
90
+ <React.Fragment key={provider.slug}>
91
+ <TableRow>
92
+ <TableCell className="font-medium">{provider.slug}</TableCell>
93
+ <TableCell className="font-mono text-xs">{provider.type}</TableCell>
94
+ <TableCell>
95
+ {provider.disabledAt
96
+ ? <span className="text-destructive">{dict.tenant.configView.disabled}</span>
97
+ : <span>{dict.tenant.configView.enabled}</span>}
98
+ </TableCell>
99
+ <TableCell>{formatConfigValue(provider.options.autoSignUp)}</TableCell>
100
+ <TableCell>{formatConfigValue(provider.options.exclusive)}</TableCell>
101
+ <TableCell>{formatStrictResponseType(provider.type, provider.configuration)}</TableCell>
102
+ <TableCell>
103
+ <Button
104
+ variant="outline"
105
+ size="sm"
106
+ onClick={() => setExpanded(expanded === provider.slug ? null : provider.slug)}
107
+ >
108
+ {expanded === provider.slug
109
+ ? dict.tenant.identityProviderList.hideConfiguration
110
+ : dict.tenant.identityProviderList.showConfiguration}
111
+ </Button>
112
+ </TableCell>
113
+ </TableRow>
114
+ {expanded === provider.slug && (
115
+ <TableRow>
116
+ <TableCell colSpan={7}>
117
+ <pre className="overflow-x-auto text-xs bg-gray-50 p-3 rounded">
118
+ {JSON.stringify(provider.configuration, null, 2)}
119
+ </pre>
120
+ </TableCell>
121
+ </TableRow>
122
+ )}
123
+ </React.Fragment>
124
+ ))}
125
+ </TableBody>
126
+ </Table>
127
+ </TableWrapper>
110
128
  <p className="text-sm text-gray-500">{dict.tenant.identityProviderList.secretsNote}</p>
111
129
  </div>
112
130
  )
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { ReactNode } from 'react'
3
- import { Loader, Table, TableCell, TableHead, TableHeader, TableRow } from '~/lib'
3
+ import { Loader, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '~/lib'
4
4
  import { useConfigurationQuery, useTenantQueryLoader } from '@contember/react-client-tenant'
5
5
  import { dict } from '../dict.js'
6
6
  import { ConfigSection, formatConfigValue, ManagedByCliNote, renderConfigQueryState } from './common.js'
@@ -32,12 +32,14 @@ const SettingsTable = ({ rows }: { rows: readonly (readonly [string, ReactNode])
32
32
  <TableHead>{dict.tenant.configView.value}</TableHead>
33
33
  </TableRow>
34
34
  </TableHeader>
35
- {rows.map(([label, value]) => (
36
- <TableRow key={label}>
37
- <TableCell className="font-medium">{label}</TableCell>
38
- <TableCell>{value}</TableCell>
39
- </TableRow>
40
- ))}
35
+ <TableBody>
36
+ {rows.map(([label, value]) => (
37
+ <TableRow key={label}>
38
+ <TableCell className="font-medium">{label}</TableCell>
39
+ <TableCell>{value}</TableCell>
40
+ </TableRow>
41
+ ))}
42
+ </TableBody>
41
43
  </Table>
42
44
  )
43
45
 
@@ -92,7 +94,12 @@ export const TenantConfigView = ({ controller }: TenantConfigViewProps) => {
92
94
  </ConfigSection>
93
95
 
94
96
  <ConfigSection title={dict.tenant.configView.emailChange}>
95
- <SettingsTable rows={[['requireVerification', formatConfigValue(config.emailChange.requireVerification)]]} />
97
+ <SettingsTable
98
+ rows={[
99
+ ['requireVerification', formatConfigValue(config.emailChange.requireVerification)],
100
+ ['requireReauthentication', formatConfigValue(config.emailChange.requireReauthentication)],
101
+ ]}
102
+ />
96
103
  </ConfigSection>
97
104
 
98
105
  <ConfigSection title={dict.tenant.configView.password}>
@@ -106,6 +113,7 @@ export const TenantConfigView = ({ controller }: TenantConfigViewProps) => {
106
113
  ['pattern', formatConfigValue(config.password.pattern)],
107
114
  ['checkBlacklist', formatConfigValue(config.password.checkBlacklist)],
108
115
  ['checkHibp', formatConfigValue(config.password.checkHibp)],
116
+ ['revokeSessionsOnChange', formatConfigValue(config.password.revokeSessionsOnChange)],
109
117
  ]}
110
118
  />
111
119
  </ConfigSection>
@@ -116,6 +124,7 @@ export const TenantConfigView = ({ controller }: TenantConfigViewProps) => {
116
124
  ['enabled', formatConfigValue(config.passwordless.enabled)],
117
125
  ['url', formatConfigValue(config.passwordless.url)],
118
126
  ['expiration', formatConfigValue(config.passwordless.expiration)],
127
+ ['uniformResponse', formatConfigValue(config.passwordless.uniformResponse)],
119
128
  ]}
120
129
  />
121
130
  </ConfigSection>
@@ -131,6 +140,7 @@ export const TenantConfigView = ({ controller }: TenantConfigViewProps) => {
131
140
  ['defaultTokenExpiration', formatConfigValue(config.login.defaultTokenExpiration)],
132
141
  ['maxTokenExpiration', formatConfigValue(config.login.maxTokenExpiration)],
133
142
  ['mfaGraceDuration', formatConfigValue(config.login.mfaGraceDuration)],
143
+ ['mfaChangeRequiresReauthentication', formatConfigValue(config.login.mfaChangeRequiresReauthentication)],
134
144
  ]}
135
145
  />
136
146
  </ConfigSection>
@@ -142,6 +152,7 @@ export const TenantConfigView = ({ controller }: TenantConfigViewProps) => {
142
152
  ['historySize', formatConfigValue(config.login.anomalyDetection.historySize)],
143
153
  ['emailThreshold', formatConfigValue(config.login.anomalyDetection.emailThreshold)],
144
154
  ['stepUpThreshold', formatConfigValue(config.login.anomalyDetection.stepUpThreshold)],
155
+ ['missingSignalIsNew', formatConfigValue(config.login.anomalyDetection.missingSignalIsNew)],
145
156
  ]}
146
157
  />
147
158
  </ConfigSection>
@@ -168,13 +179,15 @@ export const TenantConfigView = ({ controller }: TenantConfigViewProps) => {
168
179
  <TableHead>{dict.tenant.configView.window}</TableHead>
169
180
  </TableRow>
170
181
  </TableHeader>
171
- {rateLimitKeys.map(key => (
172
- <TableRow key={key}>
173
- <TableCell className="font-medium">{key}</TableCell>
174
- <TableCell>{formatConfigValue(config.rateLimits[key].limit)}</TableCell>
175
- <TableCell>{formatConfigValue(config.rateLimits[key].window)}</TableCell>
176
- </TableRow>
177
- ))}
182
+ <TableBody>
183
+ {rateLimitKeys.map(key => (
184
+ <TableRow key={key}>
185
+ <TableCell className="font-medium">{key}</TableCell>
186
+ <TableCell>{formatConfigValue(config.rateLimits[key].limit)}</TableCell>
187
+ <TableCell>{formatConfigValue(config.rateLimits[key].window)}</TableCell>
188
+ </TableRow>
189
+ ))}
190
+ </TableBody>
178
191
  </Table>
179
192
  </ConfigSection>
180
193
  </div>
@@ -310,6 +310,9 @@ export const dict = {
310
310
  hideConfiguration: 'Hide configuration',
311
311
  autoSignUp: 'Auto sign-up',
312
312
  exclusive: 'Exclusive',
313
+ strictResponseType: 'Strict response type',
314
+ /** A setting the provider's handler type does not have. */
315
+ notApplicable: '—',
313
316
  noResults: 'No identity providers configured',
314
317
  failedToLoadData: 'Failed to load data',
315
318
  forbidden: 'You do not have permission to view identity providers.',