Skip to content

Declared in <galanthus/c_api/gln_capi.h>.

GLN_API gln_status_t GLN_CALL gln_open_revolut_backend(
    const gln_revolut_config_t* in_config,
    gln_state_store_t*          in_state_store,
    gln_backend_t**             out_backend,
    gln_error_t*                out_error);
  • Family: Create and open functions
  • Return type: gln_status_t

Purpose

Opens a Revolut backend handle from a typed Revolut configuration and a state store.

The Revolut configuration names a product credential/profile reference instead of accepting caller-supplied PEM key material. Token persistence is owned by Galanthus and rooted under the configured storage root; product credential profiles may be resolved from the default root or an explicit setup root.

Return

Returns GLN_OK on success and a non-OK gln_status_t value on failure.

TypeNullabilityOwnership
gln_status_tvaluevalue

Parameters

NameDirectionTypeNullabilityOwnership
in_configinputconst gln_revolut_config_t*nonnullborrowed
in_state_storeinputgln_state_store_t*nonnullborrowed
out_backendoutputgln_backend_t**nonnulltransferred_out
out_erroroutputgln_error_t*nullablecaller_allocated_output

Configuration

Initialize gln_revolut_config_t by calling gln_default_revolut_config so struct_size and optional defaults match the loaded header.

product_credential_ref_or_null identifies the Revolut product credential/profile to resolve. product_credential_root_or_null optionally names the profile root produced by setup. storage_root_or_null identifies the Galanthus-owned storage root for product-scoped token persistence. environment_or_null may be absent, sandbox, or production; absence selects the provisioned profile environment.

The C strings in in_config are borrowed only for the open call. The implementation copies required configuration before returning.

dump_dir_or_null and plugin_dll_path_or_null are optional UTF-8 filesystem path strings; leave dump_dir_or_null absent during normal operation unless wire dumps are deliberately enabled.

profile_name_or_null and plugin_dll_path_or_null are copied when present and non-empty; they are stored for Revolut surfaces that require a local profile or plugin path.

Ownership And Lifetime

in_state_store is required and borrowed by the backend. Keep the handle alive until after gln_close_backend closes every backend using it.

On success, out_backend is caller-owned and must be released with gln_close_backend. The function clears *out_backend to NULL before validation when the output slot itself is non-NULL.

Failure Cases

The call returns GLN_ERR_INVALID_ARG when out_backend, in_config, or in_state_store is NULL, when in_config->struct_size does not match sizeof(gln_revolut_config_t), or when the environment string is not sandbox or production.

A missing product credential profile returns GLN_ERR_NOT_FOUND with issue_type revolut_product_credential_missing. Inaccessible profiles, mismatched profile SIDs, inaccessible signing keys, insecure profile ACLs, and token-store setup failures return explicit non-OK statuses and issue types instead of falling back to PEM or JSON runtime configuration.

out_error may be NULL. If it is non-NULL, its struct_size must describe a valid gln_error_t; otherwise the call fails before writing diagnostic fields.

Capability Probing

Code that accepts an arbitrary backend should probe specific operations with gln_check_backend_operation_support; use gln_get_backend_operation_name and gln_parse_backend_operation_name when converting between enum values and operation names.

Example

gln_revolut_config_t config = {0};
gln_default_revolut_config(&config);
config.product_credential_ref_or_null = "revolut/product/default";
config.product_credential_root_or_null = "C:/ProgramData/Galanthus/RevolutProductCredentials";
config.storage_root_or_null = "C:/ProgramData/Galanthus/Revolut";
config.environment_or_null = "sandbox";

gln_backend_t* backend = NULL;
gln_error_t error = {0};
gln_default_error(&error);
gln_status_t rc = gln_open_revolut_backend(
    &config,
    state_store,
    &backend,
    &error);
if (rc == GLN_OK) {
    remember_open_backend(backend);
}

gln_close_backend(backend);
gln_release_error(&error);

See Also