Class ZtsClientMock

  • All Implemented Interfaces:
    com.yahoo.vespa.athenz.client.zts.ZtsClient, java.lang.AutoCloseable

    public class ZtsClientMock
    extends java.lang.Object
    implements com.yahoo.vespa.athenz.client.zts.ZtsClient
    Author:
    bjorncs
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      com.yahoo.vespa.athenz.api.AthenzAccessToken getAccessToken​(com.yahoo.vespa.athenz.api.AthenzDomain domain)  
      com.yahoo.vespa.athenz.api.AthenzAccessToken getAccessToken​(java.util.List<com.yahoo.vespa.athenz.api.AthenzRole> athenzRole)  
      com.yahoo.vespa.athenz.api.AwsTemporaryCredentials getAwsTemporaryCredentials​(com.yahoo.vespa.athenz.api.AthenzDomain athenzDomain, com.yahoo.vespa.athenz.api.AwsRole awsRole, java.time.Duration duration, java.lang.String externalId)  
      java.security.cert.X509Certificate getRoleCertificate​(com.yahoo.vespa.athenz.api.AthenzRole role, com.yahoo.security.Pkcs10Csr csr)  
      java.security.cert.X509Certificate getRoleCertificate​(com.yahoo.vespa.athenz.api.AthenzRole role, com.yahoo.security.Pkcs10Csr csr, java.time.Duration expiry)  
      com.yahoo.vespa.athenz.api.ZToken getRoleToken​(com.yahoo.vespa.athenz.api.AthenzDomain domain)  
      com.yahoo.vespa.athenz.api.ZToken getRoleToken​(com.yahoo.vespa.athenz.api.AthenzRole athenzRole)  
      com.yahoo.vespa.athenz.client.zts.Identity getServiceIdentity​(com.yahoo.vespa.athenz.api.AthenzIdentity identity, java.lang.String keyId, com.yahoo.security.Pkcs10Csr csr)  
      com.yahoo.vespa.athenz.client.zts.Identity getServiceIdentity​(com.yahoo.vespa.athenz.api.AthenzIdentity identity, java.lang.String keyId, java.security.KeyPair keyPair, java.lang.String dnsSuffix)  
      java.util.List<com.yahoo.vespa.athenz.api.AthenzDomain> getTenantDomains​(com.yahoo.vespa.athenz.api.AthenzIdentity providerIdentity, com.yahoo.vespa.athenz.api.AthenzIdentity userIdentity, java.lang.String roleName)  
      com.yahoo.vespa.athenz.client.zts.InstanceIdentity refreshInstance​(com.yahoo.vespa.athenz.api.AthenzIdentity providerIdentity, com.yahoo.vespa.athenz.api.AthenzIdentity instanceIdentity, java.lang.String instanceId, com.yahoo.security.Pkcs10Csr csr)  
      com.yahoo.vespa.athenz.client.zts.InstanceIdentity registerInstance​(com.yahoo.vespa.athenz.api.AthenzIdentity providerIdentity, com.yahoo.vespa.athenz.api.AthenzIdentity instanceIdentity, java.lang.String attestationData, com.yahoo.security.Pkcs10Csr csr)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.yahoo.vespa.athenz.client.zts.ZtsClient

        getAwsTemporaryCredentials, getAwsTemporaryCredentials
    • Constructor Detail

      • ZtsClientMock

        public ZtsClientMock​(AthenzDbMock athenz)
    • Method Detail

      • getTenantDomains

        public java.util.List<com.yahoo.vespa.athenz.api.AthenzDomain> getTenantDomains​(com.yahoo.vespa.athenz.api.AthenzIdentity providerIdentity,
                                                                                        com.yahoo.vespa.athenz.api.AthenzIdentity userIdentity,
                                                                                        java.lang.String roleName)
        Specified by:
        getTenantDomains in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • registerInstance

        public com.yahoo.vespa.athenz.client.zts.InstanceIdentity registerInstance​(com.yahoo.vespa.athenz.api.AthenzIdentity providerIdentity,
                                                                                   com.yahoo.vespa.athenz.api.AthenzIdentity instanceIdentity,
                                                                                   java.lang.String attestationData,
                                                                                   com.yahoo.security.Pkcs10Csr csr)
        Specified by:
        registerInstance in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • refreshInstance

        public com.yahoo.vespa.athenz.client.zts.InstanceIdentity refreshInstance​(com.yahoo.vespa.athenz.api.AthenzIdentity providerIdentity,
                                                                                  com.yahoo.vespa.athenz.api.AthenzIdentity instanceIdentity,
                                                                                  java.lang.String instanceId,
                                                                                  com.yahoo.security.Pkcs10Csr csr)
        Specified by:
        refreshInstance in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • getServiceIdentity

        public com.yahoo.vespa.athenz.client.zts.Identity getServiceIdentity​(com.yahoo.vespa.athenz.api.AthenzIdentity identity,
                                                                             java.lang.String keyId,
                                                                             com.yahoo.security.Pkcs10Csr csr)
        Specified by:
        getServiceIdentity in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • getServiceIdentity

        public com.yahoo.vespa.athenz.client.zts.Identity getServiceIdentity​(com.yahoo.vespa.athenz.api.AthenzIdentity identity,
                                                                             java.lang.String keyId,
                                                                             java.security.KeyPair keyPair,
                                                                             java.lang.String dnsSuffix)
        Specified by:
        getServiceIdentity in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • getRoleToken

        public com.yahoo.vespa.athenz.api.ZToken getRoleToken​(com.yahoo.vespa.athenz.api.AthenzDomain domain)
        Specified by:
        getRoleToken in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • getRoleToken

        public com.yahoo.vespa.athenz.api.ZToken getRoleToken​(com.yahoo.vespa.athenz.api.AthenzRole athenzRole)
        Specified by:
        getRoleToken in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • getAccessToken

        public com.yahoo.vespa.athenz.api.AthenzAccessToken getAccessToken​(com.yahoo.vespa.athenz.api.AthenzDomain domain)
        Specified by:
        getAccessToken in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • getAccessToken

        public com.yahoo.vespa.athenz.api.AthenzAccessToken getAccessToken​(java.util.List<com.yahoo.vespa.athenz.api.AthenzRole> athenzRole)
        Specified by:
        getAccessToken in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • getRoleCertificate

        public java.security.cert.X509Certificate getRoleCertificate​(com.yahoo.vespa.athenz.api.AthenzRole role,
                                                                     com.yahoo.security.Pkcs10Csr csr,
                                                                     java.time.Duration expiry)
        Specified by:
        getRoleCertificate in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • getRoleCertificate

        public java.security.cert.X509Certificate getRoleCertificate​(com.yahoo.vespa.athenz.api.AthenzRole role,
                                                                     com.yahoo.security.Pkcs10Csr csr)
        Specified by:
        getRoleCertificate in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • getAwsTemporaryCredentials

        public com.yahoo.vespa.athenz.api.AwsTemporaryCredentials getAwsTemporaryCredentials​(com.yahoo.vespa.athenz.api.AthenzDomain athenzDomain,
                                                                                             com.yahoo.vespa.athenz.api.AwsRole awsRole,
                                                                                             java.time.Duration duration,
                                                                                             java.lang.String externalId)
        Specified by:
        getAwsTemporaryCredentials in interface com.yahoo.vespa.athenz.client.zts.ZtsClient
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface com.yahoo.vespa.athenz.client.zts.ZtsClient