Commit Graph
100 Commits
Author SHA1 Message Date
Aaron L 704697472f Add redirection on pages when logged in.
- Stop logged in users from accessing pages like auth/recover etc.
- Ensure that half-authed users are allowed access to auth-like pages.
- Make sure that if users have a remember token, it's processed before
  we decide if a user is logged in or not, preventing or granting access
  to these pages.
- Fix #58
2015-04-10 22:41:59 -07:00
Aaron L 52c4ce69fa Use stringer program with go generate.
- Fix #60
2015-04-10 19:28:48 -07:00
Aaron c98ef93e06 Fix modules after refactor. 2015-04-01 13:08:08 -07:00
Aaron 9ff0b65629 Rewrite module loading to be per-instance 2015-03-31 15:08:43 -07:00
Aaron d6c0eb8684 Remove state from config, add to authboss type. 2015-03-31 12:36:40 -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 bd0d3c5f68 Add a default logger.
- Having the default logger set to nil was troublesome because some errors
  are hard to detect without a logger. This falls under "sane default"
  changes and so should be made.
2015-03-30 09:55:37 -07:00
Aaron c956141007 Clarify some documentation. 2015-03-27 09:44:20 -07:00
Aaron 1f6bb00137 Update Readme. 2015-03-27 09:38:23 -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 1c275a132a Make storage requirements more consistent.
- Fix #44
2015-03-27 09:35:54 -07:00
Aaron 883a907ca4 Add bages to readme. 2015-03-27 09:35:54 -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 e83110ee31 Add UpdatePassword.
- Fix #50
2015-03-16 22:58:32 -07:00
Aaron L 04d2716963 Add logout route to oauth2
- Fix #51
2015-03-16 21:46:15 -07:00
Aaron L 185d916d95 Fix some comments. 2015-03-16 21:38:00 -07:00
Aaron L 3d905f001f Go vet fixes. 2015-03-16 14:51:44 -07:00
Aaron L 99d0af8b72 Destroy a list of go lint errors. 2015-03-16 14:42:45 -07:00
Aaron ae71333bfe Update docs again. 2015-03-15 15:20:50 -07:00
Aaron d7e63bc876 Remove silly key return from RememberStorer 2015-03-15 15:00:37 -07:00
Aaron ec527a1113 Add documentation. 2015-03-15 14:36:27 -07:00
Aaron e14efb13b7 Make confirm redirect to a sane path. 2015-03-15 11:56:15 -07:00
Aaron d8cede4292 Rename TokenStorer to RememberStorer 2015-03-15 11:26:25 -07:00
Aaron 47d9dc66f8 Rename OAuthProvider to OAuth2Provider
- Add more docs.
2015-03-15 11:25:59 -07:00
Aaron 090ce2b6c3 Make register follow it's redir path. 2015-03-15 11:25:23 -07:00
Aaron 4651176f4d Add more config docs. 2015-03-15 11:25:01 -07:00
Aaron 87e0ab9835 Delete useless readme files. 2015-03-15 11:24:38 -07:00
Aaron fc0ec60a4f Make the lock module respect lock duration. 2015-03-15 08:38:50 -07:00
Aaron 0754b965b1 Update config documentation.
- Fix #47: Remove ModuleAttrMeta from Storers. Rename to ModuleAttributes.
- Add some additional deafult values to config.
2015-03-15 08:31:48 -07:00
Aaron f93fb38181 Change documentation a little bit, and fix one bug. 2015-03-15 08:06:08 -07:00
Aaron fb97394c7f Fix CurrentUser to pull the current user.
- Make slightly nicer tests for camelcasing.
- Fix an issue with oauth url generation.
2015-03-13 22:09:01 -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 082caf88b3 Clean up OAuth and finish tests.
- Fix #25
2015-03-13 02:15:58 -07:00
Aaron 538adcf188 Add initial oauth2 support.
- Needs more providers and more tests.
2015-03-12 19:20:36 -07:00
Aaron dccabb0754 Rename HostName to RootURL 2015-03-12 19:20:28 -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
Aaron b93e0e6eb1 Add callback from confirm to BeforeAuth
- Allow missing struct attributes to go unnoticed in Bind()
2015-02-26 12:15:33 -08:00
Aaron e6d3558704 Fix confirm email templates. 2015-02-25 23:39:55 -08:00
Aaron fa3cd5ef4f Fix confirm fields. 2015-02-25 23:20:02 -08:00
Aaron 889dcaa974 Make log output cooler. 2015-02-25 23:11:58 -08:00
Aaron bf0a8b098c Add mountedpath so forms work on mounted paths.
- Refactor naming for config "redirect" variables.
- Removed flash messages from config, Fix #19
2015-02-25 23:05:14 -08:00
Aaron 8b1007f7dd Fix broken redirect tests. 2015-02-24 23:45:55 -08:00
Aaron f716720759 Fix broken render test. 2015-02-24 14:52:22 -08:00
Aaron 1075149bb8 Add router tests.
- Rename Endpoint to Location in ErrAndRedirect
2015-02-24 14:45:37 -08:00
Aaron e369d626a8 Increase test coverage in authboss. 2015-02-24 13:03:06 -08:00
Aaron faa35b66be Add additional rule options. 2015-02-24 11:13:46 -08:00
Aaron c723f46a3e Refactor storers into modules. 2015-02-24 11:04:27 -08:00
Aaron ec5da7694e Finish register module. 2015-02-23 02:03:39 -08:00
Aaron 6f074543f4 Start the register module. 2015-02-23 02:03:29 -08:00
Aaron 73dcb5beb1 Add a few updates to documentation. 2015-02-22 22:27:45 -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
Aaron 35e0c6738b Delete useless module. 2015-02-22 12:47:42 -08:00
Aaron 7366629ab4 Fix auth interruption handling. 2015-02-22 12:47:02 -08:00
Aaron bab0da8575 Fix lock module. 2015-02-22 12:43:28 -08:00
Aaron 681bfdeac0 Fix up expire module. 2015-02-22 00:25:29 -08:00
Aaron 94f441f3d7 Fix confirm module. 2015-02-22 00:09:52 -08:00
Aaron 1ca6eb1cc0 Change the way callbacks work AGAIN. 2015-02-21 21:03:03 -08:00
Aaron 0840d9743c Fix error handling in callbacks. 2015-02-20 23:10:18 -08:00
Aaron 205d1669e2 Add error handling to callbacks. 2015-02-20 23:01:45 -08:00
Aaron 5f96e8dec8 Make an GetErr version of the ClientStorer. 2015-02-20 22:02:55 -08:00
Aaron 8b87d9c826 Add many tests.
- Finish up render package, rename some things.
- Add authboss view data/error tests.
2015-02-20 05:08:11 -08:00
Aaron 585f842a5c Get authboss tests passing. 2015-02-20 04:03:22 -08:00
Aaron 13a38828bd Merge should actually work now. 2015-02-19 14:50:14 -08:00
Aaron 6a4feaa2ea Add authboss error types.
- Add error handling at the routing level so that all errors can bubble
  up and be handled and logged there in one place.
- Add Err variants for ClientStorer and Attributes to facilitate
  generating errors for missing type-failing arguments.
- Add better control flow and error handling for callbacks.
2015-02-19 14:46:38 -08:00
Aaron 679798564f Fix test breakages from new saving stuff. 2015-02-18 08:57:50 -08:00
Aaron 9f4cde2934 Clean up save/load user on context.
- Fix #16
2015-02-18 08:45:27 -08:00
Aaron d050610129 Rename UserXXX to StoreXXX in lock module. 2015-02-16 13:31:26 -08:00
Aaron dee6a42a68 Finish tests for confirm.
- Rename UserXXX to StoreXXX in confirm/authboss.
2015-02-16 13:27:29 -08:00
Aaron c74bb311b3 Fix lock test. 2015-02-16 11:32:31 -08:00
Aaron 127ef8ea17 Fix confirm's initial test.
- Add e-mail templates for confirm.
2015-02-15 20:21:39 -08:00
Aaron a91a7ef162 Finish confirm module (except tests). 2015-02-15 20:21:38 -08:00
Aaron d86fac49ac Add confirm module beginnings.
- Fix some inconsistencies in expire and lock.
- Add bool type to storer.
2015-02-07 04:27:12 -08:00
Aaron 8a9736f664 Add ViewData concepts for layout files. 2015-02-01 15:51:01 -08:00
Aaron 58e2f1f355 Add a method to pick attributes from a context. 2015-01-28 00:32:53 -08:00
Aaron L c1670a041f Add form value name for xsrf tokens. 2015-01-27 17:34:55 -08:00
Aaron b3042339d0 Add XSRF support. 2015-01-27 02:11:19 -08:00
Aaron 042bdba669 First shot at the expire module. 2015-01-25 18:13:32 -08:00
Aaron 22efa3b740 Make mailer test a bit more inclusive. 2015-01-25 16:55:30 -08:00
Aaron 8ceeec5420 Fixed up e-mailing.
- Fix #13
2015-01-25 15:40:57 -08:00
Aaron f0552cd8c6 Add lock tests.
- Fix some logic errors in lock module.
- Add some more power to the mocks.
2015-01-24 22:19:22 -08:00
Aaron 65f7fad5fc Second shot at proper validation. 2015-01-24 16:07:41 -08:00
Aaron fe7b990095 Add beginnings of lock package.
- Adjust configuration for some lock variables and better XML Names.
2015-01-23 16:25:12 -08:00
Aaron 8f6f322c63 Add new internal mocks.
- Update remember to use new mocks.
2015-01-23 16:24:34 -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
Aaron efc834006a Add proper database/go casing. 2015-01-18 14:35:51 -08:00
Aaron e4dfe30d02 Initial validate module. 2015-01-17 23:37:05 -08:00
Aaron 89875f7b68 Clean up mocks.
- Add CurrentUser method.
2015-01-17 02:42:42 -08:00
Aaron 1073b36cce Add SaveUser for context.
- Add test coverage for context.go
2015-01-16 21:30:04 -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 d9bcf5326c Lowercase all identifiers used with storer. 2015-01-14 17:48:14 -08:00
Aaron f51bce96c9 Just store the type itself. Go has reflection. 2015-01-14 16:07:15 -08:00
Aaron de3fdaeacd Fix bad hg dependencies :D 2015-01-12 23:51:25 -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
Aaron 11a0cabe5f Add unbind to pull data from a struct. 2015-01-07 11:39:12 -08:00
Aaron 92b3172a3e Add a lot of module related stuff.
- Leave a failing test to make hate not love.
2015-01-05 00:18:41 -08:00
Aaron L 8ac986b99b Add some more infrastructure.
- Add module system.
- Add storer interface.
2015-01-03 12:03:57 -08:00