Skip to content

Commit

Permalink
remove include imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHougaard committed Jan 21, 2025
1 parent d7eda65 commit 81342e1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
16 changes: 3 additions & 13 deletions InfisicalConfiguration/InfisicalConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,22 @@ public class InfisicalConfig
public string SecretPath { get; }
public string InfisicalUrl { get; }
public string Prefix { get; }
public bool IncludeImports { get; }

internal InfisicalConfig(
string environment,
string projectId,
InfisicalAuth auth,
string secretPath,
string infisicalUrl,
string prefix,
bool includeImports)
string prefix
)
{
Environment = environment;
ProjectId = projectId;
Auth = auth;
SecretPath = secretPath;
InfisicalUrl = infisicalUrl;
Prefix = prefix;
IncludeImports = includeImports;
}
}

Expand All @@ -40,20 +38,13 @@ public class InfisicalConfigBuilder
private InfisicalAuth? _auth;
private string _secretPath = "/";
private string _infisicalUrl = "https://app.infisical.com";
private bool _includeImports = true;

public InfisicalConfigBuilder SetAuth(InfisicalAuth auth)
{
_auth = auth;
return this;
}

public InfisicalConfigBuilder SetIncludeImports(bool includeImports)
{
_includeImports = includeImports;
return this;
}

public InfisicalConfigBuilder SetPrefix(string prefix)
{
_prefix = prefix;
Expand Down Expand Up @@ -98,8 +89,7 @@ public InfisicalConfig Build()
auth: _auth!,
secretPath: _secretPath,
infisicalUrl: _infisicalUrl,
prefix: _prefix ?? "",
includeImports: _includeImports
prefix: _prefix ?? ""
);
}

Expand Down
2 changes: 1 addition & 1 deletion InfisicalConfiguration/InfisicalConfigurationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private async Task LoadAsync()

var prefix = _config.Prefix ?? "";

var url = $"{_config.InfisicalUrl}/api/v3/secrets/raw/?environment={_config.Environment}&workspaceId={_config.ProjectId}&secretPath={_config.SecretPath}&include_imports={_config.IncludeImports.ToString().ToLower()}";
var url = $"{_config.InfisicalUrl}/api/v3/secrets/raw/?environment={_config.Environment}&workspaceId={_config.ProjectId}&secretPath={_config.SecretPath}&include_imports=true";

var response = await _httpClient.GetAsync(url);
var content = await response.Content.ReadAsStringAsync();
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ The equivalent of this JSON would be a secret in Infisical with the key `CONNNEC
**SetPrefix()**
- `prefix` (string): A string to prefix your secret keys with. Optional, and defaults to no prefix.

**SetIncludeImports()**
- `includeImports` (boolean): Wether or not to include imports when fetching secrets. Optional, and defaults to `true`.

**SetAuth()**
- `auth` (InfisicalAuth): The authentication details that will be used for authenticating against the Infisical API. See more details below.

Expand Down

0 comments on commit 81342e1

Please sign in to comment.