-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a config file that can be used for remote config. This also makes a few changes to make that more possible. - Allow scopes to be configured either as a list of strings, or as space separated strings. - Allow an empty "certificate" block - Improve handling of empty values.
- Loading branch information
Showing
7 changed files
with
211 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
|
||
namespace Cognite.Common | ||
{ | ||
/// <summary> | ||
/// A wrapper for yaml types that are serialized either as lists or as space separated values. | ||
/// </summary> | ||
public class ListOrSpaceSeparated | ||
{ | ||
/// <summary> | ||
/// Inner values | ||
/// </summary> | ||
public string[] Values { get; } | ||
|
||
/// <summary> | ||
/// Constructor | ||
/// </summary> | ||
/// <param name="values">List of values, will always be serialized as a list</param> | ||
public ListOrSpaceSeparated(params string[] values) | ||
{ | ||
Values = values; | ||
} | ||
|
||
/// <summary> | ||
/// Explicit conversion to string array | ||
/// </summary> | ||
/// <param name="list">List of values</param> | ||
public static implicit operator string[](ListOrSpaceSeparated list) => list?.Values ?? throw new ArgumentNullException(nameof(list)); | ||
} | ||
} |
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
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
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,39 @@ | ||
# Sample configuration file for remote config. This can be used as remote config directly. | ||
|
||
cognite: | ||
# The project to connect to in the API | ||
project: ${COGNITE_PROJECT} | ||
# Cognite service url | ||
host: ${COGNITE_BASE_URL} | ||
# Config for authentication if a bearer access token has to be used for authentication. | ||
# Leave empty to disable. | ||
idp-authentication: | ||
# URL to fetch tokens from, either this, or tenant must be present. | ||
token-url: ${COGNITE_TOKEN_URL} | ||
# Identity provider authority endpoint (optional, only used in combination with tenant) | ||
authority: ${COGNITE_AUTHORITY_URL} | ||
# Directory tenant | ||
tenant: ${COGNITE_TENANT} | ||
# Application Id | ||
client-id: ${COGNITE_CLIENT_ID} | ||
# Client secret | ||
secret: ${COGNITE_CLIENT_SECRET} | ||
# List of resource scopes, ex: | ||
# scopes: | ||
# - scopeA | ||
# - scopeB | ||
scopes: ${COGNITE_SCOPES} | ||
# Audience | ||
audience: ${COGNITE_AUDIENCE} | ||
# Minimum time-to-live in seconds for the token (optional) | ||
min-ttl: 30 | ||
# Configuration for certificate based authentication | ||
certificate: | ||
# Path to a .pfx or .pem certificate file (.pem only for .NET 7 extractors) | ||
path: ${COGNITE_CERTIFICATE_PATH} | ||
# Optional certificate key password | ||
password: ${COGNITE_CERTIFICATE_PASSWORD} | ||
# Optional authority URL. If this is not specified, authority + tenant is used. | ||
authority-url: ${COGNITE_CERTIFICATE_AUTHORITY_URL} | ||
extraction-pipeline: | ||
external-id: ${COGNITE_EXTRACTION_PIPELINE} |