-
Notifications
You must be signed in to change notification settings - Fork 103
[sql-22] session: sessions CRUD #996
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
Conversation
2e7e99c
to
1988690
Compare
d2de94b
to
71cdc5a
Compare
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.
Very exiting 🎉. Will do another pass, this looks very clean! 🙏
} | ||
|
||
var macRecipe *MacaroonRecipe | ||
if perms != nil || caveats != nil { |
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.
is it ok to check only for whether one one them is present?
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.
yes - look at the calls that follow
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.
Generally looks great 🚀!!
Just leaving some comments mainly regarding differences in results between the original kvdb logic and the new sql implementation :).
sessIDs, err := db.GetSessionAliasesInGroup( | ||
ctx, sql.NullInt64{ | ||
Int64: groupID, | ||
Valid: true, | ||
}, | ||
) | ||
if err != nil { | ||
return fmt.Errorf("unable to get session IDs: %v", err) | ||
} |
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.
Just noting that original logic actually seems to error if no sessions for the legacyGroupID is found, while this would return an emprty list. But given that I think the new logic is actually more correct, and I don't see a scenario where we'd hit that anyways, I think we should probably keep as is.
@ellemouton, remember to re-request review from reviewers when ready |
71cdc5a
to
7feac60
Compare
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.
thanks yall 🙏
} | ||
|
||
var macRecipe *MacaroonRecipe | ||
if perms != nil || caveats != nil { |
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.
yes - look at the calls that follow
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.
LGTM 🚀
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.
Looks great! Adding a few more comments in regards to error handling, but feel free to ignore these if you'd like :)
This commit adds the SQL implementation of the session.Store interface. This can be run against all session unit tests via `make unit pkg=session tags=test_db_sqlite` and `make unit pkg=session tags=test_db_postgres`.
Let LiTd support a SQL db for the sessions store under the `dev` build tag. This can be used via itests.
7feac60
to
6dbf880
Compare
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.
addressed, thanks @ViktorTigerstrom 🙏
In this PR, the SQL implementation of the
sessions.Store
is added.part of #917