Commit Graph

9 Commits

Author SHA1 Message Date
Barnaby Walters ca1819776e Tested SingleUserPasswordAuthCallback, improved ServerTest 2021-06-13 15:24:17 +02:00
Barnaby Walters 74a5797c30 Added pseudocode example 2021-06-13 14:40:53 +02:00
Barnaby Walters 61aa7f55f9 Refactored TokenStorageInterface for an improved flow
* Now passing an auth code data validation callback to the exchange method
* Removed Token, it’s no longer necessary
* Simplified interface where possible
* All tests passing
* Updated docblocks
2021-06-13 14:34:37 +02:00
Barnaby Walters 3881139b95 Refactored Server to validate params in the correct order
* Authorization requests start by validating the client_id and redirect_id, and
  if valid, any further errors are reported by redirecting to the redirect_uri
* Exchange requests attempt to exchange an auth code immediately, ensuring that
  auth codes are revoked if the exchange request results in an error (not in the
  spec explicitly, but advised by aaronpk)
2021-06-12 22:54:08 +02:00
Barnaby Walters c0abe846cd Doc clarifications 2021-06-11 01:33:36 +02:00
Barnaby Walters 196d8a887f Documented Server, both important Interfaces 2021-06-11 01:21:39 +02:00
Barnaby Walters ec27c48946 Reworked TokenStorageInterface, changed JsonStorage
* TokenStorageInterface is now responsible for accessing both auth codes
  and access tokens
* TokenStorageInterface now only defines the methods strictly required
  for IndieAuth to work
* TokenStorageInterface now responsible for generating the auth code,
  making self-encoded codes possible.
* TokenStorageInterface now responsible for token lifetimes, expiry,
  and exchange
* JsonStorage implements new methods, all disk access is wrapped with
  lock acquisition

Tests not yet updated!
2021-06-09 23:46:33 +02:00
Barnaby Walters ed5f43a5e4 Started reworking TokenStorage 2021-06-09 21:56:16 +02:00
Barnaby Walters b111c619d4 Restructured src to use PSR-4 autoloading, moved many functions to functions.php 2021-06-06 15:13:13 +02:00