MCPcopy Index your code
hub / github.com/coder/mux / resolveWithClient

Method resolveWithClient

src/node/services/onePasswordService.ts:158–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156 }
157
158 const resolveWithClient = async (): Promise<string | undefined> => {
159 const client = await this.getClient();
160 const value = await withTimeout(
161 client.secrets.resolve(decodedRef),
162 RESOLVE_TIMEOUT_MS,
163 `1Password resolution timed out after ${RESOLVE_TIMEOUT_MS}ms for ${ref}`
164 );
165 if (typeof value !== "string") {
166 log.warn("[OnePasswordService] Resolved secret was not a string", {
167 ref,
168 type: typeof value,
169 });
170 return undefined;
171 }
172
173 this.cache.set(ref, {
174 value,
175 expiresAt: Date.now() + CACHE_TTL_MS,
176 });
177 return value;
178 };
179
180 try {
181 return await resolveWithClient();

Callers

nothing calls this directly

Calls 4

getClientMethod · 0.95
resolveMethod · 0.80
setMethod · 0.80
withTimeoutFunction · 0.70

Tested by

no test coverage detected