auth
auth/memstore.go
Break out scopes and events. This repo has gotten unwieldy, and there are portions of it that need to be imported by a large number of other packages. For example, scopes will be used in almost every API we write. Rather than importing the entirety of this codebase into every API we write, I've opted to move the scope logic out into a scopes package, with a subpackage for the defined types, which is all most projects actually want to import. We also define some event type constants, and importing those shouldn't require a project to import all our dependencies, either. So I made an events subpackage that just holds those constants. This package has become a little bit of a red-headed stepchild and is do for a refactor, but I'm trying to put that off as long as I can. The refactoring of our scopes stuff has left a bug wherein a token can be granted for scopes that don't exist. I'm going to need to revisit that, and also how to limit scopes to only be granted to the users that should be able to request them. But that's a battle for another day.
1.1 --- a/memstore.go Sat Jul 18 03:38:27 2015 -0400 1.2 +++ b/memstore.go Mon Dec 14 04:17:21 2015 -0800 1.3 @@ -31,9 +31,6 @@ 1.4 1.5 sessions map[string]Session 1.6 sessionLock sync.RWMutex 1.7 - 1.8 - scopes map[string]Scope 1.9 - scopeLock sync.RWMutex 1.10 } 1.11 1.12 // NewMemstore returns an in-memory version of our datastores, 1.13 @@ -53,7 +50,6 @@ 1.14 logins: map[string]Login{}, 1.15 profileLoginLookup: map[string][]string{}, 1.16 sessions: map[string]Session{}, 1.17 - scopes: map[string]Scope{}, 1.18 } 1.19 } 1.20