Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
deepu105 committed Jan 13, 2024
1 parent 04260cf commit 56c8610
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/app/jwt_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use serde_derive::{Deserialize, Serialize};
use serde_json::{to_string_pretty, Value};

use super::{
jwt_utils::{decoding_key_from_jwks_secret, get_secret_from_file_or_input, JWTError, JWTResult, SecretType},
jwt_utils::{
decoding_key_from_jwks_secret, get_secret_from_file_or_input, JWTError, JWTResult, SecretType,
},
models::{ScrollableTxt, TabRoute, TabsState},
ActiveBlock, App, Route, RouteId, TextInput,
};
Expand Down
5 changes: 4 additions & 1 deletion src/app/jwt_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ pub enum SecretType {
Plain,
}

pub fn get_secret_from_file_or_input(alg: &Algorithm, secret_string: &str) -> (JWTResult<Vec<u8>>, SecretType) {
pub fn get_secret_from_file_or_input(
alg: &Algorithm,
secret_string: &str,
) -> (JWTResult<Vec<u8>>, SecretType) {
return match alg {
Algorithm::HS256 | Algorithm::HS384 | Algorithm::HS512 => {
if secret_string.starts_with('@') {
Expand Down

0 comments on commit 56c8610

Please sign in to comment.