mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-29 04:00:09 +00:00
Initial commit of eigent-main
This commit is contained in:
commit
723df5a03e
1144 changed files with 103478 additions and 0 deletions
24
package/@stackframe/stack-shared/dist/utils/api-keys.d.ts
vendored
Normal file
24
package/@stackframe/stack-shared/dist/utils/api-keys.d.ts
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* An api key has the following format:
|
||||
* <prefix_without_underscores>_<secret_part_45_chars><id_part_32_chars><type_user_or_team_4_chars><scanner_and_marker_10_chars><checksum_8_chars>
|
||||
*
|
||||
* The scanner and marker is a base32 character that is used to determine if the api key is a public or private key
|
||||
* and if it is a cloud or self-hosted key.
|
||||
*
|
||||
* The checksum is a crc32 checksum of the api key encoded in hex.
|
||||
*
|
||||
*/
|
||||
type ProjectApiKey = {
|
||||
id: string;
|
||||
prefix: string;
|
||||
isPublic: boolean;
|
||||
isCloudVersion: boolean;
|
||||
secret: string;
|
||||
checksum: string;
|
||||
type: "user" | "team";
|
||||
};
|
||||
declare function isApiKey(secret: string): boolean;
|
||||
declare function createProjectApiKey(options: Pick<ProjectApiKey, "id" | "isPublic" | "isCloudVersion" | "type">): string;
|
||||
declare function parseProjectApiKey(secret: string): ProjectApiKey;
|
||||
|
||||
export { createProjectApiKey, isApiKey, parseProjectApiKey };
|
||||
Loading…
Add table
Add a link
Reference in a new issue