quarkiverse / quarkus-vault

Quarkus HashiCorp Vault extension
Apache License 2.0
18 stars 22 forks source link

Read timeout is not set on Vault Requests #253

Closed vsevel closed 4 months ago

vsevel commented 4 months ago

In VaultSecretsKV1RequestFactory, requests are created such as:

  public VaultRequest<VaultSecretsKV1ReadResult> read(String mountPath, String path) {
    return VaultRequest.get(getTraceOpName("Read"))
        .path(mountPath, path)
        .expectOkStatus()
        .build(VaultLeasedResultExtractor.of(VaultSecretsKV1ReadResult.class));
  }

we do not set read timeout on those requests. the value should come from the VaultRuntimeConfig.readTimeout as a result the value is always Duration timeout = Duration.ofSeconds(30); from VaultRequest.Builder. as a side not, the defaults changed as well. In VaultRuntimeConfig the default is 5 secs, whereas in VaultRequest, the default is 30 secs. Users will incur a change of behavior even if the did not set a read timeout.