-
-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: flatten (de)serialization of custom user claims #1159
base: master
Are you sure you want to change the base?
Changes from all commits
b3bc611
a4bddb6
a96dd62
97aa482
3767c4d
a825698
5a3283c
6a9ab79
2d52d02
36565ed
4f3ccce
89ac951
b3968aa
5c48468
7bd2ccb
86dbbb8
2681485
2c9bb57
7701e0a
2c71c5b
cac9e5c
0897e27
18de238
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,10 @@ FROM rust:1.83.0-slim as builder | |
WORKDIR /usr/src/ | ||
|
||
COPY . . | ||
|
||
{% if loco_dev_mode_path -%} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to use this in order to build from a local |
||
# The `loco` root folder should be moved to this dockerfile path so the context can copy it to the image | ||
RUN mkdir -p {{loco_dev_mode_path}} && mv loco/* {{loco_dev_mode_path}} && rm -rf loco | ||
{% endif -%} | ||
RUN cargo build --release | ||
|
||
FROM debian:bookworm-slim | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
source: src/auth/jwt.rs | ||
expression: jwt.validate(&token) | ||
--- | ||
Ok( | ||
TokenData { | ||
header: Header { | ||
typ: Some( | ||
"JWT", | ||
), | ||
alg: HS512, | ||
cty: None, | ||
jku: None, | ||
jwk: None, | ||
kid: None, | ||
x5u: None, | ||
x5c: None, | ||
x5t: None, | ||
x5t_s256: None, | ||
}, | ||
claims: UserClaims { | ||
pid: "pid", | ||
exp: EXP, | ||
claims: { | ||
"array": Array [ | ||
Number(1), | ||
Number(2), | ||
Number(3), | ||
], | ||
}, | ||
}, | ||
}, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this snapshot file's diff is marked as "renamed file", but actually I deleted the old |
||
source: src/auth/jwt.rs | ||
assertion_line: 133 | ||
expression: jwt.validate(&token) | ||
--- | ||
Ok( | ||
|
@@ -22,9 +21,9 @@ Ok( | |
claims: UserClaims { | ||
pid: "pid", | ||
exp: EXP, | ||
claims: Some( | ||
Object {}, | ||
), | ||
claims: { | ||
"custom": Bool(true), | ||
}, | ||
}, | ||
}, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have to split this in two steps (
generate deployment
andbuild deployment
) becausecargo loco generate deployment --kind docker
if we have the local loco dependency in the pathThe
docker build
works because once we are copying the files in the container, we move theloco
directory to${{github.workspace}}
from/tmp/myapp/loco
so the app can compile withcargo build --release
(see the dockerfile template)