MCPcopy Create free account
hub / github.com/auth0/auth0-cli / makeCustomDomainView

Function makeCustomDomainView

internal/display/custom_domain.go:142–178  ·  view source on GitHub ↗
(customDomain *management.CustomDomain)

Source from the content-addressed store, hash-verified

140}
141
142func makeCustomDomainView(customDomain *management.CustomDomain) *customDomainView {
143 metadata, err := toJSONString(customDomain.GetDomainMetadata())
144 if err != nil {
145 return nil
146 }
147
148 view := &customDomainView{
149 ID: ansi.Faint(customDomain.GetID()),
150 Domain: customDomain.GetDomain(),
151 Status: customDomainStatusColor(customDomain.GetStatus()),
152 Primary: boolean(customDomain.GetPrimary()),
153 ProvisioningType: customDomain.GetType(),
154 TLSPolicy: customDomain.GetTLSPolicy(),
155 CustomClientIPHeader: customDomain.GetCustomClientIPHeader(),
156 DomainMetadata: metadata,
157 CertificateStatus: customDomain.GetCertificate().GetStatus(),
158 CertificateAuthority: customDomain.GetCertificate().GetCertificateAuthority(),
159 CertificateRenewsBefore: customDomain.GetCertificate().GetRenewsBefore(),
160 IsDefault: boolean(customDomain.GetIsDefault()),
161 raw: customDomain,
162 }
163
164 if len(customDomain.GetVerification().Methods) > 0 {
165 method := customDomain.GetVerification().Methods[0]
166 if name, ok := method["name"].(string); ok {
167 view.VerificationMethod = name
168 }
169 if record, ok := method["record"].(string); ok {
170 view.VerificationRecord = record
171 }
172 if domain, ok := method["domain"].(string); ok {
173 view.VerificationDomain = domain
174 }
175 }
176
177 return view
178}
179
180func customDomainStatusColor(v string) string {
181 switch v {

Callers 4

CustomDomainListMethod · 0.85
CustomDomainShowMethod · 0.85
CustomDomainCreateMethod · 0.85
CustomDomainUpdateMethod · 0.85

Calls 4

FaintFunction · 0.92
toJSONStringFunction · 0.85
customDomainStatusColorFunction · 0.85
booleanFunction · 0.85

Tested by

no test coverage detected