Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
6cea796f
Commit
6cea796f
authored
9 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Update session unit tests to ensure we don't leak existence of users
parent
d40d2d9b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/metabase/api/session_test.clj
+5
-4
5 additions, 4 deletions
test/metabase/api/session_test.clj
with
5 additions
and
4 deletions
test/metabase/api/session_test.clj
+
5
−
4
View file @
6cea796f
...
...
@@ -25,7 +25,8 @@
(
client
:post
400
"session"
{
:email
"anything@metabase.com"
}))
;; Test for inactive user (user shouldn't be able to login if :is_active = false)
(
expect
{
:errors
{
:email
"no account found for the given email"
}}
;; Return same error as incorrect password to avoid leaking existence of user
(
expect
{
:errors
{
:password
"did not match stored password"
}}
(
client
:post
400
"session"
(
user->credentials
:trashbird
)))
;; Test for password checking
...
...
@@ -62,9 +63,9 @@
(
expect
{
:errors
{
:email
"field is a required param."
}}
(
client
:post
400
"session/forgot_password"
{}))
;; Test that email not found gives
404
(
expect
{
:errors
{
:email
"no account found for the given email"
}}
(
client
:post
4
00
"session/forgot_password"
{
:email
"not-found@metabase.com"
}))
;; Test that email not found
also
gives
200 as to not leak existence of user
(
expect
nil
(
client
:post
2
00
"session/forgot_password"
{
:email
"not-found@metabase.com"
}))
;; POST /api/session/reset_password
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment