UnENVerse 0.42.6
Local-first desktop secrets manager — TypeScript frontend
Loading...
Searching...
No Matches
env-link.ts File Reference

ENV chunk <-> vault linking — match plain KEY=value env-file fields against existing vault entries so they can be replaced by ${ref} placeholders, and suggest new entries for the ones that have no match. More...

import type;
Include dependency graph for env-link.ts:

Functions

function _findBestVaultMatch (key:string, value:string,)
 
 for (const e of st.vault.api_keys)
 
function _suggestCreateEntry (key:string)
 
 if (suffixMatch) return
 Parses an expression.
 
function export buildEnvLinkMatches (chunk:SecretChunk)
 

Variables

export interface EnvLinkMatch
 
rawValue __pad0__
 
alreadyLinked __pad1__
 
existingRef __pad2__
 
match __pad3__
 
ref __pad4__
 
field __pad5__
 
confidence __pad6__
 
suggestCreate __pad7__
 
keyId __pad8__
 
secretType __pad9__
 
 null
 
let tiedWith
 A second entry with the same score as best.
 
const _providerRef = (e: VaultEntry) => (e.key_id ? `${e.provider}_${e.key_id}` : e.provider)
 
return best &&best confidence = 63 ? best : null
 
let secretType
 
const suffixMatch
 
 return { provider: key, secretType }
 

Detailed Description

ENV chunk <-> vault linking — match plain KEY=value env-file fields against existing vault entries so they can be replaced by ${ref} placeholders, and suggest new entries for the ones that have no match.

Function Documentation

◆ _findBestVaultMatch()

function _findBestVaultMatch (   key:string,
  value:string 
)

◆ for()

for ( const e of st.vault.  api_keys)

◆ _suggestCreateEntry()

function _suggestCreateEntry (   key:string)

◆ if()

if ( pos !  pos ! = =toks.length)
new

Parses an expression.

Throws with a readable message on malformed input.

◆ buildEnvLinkMatches()

function export buildEnvLinkMatches (   chunk:SecretChunk)

Variable Documentation

◆ EnvLinkMatch

export interface EnvLinkMatch
Initial value:
{
key: string
let key
Definition bundle-import.ts:252

◆ __pad0__

rawValue __pad0__

◆ __pad1__

alreadyLinked __pad1__

◆ __pad2__

existingRef __pad2__

◆ __pad3__

match __pad3__

◆ __pad4__

ref __pad4__

◆ __pad5__

field __pad5__

◆ __pad6__

confidence __pad6__

◆ __pad7__

suggestCreate __pad7__

◆ __pad8__

keyId __pad8__

◆ __pad9__

secretType __pad9__

◆ null

null
Initial value:
{
let best: { entry: VaultEntry; ref: string; field: string; confidence: number } | null = null
const string
Definition auth-panel.ts:37
const entry
Definition chunk-ops.ts:480
as unknown as VaultEntry
Definition settings-panel.ts:477

◆ tiedWith

let tiedWith

A second entry with the same score as best.

Its presence refuses the link.

◆ _providerRef

const _providerRef = (e: VaultEntry) => (e.key_id ? `${e.provider}_${e.key_id}` : e.provider)

◆ confidence

return best&& best confidence = 63 ? best : null

◆ secretType

let secretType
Initial value:
{
const k = key.toLowerCase()

◆ suffixMatch

const suffixMatch
Initial value:
=
/^(.+)[_-](API_?KEY|APIKEY|KEY|TOKEN|SECRET|PASS(WORD)?|PWD|USER(NAME)?|LOGIN|URL|URI|DSN)$/i.exec(
key,
)
const $
Tools -> Config history (Phase 35): the app side of unv history ....
Definition history-pane.ts:20

◆ return

return { provider: key, secretType }