mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: add auth extension points and one ssh connect pipeline
This commit is contained in:
1 parent
d3c209af13
commit
d774df8b41
159 files changed
+43243
-7451
No files matched your search
@@ -27,7 +27,8 @@ export type CredentialTrayTrigger =
|
||||
"always" | "hover" | "click" | "actionsOnly";
|
||||
|
||||
export interface CredentialSidebarFilterState {
|
||||
type: ("password" | "key")[];
|
||||
/** Credential type ids; plugins can add their own. */
|
||||
type: string[];
|
||||
tags: string[];
|
||||
}
|
||||
|
||||
@@ -60,7 +61,7 @@ const TRAY_TRIGGERS: CredentialTrayTrigger[] = [
|
||||
"click",
|
||||
"actionsOnly",
|
||||
];
|
||||
const FILTER_TYPE: CredentialSidebarFilterState["type"] = ["password", "key"];
|
||||
const TYPE_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
|
||||
|
||||
export function defaultCredentialSidebarPreferences(): CredentialSidebarPreferences {
|
||||
return {
|
||||
@@ -112,7 +113,9 @@ export function sanitizeCredentialSidebarPreferences(
|
||||
|
||||
const filtersObj = (obj.filters ?? {}) as Record<string, unknown>;
|
||||
const filters: CredentialSidebarFilterState = {
|
||||
type: sanitizeEnumArray(filtersObj.type, FILTER_TYPE),
|
||||
type: sanitizeStringArray(filtersObj.type).filter((value) =>
|
||||
TYPE_PATTERN.test(value),
|
||||
),
|
||||
tags: sanitizeStringArray(filtersObj.tags),
|
||||
};
|
||||
|
||||
|
||||
@@ -34,9 +34,8 @@ export type HostTrayTrigger = "always" | "hover" | "click" | "actionsOnly";
|
||||
|
||||
export interface HostSidebarFilterState {
|
||||
status: ("online" | "offline" | "pinned")[];
|
||||
authType: (
|
||||
"password" | "key" | "credential" | "none" | "opkssh" | "stepca"
|
||||
)[];
|
||||
/** SSH auth type ids; plugins add their own. */
|
||||
authType: string[];
|
||||
protocol: ("ssh" | "rdp" | "vnc" | "telnet")[];
|
||||
features: ("terminal" | "fileManager" | "tunnel" | "docker")[];
|
||||
tags: string[];
|
||||
@@ -94,14 +93,8 @@ const FILTER_STATUS: HostSidebarFilterState["status"] = [
|
||||
"offline",
|
||||
"pinned",
|
||||
];
|
||||
const FILTER_AUTH_TYPE: HostSidebarFilterState["authType"] = [
|
||||
"password",
|
||||
"key",
|
||||
"credential",
|
||||
"none",
|
||||
"opkssh",
|
||||
"stepca",
|
||||
];
|
||||
/** Same shape as a manifest's contributes.auth.sshAuthTypes entries. */
|
||||
const AUTH_TYPE_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
|
||||
const FILTER_PROTOCOL: HostSidebarFilterState["protocol"] = [
|
||||
"ssh",
|
||||
"rdp",
|
||||
@@ -178,7 +171,9 @@ export function sanitizeHostSidebarPreferences(
|
||||
const filtersObj = (obj.filters ?? {}) as Record<string, unknown>;
|
||||
const filters: HostSidebarFilterState = {
|
||||
status: sanitizeEnumArray(filtersObj.status, FILTER_STATUS),
|
||||
authType: sanitizeEnumArray(filtersObj.authType, FILTER_AUTH_TYPE),
|
||||
authType: sanitizeStringArray(filtersObj.authType).filter((value) =>
|
||||
AUTH_TYPE_PATTERN.test(value),
|
||||
),
|
||||
protocol: sanitizeEnumArray(filtersObj.protocol, FILTER_PROTOCOL),
|
||||
features: sanitizeEnumArray(filtersObj.features, FILTER_FEATURES),
|
||||
tags: sanitizeStringArray(filtersObj.tags),
|
||||
|
||||
Reference in new issue
Block a user