feat: rebranded from vpn-router to linux-manager.
This commit is contained in:
1 parent
8efe21bfa6
commit
85a1ffa21f
238 files changed
+5010
-3761
No files matched your search
@@ -7,7 +7,7 @@ import {
|
||||
import { useState, type FormEvent } from 'react'
|
||||
import type { Role, User } from './api.ts'
|
||||
|
||||
/** The names vpn-router-user accepts for a service account: a user name or a GUID in lowercase. */
|
||||
/** The names linux-manager-user accepts for a service account: a user name or a GUID in lowercase. */
|
||||
const NAME_PATTERN = /^[a-z][a-z0-9-]{0,30}[a-z0-9]$|^[a-z]$|^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
|
||||
|
||||
/** A random GUID (version 4) in lowercase, from crypto.getRandomValues, which pages served over plain HTTP have too. */
|
||||
@@ -19,21 +19,21 @@ function newGuid() {
|
||||
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`
|
||||
}
|
||||
|
||||
/** The e-mail addresses vpn-router-user accepts: one @, no spaces, and a dot in the domain. */
|
||||
/** The e-mail addresses linux-manager-user accepts: one @, no spaces, and a dot in the domain. */
|
||||
const EMAIL_PATTERN = /^[^@\s]+@[^@\s]+\.[^@\s]+$/
|
||||
|
||||
/** The longest display name and description the router accepts. */
|
||||
/** The longest display name and description the server accepts. */
|
||||
const DISPLAY_NAME_MAX = 64
|
||||
const DESCRIPTION_MAX = 256
|
||||
|
||||
/** The most URIs of each kind and allowed groups of an OpenID Provider client, and the longest URI, the router accepts. */
|
||||
/** The most URIs of each kind and allowed groups of an OpenID Provider client, and the longest URI, the server accepts. */
|
||||
const CLIENT_VALUES_MAX = 16
|
||||
const URI_MAX = 1024
|
||||
|
||||
/** The hosts a client's URI may name over plain HTTP. */
|
||||
const LOOPBACK_HOSTS = ['localhost', '127.0.0.1', '[::1]']
|
||||
|
||||
/** The names of a role and of a scope of a resource the router accepts. */
|
||||
/** The names of a role and of a scope of a resource the server accepts. */
|
||||
const ROLE_NAME = /^[A-Za-z][A-Za-z0-9._-]{0,63}$/
|
||||
const SCOPE_NAME = /^[a-z][a-z0-9._-]{0,63}$/
|
||||
|
||||
@@ -55,7 +55,7 @@ export type ServiceAccountSettings = {
|
||||
roles: Role[]
|
||||
}
|
||||
|
||||
/** Why the roles are refused by the router, or ''. */
|
||||
/** Why the roles are refused by the server, or ''. */
|
||||
function rolesProblem(roles: Role[]) {
|
||||
for (const role of roles) {
|
||||
if (!ROLE_NAME.test(role.name.trim())) {
|
||||
@@ -74,7 +74,7 @@ function lines(text: string) {
|
||||
return text.split('\n').map((line) => line.trim()).filter((line) => line !== '')
|
||||
}
|
||||
|
||||
/** Why the URIs of a text field are refused by the router, or ''. */
|
||||
/** Why the URIs of a text field are refused by the server, or ''. */
|
||||
function urisProblem(text: string) {
|
||||
const uris = lines(text)
|
||||
if (uris.length > CLIENT_VALUES_MAX) {
|
||||
@@ -102,7 +102,7 @@ function urisProblem(text: string) {
|
||||
* no secret, which client credentials need, and the client scopes, chosen from scopes, those of every resource; an account with redirect URIs or grants is
|
||||
* a client, its name the client ID and its password the secret. As a resource: its scopes, typed, and its roles, each with a name, a description and the
|
||||
* groups and accounts, chosen from accounts, it is assigned to. onSave sends them, trimmed, with the password when adding; the dialog closes when it
|
||||
* succeeds and shows the router's message when it fails.
|
||||
* succeeds and shows the server's message when it fails.
|
||||
*/
|
||||
export default function ServiceAccountDialog(props: {
|
||||
account?: User
|
||||
|
||||
Reference in new issue
Block a user