Skip to content

Commit 5a97ec5

Browse files
authored
Merge branch 'main' into quenting/dynamic-policy-data
2 parents b663c4f + c6cf84c commit 5a97ec5

File tree

10 files changed

+265
-178
lines changed

10 files changed

+265
-178
lines changed

.github/workflows/build.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
steps:
223223
- name: Docker meta
224224
id: meta
225-
uses: docker/metadata-action@v5.6.1
225+
uses: docker/metadata-action@v5.7.0
226226
with:
227227
images: "${{ env.IMAGE }}"
228228
bake-target: docker-metadata-action
@@ -238,7 +238,7 @@ jobs:
238238
239239
- name: Docker meta (debug variant)
240240
id: meta-debug
241-
uses: docker/metadata-action@v5.6.1
241+
uses: docker/metadata-action@v5.7.0
242242
with:
243243
images: "${{ env.IMAGE }}"
244244
bake-target: docker-metadata-action-debug
@@ -255,7 +255,7 @@ jobs:
255255
256256
- name: Docker meta (syn2mas)
257257
id: meta-syn2mas
258-
uses: docker/metadata-action@v5.6.1
258+
uses: docker/metadata-action@v5.7.0
259259
with:
260260
images: "${{ env.IMAGE_SYN2MAS }}"
261261
bake-target: docker-metadata-action-syn2mas
@@ -273,7 +273,7 @@ jobs:
273273
uses: sigstore/[email protected]
274274

275275
- name: Set up Docker Buildx
276-
uses: docker/setup-buildx-action@v3.9.0
276+
uses: docker/setup-buildx-action@v3.10.0
277277
with:
278278
buildkitd-config-inline: |
279279
[registry."docker.io"]
@@ -288,7 +288,7 @@ jobs:
288288

289289
- name: Build and push
290290
id: bake
291-
uses: docker/bake-action@v6.4.0
291+
uses: docker/bake-action@v6.5.0
292292
with:
293293
files: |
294294
./docker-bake.hcl

.github/workflows/coverage.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: make coverage
3434

3535
- name: Upload to codecov.io
36-
uses: codecov/codecov-action@v5.3.1
36+
uses: codecov/codecov-action@v5.4.0
3737
with:
3838
token: ${{ secrets.CODECOV_TOKEN }}
3939
files: policies/coverage.json
@@ -60,7 +60,7 @@ jobs:
6060
run: npm run coverage
6161

6262
- name: Upload to codecov.io
63-
uses: codecov/codecov-action@v5.3.1
63+
uses: codecov/codecov-action@v5.4.0
6464
with:
6565
token: ${{ secrets.CODECOV_TOKEN }}
6666
directory: frontend/coverage/
@@ -127,7 +127,7 @@ jobs:
127127
grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage/tests.lcov
128128
129129
- name: Upload to codecov.io
130-
uses: codecov/codecov-action@v5.3.1
130+
uses: codecov/codecov-action@v5.4.0
131131
with:
132132
token: ${{ secrets.CODECOV_TOKEN }}
133133
files: target/coverage/*.lcov

crates/policy/src/model.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ pub enum Code {
3232
/// The username contains only numeric characters.
3333
UsernameAllNumeric,
3434

35+
/// The username is banned.
36+
UsernameBanned,
37+
38+
/// The username is not allowed.
39+
UsernameNotAllowed,
40+
3541
/// The email domain is not allowed.
3642
EmailDomainNotAllowed,
3743

@@ -54,6 +60,8 @@ impl Code {
5460
Self::UsernameTooLong => "username-too-long",
5561
Self::UsernameInvalidChars => "username-invalid-chars",
5662
Self::UsernameAllNumeric => "username-all-numeric",
63+
Self::UsernameBanned => "username-banned",
64+
Self::UsernameNotAllowed => "username-not-allowed",
5765
Self::EmailDomainNotAllowed => "email-domain-not-allowed",
5866
Self::EmailDomainBanned => "email-domain-banned",
5967
Self::EmailNotAllowed => "email-not-allowed",

docs/reference/configuration.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,35 @@ policy:
382382
# don't require clients to provide a client_uri. default: false
383383
allow_missing_client_uri: false
384384

385+
# Restrictions on user registration
386+
registration:
387+
# If specified, the username (localpart) *must* match one of the allowed
388+
# usernames. If unspecified, all usernames are allowed.
389+
allowed_usernames:
390+
# Exact usernames that are allowed
391+
literals: ["alice", "bob"]
392+
# Substrings that match allowed usernames
393+
substrings: ["user"]
394+
# Regular expressions that match allowed usernames
395+
regexes: ["^[a-z]+$"]
396+
# Prefixes that match allowed usernames
397+
prefixes: ["user-"]
398+
# Suffixes that match allowed usernames
399+
suffixes: ["-corp"]
400+
# If specified, the username (localpart) *must not* match one of the
401+
# banned usernames. If unspecified, all usernames are allowed.
402+
banned_usernames:
403+
# Exact usernames that are banned
404+
literals: ["admin", "root"]
405+
# Substrings that match banned usernames
406+
substrings: ["admin", "root"]
407+
# Regular expressions that match banned usernames
408+
regexes: ["^admin$", "^root$"]
409+
# Prefixes that match banned usernames
410+
prefixes: ["admin-", "root-"]
411+
# Suffixes that match banned usernames
412+
suffixes: ["-admin", "-root"]
413+
385414
# Restrict what email addresses can be added to a user
386415
emails:
387416
# If specified, the email address *must* match one of the allowed addresses.

0 commit comments

Comments
 (0)