-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
114 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Licensed to Elasticsearch B.V. under one or more contributor | ||
// license agreements. See the NOTICE file distributed with | ||
// this work for additional information regarding copyright | ||
// ownership. Elasticsearch B.V. licenses this file to you under | ||
// the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
// Package rc provides run control types for the mito tool and tests. | ||
package rc | ||
|
||
import ( | ||
"net/url" | ||
|
||
"github.com/elastic/mito/lib" | ||
) | ||
|
||
// Config controls configuration of the mito tool run behavior. | ||
type Config struct { | ||
// Globals is the set of global variables available to the CEL environment. | ||
Globals map[string]interface{} `yaml:"globals"` | ||
// Regexps is a look-up into a table of pre-compiled regular expressions. | ||
Regexps map[string]string `yaml:"regexp"` | ||
// XSDs is a look-up into a table of pre-compiled XML document descriptions. | ||
XSDs map[string]string `yaml:"xsd"` | ||
// Auth is the authentication configuration for HTTP requests. | ||
Auth *AuthConfig `yaml:"auth"` | ||
// MaxExecutions is the maximum number of want_more executions for a single | ||
// run of mito. This value is overridden by the -max_executions command | ||
// line flag. | ||
MaxExecutions *int `yaml:"max_executions"` | ||
} | ||
|
||
// AuthConfig controls configuration of HTTP request authentication behavior. | ||
type AuthConfig struct { | ||
// Basic is a Basic Authentication configuration. | ||
Basic *lib.BasicAuth `yaml:"basic"` | ||
// OAuth2 is an OAuth2.0 authentication configuration. | ||
OAuth2 *OAuth2Config `yaml:"oauth2"` | ||
} | ||
|
||
// OAuth2Config controls configuration of HTTP OAuth2.0 request authentication | ||
// behavior. | ||
type OAuth2Config struct { | ||
Provider string `yaml:"provider"` | ||
|
||
ClientID string `yaml:"client.id"` | ||
ClientSecret *string `yaml:"client.secret"` | ||
EndpointParams url.Values `yaml:"endpoint_params"` | ||
Password string `yaml:"password"` | ||
Scopes []string `yaml:"scopes"` | ||
TokenURL string `yaml:"token_url"` | ||
User string `yaml:"user"` | ||
|
||
GoogleCredentialsFile string `yaml:"google.credentials_file"` | ||
GoogleCredentialsJSON string `yaml:"google.credentials_json"` | ||
GoogleJWTFile string `yaml:"google.jwt_file"` | ||
GoogleJWTJSON string `yaml:"google.jwt_json"` | ||
GoogleDelegatedAccount string `yaml:"google.delegated_account"` | ||
|
||
AzureTenantID string `yaml:"azure.tenant_id"` | ||
AzureResource string `yaml:"azure.resource"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters