File tree Expand file tree Collapse file tree 5 files changed +20
-4
lines changed
apps/dashboard/src/components/settings/ApiKeys
packages/service-utils/src Expand file tree Collapse file tree 5 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @thirdweb-dev/service-utils " : patch
3+ ---
4+
5+ Adds insight scope to api key and exposes cacheOptions for node auth
Original file line number Diff line number Diff line change @@ -149,4 +149,4 @@ export type ApiKeyPayConfigValidationSchema = z.infer<
149149> ;
150150
151151// FIXME: Remove
152- export const HIDDEN_SERVICES = [ "relayer" , "chainsaw" ] ;
152+ export const HIDDEN_SERVICES = [ "relayer" , "chainsaw" , "insight" ] ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export type AuthorizationInput = {
2222 useWalletAuth ?: string | null ;
2323} ;
2424
25- type CacheOptions = {
25+ export type CacheOptions = {
2626 get : ( clientId : string ) => Promise < string | null > ;
2727 put : (
2828 clientId : string ,
Original file line number Diff line number Diff line change @@ -58,6 +58,13 @@ export const SERVICE_DEFINITIONS = {
5858 // all actions allowed
5959 actions : [ ] ,
6060 } ,
61+ insight : {
62+ name : "insight" ,
63+ title : "Insight" ,
64+ description : "Insight services" ,
65+ // all actions allowed
66+ actions : [ ] ,
67+ } ,
6168} as const ;
6269
6370export const SERVICE_NAMES = Object . keys (
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ import type {
66} from "node:http" ;
77import type { CoreServiceConfig } from "../core/api.js" ;
88import { authorize } from "../core/authorize/index.js" ;
9- import type { AuthorizationInput } from "../core/authorize/index.js" ;
9+ import type {
10+ AuthorizationInput ,
11+ CacheOptions ,
12+ } from "../core/authorize/index.js" ;
1013import type { AuthorizationResult } from "../core/authorize/types.js" ;
1114import type { CoreAuthInput } from "../core/types.js" ;
1215export * from "../core/usage.js" ;
@@ -39,6 +42,7 @@ export type AuthInput = CoreAuthInput & {
3942export async function authorizeNode (
4043 authInput : AuthInput ,
4144 serviceConfig : NodeServiceConfig ,
45+ cacheOptions ?: CacheOptions ,
4246) : Promise < AuthorizationResult > {
4347 let authData : AuthorizationInput ;
4448 try {
@@ -60,7 +64,7 @@ export async function authorizeNode(
6064 } ;
6165 }
6266
63- return await authorize ( authData , serviceConfig ) ;
67+ return await authorize ( authData , serviceConfig , cacheOptions ) ;
6468}
6569
6670function getHeader (
You can’t perform that action at this time.
0 commit comments