Expand TokenInfo type.
This commit is contained in:
parent
ba7e619bdf
commit
e16ef675cb
|
@ -1,8 +1,5 @@
|
|||
import { appendAPIURL, getHeaders } from "../apiUtils";
|
||||
|
||||
type TokenInfo = {
|
||||
expire_time: string;
|
||||
}
|
||||
import { TokenInfo } from "../types/token";
|
||||
|
||||
export async function lookupSelf(): Promise<TokenInfo> {
|
||||
const request = new Request(appendAPIURL("/v1/auth/token/lookup-self"), {
|
||||
|
|
19
src/api/types/token.ts
Normal file
19
src/api/types/token.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
export type TokenInfo = {
|
||||
accessor: string;
|
||||
creation_time: number;
|
||||
creation_ttl: number;
|
||||
display_name: string;
|
||||
entity_id: string;
|
||||
expire_time: string;
|
||||
explicit_max_ttl: 0;
|
||||
id: string;
|
||||
identity_policies: string[];
|
||||
issue_time: string;
|
||||
meta: any;
|
||||
num_uses: number;
|
||||
orphan: Boolean;
|
||||
path: string;
|
||||
policies: string[];
|
||||
renewable: Boolean;
|
||||
ttl: number;
|
||||
}
|
|
@ -11,6 +11,7 @@ export const enum TransitKeyTypes {
|
|||
RSA_4096 = "rsa-4096",
|
||||
}
|
||||
|
||||
// Type when used to make new transit keys.
|
||||
export type TransitKeyBaseType = {
|
||||
name: string;
|
||||
convergent_encryption: Boolean;
|
||||
|
@ -20,10 +21,11 @@ export type TransitKeyBaseType = {
|
|||
type: keyof typeof TransitKeyTypes;
|
||||
}
|
||||
|
||||
// Type returned when calling getTransitKey
|
||||
export type TransitKeyType = TransitKeyBaseType & {
|
||||
keys?: {
|
||||
keys: {
|
||||
[version: string]: number;
|
||||
},
|
||||
};
|
||||
min_decryption_version: number;
|
||||
min_encryption_version: number;
|
||||
supports_encryption: Boolean;
|
||||
|
|
Loading…
Reference in a new issue