• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / auth / 9783578837
69%

Build:
DEFAULT BRANCH: master
Ran 03 Jul 2024 07:18PM UTC
Jobs 1
Files 125
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Jul 2024 07:13PM UTC coverage: 57.978% (+0.2%) from 57.775%
9783578837

push

github

web-flow
feat: add `password_hash` and `id` fields to admin create user (#1641)

## What kind of change does this PR introduce?
* Add a `password_hash` field to admin create user, which allows an
admin to create a user with a given password hash (argon2 or bcrypt)
* Add an `id` field to admin create user, which allows an admin to
create a user with a custom id
* To prevent someone from creating a bunch of users with a high bcrypt
hashing cost, we opt to rehash the password with the default cost (10)
on subsequent sign-in.

## What is the current behavior?
* Only plaintext passwords are allowed, which will subsequently be
hashed internally

## What is the new behavior?

Example request using the bcrypt hash of "test":
```bash
$ curl -X POST 'http://localhost:9999/admin/users' \
-H 'Authorization: Bearer <admin_jwt>' \
-H 'Content-Type: application/json' \
-d '{"email": "foo@example.com", "password_hash": "$2y$10$SXEz2HeT8PUIGQXo9yeUIem8KzNxgG0d7o/.eGj2rj8KbRgAuRVlq"}'
```

Example request using a custom id:
```bash
$ curl -X POST 'http://localhost:9999/admin/users' \
-H 'Authorization: Bearer <admin_jwt>' \
-H 'Content-Type: application/json' \
-d '{"id": "2a8813c2-bda7-47f0-94a6-49fcfdf61a70", "email": "foo@example.com"}'
```

Feel free to include screenshots if it includes visual changes.

## Additional context

Add any other context or screenshots.

88 of 105 new or added lines in 5 files covered. (83.81%)

8797 of 15173 relevant lines covered (57.98%)

54.68 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
65.95
2.95% internal/api/admin.go
4
76.79
1.18% internal/models/user.go
11
79.26
0.96% internal/crypto/password.go
Jobs
ID Job ID Ran Files Coverage
1 9783578837.1 03 Jul 2024 07:18PM UTC 125
57.98
GitHub Action Run
Source Files on build 9783578837
  • Tree
  • List 125
  • Changed 35
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 20d59f10 on github
  • Prev Build on master (#9783567896)
  • Next Build on master (#9784210350)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc