Class ApplicationContext
Thread-safe and security-enhanced implementation of ApplicationContext with support for secure string storage.
public static class ApplicationContext
- Inheritance
-
ApplicationContext
- Inherited Members
Properties
ApplicationDisplayName
Gets the display name of the application.
public static string ApplicationDisplayName { get; }
Property Value
- string
The display name of the application.
ApplicationName
Gets the name of the application.
public static string ApplicationName { get; }
Property Value
- string
The name of the application.
ApplicationSystemName
Gets the system name of the application.
public static string ApplicationSystemName { get; }
Property Value
- string
The system name of the application.
AuthenticationServiceAudience
Gets the audience value for the authentication service.
public static string AuthenticationServiceAudience { get; }
Property Value
- string
The audience value for the authentication service.
AuthenticationServiceEndpoint
Gets the endpoint for the authentication service.
public static string AuthenticationServiceEndpoint { get; }
Property Value
- string
The endpoint for the authentication service.
AuthenticationServicePublicKeyPath
Gets the path to the public key file for the authentication service.
public static string AuthenticationServicePublicKeyPath { get; }
Property Value
- string
The path to the public key file for the authentication service.
AuthorizationServiceEndpoint
Gets the endpoint for the authorization service.
public static string AuthorizationServiceEndpoint { get; }
Property Value
- string
The endpoint for the authorization service.
Context
Gets the current application context, defaulting to "local" if not explicitly set in the environment variables.
public static string Context { get; }
Property Value
- string
The current application context, defaulting to "local" if not explicitly set in the environment variables.
ServiceAccountName
Gets the name of the service account.
public static string ServiceAccountName { get; }
Property Value
- string
The name of the service account.
ServiceAccountPrivateKeyPasswordSecure
Gets the password for the service account's private key.
public static string ServiceAccountPrivateKeyPasswordSecure { get; }
Property Value
- string
The password for the service account's private key.
ServiceAccountPrivateKeyPath
Gets the path to the private key file for the service account.
public static string ServiceAccountPrivateKeyPath { get; }
Property Value
- string
The path to the private key file for the service account.
Methods
ConvertToUnsecureString(string)
Returns the string value directly. This method exists for backward compatibility after SecureString removal (Microsoft deprecated SecureString for .NET Core).
public static string ConvertToUnsecureString(string secureString)
Parameters
secureStringstring
Returns
Expand(string?)
Expands placeholders in the specified value using the context and environment variables.
public static string? Expand(string? value)
Parameters
valuestring
Returns
Get(string)
Gets a value with the specified key from the context.
public static string Get(string key)
Parameters
keystring
Returns
Get(string, string)
Gets a value with the specified key from the context, or a default value if not found.
public static string Get(string key, string defaultValue)
Parameters
Returns
Init(IDictionary<string, string?>)
Initializes the application context with the specified key-value pairs. Sensitive values are automatically stored securely.
public static void Init(IDictionary<string, string?> context)
Parameters
contextIDictionary<string, string>A dictionary containing context key-value pairs.
Reset()
Resets the application context by clearing all stored values.
public static void Reset()