github.com/Venafi/vcert/v5@v5.10.2/pkg/endpoint/authentication.go (about) 1 /* 2 * Copyright 2023 Venafi, Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package endpoint 18 19 // Authentication provides a struct for authentication data. Either specify User and Password for Trust Protection Platform 20 // or Firefly or ClientId and ClientSecret for Firefly or specify an APIKey for TLS Protect Cloud. 21 type Authentication struct { 22 // TPP Auth methods 23 // user and password 24 User string `yaml:"user,omitempty"` //**DEPRECATED** Use access/refresh token or client certificate instead 25 Password string `yaml:"password,omitempty"` //**DEPRECATED** Use access/refresh token or client certificate instead 26 // tokens 27 AccessToken string `yaml:"accessToken,omitempty"` 28 RefreshToken string `yaml:"refreshToken,omitempty"` 29 // client certificate 30 ClientPKCS12 bool `yaml:"-"` 31 32 // VCP Auth methods 33 // API key 34 APIKey string `yaml:"apiKey,omitempty"` 35 // Service account 36 TokenURL string `yaml:"tokenURL,omitempty"` 37 ExternalJWT string `yaml:"externalJWT,omitempty"` 38 39 // OIDC Auth methods 40 ClientId string `yaml:"clientId,omitempty"` 41 ClientSecret string `yaml:"clientSecret,omitempty"` 42 Scope string `yaml:"scope,omitempty"` 43 // IdentityProvider specify the OAuth 2.0 which VCert will be working for authorization purposes 44 IdentityProvider *OAuthProvider `yaml:"idP,omitempty"` 45 } 46 47 // OAuthProvider provides a struct for the OAuth 2.0 providers information 48 type OAuthProvider struct { 49 // OIDC Auth methods 50 DeviceURL string `yaml:"-"` 51 TokenURL string `yaml:"tokenURL,omitempty"` 52 Audience string `yaml:"audience,omitempty"` 53 }