1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-01-08 04:03:53 +02:00
Commit Graph

50 Commits

Author SHA1 Message Date
Aaron L
e62387f74f Fix eventing mess in recover/remember 2021-02-14 22:39:57 -08:00
Aaron L
3a5c333b5b Move to go modules 2020-07-03 11:24:07 -07:00
frederikhors
9c764f69fe Redundant type conversion 2020-01-29 14:04:44 +01:00
Aaron L
470b7c0488 Fix bug in remember 2019-01-12 11:30:39 -08:00
Aaron L
6c663762e4 Fix couple bugs with remember and 2fa
- Fix bug where setup paths were not mountpathed so twofactor_verify
  would redirect to a 404.
- Fix bug in remember where a user would be remembered even if logged in
  depending on the middleware order (if something had previously called
  LoadCurrentUser/LoadCurrentUserID it was fine, if not, the user was
  half-authed even if he was cleared of half-auth previously).
2018-11-04 22:49:43 -08:00
Aaron L
98147bc020 Fix several lint errors 2018-09-03 16:34:10 -07:00
Aaron L
b7cec028b9 Use io.ReadFull to read from crypto/rand
There have been bugs filed in other libraries where rand.Read()
simply returns all 0s, instead use io.ReadFull to ensure that we get
the amount of bytes we want.

- Use io.ReadFull(rand.Reader, ...) instead of rand.Read() for getting
  randomness from crypto/rand.
2018-07-17 10:10:07 -07:00
Aaron L
db3a3a10e3 Add context.Context to RememberingServerStorer 2018-06-27 10:58:53 -07:00
Aaron L
2399b4c089 Fix bug where remember didn't log you in
- The current request needed a pid set, the session sets that existed in
  the current code would only log you in the next request.
2018-05-08 18:11:13 -07:00
Aaron L
ee4b2658d5 Finish TODOs 2018-03-09 13:11:08 -08:00
Aaron L
1112987bce Rewrite oauth module
- Tried to be clear about OAuth2 vs OAuth in all places.
- Allow users to be locked from OAuth logins (if done manually for some
  reason other than failed logins)
- Cleaned up some docs and wording around the previously very confusing
  (now hopefully only somewhat confusing) oauth2 module.
2018-03-08 18:39:51 -08:00
Aaron L
634892e29c Fix breakages from last commit 2018-03-07 16:41:58 -08:00
Aaron L
ce2d3dac09 Make "remember" value passing unobtrusive
- Remove RM context key for Values.
- Add values types and code to be able to pull the remember me bool
  checkbox from the user.
2018-03-07 15:17:22 -08:00
Aaron L
ac3d2846f8 Rewrite the remember module
- Add context keys and storage pieces for remember
2018-03-07 15:13:06 -08:00
Aaron L
ad5230a303 Bring back events
- Rename callbacks -> events
- Regenerate stringers.go with later version of stringer
2018-02-01 16:31:08 -08:00
Aaron L
2b5c85ee16 Import path fixes 2017-07-30 19:42:05 -07:00
Aaron L
f65d9f6bb6 Fix errors package
- Fix many compilation errors
2017-02-21 15:04:30 -08:00
Aaron L
0c3d6d26ca Remove gopkg.in 2016-12-19 22:47:12 -08:00
Ryan Lester
96c55ccaaa no DisableGoroutines (just check for -Maker); no ModuleNames; test fix 2016-05-09 13:20:10 -04:00
Ryan Lester
588c21260c final App-Engine-related fixes 2016-05-07 02:12:20 -04:00
Aaron L
be041cbae6 remember: Context+Request separation ripple
- Re-add the age-old "Values" from the Context. This was originally
  there for exactly the documented purpose. However the Context holding
  the request form values negated it's use. It's back because of this
  new separation.
- Make the auth success path set the authboss.CookieRemember value in
  the context before calling it's callback.
2015-08-02 14:02:14 -07:00
Aaron
c98ef93e06 Fix modules after refactor. 2015-04-01 13:08:08 -07:00
Aaron
f12f10fa43 Stop reliance on global scope.
- This change was necessary because multi-tenancy sites could not use
  authboss properly.
2015-03-31 12:34:03 -07:00
Aaron
a4fd382287 Make RememberStorer more independent.
- RememberStorer checks to see if either provided storer is of the correct
  type. If neither are then the module fails to load.
- Fix #48
2015-03-27 09:35:55 -07:00
Aaron
07cbd6016f Make remember and oauth2 work better together.
- Change OAuth2 extra params to not use state, but session instead.
2015-03-24 19:39:20 -07:00
Aaron L
185d916d95 Fix some comments. 2015-03-16 21:38:00 -07:00
Aaron L
99d0af8b72 Destroy a list of go lint errors. 2015-03-16 14:42:45 -07:00
Aaron
d7e63bc876 Remove silly key return from RememberStorer 2015-03-15 15:00:37 -07:00
Aaron
d8cede4292 Rename TokenStorer to RememberStorer 2015-03-15 11:26:25 -07:00
Aaron
f93fb38181 Change documentation a little bit, and fix one bug. 2015-03-15 08:06:08 -07:00
Aaron L
06edd2e615 Make OAuth2 implementation less shoddy.
- Add a new storer specifically for OAuth2 to enable clients to choose
  regular database storing OR Oauth2 but not have to have both.
- Stop storing OAuth2 credentials in a combined form inside username.
- Add new events to capture OAuth events just like auth.
- Have pass-through parameters for OAuth init urls, this allows us to
  pass additional behavior options (redirects and remember me) as well
  as other things that should be present on the page that is redirected
  to.
- Context.LoadUser is now OAuth aware.
- Remember's callbacks now include an OAuth check to see if a horribly
  packed state variable contains a flag to say that we want to be
  remembered.
- Change the OAuth2 Callback to use Attributes instead of that custom
  struct to allow people to append whatever attributes they want into
  the user that will be saved.
2015-03-13 16:29:58 -07:00
Aaron L
aaf9c71f3c Add new PasswordReset event.
- Make remember clear it's tokens on password reset.
- Fix #14
2015-03-05 20:06:44 -08:00
Kris Runzer
045b9331c7 Fix expire token shenanigans
- Add session and cookie cleanup on logout
2015-03-02 22:09:32 -08:00
Kris Runzer
21c35ac1d5 Remember now properly regenerates tokens on use. 2015-03-01 20:40:09 -08:00
Kris Runzer
a7a67981ce Move create from Storer to RegisterStorer
- Fixed the qq tests
- Removed all module singletons
2015-03-01 20:00:19 -08:00
Aaron
c723f46a3e Refactor storers into modules. 2015-02-24 11:04:27 -08:00
Aaron
001810bf7c Add PrimaryID to the system.
- Fix #17
2015-02-22 13:24:53 -08:00
Aaron
4eeb21e16d Fix the remember module. 2015-02-22 12:55:09 -08:00
Kris Runzer
bab1475b72 Change config to be global. Updated most modules and tests. 2015-02-15 20:07:36 -08:00
Aaron
f537664fd9 Cleanup various sad things.
- Export ModuleAttrMeta so the modules can access it.
- Add a couple new events for later use.
- Fix a few compile errors.
- Prefix err constants with Err.
2015-01-23 15:56:24 -08:00
Kris Runzer
934ddf5531 Move all html to internal packge views 2015-01-18 14:24:20 -08:00
Aaron
e4dfe30d02 Initial validate module. 2015-01-17 23:37:05 -08:00
Kris Runzer
a0bde30e3d Implement auth logout
- Add del to client storer interface
2015-01-15 16:04:33 -08:00
Kris Runzer
14272c8164 Changed remember and auth to work together. 2015-01-15 15:10:47 -08:00
Kris Runzer
716e7dd6ba Add response writer to client storer 2015-01-15 14:01:01 -08:00
Aaron
443f482b71 Fixed auth and auth tests.
- Added more error checking to remember module.
2015-01-15 13:24:12 -08:00
Aaron
0b66578b88 Add full-circle remember me test.
- Add more helpers to context.
2015-01-15 02:56:13 -08:00
Aaron
670c6f3b9f Add more to context.
- Add test coverage to various modules.
2015-01-14 19:18:45 -08:00
Aaron
7f9fe3ec77 Add session and cookie concepts.
- Add tests for callbacks.
- Refactor callbacks into a keyed map.
2015-01-12 23:46:52 -08:00
Aaron
a2ffe4f7c4 Add many new files and types.
- Add context.
- Add handler type.
- Add new storers for client storage and sessions.
- Add start of remember module.
2015-01-10 22:54:31 -08:00