auth
auth/sql/postgres_empty.sql
Enable terminating sessions through the API. Add a terminateSession method to the sessionStore that sets the Active property of the Session to false. Create a Context.TerminateSession wrapper for the terminateSession method on the sessionStore. Add a Sessions property to our response type so we can return a []Session in API responses. Use the URL-safe encoding when base64 encoding our session ID and CSRFToken, so the ID can be passed in the URL and so our encodings are consistent. Add a TerminateSessionHandler function that will extract a Session ID from the request URL, authenticate the user, check that the authenticated user owns the session in question, and terminate the session. Add implementations for our new terminateSession method for the memstore and postgres types. Test both the memstore and postgres implementation of our terminateSession helper in session_test.go.
| paddy@155 | 1 TRUNCATE profiles; |
| paddy@155 | 2 TRUNCATE logins; |
| paddy@155 | 3 TRUNCATE clients; |
| paddy@155 | 4 TRUNCATE endpoints; |
| paddy@155 | 5 TRUNCATE scopes; |
| paddy@155 | 6 TRUNCATE sessions; |
| paddy@155 | 7 TRUNCATE tokens; |
| paddy@155 | 8 TRUNCATE scopes_tokens; |
| paddy@156 | 9 TRUNCATE authorization_codes; |
| paddy@156 | 10 TRUNCATE authorization_codes_scopes; |