-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
s/oidc: Replaced cryptopp with utility function
Signed-off-by: Michael Boquard <michael@redpanda.com>
- Loading branch information
1 parent
710dc18
commit f0dd8f4
Showing
3 changed files
with
34 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2024 Redpanda Data, Inc. | ||
* | ||
* Licensed as a Redpanda Enterprise file under the Redpanda Community | ||
* License (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* https://github.com/redpanda-data/redpanda/blob/master/licenses/rcl.md | ||
*/ | ||
#include "security/jwt.h" | ||
|
||
namespace security::oidc::detail { | ||
bytes base64_url_decode(std::string_view sv) { return base64url_to_bytes(sv); }; | ||
|
||
std::optional<bytes> | ||
base64_url_decode(json::Value const& v, std::string_view field) { | ||
auto b64 = string_view<>(v, field); | ||
if (!b64.has_value()) { | ||
return std::nullopt; | ||
} | ||
return base64_url_decode(b64.value()); | ||
} | ||
} // namespace security::oidc::detail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters