java.lang.Object
io.getlime.security.powerauth.lib.tpp.engine.client.TppEngineClient

public class TppEngineClient
extends Object
TPP Engine Client provides methods for communication with the TPP registry and consent engine. It uses the Rest Client to handle REST API calls.
Author:
Petr Dvorak, petr@wultra.com, Roman Strobl, roman.strobl@wultra.com
  • Constructor Summary

    Constructors
    Constructor Description
    TppEngineClient​(com.wultra.core.rest.client.base.RestClientConfiguration restClientConfiguration)
    Create a new client with detailed configuration of REST client.
    TppEngineClient​(String serviceUrl)
    Create a new client with provided base URL.
  • Method Summary

    Modifier and Type Method Description
    io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.ConsentDetailResponse> consentDetail​(String id)
    Lookup consent details (details of a consent template).
    io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.UserConsentDetailResponse> consentStatus​(String userId, String consentId, String clientId)
    Lookup consent status for given user and app.
    io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> createApplication​(io.getlime.security.powerauth.app.tppengine.model.request.CreateTppAppRequest request)
    Create an application with provided information.
    io.getlime.core.rest.model.base.response.Response deleteApplication​(String clientId, String tppLicense)
    Delete an application with provided information.
    io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> fetchAppInfo​(String clientId)
    Lookup information about a provided app.
    io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> fetchAppInfoWithLicenseRestriction​(String clientId, String tppLicense)
    Lookup information about a provided app.
    io.getlime.core.rest.model.base.response.ObjectResponse<List<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse>> fetchApplicationList​(String tppLicense)
    Fetch list of TPP applications based on the license info.
    io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.GiveConsentResponse> giveConsent​(io.getlime.security.powerauth.app.tppengine.model.request.GiveConsentRequest request)
    Give consent according to request parameters.
    io.getlime.core.rest.model.base.response.Response rejectConsent​(io.getlime.security.powerauth.app.tppengine.model.request.RemoveConsentRequest request)
    Reject consent according to request parameters.
    io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> renewClientSecret​(String clientId, String tppLicense)
    Renew the client secret for the application.
    io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> updateApplication​(String clientId, io.getlime.security.powerauth.app.tppengine.model.request.CreateTppAppRequest request)
    Update an application with provided client ID with a new information.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TppEngineClient

      public TppEngineClient​(String serviceUrl) throws TppEngineClientException
      Create a new client with provided base URL.
      Parameters:
      serviceUrl - Base service URL.
      Throws:
      TppEngineClientException - Thrown when REST client initialization fails.
    • TppEngineClient

      public TppEngineClient​(com.wultra.core.rest.client.base.RestClientConfiguration restClientConfiguration) throws TppEngineClientException
      Create a new client with detailed configuration of REST client.
      Parameters:
      restClientConfiguration - REST service client configuration.
      Throws:
      TppEngineClientException - Thrown when REST client initialization fails.
  • Method Details

    • consentDetail

      public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.ConsentDetailResponse> consentDetail​(String id) throws TppEngineClientException
      Lookup consent details (details of a consent template).
      Parameters:
      id - Username for user account which is being looked up.
      Returns:
      Response with user details.
      Throws:
      TppEngineClientException - Thrown when client request fails or user does not exist.
    • consentStatus

      public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.UserConsentDetailResponse> consentStatus​(String userId, String consentId, String clientId) throws TppEngineClientException
      Lookup consent status for given user and app.
      Parameters:
      userId - Username for user account which is being looked up.
      consentId - Identifier of a consent.
      clientId - Identifier of a TPP app.
      Returns:
      Response with details of consent for given user and TPP app.
      Throws:
      TppEngineClientException - Thrown when client request fails or user does not exist.
    • giveConsent

      public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.GiveConsentResponse> giveConsent​(io.getlime.security.powerauth.app.tppengine.model.request.GiveConsentRequest request) throws TppEngineClientException
      Give consent according to request parameters.
      Parameters:
      request - Consent information.
      Returns:
      Information about newly created consent.
      Throws:
      TppEngineClientException - Thrown when client request fails or authentication fails.
    • rejectConsent

      public io.getlime.core.rest.model.base.response.Response rejectConsent​(io.getlime.security.powerauth.app.tppengine.model.request.RemoveConsentRequest request) throws TppEngineClientException
      Reject consent according to request parameters.
      Parameters:
      request - Consent information.
      Returns:
      Static OK response. In case consent didn't exist, this operation is no-op.
      Throws:
      TppEngineClientException - Thrown when client request fails or authentication fails.
    • fetchAppInfo

      public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> fetchAppInfo​(String clientId) throws TppEngineClientException
      Lookup information about a provided app.
      Parameters:
      clientId - Identifier of a TPP app.
      Returns:
      Response with details TPP app with given client ID.
      Throws:
      TppEngineClientException - Thrown when client request fails or app does not exist.
    • fetchAppInfoWithLicenseRestriction

      public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> fetchAppInfoWithLicenseRestriction​(String clientId, String tppLicense) throws TppEngineClientException
      Lookup information about a provided app.
      Parameters:
      clientId - Identifier of a TPP app.
      tppLicense - TPP license information.
      Returns:
      Response with details TPP app with given client ID.
      Throws:
      TppEngineClientException - Thrown when client request fails or app does not exist.
    • fetchApplicationList

      public io.getlime.core.rest.model.base.response.ObjectResponse<List<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse>> fetchApplicationList​(String tppLicense) throws TppEngineClientException
      Fetch list of TPP applications based on the license info.
      Parameters:
      tppLicense - TPP license information.
      Returns:
      Response with details TPP app with given client ID.
      Throws:
      TppEngineClientException - Thrown when client request fails or app does not exist.
    • createApplication

      public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> createApplication​(io.getlime.security.powerauth.app.tppengine.model.request.CreateTppAppRequest request) throws TppEngineClientException
      Create an application with provided information.
      Parameters:
      request - New application information.
      Returns:
      Information about newly created application.
      Throws:
      TppEngineClientException - Thrown when client request fails or user does not exist.
    • updateApplication

      public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> updateApplication​(String clientId, io.getlime.security.powerauth.app.tppengine.model.request.CreateTppAppRequest request) throws TppEngineClientException
      Update an application with provided client ID with a new information.
      Parameters:
      clientId - Client ID of an app to be updated.
      request - New application information.
      Returns:
      Information about newly created application.
      Throws:
      TppEngineClientException - Thrown when client request fails or user does not exist.
    • renewClientSecret

      public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> renewClientSecret​(String clientId, String tppLicense) throws TppEngineClientException
      Renew the client secret for the application.
      Parameters:
      clientId - Client ID of an application to be refreshed.
      tppLicense - License information of TPP.
      Returns:
      Information about newly created application.
      Throws:
      TppEngineClientException - Thrown when client request fails or user does not exist.
    • deleteApplication

      public io.getlime.core.rest.model.base.response.Response deleteApplication​(String clientId, String tppLicense) throws TppEngineClientException
      Delete an application with provided information.
      Parameters:
      clientId - Client ID of the app.
      tppLicense - License information of TPP.
      Returns:
      Generic response.
      Throws:
      TppEngineClientException - Thrown when client request fails or user does not exist.