Commit Graph

15 Commits

Author SHA1 Message Date
🐙PiperYxzzy
dbdd4cb650 Adding Live 2fa capacity
* Some requests may be sensitive enough to require a secondary
two-factor authorization on the spot
* Examples: changing password, changing email address, viewing API
tokens etc
* This creates a core handler that can attach to any Auth-able method
which will require a "twofactorcode" query param before processing
2022-05-01 22:34:07 +02:00
🐙PiperYxzzy
67efb0600f Adding util test class 2022-05-01 20:59:24 +02:00
🐙PiperYxzzy
6e7b30be0a Added test suites for all current models 2022-05-01 20:49:03 +02:00
🐙PiperYxzzy
5f85a5800e Updating postman collection 2022-05-01 19:22:47 +02:00
🐙PiperYxzzy
6c567cd58c Verify and password reset
* Users can now request a password reset and reset with their token
2022-05-01 19:20:47 +02:00
🐙PiperYxzzy
5903d52755 Restrict the cookie to the /adm and /sec paths appropriately 2022-05-01 13:37:01 +02:00
🐙PiperYxzzy
0af09dcc01 Fix signup risk of enumeration to test emails
* Now, if a known email is used, it will still return the same result
* If a known email is used, we will ping the email address to know that
there was a signup attempt
2022-05-01 13:25:09 +02:00
🐙PiperYxzzy
dd8d2a677d Added better Tenanting
* Removed Tenanting from base objects as some models may be tenantless
* Admins are naturally not restricted by tenants
* Users *ARE* the tenants (for now) so they don't require a tenant ID
either
* User-owned models should all include the Tenanted model as their base
* Created .Create and .Save methods attached to base model
2022-05-01 12:48:40 +02:00
🐙PiperYxzzy
8ab45e2401 Login, JWT and auth overstructure
* Signup -> Login -> JWT-Doot flow now works for users
* Administrators cannot currently sign up for obvious reasons
* Segmented the main.go methods into a core controller package
2022-05-01 12:31:41 +02:00
🐙PiperYxzzy
6db02148ea Building and returning JWTs on login
* Created Util package for assorted items
* Currently generates an HMAC key on startup, to be changed
* JWT also includes login role
2022-04-30 16:30:07 +02:00
🐙PiperYxzzy
d1c31e0fd4 Temp tweak to enable an easy way to turn email verification off for testing 2022-04-30 16:05:41 +02:00
🐙PiperYxzzy
4b270733a7 Slight refactor to re-use Auth structures
* Now Auth.Login is a consolidated attempt to verify password, 2fa code
and verified status
2022-04-30 16:03:42 +02:00
🐙PiperYxzzy
47ac0cdc07 Adding models, DB access, signup, login
* Created Base, Auth, User and Admin models
* Added skeleton API structure containing: User signup, User & Admin
login, authorized zones, ping tests
* Simple user signup functional
* Skeleton user login functional, no means to verify as of yet
* Added POSTMAN file
2022-04-30 16:02:26 +02:00
🐙PiperYxzzy
b74158a7a5 Init, installing gin-gonic 2022-04-29 22:47:52 +02:00
yxzzy-wtf
28a7ed8ba8 Initial commit 2022-04-29 22:40:21 +02:00