@Test public void renewClientSecret() throws Exception{ when(dcrService.renewSecret(any(), any())).thenReturn(Single.just(new Client())); when(clientSyncService.addDynamicClientRegistred(any())).thenReturn(new Client()); testRequest( HttpMethod.POST, "/register/my-test-client_id/renew_secret", HttpStatusCode.OK_200, "OK"); }
public void renewClientSecret(RoutingContext context) { LOGGER.debug("Dynamic client registration RENEW SECRET endpoint"); this.getClient(context) .flatMapSingle(Single::just) .flatMap(toRenew -> dcrService.renewSecret(toRenew, UriBuilderRequest.resolveProxyRequest(context))) .map(clientSyncService::addDynamicClientRegistred) .subscribe( client -> context.response() .putHeader(HttpHeaders.CACHE_CONTROL, "no-store") .putHeader(HttpHeaders.PRAGMA, "no-cache") .putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .setStatusCode(HttpStatusCode.OK_200) .end(Json.encodePrettily(DynamicClientRegistrationResponse.fromClient(client))) , error -> context.fail(error) ); }
DynamicClientAccessEndpoint extends DynamicClientRegistrationEndpoint { public void renewClientSecret(RoutingContext context) { LOGGER.debug("Dynamic client registration RENEW SECRET endpoint"); this.getClient(context) .flatMapSingle(Single::just) .flatMap(toRenew -> dcrService.renewSecret(toRenew, UriBuilderRequest.resolveProxyRequest(context))) .map(clientSyncService::addDynamicClientRegistred) .subscribe( client -> context.response() .putHeader(HttpHeaders.CACHE_CONTROL, "no-store") .putHeader(HttpHeaders.PRAGMA, "no-cache") .putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .setStatusCode(HttpStatusCode.OK_200) .end(Json.encodePrettily(DynamicClientRegistrationResponse.fromClient(client))) , error -> context.fail(error) ); } }
DynamicClientAccessEndpoint extends DynamicClientRegistrationEndpoint { public void renewClientSecret(RoutingContext context) { LOGGER.debug("Dynamic client registration RENEW SECRET endpoint"); this.getClient(context) .flatMapSingle(Single::just) .flatMap(toRenew -> dcrService.renewSecret(toRenew, UriBuilderRequest.resolveProxyRequest(context))) .map(clientSyncService::addDynamicClientRegistred) .subscribe( client -> context.response() .putHeader(HttpHeaders.CACHE_CONTROL, "no-store") .putHeader(HttpHeaders.PRAGMA, "no-cache") .putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .setStatusCode(HttpStatusCode.OK_200) .end(Json.encodePrettily(DynamicClientRegistrationResponse.fromClient(client))) , error -> context.fail(error) ); } DynamicClientAccessEndpoint(DynamicClientRegistrationService dcrService, ClientSyncService clientSyncService); }
DynamicClientAccessEndpoint extends DynamicClientRegistrationEndpoint { public void renewClientSecret(RoutingContext context) { LOGGER.debug("Dynamic client registration RENEW SECRET endpoint"); this.getClient(context) .flatMapSingle(Single::just) .flatMap(toRenew -> dcrService.renewSecret(toRenew, UriBuilderRequest.resolveProxyRequest(context))) .map(clientSyncService::addDynamicClientRegistred) .subscribe( client -> context.response() .putHeader(HttpHeaders.CACHE_CONTROL, "no-store") .putHeader(HttpHeaders.PRAGMA, "no-cache") .putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .setStatusCode(HttpStatusCode.OK_200) .end(Json.encodePrettily(DynamicClientRegistrationResponse.fromClient(client))) , error -> context.fail(error) ); } DynamicClientAccessEndpoint(DynamicClientRegistrationService dcrService, ClientSyncService clientSyncService); void read(RoutingContext context); void patch(RoutingContext context); void update(RoutingContext context); void delete(RoutingContext context); void renewClientSecret(RoutingContext context); }
DynamicClientAccessEndpoint extends DynamicClientRegistrationEndpoint { public void renewClientSecret(RoutingContext context) { LOGGER.debug("Dynamic client registration RENEW SECRET endpoint"); this.getClient(context) .flatMapSingle(Single::just) .flatMap(toRenew -> dcrService.renewSecret(toRenew, UriBuilderRequest.resolveProxyRequest(context))) .map(clientSyncService::addDynamicClientRegistred) .subscribe( client -> context.response() .putHeader(HttpHeaders.CACHE_CONTROL, "no-store") .putHeader(HttpHeaders.PRAGMA, "no-cache") .putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .setStatusCode(HttpStatusCode.OK_200) .end(Json.encodePrettily(DynamicClientRegistrationResponse.fromClient(client))) , error -> context.fail(error) ); } DynamicClientAccessEndpoint(DynamicClientRegistrationService dcrService, ClientSyncService clientSyncService); void read(RoutingContext context); void patch(RoutingContext context); void update(RoutingContext context); void delete(RoutingContext context); void renewClientSecret(RoutingContext context);  }