MCPcopy Create free account

hub / github.com/avikalpg/byok-relay / functions

Functions35 in github.com/avikalpg/byok-relay

↓ 4 callersFunctiongetToken
()
examples/react-vite/src/relay.js:13
↓ 3 callersFunctionensureToken
(appId = 'react-vite-example')
examples/react-vite/src/relay.js:32
↓ 3 callersFunctiongetEncryptionKey
()
src/db.js:119
↓ 2 callersFunction_getHmacKey
* Returns the HMAC key used to hash relay tokens. * Uses TOKEN_HMAC_SECRET if set; otherwise falls back to ENCRYPTION_SECRET. * Both are acceptable;
src/db.js:163
↓ 2 callersFunction_hmac
* Returns the HMAC-SHA256 hex digest of `token` using `key`.
src/db.js:172
↓ 2 callersFunctionhashToken
* Hash a plaintext relay token for safe storage.
src/db.js:179
↓ 2 callersFunctionlistKeys
()
examples/react-vite/src/relay.js:74
↓ 1 callersFunction_migrateTokenColumn
()
src/db.js:67
↓ 1 callersFunctionclearToken
()
examples/react-vite/src/relay.js:21
↓ 1 callersFunctioncreateUser
* Create a new user. * * @returns {{ id: string, token: string }} * `token` is the **plaintext** random token — returned to the caller ONCE, *
src/db.js:192
↓ 1 callersFunctiondecryptApiKey
(encryptedHex, ivHex, authTagHex)
src/db.js:145
↓ 1 callersFunctiondeleteKey
(userId, provider)
src/db.js:236
↓ 1 callersFunctiondeleteKey
(provider)
examples/react-vite/src/relay.js:87
↓ 1 callersFunctionencryptApiKey
(plaintext)
src/db.js:132
↓ 1 callersFunctionforwardRequest
* Forward a request to the AI provider. * Returns a node-fetch Response (streaming-capable). * * @param {string} provider - Provider name from PROV
src/providers.js:299
↓ 1 callersFunctiongetDecryptedKey
(userId, provider)
src/db.js:230
↓ 1 callersFunctiongetUserByToken
* Look up a user by their plaintext relay token. * Hashes the token before querying so plaintext is never compared in SQL.
src/db.js:208
↓ 1 callersFunctionhydrateKeyState
()
examples/react-vite/src/App.jsx:33
↓ 1 callersFunctionipToInt
Convert a dotted-decimal IPv4 string to a 32-bit unsigned integer.
src/providers.js:51
↓ 1 callersFunctionipv6ToBigInt
* Parse a colon-separated IPv6 address string (without surrounding brackets) * into a 128-bit BigInt. Returns null on any parse error.
src/providers.js:88
↓ 1 callersFunctionisBlockedIp
Return true if ipStr falls inside any blocked CIDR range.
src/providers.js:60
↓ 1 callersFunctionisBlockedIpv6
Return true if an IPv6 address string (without brackets) is in a blocked range.
src/providers.js:127
↓ 1 callersFunctionlistProviders
(userId)
src/db.js:240
↓ 1 callersFunctionsaveToken
(token)
examples/react-vite/src/relay.js:17
↓ 1 callersFunctionstoreKey
(provider, apiKey)
examples/react-vite/src/relay.js:54
↓ 1 callersFunctionstreamChat
({ provider, model, messages, onChunk })
examples/react-vite/src/relay.js:111
↓ 1 callersFunctionupsertKey
(userId, provider, plaintextKey)
src/db.js:217
↓ 1 callersFunctionvalidateAndNormaliseBaseUrl
* Validate that a client-supplied base URL is safe to use as an upstream * target. Throws RelayUrlValidationError on any policy violation. * * Rul
src/providers.js:160
FunctionApp
()
examples/react-vite/src/App.jsx:19
Methodconstructor
(message)
src/providers.js:139
FunctionhandleReset
()
examples/react-vite/src/App.jsx:68
FunctionhandleSend
(e)
examples/react-vite/src/App.jsx:82
FunctionhandleStoreKey
(e)
examples/react-vite/src/App.jsx:55
FunctionrequireAppSecret
* requireAppSecret — guards POST /users when APP_SECRET is configured. * If APP_SECRET env var is set, the caller must supply: * Authorization: Be
src/index.js:91
FunctionrequireToken
(req, res, next)
src/index.js:112