Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Php70 compat #1

Merged
merged 72 commits into from
Jan 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
326d8a3
Put classes into namespace, make composer-installable, reformat code …
lordelph Mar 14, 2018
deb9842
Additional documentation / configuration
lordelph Mar 14, 2018
ace584e
Fix phpdoc comments and method call with too many args
lordelph Mar 14, 2018
9d47a43
Add support for PSR-3 logger
lordelph Mar 14, 2018
02c810f
Added first unit test
lordelph Mar 14, 2018
b8cb94c
Corrected minimum php version
lordelph Mar 14, 2018
a43e0b6
Added roadmap notes
lordelph Mar 14, 2018
f529fbb
Fix minor issues reported by Scrutinizer
lordelph Mar 14, 2018
90979db
Fix minor issues reported by Scrutinizer
lordelph Mar 14, 2018
cf27e1e
Fix style
lordelph Mar 14, 2018
5b0af60
Add new exception classes and test coverage for LEFunctions
lordelph Mar 14, 2018
cc4c24d
Correct testing and coverage settings for travis and scrutinizer
lordelph Mar 14, 2018
af5b3fa
Fix logic error found by scrutinizer
lordelph Mar 14, 2018
e4b8e02
Correct phpdoc
lordelph Mar 14, 2018
f0b344c
Reduce complexity of the larger methods
lordelph Mar 14, 2018
5759554
Refactored getCertificate to have a less complex structure
lordelph Mar 14, 2018
dcf57e3
Removed extraneous break
lordelph Mar 14, 2018
76e97f5
Drop curl requirement and add Guzzle
lordelph Mar 17, 2018
ffd9fb5
Add full test coverage for DiagnosticLogger
lordelph Mar 17, 2018
8b30f0b
Bug fix to debug log message
lordelph Mar 17, 2018
268ef59
Refactor LEConnector to use Guzzle to support testing
lordelph Mar 17, 2018
8ae729e
Add LETestCase base class with simulated ACME responses
lordelph Mar 17, 2018
43bf01d
Add support for injectable DNS and Sleep
lordelph Mar 17, 2018
2d639db
Add replaceable Sleep and DNS verification
lordelph Mar 17, 2018
64a2559
Move checkDNSChallenge to LEorder
lordelph Mar 17, 2018
23eee65
Refactor client to better support testing
lordelph Mar 17, 2018
99a780a
Add tool to assist in generating test responses
lordelph Mar 17, 2018
bddc6ad
Removed unused checkDNSChallenge
lordelph Mar 17, 2018
4231ddb
Refactor complexity of initCertificateKeys and initAccountKeys
lordelph Mar 17, 2018
ff4f087
Add test coverage for LEOrder with some refactoring to simplify
lordelph Mar 18, 2018
1af0f10
Reduce complexity of LEOrder
lordelph Mar 18, 2018
67be7a6
Refactor LEORder constructor so that it takes no immediate action, ad…
lordelph Mar 18, 2018
7ed0418
Reduce complexity of LEOrder
lordelph Mar 18, 2018
a000060
Make request() handle ACME request failures better by extracting reason
lordelph Mar 19, 2018
913fe6b
Fix and simplify revokeCertificate, and add unit test
lordelph Mar 19, 2018
1bd9354
Simplfy LEConnector::request
lordelph Mar 19, 2018
9dc7bb8
Clarified aims for logging and exception handling
lordelph Apr 3, 2018
cb625a6
Minor refactoring and improved test coverage of LEAccount
lordelph Apr 3, 2018
ea031f8
Simplified class phpdoc header
lordelph Apr 3, 2018
f6972c5
Simplified and increased test coverage
lordelph Apr 3, 2018
436b9fe
Simplfied phpdoc header
lordelph Apr 3, 2018
715feeb
Improved test coverage
lordelph Apr 3, 2018
046cd94
Add new CertificateStorageInterface and a filesystem implementation
lordelph Apr 23, 2018
ae5ccb9
Add support for DNS over HTTPS and refactor original DNS validator wi…
lordelph Apr 23, 2018
a1b012c
Refactor to use use storage interface and dns validator interface
lordelph Apr 23, 2018
a63c4fb
Add credit for DNS over HTTPS addition
lordelph Apr 23, 2018
0936036
Removed unused member variables
lordelph Apr 23, 2018
a04ce9a
Annotate false-positive scrutinizer warning
lordelph Apr 23, 2018
709e858
Add check for failure to load private key
lordelph Apr 23, 2018
50efcf0
Renamed to PHP Certificate Tools
lordelph Apr 23, 2018
ba1152d
Ensure the order is still valid
mbardelmeijer Jul 28, 2018
0475d18
Clean-up DNSOverHTTPS & add new service provider.
GXTX Jul 30, 2018
855477d
Add tests for DNSOverHTTPS
GXTX Jul 30, 2018
d31b188
Add check for NOERROR DNS response
GXTX Jul 31, 2018
8d83fd3
Merge pull request #3 from GXTX/dohfixes
lordelph Jul 31, 2018
db2d822
Fix line length
mbardelmeijer Aug 1, 2018
d74a1d0
Ensured integration tests are excluded from usual CI tests
lordelph Aug 1, 2018
bb8bd9e
Merge branch 'master' of https://github.com/enflow-nl/php-certificate…
lordelph Aug 1, 2018
3f96865
Make it possible to have other order status in the mock
lordelph Aug 1, 2018
4e425a2
Add test coverage
lordelph Aug 1, 2018
204238a
Merge branch 'enflow-nl-master' into polish
lordelph Aug 1, 2018
4ed11ad
Consolidate functions inside DoH and set-up proper exception handling…
GXTX Aug 1, 2018
dd93fa5
Merge pull request #4 from GXTX/dohfixes
lordelph Aug 1, 2018
cacc7c4
LetsEncrypt API now returns a 200 status for HEAD requests for nonce
mbardelmeijer Jan 28, 2019
1074424
Merge pull request #5 from enflow-nl/master
lordelph Feb 7, 2019
607f580
added certificate directories to gitignore
lordelph Feb 7, 2019
d75ef2b
Corrected test for new nonce return code
lordelph Feb 7, 2019
a0b3d10
Make php70 compatible
Zwartpet Feb 12, 2019
e2e5bc4
Check extra fields
Zwartpet Jan 24, 2020
b1a8a21
Change namespace
Zwartpet Jan 24, 2020
cfdd616
Test php 7.0 and skip some tests for now
Zwartpet Jan 24, 2020
e10d5ce
Update readme's
Zwartpet Jan 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/docs export-ignore
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea
build
composer.lock
vendor
examples/keys
certificates
keys
23 changes: 23 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
filter:
excluded_paths: [tests/*]

checks:
php:
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true

tools:
external_code_coverage:
timeout: 600
runs: 2
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
preset: psr2
34 changes: 34 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
dist: trusty
language: php

php:
- 7.0
- 7.1

# This triggers builds to run on the new TravisCI infrastructure.
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false

## Cache composer
cache:
directories:
- $HOME/.composer/cache

#matrix:
# include:
# - php: 5.6
# env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'

before_script:
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist

script:
- vendor/bin/phpcs --standard=psr2 src/
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
- |
if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' && "$TRAVIS_PHP_VERSION" != '7.0' ]]; then
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
fi
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to `php-certificate-toolbox` will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## 0.1.0

First release after major refactoring of [LEClient](https://github.com/yourivw/leclient)
to be composer installable and testable, as well as support for alternative storage
systems.

74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributor Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at `[email protected]`. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
66 changes: 66 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Contributing

Contributions are **welcome** and will be fully **credited**. This page details how to
contribute and the expected code quality for all contributions.

## Pull Requests

We accept contributions via Pull Requests on [Github](https://github.com/lordelph/php-certificate-toolbox).

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - Check the code style with ``$ composer check-style`` and fix it with ``$ composer fix-style``.

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.

- **Create feature branches** - Don't ask us to pull from your master branch.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.


## Running Tests

``` bash
$ composer test
```

## Exceptions

* All exceptions thrown by code in this package MUST implement `LEClientException`
* Custom exception classes SHOULD derive from standard base exceptions where appropriate
* a `LogicException` SHOULD be used for invalid use of methods or classses which would be
fixable by the developer using the classes
* a `RuntimeException` SHOULD be used for problems which arise from unexpected external
conditions, such as an ACME API failure.
* It is not necessary to add code coverage for runtime exceptions - such code paths SHOULD
be marked with `@codeCoverageIgnoreStart` / `@codeCoverageIgnoreEnd` markers

## Logging

The classes use a PSR-3 compatible logger. The following should be used as a guideline
for appropriate logging levels:

* `debug` is for maintainer use only. If an end-user has an issue, they should be asked to
submit a report which contains a log with debug enabled. This should allow the interactions
with the remote ACME API to be observed.
* `info` should record a general interaction which an outside observer would find interesting,
typically, that a high level method of the main client class has been used.
* `notice` should record some expected change of state, e.g. a new order, new certificate etc
* `warning` should record an unusual but handled problem, e.g. regenerating a private key
* `error` should record an unusual but unhandled problem
* `critical` should record any logic problem where the problem is likely correctable by the
code using these classes. It will usually be followed by a `LogicException`
* `alert` should record unexpected issues arising from ACME API interactions, and will
generally be followed by a `RuntimeException`
* `emergency` should be used only when time is of the essence. This is not presently used
but one example might be failure to renew a certificate when an existing certificate is
known to be expiring soon




**Happy coding**!
27 changes: 27 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- Provide a general summary of the issue in the Title above -->

## Detailed description

Provide a detailed description of the change or addition you are proposing.

Make it clear if the issue is a bug, an enhancement or just a question.

## Context

Why is this change important to you? How would you use it?

How can it benefit other users?

## Possible implementation

Not obligatory, but suggest an idea for implementing addition or change.

## Your environment

Include as many relevant details about the environment you experienced the bug in and how to reproduce it.

* Version used (e.g. PHP 5.6, HHVM 3):
* Operating system and version (e.g. Ubuntu 16.04, Windows 7):
* Link to your project:
* ...
* ...
Loading