INNER CODE UNIT · TypeScript

getOptionalJwks

bex-co/beancount-io · backend-cluster/backend-v2/src/config/jwks/index.ts:203

export function getOptionalJwks(
  env: Environment,
  serializedProductionJwks: string | undefined = process.env.OAUTH_JWKS,
  derivation: JwksDerivation = derivationFromEnvironment(),
): OptionalSigningJwks {
  try {
    return { jwks: getJwks(env, serializedProductionJwks, derivation) };
  } catch (error) {
    return {
      jwks: undefined,
      unavailableReason:
        error instanceof Error
          ? error.message
          : "OAuth signing keys are invalid",
    };
  }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…