Skip to content

Commit

Permalink
Merge pull request #618 from NordSecurity/LLT-5294_create_ffi_method_…
Browse files Browse the repository at this point in the history
…to_get_default_config

LLT-5294: Add FFI function to get default feature config
  • Loading branch information
mathiaspeters authored Jun 13, 2024
2 parents 6f71d79 + 5e80eb5 commit ad7280b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .unreleased/LLT-5294
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add FFI function to get default feature config
5 changes: 5 additions & 0 deletions src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ pub fn generate_public_key(secret_key: SecretKey) -> PublicKey {
secret_key.public()
}

/// Utility function to get the default feature config
pub fn get_default_feature_config() -> Features {
Features::default()
}

/// Utility function to create a `Features` object from a json-string
/// Passing an empty string will return the default feature config
pub fn deserialize_feature_config(fstr: String) -> FFIResult<Features> {
Expand Down
3 changes: 3 additions & 0 deletions src/libtelio.udl
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ namespace telio {
/// Get the public key that corresponds to a given private key.
PublicKey generate_public_key(SecretKey secret_key);

/// Utility function to get the default feature config
Features get_default_feature_config();

/// Utility function to create a `Features` object from a json-string
/// Passing an empty string will return the default feature config
[Throws=TelioError]
Expand Down

0 comments on commit ad7280b

Please sign in to comment.