Skip to content

Conversation

@rescribet
Copy link
Contributor

@rescribet rescribet commented Oct 28, 2022

PR Checklist:

@rescribet rescribet changed the title Cookie authentication bug Cookie authentication bug #525 Oct 28, 2022
@rescribet rescribet requested a review from joepio October 28, 2022 10:57
@joepio
Copy link
Member

joepio commented Oct 28, 2022

Looks good! I've started deploying this version on atomicdata.dev, let's hope this also fixes #527

Edit: it does! I've updated the OP

}
}

fn origin(url: &str) -> String {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the actix_web::http:Uri not provide this with the authority method?

Might handle some extra edge cases, I'm not sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't include the scheme, so it's not a valid uri (which is the type of the subject field afaict).

requested_subject: &String,
) -> Option<AtomicServerResult<Option<AuthValues>>> {
let encoded_session = session_cookie_from_header(map.get("Cookie")?)?;
) -> AtomicServerResult<Option<AuthValues>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better, nice!

Some(Err(values.err().unwrap()))
if subject_invalid {
return Err(AtomicServerError {
message: format!(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a AtomicServerError::unauthorized creator method might help clean up this code a bit. Not needed to fix now though.

@joepio joepio merged commit 2ae09f7 into master Oct 28, 2022
@joepio joepio deleted the cookie-authentication-bug branch October 28, 2022 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong requested subject when opening atomicdata.dev as agent Cookie authentication not properly working

3 participants