Skip to content

Commit b46c818

Browse files
committed
apply review suggestion
1 parent a7f3185 commit b46c818

File tree

11 files changed

+135
-79
lines changed

11 files changed

+135
-79
lines changed

frontend/src/i18n/admin/de.ts

Lines changed: 32 additions & 28 deletions
Large diffs are not rendered by default.

frontend/src/i18n/admin/en.ts

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export let I18nAdminEn: I18nAdmin = {
5252
confidential: "Confidential",
5353
confidentialNoSecret: "This is a non-confidential client and therefore has not secret.",
5454
config: "Client Configuration",
55+
custEmailMapping: "Custom E-Mail Mapping",
56+
custEmailMappingExplanation: "Use a custom attribute for the E-Mail that will be provided to the client.",
57+
custEmailMappingNoAttrs: `No custom attributes are available for custom E-Mail mapping.
58+
The attribute must be of type \`email\` and must not be user editable.`,
5559
delete1: "Are you sure you want to delete this client?",
5660
descAuthCode: `The validity for auth codes can be adjusted for increased security. Auth codes
5761
can be used only once and are valid for 60 seconds by default. The shorter the validity, the
@@ -64,20 +68,20 @@ export let I18nAdminEn: I18nAdmin = {
6468
Only users, that are assigned to a matching group, will be allowed to log in.`,
6569
descOrigin: `External, additionally allowed origins - usually only necessary, if this client
6670
needs to make requests to Rauthy directly from the browser, typically SPAs.`,
67-
descPKCE: `If the client supports it, you should always activate S256 PKCE for additional
68-
security. If a non-confidential client (e.g. a SPA) is being used, you must at least
71+
descPKCE: `If the client supports it, you should always activate S256 PKCE for additional
72+
security. If a non-confidential client (e.g. a SPA) is being used, you must at least
6973
activate one of the PKCE challenges to have enough security.`,
7074
descPKCEEnforce: `If any PKCE is activated, Rauthy will enforce the usage during Logins, and
7175
rejects login request that do not contain a valida challenge.`,
72-
descUri: `You can provide as many redirect URIs as you like. At the end of each, you can use
76+
descUri: `You can provide as many redirect URIs as you like. At the end of each, you can use
7377
<code>*</code> as a Wildcard.`,
7478
errConfidentialPKCE: `The client must either be confidential or have at least one PKCE
7579
challenge activated.`,
7680
forceMfa: "Force MFA",
7781
groupLoginPrefix: "Login Group Prefix",
7882
name: "Client Name",
7983
scim: {
80-
baseUri: `The SCIM base URI is the one from which the sub routes like
84+
baseUri: `The SCIM base URI is the one from which the sub routes like
8185
<code>{base_uri}/Users/{id}</base_uri></code> can be derived correctly.`,
8286
desc: "If this client supports {{ SCIM_LINK }}, you can activate it here.",
8387
enable: "Enable SCIMv2",
@@ -91,15 +95,15 @@ export let I18nAdminEn: I18nAdmin = {
9195
reqLi1: "The client must handle <code>externalId</code> correctly.",
9296
reqLi2: `At least <code>/Users</code> endpoints with <code>filter=externalId eq "*"</code> and
9397
<code>filter=userName eq "*"</code> must be supported.`,
94-
reqLi3: `If groups should be synchronized, <code>/Groups</code> must also support
98+
reqLi3: `If groups should be synchronized, <code>/Groups</code> must also support
9599
<code>filter=displayName eq "*"</code>.`,
96100
},
97101
scopes: {
98102
allowed: "Allowed Scopes",
99103
default: "Default Scopes",
100104
desc: `Allowed Scopes are the ones the client is allowed to request dynamically during
101105
a redirect to the login when using the <code>authorization_code</code> flow. The default
102-
scopes will always be added to the tokens to solve some issues when using the
106+
scopes will always be added to the tokens to solve some issues when using the
103107
<code>password</code> for instance.`,
104108
},
105109
secret: {
@@ -149,11 +153,11 @@ export let I18nAdminEn: I18nAdmin = {
149153
keysAvailable: "Available Keys",
150154
migrate: "Migrate",
151155
migrateToKey: 'Migrate all existing encrypted values to the following key',
152-
p1: `These Keys are used for an additional encryption at rest, independently from any data store technology
156+
p1: `These Keys are used for an additional encryption at rest, independently from any data store technology
153157
used under the hood. They are configured statically, but can be rotated and migrated on this page manually.`,
154158
p2: `The active key is statically set in the Rauthy config file / environment variables. It cannot be changed
155159
here dynamically. All new JWK encryption's will always use the currently active key.`,
156-
p3: `If you migrate all existing secrets, it might take a few seconds to finish, if you have a big
160+
p3: `If you migrate all existing secrets, it might take a few seconds to finish, if you have a big
157161
dataset.`,
158162
pNotPossible: 'To be able to migrate, at least 2 encryption keys need to be available.',
159163
},
@@ -162,63 +166,63 @@ export let I18nAdminEn: I18nAdmin = {
162166

163167
currValuesHead: 'Current values',
164168
currValues1: 'The current values from the backend are the following:',
165-
currValuesNote: `Note: The Login Time from the backend does only provide a good guideline after at least 5
166-
successful logins, after Rauthy has been started. The base value is always 2000 ms after a fresh restart
169+
currValuesNote: `Note: The Login Time from the backend does only provide a good guideline after at least 5
170+
successful logins, after Rauthy has been started. The base value is always 2000 ms after a fresh restart
167171
and will adjust over time with each successful login.`,
168172
currValuesThreadsAccess: 'Threads (p_cost) Rauthy has access to',
169173

170174
loginTimeHead: 'A word about Login Time',
171-
loginTime1: `Generally, users want everything as fast as possible. When doing a safe login though, a time
172-
between 500 - 1000 ms should not be a problem. The login time must not be too short, since it would lower
175+
loginTime1: `Generally, users want everything as fast as possible. When doing a safe login though, a time
176+
between 500 - 1000 ms should not be a problem. The login time must not be too short, since it would lower
173177
the strength of the hash, of course.`,
174-
loginTime2: `To provide as much safety by default as possible, this utility does not allow you to go below
178+
loginTime2: `To provide as much safety by default as possible, this utility does not allow you to go below
175179
500 ms for the login time.`,
176180

177181
mCost1: `The <code>m_cost</code> defines the amount of <b>memory (in kB)</b>, which is used for the hashing.
178182
The higher the value, the better, of course. But you need to keep in mind the servers resources.<br>
179183
When you hash 4 passwords at the same time, for instance, the backend needs <code>4 x m_cost</code>
180184
during the hashing. These resources must be available.`,
181185
mCost2: `Tuning <code>m_cost</code> is pretty easy. Define the max amount of memory that Rauthy should use,
182-
divide it by the number of max allowed parallel logins (<code>MAX_HASH_THREADS</code>) and subtract a small
186+
divide it by the number of max allowed parallel logins (<code>MAX_HASH_THREADS</code>) and subtract a small
183187
static amount of memory. How much static memory should be taken into account depends on the used database
184188
and the total amount of users, but will typically be in the range of 32 - 96 MB.`,
185189
mCost3: 'The minimal allowed <code>m_cost</code> is <code>32768</code>.',
186190

187-
pCost1: `The <code>p_cost</code> defines the amount of <b>parallelism</b> for hashing. This value most often
191+
pCost1: `The <code>p_cost</code> defines the amount of <b>parallelism</b> for hashing. This value most often
188192
tops out at ~8, which is the default for Rauthy.`,
189193
pCost2: `The general rule is:<br>
190194
Set the <code>p_cost</code> to twice the size of cores your have available.<br>
191195
For instance, if you have 4 cores available, set the <code>p_cost</code> to <code>8</code>.<br>
192196
However, this value must take the configured allowed parallel logins (<code>MAX_HASH_THREADS</code>) into
193197
account and be reduced accordingly.`,
194198

195-
tCost1: `The <code>t_cost</code> defines the amount of <b>time</b> for hashing. This value is actually the
196-
only value, that needs tuning, since <code>m_cost</code> and <code>p_cost</code> are basically given by the
199+
tCost1: `The <code>t_cost</code> defines the amount of <b>time</b> for hashing. This value is actually the
200+
only value, that needs tuning, since <code>m_cost</code> and <code>p_cost</code> are basically given by the
197201
environment.`,
198202
tCost2: `Tuning is easy: Set <code>m_cost</code> and <code>p_cost</code> accordingly and then increase
199203
<code>t_cost</code> as long as you have not reached your hashing-time-goal.`,
200204

201205
utilityHead: 'Parameter Calculation Utility',
202-
utility1: `You can use this tool to approximate good values for your deployment. Keep in mind, that this
203-
should be executed with Rauthy in its final place with all final resources available. You should execute
206+
utility1: `You can use this tool to approximate good values for your deployment. Keep in mind, that this
207+
should be executed with Rauthy in its final place with all final resources available. You should execute
204208
this utility during load to not over tune.`,
205-
utility2: `<code>m_cost</code> is optional and the safe minimal value of <code>32768</code> would be chosen,
209+
utility2: `<code>m_cost</code> is optional and the safe minimal value of <code>32768</code> would be chosen,
206210
if empty. <code>p_cost</code> is optional too and Rauthy will utilize all threads it can see, if empty.`,
207211

208212
time: "Time",
209213
targetTime: "Target Time",
210214
tune: 'Important: These values need to be tuned on the final architecture!',
211-
pDetials: `If you want a detailed introduction to Argon2ID, many sources exist online. This guide just
215+
pDetials: `If you want a detailed introduction to Argon2ID, many sources exist online. This guide just
212216
gives very short overview about the values. Three of them need to be configured:`,
213-
pTune: `They change depending on the capabilities of the system. The more powerful the system, the more safe
217+
pTune: `They change depending on the capabilities of the system. The more powerful the system, the more safe
214218
these values can be.`,
215219
pUtility: `This utility helps you find the best Argon2ID settings for your platform.
216-
Argon2ID is currently the safest available password hashing algorithm. To use it to its fullest potential,
220+
Argon2ID is currently the safest available password hashing algorithm. To use it to its fullest potential,
217221
it has to be tuned for each deployment.`,
218222
},
219223
openapi: "If you want to integrate an external application and use Rauthy's API, take a look at the",
220224
openapiNote: `Depending on the backend configuration, the Swagger UI may not be exposed publicly at this point.
221-
It is however by default available via the internal metrics HTTP server to not expose any
225+
It is however by default available via the internal metrics HTTP server to not expose any
222226
information.`,
223227
source: "The source code can be found here",
224228
},
@@ -242,7 +246,7 @@ export let I18nAdminEn: I18nAdmin = {
242246
p1: "These are the Json Web Keys (JWKs) used for token singing.",
243247
p2: `The JWKs will be rotated by default every 1st of a month. For all newly created tokens, only the latest
244248
available key for the given algorithm will be used for signing. Old keys will be kept for a while to make sure
245-
that currently valid tokens can still be validated properly. After a while, they will be cleaned up
249+
that currently valid tokens can still be validated properly. After a while, they will be cleaned up
246250
automatically.`,
247251
p3: `Keys can also be rotated manually. Depending on the hardware this Rauthy instance is running on, it might
248252
take a few seconds.`,
@@ -359,7 +363,7 @@ export let I18nAdminEn: I18nAdmin = {
359363
forceLogout: `Are you sure you want to invalidate all existing sessions and delete all refresh tokens
360364
for this user?`,
361365
lastLogin: "Last Login",
362-
manualInitDesc: `The user can also be initialized here, In this case though, you need to communicate the
366+
manualInitDesc: `The user can also be initialized here, In this case though, you need to communicate the
363367
password directly.`,
364368
manualInit: "Manual Initialization",
365369
mfaDelete1: "You can delete Passkeys for this users.",

frontend/src/i18n/admin/interface.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export interface I18nAdmin {
5252
confidential: string,
5353
confidentialNoSecret: string,
5454
config: string,
55+
custEmailMapping: string,
56+
custEmailMappingExplanation: string,
57+
custEmailMappingNoAttrs: string,
5558
delete1: string,
5659
descAuthCode: string,
5760
descClientUri: string,

frontend/src/i18n/admin/ko.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export let I18nAdminKo: I18nAdmin = {
5050
confidential: "기밀",
5151
confidentialNoSecret: "이 클라이언트는 기밀이 아닌 클라이언트이므로 Secret이 없습니다.",
5252
config: "클라이언트 설정",
53+
custEmailMapping: "Custom E-Mail Mapping",
54+
custEmailMappingExplanation: "Use a custom attribute for the E-Mail that will be provided to the client.",
55+
custEmailMappingNoAttrs: `No custom attributes are available for custom E-Mail mapping.
56+
The attribute must be of type \`email\` and must not be user editable.`,
5357
delete1: "이 클라이언트를 삭제하시겠습니까?",
5458
descAuthCode: `보안을 강화하기 위해 인증 코드의 유효 기간을 조정할 수 있습니다. 인증 코드는
5559
한 번만 사용할 수 있으며 기본적으로 60초 동안 유효합니다. 클라이언트가 로그인 절차를
@@ -73,7 +77,7 @@ export let I18nAdminKo: I18nAdmin = {
7377
groupLoginPrefix: "Login Group Prefix",
7478
name: "클라이언트 이름",
7579
scim: {
76-
baseUri: `The SCIM base URI is the one from which the sub routes like
80+
baseUri: `The SCIM base URI is the one from which the sub routes like
7781
<code>{base_uri}/Users/{id}</base_uri></code> can be derived correctly.`,
7882
desc: "If this client supports {{ SCIM_LINK }}, you can activate it here.",
7983
enable: "Enable SCIMv2",
@@ -87,7 +91,7 @@ export let I18nAdminKo: I18nAdmin = {
8791
reqLi1: "The client must handle <code>externalId</code> correctly.",
8892
reqLi2: `At least <code>/Users</code> endpoints with <code>filter=externalId eq "*"</code> and
8993
<code>filter=userName eq "*"</code> must be supported.`,
90-
reqLi3: `If groups should be synchronized, <code>/Groups</code> must also support
94+
reqLi3: `If groups should be synchronized, <code>/Groups</code> must also support
9195
<code>filter=displayName eq "*"</code>.`,
9296
},
9397
scopes: {
@@ -348,7 +352,7 @@ export let I18nAdminKo: I18nAdmin = {
348352
descAttr: `사용자 지정 속성을 설정합니다. 모든 키/값 쌍은 문자열/JSON 값으로 처리됩니다.`,
349353
forceLogout: `기존 세션을 모두 삭제하고, 이 사용자의 모든 Refresh 토큰을 삭제하시겠습니까?`,
350354
lastLogin: "마지막 로그인",
351-
manualInitDesc: `The user can also be initialized here, In this case though, you need to communicate the
355+
manualInitDesc: `The user can also be initialized here, In this case though, you need to communicate the
352356
password directly.`,
353357
manualInit: "Manual Initialization",
354358
mfaDelete1: "이 사용자의 패스키를 삭제할 수 있습니다.",

frontend/src/lib/admin/clients/ClientConfig.svelte

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,16 @@
3333
client = $bindable(),
3434
clients,
3535
scopesAll,
36-
attrsAll,
36+
attrsEmail,
3737
onSave,
3838
}: {
3939
client: ClientResponse,
4040
clients: ClientResponse[],
4141
scopesAll: string[],
42-
attrsAll: string[],
42+
attrsEmail: string[],
4343
onSave: () => void,
4444
} = $props();
4545
46-
let attrsWithNone = $state(['None'].concat(attrsAll));
47-
4846
let t = useI18n();
4947
let ta = useI18nAdmin();
5048
@@ -63,7 +61,9 @@
6361
let postLogoutRedirectURIs: string[] = $state(client.post_logout_redirect_uris ? Array.from(client.post_logout_redirect_uris) : []);
6462
let backchannel_logout_uri: string = $state(client.backchannel_logout_uri || '');
6563
let restrict_group_prefix: string = $state(client.restrict_group_prefix || '');
66-
let cust_email_mapping: string = $state(client.cust_email_mapping || 'None');
64+
let cust_email_mapping: string | undefined = $state(client.cust_email_mapping);
65+
let cust_email_mapping_exists = $derived(cust_email_mapping !== undefined);
66+
6767
6868
let scimEnabled = $state(client.scim !== undefined);
6969
let scim: ScimClientRequestResponse = $state({
@@ -122,7 +122,7 @@
122122
origins = client.allowed_origins ? Array.from(client.allowed_origins) : [];
123123
redirectURIs = Array.from(client.redirect_uris);
124124
postLogoutRedirectURIs = client.post_logout_redirect_uris ? Array.from(client.post_logout_redirect_uris) : [];
125-
cust_email_mapping = client.cust_email_mapping || 'None';
125+
cust_email_mapping = client.cust_email_mapping;
126126
127127
flows.authorizationCode = client.flows_enabled.includes('authorization_code');
128128
flows.clientCredentials = client.flows_enabled.includes('client_credentials');
@@ -210,7 +210,7 @@
210210
contacts: contacts.length > 0 ? contacts : undefined,
211211
backchannel_logout_uri: backchannel_logout_uri || undefined,
212212
restrict_group_prefix: restrict_group_prefix || undefined,
213-
cust_email_mapping: cust_email_mapping != 'None' ? cust_email_mapping : undefined,
213+
cust_email_mapping: cust_email_mapping || undefined,
214214
}
215215
216216
if (flows.authorizationCode) {
@@ -318,14 +318,29 @@
318318
width={inputWidth}
319319
pattern={PATTERN_GROUP}
320320
/>
321+
<span class="muted">{ta.clients.custEmailMappingExplanation}</span>
321322
<div class="flex gap-05">
322-
Todo
323+
{ta.clients.custEmailMapping}
324+
<InputCheckbox
325+
disabled={attrsEmail.length === 0}
326+
ariaLabel={ta.clients.custEmailMapping}
327+
bind:checked={cust_email_mapping_exists}
328+
onclickOverride={(isChecked: boolean) => {
329+
cust_email_mapping = attrsEmail.length > 0 && isChecked ? attrsEmail[0] : undefined;
330+
}}
331+
/>
332+
333+
{#if cust_email_mapping }
323334
<Options
324-
ariaLabel={ta.attrs.name}
325-
options={attrsWithNone}
335+
ariaLabel={ta.clients.custEmailMapping}
336+
options={attrsEmail}
326337
bind:value={cust_email_mapping}
327338
/>
339+
{/if}
328340
</div>
341+
{#if attrsEmail.length === 0}
342+
<span class="muted">{ta.clients.custEmailMappingNoAttrs}</span>
343+
{/if}
329344

330345
<p class="mb-0"><b>Authentication Flows</b></p>
331346
<InputCheckbox ariaLabel="authorization_code" bind:checked={flows.authorizationCode}>

frontend/src/lib/admin/clients/ClientDetails.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
<div class="details">
5454
{#if selected === ta.nav.config}
55-
<ClientConfig {client} {clients} {scopesAll} {attrsAll} {onSave}/>
55+
<ClientConfig {client} {clients} {scopesAll} attrsEmail={attrsAll} {onSave}/>
5656
{:else if selected === 'Secret'}
5757
<ClientSecret {client}/>
5858
{:else if selected === 'Branding'}

0 commit comments

Comments
 (0)