github.com/Axway/agent-sdk@v1.1.101/pkg/apic/provisioning/idp/credentialdata.go (about) 1 package idp 2 3 import ( 4 "strings" 5 ) 6 7 type credData struct { 8 clientID string 9 clientSecret string 10 scopes []string 11 grantTypes []string 12 tokenAuthMethod string 13 responseTypes []string 14 redirectURLs []string 15 jwksURI string 16 publicKey string 17 certificate string 18 certificateMetadata string 19 tlsClientAuthSanDNS string 20 tlsClientAuthSanEmail string 21 tlsClientAuthSanIP string 22 tlsClientAuthSanURI string 23 registrationAccessToken string 24 } 25 26 // GetClientID - returns client ID 27 func (c *credData) GetClientID() string { 28 return c.clientID 29 } 30 31 // GetClientSecret - returns client secret 32 func (c *credData) GetClientSecret() string { 33 return c.clientSecret 34 } 35 36 // GetScopes - returns client scopes 37 func (c *credData) GetScopes() []string { 38 return c.scopes 39 } 40 41 // GetGrantTypes - returns grant types 42 func (c *credData) GetGrantTypes() []string { 43 return c.grantTypes 44 } 45 46 // GetTokenEndpointAuthMethod - returns token auth method 47 func (c *credData) GetTokenEndpointAuthMethod() string { 48 return c.tokenAuthMethod 49 } 50 51 // GetResponseTypes - returns token response type 52 func (c *credData) GetResponseTypes() []string { 53 return c.responseTypes 54 } 55 56 // GetRedirectURIs - Returns redirect urls 57 func (c *credData) GetRedirectURIs() []string { 58 return c.redirectURLs 59 } 60 61 // GetJwksURI - returns JWKS uri 62 func (c *credData) GetJwksURI() string { 63 return c.jwksURI 64 } 65 66 // GetPublicKey - returns the public key 67 func (c *credData) GetPublicKey() string { 68 return c.publicKey 69 } 70 71 // GetCertificate - returns the certificate 72 func (c *credData) GetCertificate() string { 73 return c.certificate 74 } 75 76 // GetCertificateMetadata - returns the certificate metadata property 77 func (c *credData) GetCertificateMetadata() string { 78 return c.certificateMetadata 79 } 80 81 // GetTLSClientAuthSanDNS - returns the value for tls_client_auth_san_dns 82 func (c *credData) GetTLSClientAuthSanDNS() string { 83 return c.tlsClientAuthSanDNS 84 } 85 86 // GetTLSClientAuthSanDNS - returns the value for tls_client_auth_san_dns 87 func (c *credData) GetTLSClientAuthSanEmail() string { 88 return c.tlsClientAuthSanEmail 89 } 90 91 // GetTLSClientAuthSanIP - returns the value for tls_client_auth_san_ip 92 func (c *credData) GetTLSClientAuthSanIP() string { 93 return c.tlsClientAuthSanIP 94 } 95 96 // GetTLSClientAuthSanURI - returns the value for tls_client_auth_san_uri 97 func (c *credData) GetTLSClientAuthSanURI() string { 98 return c.tlsClientAuthSanURI 99 } 100 101 func formattedJWKS(jwks string) string { 102 formattedJWKS := strings.ReplaceAll(jwks, "----- ", "-----\n") 103 return strings.ReplaceAll(formattedJWKS, " -----", "\n-----") 104 }