diff --git a/README.md b/README.md index fea7c0d..ca7af28 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,26 @@ A PSR-7-compatible implementation of the request-handling logic for IndieAuth authorization endpoints and token endpoints. -* [API Documentation](https://taproot.github.io/indieauth/) +* [API Documentation](https://taproot.github.io/indieauth/namespaces/taproot-indieauth.html) * [Code Coverage](https://taproot.github.io/indieauth/coverage/) +## Installation + +taproot/indieauth is currently tested against and compatible with PHP 7.3, 7.4, and 8.0. + +Install taproot/indieauth using [composer](https://getcomposer.org/): + + composer.phar require taproot/indieauth + composer.phar install (or composer.phar update) + +Versioned releases are GPG signed so you can verify that the code hasn’t been tampered with. + + gpg --recv-keys 1C00430B19C6B426922FE534BEF8CE58118AD524 + cd vendor/taproot/indieauth + git tag -v v0.1.0 # Replace with the version you have installed + +## Usage + Typical minimal usage looks something like this: ```php @@ -59,3 +76,11 @@ documentation](https://taproot.github.io/indieauth/namespaces/taproot-indieauth. * [Taproot\IndieAuth\Callback\SingleUserPasswordAuthenticationCallback](https://taproot.github.io/indieauth/classes/Taproot-IndieAuth-Callback-SingleUserPasswordAuthenticationCallback.html) for an example of how to implement an authentication callback, and it’s [corresponding template](https://github.com/Taproot/indieauth/blob/main/templates/single_user_password_authentication_form.html.php) for information on customising the template. * [Taproot\IndieAuth\Storage\TokenStorageInterface](https://taproot.github.io/indieauth/classes/Taproot-IndieAuth-Storage-TokenStorageInterface.html) for details about implementing your own token storage * [Taproot\IndieAuth\Callback\AuthorizationFormInterface](https://taproot.github.io/indieauth/classes/Taproot-IndieAuth-Callback-AuthorizationFormInterface.html) for infomation about implementing your own authorization form. + +### Example Application + +See the [taproot/micropub example app](https://github.com/Taproot/micropub-adapter/tree/main/example) for a working example of how to use taproot/indieauth. + +## Changelog + +* v0.1.0 coming soon! diff --git a/composer.json b/composer.json index 756e601..4234e5f 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,8 @@ "mf2/mf2": "^0.4.6", "barnabywalters/mf-cleaner": "^0.1.4", "guzzlehttp/psr7": "^1.8", - "webmozart/path-util": "^2.3" + "webmozart/path-util": "^2.3", + "php": ">= 7.3.0" }, "require-dev": { "guzzlehttp/guzzle": "^7.3", diff --git a/docs/classes/Taproot-IndieAuth-Callback-DefaultAuthorizationForm.html b/docs/classes/Taproot-IndieAuth-Callback-DefaultAuthorizationForm.html index 6e97e16..60e4ca4 100644 --- a/docs/classes/Taproot-IndieAuth-Callback-DefaultAuthorizationForm.html +++ b/docs/classes/Taproot-IndieAuth-Callback-DefaultAuthorizationForm.html @@ -215,7 +215,7 @@ may make sense to create your own implementation of Au @@ -225,7 +225,8 @@ may make sense to create your own implementation of Au $csrfKey - +
+ @@ -245,7 +246,7 @@ may make sense to create your own implementation of Au @@ -255,7 +256,8 @@ may make sense to create your own implementation of Au $formTemplatePath - +
+ @@ -275,7 +277,7 @@ may make sense to create your own implementation of Au @@ -285,7 +287,8 @@ may make sense to create your own implementation of Au $logger - +
+ @@ -309,7 +312,7 @@ may make sense to create your own implementation of Au

Constructor

@@ -373,7 +376,7 @@ may make sense to create your own implementation of Au @@ -415,7 +418,7 @@ may make sense to create your own implementation of Au

Show Form

@@ -521,7 +524,7 @@ library, but, if stored on the access token, will be available to your app for u

Transform Authorization Code

diff --git a/docs/classes/Taproot-IndieAuth-Callback-SingleUserPasswordAuthenticationCallback.html b/docs/classes/Taproot-IndieAuth-Callback-SingleUserPasswordAuthenticationCallback.html index df48cff..37cb4a2 100644 --- a/docs/classes/Taproot-IndieAuth-Callback-SingleUserPasswordAuthenticationCallback.html +++ b/docs/classes/Taproot-IndieAuth-Callback-SingleUserPasswordAuthenticationCallback.html @@ -321,7 +321,7 @@ $server = new IndieAuth\Server([ @@ -331,7 +331,8 @@ $server = new IndieAuth\Server([ $csrfKey
- +
+ @@ -351,7 +352,7 @@ $server = new IndieAuth\Server([ @@ -361,7 +362,8 @@ $server = new IndieAuth\Server([ $formTemplate
- +
+ @@ -381,7 +383,7 @@ $server = new IndieAuth\Server([ @@ -391,7 +393,8 @@ $server = new IndieAuth\Server([ $hashedPassword
- +
+ @@ -411,7 +414,7 @@ $server = new IndieAuth\Server([ @@ -421,7 +424,8 @@ $server = new IndieAuth\Server([ $secret
- +
+ @@ -441,7 +445,7 @@ $server = new IndieAuth\Server([ @@ -451,7 +455,8 @@ $server = new IndieAuth\Server([ $ttl
- +
+ @@ -471,7 +476,7 @@ $server = new IndieAuth\Server([ @@ -481,7 +486,8 @@ $server = new IndieAuth\Server([ $user
- +
+ @@ -505,7 +511,7 @@ $server = new IndieAuth\Server([

Constructor

@@ -596,7 +602,7 @@ $server = new IndieAuth\Server([ diff --git a/docs/classes/Taproot-IndieAuth-IndieAuthException.html b/docs/classes/Taproot-IndieAuth-IndieAuthException.html index b6ac752..bba07a5 100644 --- a/docs/classes/Taproot-IndieAuth-IndieAuthException.html +++ b/docs/classes/Taproot-IndieAuth-IndieAuthException.html @@ -739,7 +739,7 @@ @@ -749,7 +749,8 @@ $request - +
+ @@ -773,7 +774,7 @@ @@ -829,7 +830,7 @@ @@ -861,7 +862,7 @@ @@ -893,7 +894,7 @@ @@ -925,7 +926,7 @@ @@ -957,7 +958,7 @@

Trust Query Params

diff --git a/docs/classes/Taproot-IndieAuth-Middleware-ClosureRequestHandler.html b/docs/classes/Taproot-IndieAuth-Middleware-ClosureRequestHandler.html index 1f46dda..8fb60e0 100644 --- a/docs/classes/Taproot-IndieAuth-Middleware-ClosureRequestHandler.html +++ b/docs/classes/Taproot-IndieAuth-Middleware-ClosureRequestHandler.html @@ -178,7 +178,7 @@ @@ -188,7 +188,8 @@ $args - +
+ @@ -242,7 +243,7 @@ @@ -284,7 +285,7 @@ diff --git a/docs/classes/Taproot-IndieAuth-Middleware-DoubleSubmitCookieCsrfMiddleware.html b/docs/classes/Taproot-IndieAuth-Middleware-DoubleSubmitCookieCsrfMiddleware.html index 7a03a52..ee14c6c 100644 --- a/docs/classes/Taproot-IndieAuth-Middleware-DoubleSubmitCookieCsrfMiddleware.html +++ b/docs/classes/Taproot-IndieAuth-Middleware-DoubleSubmitCookieCsrfMiddleware.html @@ -413,7 +413,7 @@ about customising the error response.

@@ -423,7 +423,8 @@ about customising the error response.

$attribute - +
+ @@ -443,7 +444,7 @@ about customising the error response.

@@ -473,7 +474,7 @@ about customising the error response.

@@ -483,7 +484,8 @@ about customising the error response.

$logger - +
+ @@ -503,7 +505,7 @@ about customising the error response.

@@ -513,7 +515,8 @@ about customising the error response.

$tokenLength - +
+ @@ -533,7 +536,7 @@ about customising the error response.

@@ -543,7 +546,8 @@ about customising the error response.

$ttl - +
+ @@ -567,7 +571,7 @@ about customising the error response.

Constructor

@@ -647,7 +651,7 @@ the return value of which will be returned as-is. @@ -696,7 +700,7 @@ the return value of which will be returned as-is. @@ -738,7 +742,7 @@ the return value of which will be returned as-is. diff --git a/docs/classes/Taproot-IndieAuth-Middleware-ResponseRequestHandler.html b/docs/classes/Taproot-IndieAuth-Middleware-ResponseRequestHandler.html index ecc0818..dbb795e 100644 --- a/docs/classes/Taproot-IndieAuth-Middleware-ResponseRequestHandler.html +++ b/docs/classes/Taproot-IndieAuth-Middleware-ResponseRequestHandler.html @@ -171,7 +171,7 @@ @@ -181,7 +181,8 @@ $response - +
+ @@ -205,7 +206,7 @@ @@ -247,7 +248,7 @@ diff --git a/docs/classes/Taproot-IndieAuth-Server.html b/docs/classes/Taproot-IndieAuth-Server.html index fa1f7e8..ae0754d 100644 --- a/docs/classes/Taproot-IndieAuth-Server.html +++ b/docs/classes/Taproot-IndieAuth-Server.html @@ -525,7 +525,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 105 + 107 @@ -535,7 +535,8 @@ documentation for both handling methods for further documentation about them.

$authorizationForm - +
+ @@ -555,7 +556,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 107 + 110 @@ -565,7 +566,8 @@ documentation for both handling methods for further documentation about them.

$csrfMiddleware - +
+ @@ -585,7 +587,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 120 + 125 @@ -595,7 +597,8 @@ documentation for both handling methods for further documentation about them.

$exceptionTemplatePath - +
+ @@ -615,7 +618,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 115 + 119 @@ -646,7 +649,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 118 + 122 @@ -677,7 +680,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 112 + 116 @@ -708,7 +711,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 109 + 113 @@ -718,7 +721,8 @@ documentation for both handling methods for further documentation about them.

$logger - +
+ @@ -738,7 +742,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 124 + 131 @@ -748,7 +752,8 @@ documentation for both handling methods for further documentation about them.

$requirePkce - +
+ @@ -768,7 +773,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 122 + 128 @@ -778,7 +783,8 @@ documentation for both handling methods for further documentation about them.

$secret - +
+ @@ -798,7 +804,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 103 + 104 @@ -808,7 +814,8 @@ documentation for both handling methods for further documentation about them.

$tokenStorage - +
+ @@ -832,7 +839,7 @@ documentation for both handling methods for further documentation about them.

Server.php : - 201 + 208

Constructor

@@ -961,7 +968,7 @@ these old authorization codes will no longer be redeemable. @@ -993,7 +1000,7 @@ these old authorization codes will no longer be redeemable.

Handle Authorization Endpoint Request

@@ -1068,7 +1075,7 @@ error behaviour, one way to do so is to subclass Serve

Handle Token Endpoint Request

@@ -1124,7 +1131,7 @@ error behaviour, one way to do so is to subclass Serve

Handle Exception

diff --git a/docs/classes/Taproot-IndieAuth-Storage-FilesystemJsonStorage.html b/docs/classes/Taproot-IndieAuth-Storage-FilesystemJsonStorage.html index bc22e89..17031f6 100644 --- a/docs/classes/Taproot-IndieAuth-Storage-FilesystemJsonStorage.html +++ b/docs/classes/Taproot-IndieAuth-Storage-FilesystemJsonStorage.html @@ -389,7 +389,7 @@ will likely be superceded by the SQLite version.

@@ -399,7 +399,8 @@ will likely be superceded by the SQLite version.

$accessTokenTtl
- +
+ @@ -419,7 +420,7 @@ will likely be superceded by the SQLite version.

@@ -429,7 +430,8 @@ will likely be superceded by the SQLite version.

$authCodeTtl
- +
+ @@ -449,7 +451,7 @@ will likely be superceded by the SQLite version.

@@ -459,7 +461,8 @@ will likely be superceded by the SQLite version.

$logger - +
+ @@ -479,7 +482,7 @@ will likely be superceded by the SQLite version.

@@ -489,7 +492,8 @@ will likely be superceded by the SQLite version.

$path - +
+ @@ -509,7 +513,7 @@ will likely be superceded by the SQLite version.

@@ -519,7 +523,8 @@ will likely be superceded by the SQLite version.

$secret - +
+ @@ -543,7 +548,7 @@ will likely be superceded by the SQLite version.

@@ -620,7 +625,7 @@ will likely be superceded by the SQLite version.

Create Authorization Code

@@ -705,7 +710,7 @@ throw exceptions.

@@ -754,7 +759,7 @@ throw exceptions.

@@ -786,7 +791,7 @@ throw exceptions.

Exchange Authorization Code for Access Token

@@ -906,7 +911,7 @@ reference.

@@ -948,7 +953,7 @@ reference.

Get Access Token

@@ -994,7 +999,7 @@ null if it is expired or invalid.

@@ -1036,7 +1041,7 @@ null if it is expired or invalid.

@@ -1085,7 +1090,7 @@ null if it is expired or invalid.

Revoke Access Token

@@ -1131,7 +1136,7 @@ or false on error, including if the token did not exist.

@@ -1173,7 +1178,7 @@ or false on error, including if the token did not exist.

@@ -1215,7 +1220,7 @@ or false on error, including if the token did not exist.