Commit d24b1ced authored by kharade's avatar kharade

clang formating

parent 11678473
...@@ -44,15 +44,13 @@ bool nrf_jwt::generate_signature( ...@@ -44,15 +44,13 @@ bool nrf_jwt::generate_signature(
get_secret_key(scope, nf_type, target_nf_type, key); get_secret_key(scope, nf_type, target_nf_type, key);
// Create JWT object // Create JWT object
// TODO // TODO
jwt::jwt_object obj{ jwt::jwt_object obj{jwt::params::algorithm("HS256"),
jwt::params::algorithm("HS256"), jwt::params::payload({{"iss", nrf_instance_id},
jwt::params::payload( {"sub", nf_consumer_id},
{{"iss", nrf_instance_id}, {"aud", target_nf_type},
{"sub", nf_consumer_id}, {"scope", scope},
{"aud", target_nf_type}, {"exp", "1000"}}), // in second
{"scope", scope}, jwt::params::secret(key)};
{"exp", "1000"}}), // in second
jwt::params::secret(key)};
// Get the encoded string/assertion // Get the encoded string/assertion
signature = obj.signature(); signature = obj.signature();
...@@ -68,15 +66,13 @@ bool nrf_jwt::generate_signature( ...@@ -68,15 +66,13 @@ bool nrf_jwt::generate_signature(
get_secret_key(scope, target_nf_instance_Id, key); get_secret_key(scope, target_nf_instance_Id, key);
// Create JWT object // Create JWT object
// TODO // TODO
jwt::jwt_object obj{ jwt::jwt_object obj{jwt::params::algorithm("HS256"),
jwt::params::algorithm("HS256"), jwt::params::payload({{"iss", nrf_instance_id},
jwt::params::payload( {"sub", nf_consumer_id},
{{"iss", nrf_instance_id}, {"aud", target_nf_instance_Id},
{"sub", nf_consumer_id}, {"scope", scope},
{"aud", target_nf_instance_Id}, {"exp", "1000"}}), // in second
{"scope", scope}, jwt::params::secret(key)};
{"exp", "1000"}}), // in second
jwt::params::secret(key)};
// Get the encoded string/assertion // Get the encoded string/assertion
signature = obj.signature(); signature = obj.signature();
...@@ -107,8 +103,8 @@ void nrf_jwt::test_jwt() { ...@@ -107,8 +103,8 @@ void nrf_jwt::test_jwt() {
auto key = "secret"; // Secret to use for the algorithm auto key = "secret"; // Secret to use for the algorithm
// Create JWT object // Create JWT object
jwt::jwt_object obj{ jwt::jwt_object obj{algorithm("HS256"), payload({{"some", "payload"}}),
algorithm("HS256"), payload({{"some", "payload"}}), secret(key)}; secret(key)};
// Get the encoded string/assertion // Get the encoded string/assertion
auto enc_str = obj.signature(); auto enc_str = obj.signature();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment