serato/jwt

There is no license information available for the latest version (v3.1.1) of this package.

JWT handling for Serato Web Services

v3.1.1 2024-08-08 04:08 UTC

README

Latest Stable Version

A PHP library containing common functionality for working with JWTs witin Serato Web Services web applications.

Adding to a project via composer.json

To include this library in a PHP project add the following line to the project's composer.json file in the require section:

{
	"require": {
		"serato/jwt": "~1.0"
	}
}

See Packagist for a list of all available versions.

Style guide

Please ensure code adheres to the PHP-FIG PSR-2 Coding Style Guide

Use PHP_CodeSniffer to validate your code against coding standards:

$ ./vendor/bin/phpcs

PHPStan

Use PHPStan for static code analysis:

$ vendor/bin/phpstan analyse

Unit tests

Configuration for PHPUnit is defined within phpunit.xml.

To run tests:

$ php vendor/bin/phpunit

See PHPUnit documentation for more options.

Using Docker to develop this library.

Use the provided docker-compose.yml file to develop this library.

# Run the `php-build` service using the default PHP version (7.1) and remove the container after use.
docker-compose run --rm  php-build

# Provide an alternative PHP version via the PHP_VERSION environment variable.
PHP_VERSION=7.2 docker-compose run --rm  php-build

When Docker Compose runs the container it executes docker.sh.

This script installs some required packages, installs Composer and performs a composer install for this PHP library.

It then opens a bash shell for interacting with the running container.

AWS credentials for integration tests

To run integration tests that interact with AWS services provide an IAM access key and secret via the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.

AWS_ACCESS_KEY_ID=my_key_id AWS_SECRET_ACCESS_KEY=my_key_secret docker-compose run --rm  php-build