@Test void testFetchJwtSvid() { try { JwtSvid jwtSvid = workloadApiClient.fetchJwtSvid("aud1", "aud2", "aud3"); assertNotNull(jwtSvid); assertEquals(SpiffeId.parse("spiffe: assertTrue(jwtSvid.getAudience().contains("aud1")); assertEquals(3, jwtSvid.getAudience().size()); } catch (JwtSvidException e) { fail(e); } }
@Override public JwtSvid fetchJwtSvid(@NonNull String audience, String... extraAudience) throws JwtSvidException { final Set<String> audParam = createAudienceSet(audience, extraAudience); try (val cancellableContext = Context.current().withCancellation()) { return cancellableContext.call(() -> callFetchJwtSvid(audParam)); } catch (Exception e) { throw new JwtSvidException("Error fetching JWT SVID", e); } }
DefaultWorkloadApiClient implements WorkloadApiClient { @Override public JwtSvid fetchJwtSvid(@NonNull String audience, String... extraAudience) throws JwtSvidException { final Set<String> audParam = createAudienceSet(audience, extraAudience); try (val cancellableContext = Context.current().withCancellation()) { return cancellableContext.call(() -> callFetchJwtSvid(audParam)); } catch (Exception e) { throw new JwtSvidException("Error fetching JWT SVID", e); } } }
DefaultWorkloadApiClient implements WorkloadApiClient { @Override public JwtSvid fetchJwtSvid(@NonNull String audience, String... extraAudience) throws JwtSvidException { final Set<String> audParam = createAudienceSet(audience, extraAudience); try (val cancellableContext = Context.current().withCancellation()) { return cancellableContext.call(() -> callFetchJwtSvid(audParam)); } catch (Exception e) { throw new JwtSvidException("Error fetching JWT SVID", e); } } private  DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                                     final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                                     final ManagedChannelWrapper managedChannel,
                                     final ExponentialBackoffPolicy exponentialBackoffPolicy,
                                     final ScheduledExecutorService retryExecutor,
                                     final ExecutorService executorService);   DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                             final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                             final ManagedChannelWrapper managedChannel,
                             final ExponentialBackoffPolicy backoffPolicy); }
DefaultWorkloadApiClient implements WorkloadApiClient { @Override public JwtSvid fetchJwtSvid(@NonNull String audience, String... extraAudience) throws JwtSvidException { final Set<String> audParam = createAudienceSet(audience, extraAudience); try (val cancellableContext = Context.current().withCancellation()) { return cancellableContext.call(() -> callFetchJwtSvid(audParam)); } catch (Exception e) { throw new JwtSvidException("Error fetching JWT SVID", e); } } private  DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                                     final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                                     final ManagedChannelWrapper managedChannel,
                                     final ExponentialBackoffPolicy exponentialBackoffPolicy,
                                     final ScheduledExecutorService retryExecutor,
                                     final ExecutorService executorService);   DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                             final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                             final ManagedChannelWrapper managedChannel,
                             final ExponentialBackoffPolicy backoffPolicy); static WorkloadApiClient newClient(); static WorkloadApiClient newClient(@NonNull final ClientOptions options); @Override X509Context fetchX509Context(); @Override void watchX509Context(@NonNull final Watcher<X509Context> watcher); @Override JwtSvid fetchJwtSvid(@NonNull String audience, String... extraAudience); @Override JwtSvid fetchJwtSvid(@NonNull final SpiffeId subject,
                                @NonNull final String audience,
                                final String... extraAudience); @Override JwtBundleSet fetchJwtBundles(); @Override JwtSvid validateJwtSvid(@NonNull final String token, @NonNull final String audience); @Override void watchJwtBundles(@NonNull final Watcher<JwtBundleSet> watcher); @Override void close(); }
DefaultWorkloadApiClient implements WorkloadApiClient { @Override public JwtSvid fetchJwtSvid(@NonNull String audience, String... extraAudience) throws JwtSvidException { final Set<String> audParam = createAudienceSet(audience, extraAudience); try (val cancellableContext = Context.current().withCancellation()) { return cancellableContext.call(() -> callFetchJwtSvid(audParam)); } catch (Exception e) { throw new JwtSvidException("Error fetching JWT SVID", e); } } private  DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                                     final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                                     final ManagedChannelWrapper managedChannel,
                                     final ExponentialBackoffPolicy exponentialBackoffPolicy,
                                     final ScheduledExecutorService retryExecutor,
                                     final ExecutorService executorService);   DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                             final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                             final ManagedChannelWrapper managedChannel,
                             final ExponentialBackoffPolicy backoffPolicy); static WorkloadApiClient newClient(); static WorkloadApiClient newClient(@NonNull final ClientOptions options); @Override X509Context fetchX509Context(); @Override void watchX509Context(@NonNull final Watcher<X509Context> watcher); @Override JwtSvid fetchJwtSvid(@NonNull String audience, String... extraAudience); @Override JwtSvid fetchJwtSvid(@NonNull final SpiffeId subject,
                                @NonNull final String audience,
                                final String... extraAudience); @Override JwtBundleSet fetchJwtBundles(); @Override JwtSvid validateJwtSvid(@NonNull final String token, @NonNull final String audience); @Override void watchJwtBundles(@NonNull final Watcher<JwtBundleSet> watcher); @Override void close();  }