diff --git a/apps/devtool/src/app/_hooks/useAccountSignature.tsx b/apps/devtool/src/app/_hooks/useAccountSignature.tsx index 927041b0d..7c45f5349 100644 --- a/apps/devtool/src/app/_hooks/useAccountSignature.tsx +++ b/apps/devtool/src/app/_hooks/useAccountSignature.tsx @@ -1,4 +1,4 @@ -import { Curves, KeyTypes, PublicKey, SigningAlg, hexToBase64Url } from '@narval/signature' +import { Curves, KeyTypes, PublicKey, SigningAlg, hexToBase64Url } from '@narval/armory-sdk' import { signMessage } from '@wagmi/core' import { useEffect, useState } from 'react' import { useAccount } from 'wagmi' diff --git a/apps/devtool/src/app/_hooks/useAuthServerApi.tsx b/apps/devtool/src/app/_hooks/useAuthServerApi.tsx index 7a0227409..0273a95d7 100644 --- a/apps/devtool/src/app/_hooks/useAuthServerApi.tsx +++ b/apps/devtool/src/app/_hooks/useAuthServerApi.tsx @@ -4,9 +4,9 @@ import { AuthorizationRequestStatus, EntityStoreClient, Evaluate, - Request + Request, + SigningAlg } from '@narval/armory-sdk' -import { SigningAlg } from '@narval/signature' import { useMemo, useState } from 'react' import { SetOptional } from 'type-fest' import { extractErrorMessage, getUrlProtocol } from '../_lib/utils' diff --git a/apps/devtool/src/app/_hooks/useDataStoreApi.tsx b/apps/devtool/src/app/_hooks/useDataStoreApi.tsx index 416733560..f9bb30310 100644 --- a/apps/devtool/src/app/_hooks/useDataStoreApi.tsx +++ b/apps/devtool/src/app/_hooks/useDataStoreApi.tsx @@ -1,14 +1,15 @@ -import { EntityStoreClient, PolicyStoreClient } from '@narval/armory-sdk' import { Entities, EntityData, EntityStore, + EntityStoreClient, EntityUtil, Policy, PolicyData, - PolicyStore -} from '@narval/policy-engine-shared' -import { SigningAlg } from '@narval/signature' + PolicyStore, + PolicyStoreClient, + SigningAlg +} from '@narval/armory-sdk' import { useEffect, useMemo, useState } from 'react' import { backOff, extractErrorMessage, getHost, isValidUrl } from '../_lib/utils' import useAccountSignature from './useAccountSignature' diff --git a/apps/devtool/src/app/_hooks/useEngineApi.tsx b/apps/devtool/src/app/_hooks/useEngineApi.tsx index a8d933a8b..5ee5d6848 100644 --- a/apps/devtool/src/app/_hooks/useEngineApi.tsx +++ b/apps/devtool/src/app/_hooks/useEngineApi.tsx @@ -1,12 +1,12 @@ import { EngineClientConfig, + EvaluationRequest, + SigningAlg, onboardEngineClient, pingEngine, sendEvaluationRequest, syncPolicyEngine } from '@narval/armory-sdk' -import { EvaluationRequest } from '@narval/policy-engine-shared' -import { SigningAlg } from '@narval/signature' import { useMemo, useState } from 'react' import { extractErrorMessage, getUrlProtocol } from '../_lib/utils' import useAccountSignature from './useAccountSignature' diff --git a/apps/devtool/src/app/_hooks/useVaultApi.tsx b/apps/devtool/src/app/_hooks/useVaultApi.tsx index a4b56a37b..a93b0a380 100644 --- a/apps/devtool/src/app/_hooks/useVaultApi.tsx +++ b/apps/devtool/src/app/_hooks/useVaultApi.tsx @@ -3,11 +3,15 @@ import { GenerateKeyRequest, ImportPrivateKeyRequest, ImportSeedRequest, + Jwk, + Request, + RsaPublicKey, + SigningAlg, VaultAdminClient, - VaultClient + VaultClient, + rsaKeyToKid, + rsaPublicKeySchema } from '@narval/armory-sdk' -import { Request } from '@narval/policy-engine-shared' -import { Alg, Jwk, RsaPublicKey, SigningAlg, rsaKeyToKid, rsaPublicKeySchema } from '@narval/signature' import { exportJWK, importSPKI } from 'jose' import { useMemo, useState } from 'react' import { extractErrorMessage, getHost, isValidUrl } from '../_lib/utils' @@ -81,13 +85,13 @@ const useVaultApi = () => { } = vaultClientData const getJwkFromRsaPem = async (pem: string): Promise => { - const key = await importSPKI(pem, Alg.RS256, { extractable: true }) + const key = await importSPKI(pem, SigningAlg.RS256, { extractable: true }) const jwk = await exportJWK(key) const kid = rsaKeyToKid(jwk as Jwk) return rsaPublicKeySchema.parse({ ...jwk, - alg: Alg.RS256, + alg: SigningAlg.RS256, kid }) } diff --git a/packages/armory-sdk/src/index.ts b/packages/armory-sdk/src/index.ts index b7b868fda..10f35d498 100644 --- a/packages/armory-sdk/src/index.ts +++ b/packages/armory-sdk/src/index.ts @@ -9,7 +9,7 @@ export * from './lib/vault' export { resourceId } from './lib/utils' -export type { Alg, PrivateKey, PublicKey, RsaPublicKey } from '@narval/signature' +export type { Alg, Jwk, PrivateKey, PublicKey, RsaPublicKey } from '@narval/signature' export { Curves, @@ -27,6 +27,8 @@ export { privateKeyToJwk, publicKeySchema, publicKeyToJwk, + rsaKeyToKid, + rsaPublicKeySchema, signJwt } from '@narval/signature' @@ -41,6 +43,7 @@ export type { Eip712TypedData, Entities, EntityType, + EvaluationRequest, Hex, JwtString, Policy, @@ -50,13 +53,17 @@ export type { TransactionRequest, UserAccountEntity, UserEntity, - ValueOperators, + ValueOperators } from '@narval/policy-engine-shared' export { AccountType, Action, + EntityData, + EntityStore, EntityUtil, + PolicyData, + PolicyStore, UserRole, getAddress, hexSchema,