Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-NRF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-NRF
Commits
d24b1ced
Commit
d24b1ced
authored
Apr 01, 2022
by
kharade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang formating
parent
11678473
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
+16
-20
src/nrf_app/nrf_jwt.cpp
src/nrf_app/nrf_jwt.cpp
+16
-20
No files found.
src/nrf_app/nrf_jwt.cpp
View file @
d24b1ced
...
@@ -44,10 +44,8 @@ bool nrf_jwt::generate_signature(
...
@@ -44,10 +44,8 @@ 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
(
{{
"iss"
,
nrf_instance_id
},
{
"sub"
,
nf_consumer_id
},
{
"sub"
,
nf_consumer_id
},
{
"aud"
,
target_nf_type
},
{
"aud"
,
target_nf_type
},
{
"scope"
,
scope
},
{
"scope"
,
scope
},
...
@@ -68,10 +66,8 @@ bool nrf_jwt::generate_signature(
...
@@ -68,10 +66,8 @@ 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
(
{{
"iss"
,
nrf_instance_id
},
{
"sub"
,
nf_consumer_id
},
{
"sub"
,
nf_consumer_id
},
{
"aud"
,
target_nf_instance_Id
},
{
"aud"
,
target_nf_instance_Id
},
{
"scope"
,
scope
},
{
"scope"
,
scope
},
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment