Settings
Configuration settings for DiracX services and components. See also environment variables and dev environment variables.
settings
Settings for the core services.
Attributes
T = TypeVar('T')
module-attribute
TokenSigningKeyStore = Annotated[_TokenSigningKeyStore, BeforeValidator(_maybe_load_keys_from_file)]
module-attribute
LocalFileUrl = Annotated[FileUrl, BeforeValidator(_apply_default_scheme)]
module-attribute
Classes
SqlalchemyDsn
FernetKey
Bases: SecretStr
Source code in diracx-core/src/diracx/core/settings.py
Attributes
fernet = Fernet(self.get_secret_value())
instance-attribute
ServiceSettingsBase
Bases: BaseSettings
Source code in diracx-core/src/diracx/core/settings.py
Attributes
model_config = SettingsConfigDict(frozen=True)
class-attribute
instance-attribute
Functions
create()
classmethod
lifetime_function()
async
A context manager that can be used to run code at startup and shutdown.
DevelopmentSettings
Bases: ServiceSettingsBase
Settings for the Development Configuration that can influence run time.
Source code in diracx-core/src/diracx/core/settings.py
Attributes
model_config = SettingsConfigDict(env_prefix='DIRACX_DEV_', use_attribute_docstrings=True)
class-attribute
instance-attribute
crash_on_missed_access_policy = False
class-attribute
instance-attribute
When set to true (only for demo/CI), crash if an access policy isn't called.
This is useful for development and testing to ensure all endpoints have proper access control policies defined.
Functions
AuthSettings
Bases: ServiceSettingsBase
Settings for the authentication service.
Source code in diracx-core/src/diracx/core/settings.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
Attributes
model_config = SettingsConfigDict(env_prefix='DIRACX_SERVICE_AUTH_', use_attribute_docstrings=True)
class-attribute
instance-attribute
dirac_client_id = 'myDIRACClientID'
class-attribute
instance-attribute
OAuth2 client identifier for DIRAC services.
This should match the client ID registered with the identity provider.
allowed_redirects = []
class-attribute
instance-attribute
List of allowed redirect URLs for OAuth2 authorization flow.
These URLs must be pre-registered and should match the redirect URIs configured in the OAuth2 client registration. Example: ["http://localhost:8000/docs/oauth2-redirect"]
device_flow_expiration_seconds = 600
class-attribute
instance-attribute
Expiration time in seconds for device flow authorization requests.
After this time, the device code becomes invalid and users must restart the device flow process. Default: 10 minutes.
authorization_flow_expiration_seconds = 300
class-attribute
instance-attribute
Expiration time in seconds for authorization code flow.
The time window during which the authorization code remains valid before it must be exchanged for tokens. Default: 5 minutes.
state_key
instance-attribute
Encryption key used to encrypt/decrypt the state parameter passed to the IAM.
This key ensures the integrity and confidentiality of state information during OAuth2 flows. Must be a valid Fernet key.
token_issuer
instance-attribute
The issuer identifier for JWT tokens.
This should be a URI that uniquely identifies the token issuer and matches the 'iss' claim in issued JWT tokens.
token_keystore
instance-attribute
Keystore containing the cryptographic keys used for signing JWT tokens.
This includes both public and private keys for token signature generation and verification.
token_allowed_algorithms = ['RS256', 'EdDSA']
class-attribute
instance-attribute
List of allowed cryptographic algorithms for JWT token signing.
Supported algorithms include RS256 (RSA with SHA-256) and EdDSA (Edwards-curve Digital Signature Algorithm). Default: ["RS256", "EdDSA"]
access_token_expire_minutes = 20
class-attribute
instance-attribute
Expiration time in minutes for access tokens.
After this duration, access tokens become invalid and must be refreshed or re-obtained. Default: 20 minutes.
refresh_token_expire_minutes = 60
class-attribute
instance-attribute
Expiration time in minutes for refresh tokens.
The maximum lifetime of refresh tokens before they must be re-issued through a new authentication flow. Default: 60 minutes.
available_properties = Field(default_factory=(SecurityProperty.available_properties))
class-attribute
instance-attribute
Set of security properties available in this DIRAC installation.
These properties define various authorization capabilities and are used for access control decisions. Defaults to all available security properties.
SandboxStoreSettings
Bases: ServiceSettingsBase
Settings for the sandbox store.
Source code in diracx-core/src/diracx/core/settings.py
Attributes
model_config = SettingsConfigDict(env_prefix='DIRACX_SANDBOX_STORE_', use_attribute_docstrings=True)
class-attribute
instance-attribute
bucket_name
instance-attribute
Name of the S3 bucket used for storing job sandboxes.
This bucket will contain input and output sandbox files for DIRAC jobs. The bucket must exist or auto_create_bucket must be enabled.
s3_client_kwargs
instance-attribute
Configuration parameters passed to the S3 client.
auto_create_bucket = False
class-attribute
instance-attribute
Whether to automatically create the S3 bucket if it doesn't exist.
url_validity_seconds = 5 * 60
class-attribute
instance-attribute
Validity duration in seconds for pre-signed S3 URLs.
This determines how long generated download/upload URLs remain valid before expiring. Default: 300 seconds (5 minutes).
se_name = 'SandboxSE'
class-attribute
instance-attribute
Logical name of the Storage Element for the sandbox store.
This name is used within DIRAC to refer to this sandbox storage endpoint in job descriptions and file catalogs.