Skip to content

Commit

Permalink
re-generated sdk, removed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ptroger committed Dec 3, 2024
1 parent 50803ef commit b28e647
Show file tree
Hide file tree
Showing 11 changed files with 302 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ describe('SDK Compression Interceptors', () => {

expect(result.headers['Content-Encoding']).toBe('gzip')

console.log('data', result)
const decompressed = await gunzip(result.data)
expect(JSON.parse(decompressed.toString())).toEqual({ test: 'data' })
})
Expand Down
164 changes: 139 additions & 25 deletions packages/armory-sdk/src/lib/http/client/auth/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1155,20 +1155,23 @@ export interface CreateClientRequestDtoDataStoreEntityKeysInner {

export const CreateClientRequestDtoDataStoreEntityKeysInnerKtyEnum = {
Ec: 'EC',
Rsa: 'RSA'
Rsa: 'RSA',
Okp: 'OKP'
} as const;

export type CreateClientRequestDtoDataStoreEntityKeysInnerKtyEnum = typeof CreateClientRequestDtoDataStoreEntityKeysInnerKtyEnum[keyof typeof CreateClientRequestDtoDataStoreEntityKeysInnerKtyEnum];
export const CreateClientRequestDtoDataStoreEntityKeysInnerCrvEnum = {
Secp256k1: 'secp256k1',
P256: 'P-256'
P256: 'P-256',
Ed25519: 'Ed25519'
} as const;

export type CreateClientRequestDtoDataStoreEntityKeysInnerCrvEnum = typeof CreateClientRequestDtoDataStoreEntityKeysInnerCrvEnum[keyof typeof CreateClientRequestDtoDataStoreEntityKeysInnerCrvEnum];
export const CreateClientRequestDtoDataStoreEntityKeysInnerAlgEnum = {
Es256K: 'ES256K',
Es256: 'ES256',
Rs256: 'RS256'
Rs256: 'RS256',
Eddsa: 'EDDSA'
} as const;

export type CreateClientRequestDtoDataStoreEntityKeysInnerAlgEnum = typeof CreateClientRequestDtoDataStoreEntityKeysInnerAlgEnum[keyof typeof CreateClientRequestDtoDataStoreEntityKeysInnerAlgEnum];
Expand Down Expand Up @@ -1319,7 +1322,7 @@ export interface CreateClientResponseDtoPolicyEngineNodesInner {
* @type CreateClientResponseDtoPolicyEngineNodesInnerPublicKey
* @export
*/
export type CreateClientResponseDtoPolicyEngineNodesInnerPublicKey = CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf | CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf1 | CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf2 | CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf3;
export type CreateClientResponseDtoPolicyEngineNodesInnerPublicKey = CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf | CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf1 | CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf2 | CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf3 | CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4;

/**
*
Expand Down Expand Up @@ -1610,6 +1613,78 @@ export const CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf3UseEnum

export type CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf3UseEnum = typeof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf3UseEnum[keyof typeof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf3UseEnum];

/**
*
* @export
* @interface CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4
*/
export interface CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4 {
/**
*
* @type {string}
* @memberof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4
*/
'kty': CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4KtyEnum;
/**
*
* @type {string}
* @memberof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4
*/
'alg': CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4AlgEnum;
/**
*
* @type {string}
* @memberof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4
*/
'use'?: CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4UseEnum;
/**
*
* @type {string}
* @memberof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4
*/
'kid': string;
/**
*
* @type {string}
* @memberof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4
*/
'addr'?: string;
/**
*
* @type {string}
* @memberof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4
*/
'crv': CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4CrvEnum;
/**
*
* @type {string}
* @memberof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4
*/
'x': string;
}

export const CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4KtyEnum = {
Okp: 'OKP'
} as const;

export type CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4KtyEnum = typeof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4KtyEnum[keyof typeof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4KtyEnum];
export const CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4AlgEnum = {
Eddsa: 'EDDSA'
} as const;

export type CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4AlgEnum = typeof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4AlgEnum[keyof typeof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4AlgEnum];
export const CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4UseEnum = {
Sig: 'sig',
Enc: 'enc'
} as const;

export type CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4UseEnum = typeof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4UseEnum[keyof typeof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4UseEnum];
export const CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4CrvEnum = {
Ed25519: 'Ed25519'
} as const;

export type CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4CrvEnum = typeof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4CrvEnum[keyof typeof CreateClientResponseDtoPolicyEngineNodesInnerPublicKeyOneOf4CrvEnum];

/**
*
* @export
Expand Down Expand Up @@ -2840,7 +2915,8 @@ export type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf28CriterionEnum = typ
export const PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf28ArgsEnum = {
Es256K: 'ES256K',
Es256: 'ES256',
Rs256: 'RS256'
Rs256: 'RS256',
Eddsa: 'EDDSA'
} as const;

export type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf28ArgsEnum = typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf28ArgsEnum[keyof typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf28ArgsEnum];
Expand Down Expand Up @@ -3371,7 +3447,8 @@ export type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf38ArgsInnerTypeEnum =
export const PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf38ArgsInnerAlgorithmEnum = {
Es256K: 'ES256K',
Es256: 'ES256',
Rs256: 'RS256'
Rs256: 'RS256',
Eddsa: 'EDDSA'
} as const;

export type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf38ArgsInnerAlgorithmEnum = typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf38ArgsInnerAlgorithmEnum[keyof typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf38ArgsInnerAlgorithmEnum];
Expand Down Expand Up @@ -3748,57 +3825,94 @@ export interface PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsFilters {
*/
'accountGroups'?: Array<string>;
}
/**
* @type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindow
* @export
*/
export type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindow = PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf | PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1;

/**
*
* @export
* @interface PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindow
* @interface PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf
*/
export interface PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindow {
export interface PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf {
/**
*
* @type {string}
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindow
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf
*/
'type'?: PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowTypeEnum;
'type': PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOfTypeEnum;
/**
*
* @type {string}
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindow
*/
'period'?: PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowPeriodEnum;
/**
*
* @type {number}
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindow
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf
*/
'value'?: number;
'period': PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOfPeriodEnum;
/**
*
* @type {number}
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindow
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf
*/
'startDate'?: number;
/**
*
* @type {number}
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindow
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf
*/
'endDate'?: number;
}

export const PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowTypeEnum = {
Rolling: 'rolling',
export const PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOfTypeEnum = {
Fixed: 'fixed'
} as const;

export type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowTypeEnum = typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowTypeEnum[keyof typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowTypeEnum];
export const PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowPeriodEnum = {
export type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOfTypeEnum = typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOfTypeEnum[keyof typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOfTypeEnum];
export const PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOfPeriodEnum = {
_1d: '1d',
_1m: '1m',
_1y: '1y'
} as const;

export type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowPeriodEnum = typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowPeriodEnum[keyof typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowPeriodEnum];
export type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOfPeriodEnum = typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOfPeriodEnum[keyof typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOfPeriodEnum];

/**
*
* @export
* @interface PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1
*/
export interface PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1 {
/**
*
* @type {string}
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1
*/
'type': PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1TypeEnum;
/**
*
* @type {number}
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1
*/
'value': number;
/**
*
* @type {number}
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1
*/
'startDate'?: number;
/**
*
* @type {number}
* @memberof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1
*/
'endDate'?: number;
}

export const PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1TypeEnum = {
Rolling: 'rolling'
} as const;

export type PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1TypeEnum = typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1TypeEnum[keyof typeof PolicyDataStoreDtoPolicyDataInnerWhenInnerOneOf43ArgsTimeWindowOneOf1TypeEnum];

/**
*
Expand Down
74 changes: 73 additions & 1 deletion packages/armory-sdk/src/lib/http/client/vault/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export interface CreateClientDto {
* @type CreateClientDtoEngineJwk
* @export
*/
export type CreateClientDtoEngineJwk = CreateClientDtoEngineJwkOneOf | CreateClientDtoEngineJwkOneOf1 | CreateClientDtoEngineJwkOneOf2 | EncryptionKeyDtoPublicKey;
export type CreateClientDtoEngineJwk = CreateClientDtoEngineJwkOneOf | CreateClientDtoEngineJwkOneOf1 | CreateClientDtoEngineJwkOneOf2 | CreateClientDtoEngineJwkOneOf3 | EncryptionKeyDtoPublicKey;

/**
*
Expand Down Expand Up @@ -441,6 +441,78 @@ export const CreateClientDtoEngineJwkOneOf2UseEnum = {

export type CreateClientDtoEngineJwkOneOf2UseEnum = typeof CreateClientDtoEngineJwkOneOf2UseEnum[keyof typeof CreateClientDtoEngineJwkOneOf2UseEnum];

/**
*
* @export
* @interface CreateClientDtoEngineJwkOneOf3
*/
export interface CreateClientDtoEngineJwkOneOf3 {
/**
*
* @type {string}
* @memberof CreateClientDtoEngineJwkOneOf3
*/
'kty': CreateClientDtoEngineJwkOneOf3KtyEnum;
/**
*
* @type {string}
* @memberof CreateClientDtoEngineJwkOneOf3
*/
'alg': CreateClientDtoEngineJwkOneOf3AlgEnum;
/**
*
* @type {string}
* @memberof CreateClientDtoEngineJwkOneOf3
*/
'use'?: CreateClientDtoEngineJwkOneOf3UseEnum;
/**
*
* @type {string}
* @memberof CreateClientDtoEngineJwkOneOf3
*/
'kid': string;
/**
*
* @type {string}
* @memberof CreateClientDtoEngineJwkOneOf3
*/
'addr'?: string;
/**
*
* @type {string}
* @memberof CreateClientDtoEngineJwkOneOf3
*/
'crv': CreateClientDtoEngineJwkOneOf3CrvEnum;
/**
*
* @type {string}
* @memberof CreateClientDtoEngineJwkOneOf3
*/
'x': string;
}

export const CreateClientDtoEngineJwkOneOf3KtyEnum = {
Okp: 'OKP'
} as const;

export type CreateClientDtoEngineJwkOneOf3KtyEnum = typeof CreateClientDtoEngineJwkOneOf3KtyEnum[keyof typeof CreateClientDtoEngineJwkOneOf3KtyEnum];
export const CreateClientDtoEngineJwkOneOf3AlgEnum = {
Eddsa: 'EDDSA'
} as const;

export type CreateClientDtoEngineJwkOneOf3AlgEnum = typeof CreateClientDtoEngineJwkOneOf3AlgEnum[keyof typeof CreateClientDtoEngineJwkOneOf3AlgEnum];
export const CreateClientDtoEngineJwkOneOf3UseEnum = {
Sig: 'sig',
Enc: 'enc'
} as const;

export type CreateClientDtoEngineJwkOneOf3UseEnum = typeof CreateClientDtoEngineJwkOneOf3UseEnum[keyof typeof CreateClientDtoEngineJwkOneOf3UseEnum];
export const CreateClientDtoEngineJwkOneOf3CrvEnum = {
Ed25519: 'Ed25519'
} as const;

export type CreateClientDtoEngineJwkOneOf3CrvEnum = typeof CreateClientDtoEngineJwkOneOf3CrvEnum[keyof typeof CreateClientDtoEngineJwkOneOf3CrvEnum];

/**
*
* @export
Expand Down
19 changes: 13 additions & 6 deletions packages/signature/src/lib/__test__/unit/sign.spec.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
import { secp256k1 } from '@noble/curves/secp256k1'
import { sha256 as sha256Hash } from '@noble/hashes/sha256'
import { toBytes } from '@noble/hashes/utils'
import { exportJWK, importPKCS8 } from 'jose'
import { createPublicKey } from 'node:crypto'
import { hexToBytes, toHex, verifyMessage } from 'viem'
import { toHex, verifyMessage } from 'viem'
import { privateKeyToAccount, signMessage } from 'viem/accounts'
import { buildSignerEdDSA, buildSignerEip191, buildSignerEs256k, signJwt, signSecp256k1, signatureToHex } from '../../sign'
import {
buildSignerEdDSA,
buildSignerEip191,
buildSignerEs256k,
signJwt,
signSecp256k1,
signatureToHex
} from '../../sign'
import { Alg, Curves, Jwk, KeyTypes, Payload, PrivateKey, SigningAlg } from '../../types'
import {
base64UrlToBytes,
base64UrlToHex,
ed25519polyfilled as ed,
ellipticPrivateKeyToHex,
ellipticPublicKeyToHex,
generateJwk,
hexToBase64Url,
privateKeyToHex,
secp256k1PrivateKeyToJwk,
secp256k1PublicKeyToJwk,
ed25519polyfilled as ed,
privateKeyToJwk,
publicKeyToHex,
secp256k1PrivateKeyToJwk,
secp256k1PublicKeyToJwk
} from '../../utils'
import { verifyJwt } from '../../verify'
import { HEADER_PART, PAYLOAD_PART, PRIVATE_KEY_PEM } from './mock'
import { toBytes } from '@noble/hashes/utils'

describe('sign', () => {
const UNSAFE_PRIVATE_KEY = '7cfef3303797cbc7515d9ce22ffe849c701b0f2812f999b0847229c47951fca5'
Expand Down
Loading

0 comments on commit b28e647

Please sign in to comment.