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
7d5ac924
Commit
7d5ac924
authored
9 years ago
by
Allen Gilliland
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into admin_email_setting
parents
78d1fd00
9c5e2739
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
npm-shrinkwrap.json
+3467
-1313
3467 additions, 1313 deletions
npm-shrinkwrap.json
package.json
+1
-0
1 addition, 0 deletions
package.json
test/metabase/api/user_test.clj
+14
-21
14 additions, 21 deletions
test/metabase/api/user_test.clj
with
3482 additions
and
1334 deletions
npm-shrinkwrap.json
+
3467
−
1313
View file @
7d5ac924
This diff is collapsed.
Click to expand it.
package.json
+
1
−
0
View file @
7d5ac924
...
...
@@ -84,6 +84,7 @@
"build"
:
"./node_modules/webpack/bin/webpack.js"
,
"build-watch"
:
"./node_modules/webpack/bin/webpack.js --watch"
,
"build-hot"
:
"NODE_ENV=hot ./node_modules/webpack/bin/webpack.js && NODE_ENV=hot node_modules/webpack-dev-server/bin/webpack-dev-server.js --hot --inline --content-base frontend"
,
"shrinkwrap"
:
"npm shrinkwrap --dev"
,
"start"
:
"npm run build && lein ring server"
}
}
This diff is collapsed.
Click to expand it.
test/metabase/api/user_test.clj
+
14
−
21
View file @
7d5ac924
...
...
@@ -214,27 +214,20 @@
;; ## PUT /api/user/:id/password
;; Test that a User can change their password
(
let
[
user-last-name
(
random-name
)]
(
expect-eval-actual-first
(
let
[{
user-id
:id
}
(
sel
:one
User
:last_name
user-last-name
)]
(
sel
:one
:fields
[
Session
:id
]
:user_id
user-id
(
k/order
:created_at
:desc
)))
; get the latest Session for this User
(
let
[
password
{
:old
"password"
:new
"whateverUP12!!"
}
{
:keys
[
email
id
]
:as
user
}
(
create-user
:password
(
:old
password
)
:last_name
user-last-name
)
creds
{
:old
{
:password
(
:old
password
)
:email
email
}
:new
{
:password
(
:new
password
)
:email
email
}}]
;; Check that creds work
(
metabase.http-client/client
:post
200
"session"
(
:old
creds
))
;; Change the PW
(
metabase.http-client/client
(
:old
creds
)
:put
200
(
format
"user/%d/password"
id
)
{
:password
(
:new
password
)
:old_password
(
:old
password
)})
;; Old creds should no longer work
(
assert
(
=
(
metabase.http-client/client
:post
400
"session"
(
:old
creds
))
{
:errors
{
:password
"did not match stored password"
}}))
;; New creds *should* work
(
metabase.http-client/client
:post
200
"session"
(
:new
creds
)))))
(
expect-let
[
creds
{
:email
"abc@metabase.com"
:password
"def"
}
{
:keys
[
id
password
]}
(
ins
User
:first_name
"test"
:last_name
"user"
:email
"abc@metabase.com"
:password
"def"
)]
true
(
do
;; use API to reset the users password
(
metabase.http-client/client
creds
:put
200
(
format
"user/%d/password"
id
)
{
:password
"abc123!!DEF"
:old_password
(
:password
creds
)})
;; now simply grab the lastest pass from the db and compare to the one we have from before reset
(
not=
password
(
sel
:one
:field
[
User
:password
]
:email
(
:email
creds
)))))
;; Check that a non-superuser CANNOT update someone else's password
(
expect
"You don't have permissions to do that."
...
...
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