Skip to content

Commit 6403696

Browse files
committed
feat: Enables easy development via a docker container
1 parent ec80282 commit 6403696

File tree

5 files changed

+36
-4
lines changed

5 files changed

+36
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/.idea/
22
/coverage/
33
/vendor/
4+
hooks
45
.phpunit.result.cache
56
composer.lock
7+
composer.phar
8+
cghooks.lock

README.markdown renamed to README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
HOTP - PHP Based HMAC One Time Passwords
2-
========================================
1+
# HOTP - PHP Based HMAC One Time Passwords
32

43
**What is HOTP**:
54
HOTP is a class that simplifies One Time Password systems for PHP Authentication. The HOTP/TOTP Algorithms have been around for a bit, so this is a straightforward class to meet the test vector requirements.
65

76
**What works with HOTP/TOTP**:
87
It's been tested to the test vectors, and I've verified the time-sync hashes against the following:
98

10-
* Android: Mobile-OTP
11-
* iPhone: OATH Token
9+
- Android: Mobile-OTP
10+
- iPhone: OATH Token
1211

1312
**Why would I use this**:
1413
Who wouldn't love a simple drop-in class for HMAC Based One Time Passwords? It's a great extra layer of security (creating two-factor auth) and it's pretty darn zippy.
@@ -40,3 +39,22 @@ $result->toDec();
4039
// how many digits in your OTP?
4140
$result->toHotp( $length );
4241
```
42+
43+
# Development
44+
45+
In order to support multiple PHP versions, a docker file and compose is available.
46+
47+
To build a php docker image with composer (and dependencies):
48+
49+
```bash
50+
# Bring up the environment, mounts to /app in the container
51+
docker compose up
52+
53+
# Get into the PHP environment
54+
docker compose exec php bash
55+
56+
# Run composer
57+
cd /app
58+
composer install
59+
composer test
60+
```

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "jakobo/hotp-php",
3+
"version": "2.0.0",
34
"description": "HOTP simplifies One Time Password systems for PHP Authentication",
45
"license": "BSD-3-Clause",
56
"authors" : [

dev/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM php:fpm
2+
RUN curl -sS https://getcomposer.org/installer | \
3+
php -- --install-dir=/usr/local/bin --filename=composer
4+
RUN apt-get update
5+
RUN apt install -y git-all unzip

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
php:
3+
build: ./dev
4+
volumes:
5+
- ./:/app

0 commit comments

Comments
 (0)