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

2.0 release #15

Merged
merged 6 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 43 additions & 0 deletions .github/workflows/ci-php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PHP Coding Standards

on: [push]

jobs:
phpunit-tests:
name: PHP ${{ matrix.php-version }} Latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
php-version: [ '8.0','8.1','8.2' ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, curl, json, openssl

- name: Print PHP version
run: echo ${{ steps.setup-php.outputs.php-version }}

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer

- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress

- name: Run phpunit tests
run: composer cs-audit
2 changes: 1 addition & 1 deletion .github/workflows/ci-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
php-version: [ '5.6','7.0','7.1','7.2','7.3','7.4' ]
php-version: [ '8.0','8.1','8.2' ]

steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Dockerfile
###> other ###
.idea/
.psalm-cache/
.php-cs-fixer.cache
###> other ###
38 changes: 38 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=1);

/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier <[email protected]>
* Dariusz Rumiński <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

$finder = PhpCsFixer\Finder::create()
->ignoreDotFiles(false)
->ignoreVCSIgnored(true)
->exclude(['dev-tools/phpstan', 'tests/Fixtures'])
->in(__DIR__)
;

$config = new PhpCsFixer\Config();
$config
->setRiskyAllowed(true)
->setRules([
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'@PHPUnit100Migration:risky' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead
'modernize_strpos' => true, // needs PHP 8+ or polyfill
'no_useless_concat_operator' => false,
])
->setFinder($finder)
;

return $config;
22 changes: 0 additions & 22 deletions .php_cs.dist

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.0] - 2023-08-23

- Support PHP 8.0 and above

## [1.4] - 2023-08-14

- Partially updated library and supported PHP versions
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PHP extension for Domain Connect
===============
![GitHub Actions](https://github.com/gaalferov/ext-domain-connect/actions/workflows/ci-phpunit.yml/badge.svg)
![GitHub Actions](https://github.com/gaalferov/ext-domain-connect/actions/workflows/ci-php-cs-fixer.yml/badge.svg)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/1df868212d224c8589005c2e8aee7e45)](https://app.codacy.com/gh/gaalferov/ext-domain-connect/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)

[![PHP version support](https://img.shields.io/packagist/dependency-v/gaalferov/php-ext-domain-connect/php?style=flat)](https://packagist.org/packages/gaalferov/php-ext-domain-connect)
Expand All @@ -14,6 +15,9 @@ Library offers Service Provider functionality in Sync mode.
## Specification reference
https://github.com/Domain-Connect/spec/blob/master/Domain%20Connect%20Spec%20Draft.adoc

## DC Templates
https://github.com/Domain-Connect/Templates/tree/master

## Install
```bash
composer require gaalferov/php-ext-domain-connect
Expand All @@ -34,13 +38,13 @@ use DomainConnect\Services\TemplateService;

try {
$applyUrl = (new TemplateService())->getTemplateSyncUrl(
'foo.connect.domains',
'exampleservice.domainconnect.org',
'template1',
'domainconnect.org', // domain name
'exampleservice.domainconnect.org', // providerId from the template
'template1', // serviceId from the template
[
'IP' => '132.148.25.185',
'RANDOMTEXT' => 'shm:1531371203:Hello world sync',
'redirect_uri' => 'http://example.com',
'redirect_uri' => 'https://your-client-page.com',
'state' => 'someState'
],
);
Expand All @@ -54,7 +58,8 @@ try {

Output:
```text
https://domainconnect.1and1.com/sync/v2/domainTemplates/providers/exampleservice.domainconnect.org/services/template1/apply?domain=connect.domains&host=foo&IP=132.148.25.185&RANDOMTEXT=shm%3A1531371203%3AHello+world+sync&redirect_uri=http%3A%2F%2Fexample.com&state=someState
https://dcc.godaddy.com/manage/v2/domainTemplates/providers/exampleservice.domainconnect.org/services/template1/apply?domain=domainconnect.org&IP=132.148.25.185&RANDOMTEXT=shm%3A1531371203%3AHello+world+sync&redirect_uri=https%3A%2F%2Fyour-client-page.com&state=someState

```

### Sync flow with signed request
Expand All @@ -73,13 +78,13 @@ try {
$keyId = '_dck1';

$applyUrl = $templateService->getTemplateSyncUrl(
'foo.connect.domains',
'exampleservice.domainconnect.org',
'template1',
'domainconnect.org', // domain name
'exampleservice.domainconnect.org', // providerId from the template
'template1', // serviceId from the template
[
'IP' => '132.148.25.185',
'RANDOMTEXT' => 'shm:1531371203:Hello world sync',
'redirect_uri' => 'http://example.com',
'redirect_uri' => 'https://your-client-page.com',
'state' => 'someState'
],
$privateKey,
Expand Down Expand Up @@ -117,7 +122,7 @@ try {
]);

$applyUrl = $templateService->getTemplateSyncUrl(
'foo.connect.domains',
'domainconnect.org',
'exampleservice.domainconnect.org',
'template1',
[
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
}
},
"require": {
"php": "^5.6 || ^7.0",
"php": "^8.0",
"ext-json": "*",
"ext-openssl": "*",
"guzzlehttp/guzzle": "^6.3",
"layershifter/tld-extract": "^2.0"
"guzzlehttp/guzzle": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^5"
"phpunit/phpunit": "^9.0",
"friendsofphp/php-cs-fixer": "^3.0"
},
"scripts": {
"tests": "vendor/bin/phpunit",
"cs-audit": "php-cs-fixer fix -v --diff --dry-run",
"cs-fix": "php-cs-fixer fix -v --diff"
"cs-audit": "vendor/bin/php-cs-fixer fix -v --diff --dry-run",
"cs-fix": "vendor/bin/php-cs-fixer fix -v --diff"
}
}
Loading