Skip to content

Commit

Permalink
FeatureAdd: support jwt sign/verify
Browse files Browse the repository at this point in the history
  • Loading branch information
Firstero committed May 5, 2024
1 parent 1e22a9a commit aca9f25
Show file tree
Hide file tree
Showing 12 changed files with 419 additions and 24 deletions.
138 changes: 137 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ csv = "1.3.0"
ed25519 = "2.2.3"
ed25519-dalek = { version = "2.1.1", features = ["rand_core"] }
enum_dispatch = "0.3.13"
jsonwebtoken = "9.3.0"
rand = "0.8.5"
regex = "1.10.4"
ring = "0.17.8"
serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.116"
serde_yaml = "0.9.34"
Expand Down
15 changes: 8 additions & 7 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ allow = [
"Unicode-DFS-2016",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"OpenSSL"
#"Apache-2.0 WITH LLVM-exception",
]
# The confidence threshold for detecting a license from license text.
Expand All @@ -112,20 +114,19 @@ exceptions = [
# Some crates don't have (easily) machine readable licensing information,
# adding a clarification entry for it allows you to manually specify the
# licensing information
#[[licenses.clarify]]
[[licenses.clarify]]
# The package spec the clarification applies to
#crate = "ring"
crate = "ring"
# The SPDX expression for the license requirements of the crate
#expression = "MIT AND ISC AND OpenSSL"
expression = "MIT AND ISC AND OpenSSL"
# One or more files in the crate's source used as the "source of truth" for
# the license expression. If the contents match, the clarification will be used
# when running the license check, otherwise the clarification will be ignored
# and the crate will be checked normally, which may produce warnings or errors
# depending on the rest of your configuration
#license-files = [
# Each entry is a crate relative path, and the (opaque) hash of its contents
#{ path = "LICENSE", hash = 0xbd0eed23 }
#]
license-files = [
{ path = "LICENSE", hash = 0xbd0eed23 }
]

[licenses.private]
# If true, ignores workspace crates that aren't published, or are only
Expand Down
Binary file added fixtures/ed25519_pkcs8.pk
Binary file not shown.
Binary file added fixtures/ed25519_pkcs8.sk
Binary file not shown.
7 changes: 3 additions & 4 deletions src/cli/base64_opts.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use anyhow::Result;
use clap::Parser;
use enum_dispatch::enum_dispatch;
use std::{fmt::Display, str::FromStr};

use crate::{parse_input_file, process_b64decode, process_b64encode, CmdExcutor};
Expand All @@ -10,6 +11,7 @@ pub struct Base64Opts {
}

#[derive(Debug, Parser)]
#[enum_dispatch(CmdExcutor)]
pub enum Base64SubCommand {
#[command(name = "encode", about = "base64 encode")]
Encode(Base64EncodeOpts),
Expand Down Expand Up @@ -87,9 +89,6 @@ impl CmdExcutor for Base64DecodeOpts {

impl CmdExcutor for Base64Opts {
async fn execute(self) -> Result<()> {
match self.subcmd {
Base64SubCommand::Encode(opts) => opts.execute().await,
Base64SubCommand::Decode(opts) => opts.execute().await,
}
self.subcmd.execute().await
}
}
Loading

0 comments on commit aca9f25

Please sign in to comment.