Skip to content

Commit ee64191

Browse files
GertvHoutgertvanhouttomcoonen
authored
Rename package
* laravel version * rename * rename * Renames and improvements * Fix styling * CI Improvements * CI Improvements * CI Improvements * CI Improvements * CI Improvements * styling * config * CI Improvements --------- Co-authored-by: gertvanhout <g.vanhout@creacoon.nl> Co-authored-by: Tom Coonen <tom@coonen.eu> Co-authored-by: tomcoonen <tomcoonen@users.noreply.github.com>
1 parent 8f95d92 commit ee64191

16 files changed

+62
-56
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/Oneduo/laravel-cloudfront-cookies/discussions/new?category=q-a
4+
url: https://github.com/creacoon/laravel-cloudfront-cookies/discussions/new?category=q-a
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/Oneduo/laravel-cloudfront-cookies/discussions/new?category=ideas
7+
url: https://github.com/creacoon/laravel-cloudfront-cookies/discussions/new?category=ideas
88
about: Share ideas for new features
99
- name: Report a security issue
10-
url: https://github.com/Oneduo/laravel-cloudfront-cookies/security/policy
10+
url: https://github.com/creacoon/laravel-cloudfront-cookies/security/policy
1111
about: Learn how to notify us for sensitive bugs

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: '8.1'
19+
php-version: '8.3'
2020
coverage: none
2121

2222
- name: Install composer dependencies

.github/workflows/run-tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.2, 8.1]
16+
php: [8.3]
1717
laravel: [10.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
@@ -47,5 +47,9 @@ jobs:
4747
- name: List Installed Dependencies
4848
run: composer show -D
4949

50+
- name: Create private key
51+
run: |
52+
openssl genrsa -out private.key.pem
53+
5054
- name: Execute tests
5155
run: vendor/bin/pest --ci

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ testbench.yaml
1010
vendor
1111
node_modules
1212
*.pem
13+
private.key.pem

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# A tiny utility to generate signed cookies to be used with AWS Cloudfront
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/oneduo/laravel-cloudfront-cookies.svg?style=flat-square)](https://packagist.org/packages/oneduo/laravel-cloudfront-cookies)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/oneduo/laravel-cloudfront-cookies/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/oneduo/laravel-cloudfront-cookies/actions?query=workflow%3Arun-tests+branch%3Amain)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/oneduo/laravel-cloudfront-cookies/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/oneduo/laravel-cloudfront-cookies/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/oneduo/laravel-cloudfront-cookies.svg?style=flat-square)](https://packagist.org/packages/oneduo/laravel-cloudfront-cookies)
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/creacoon/laravel-cloudfront-cookies.svg?style=flat-square)](https://packagist.org/packages/creacoon/laravel-cloudfront-cookies)
4+
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/creacoon/laravel-cloudfront-cookies/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/creacoon/laravel-cloudfront-cookies/actions?query=workflow%3Arun-tests+branch%3Amain)
5+
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/creacoon/laravel-cloudfront-cookies/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/creacoon/laravel-cloudfront-cookies/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/creacoon/laravel-cloudfront-cookies.svg?style=flat-square)](https://packagist.org/packages/creacoon/laravel-cloudfront-cookies)
77

88
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
99

@@ -12,7 +12,7 @@ This is where your description should go. Limit it to a paragraph or two. Consid
1212
You can install the package via composer:
1313

1414
```bash
15-
composer require oneduo/laravel-cloudfront-cookies
15+
composer require creacoon/laravel-cloudfront-cookies
1616
```
1717

1818
You can publish and run the migrations with:
@@ -43,13 +43,15 @@ php artisan vendor:publish --tag="laravel-cloudfront-cookies-views"
4343

4444
## Usage
4545

46-
```php
47-
$laravelCloudfrontCookies = new Oneduo\LaravelCloudfrontCookies();
48-
echo $laravelCloudfrontCookies->echoPhrase('Hello, Oneduo!');
49-
```
46+
Add the middleware to set the cookies needed for AWS CloudFront
5047

5148
## Testing
5249

50+
Generate a private key
51+
```bash
52+
openssl genrsa -out private.key.pem
53+
```
54+
5355
```bash
5456
composer test
5557
```

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "oneduo/laravel-cloudfront-cookies",
2+
"name": "creacoon/laravel-cloudfront-cookies",
33
"description": "A tiny utility to generate signed cookies to be used with AWS Cloudfront",
44
"keywords": [
5-
"Oneduo",
5+
"Creacoon",
66
"laravel",
77
"laravel-cloudfront-cookies"
88
],
9-
"homepage": "https://github.com/oneduo/laravel-cloudfront-cookies",
9+
"homepage": "https://github.com/creacoon/laravel-cloudfront-cookies",
1010
"license": "MIT",
1111
"authors": [
1212
{
@@ -16,15 +16,15 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.1",
19+
"php": "^8.3",
2020
"aws/aws-sdk-php": "^3.275",
21-
"illuminate/contracts": "^10.0",
21+
"illuminate/contracts": "^9.0|^10.0",
2222
"spatie/laravel-package-tools": "^1.14.0"
2323
},
2424
"require-dev": {
25+
"larastan/larastan": "^2.0.1",
2526
"laravel/pint": "^1.0",
2627
"nunomaduro/collision": "^7.9",
27-
"nunomaduro/larastan": "^2.0.1",
2828
"orchestra/testbench": "^8.0",
2929
"pestphp/pest": "^2.0",
3030
"pestphp/pest-plugin-arch": "^2.0",
@@ -36,12 +36,12 @@
3636
},
3737
"autoload": {
3838
"psr-4": {
39-
"Oneduo\\LaravelCloudfrontCookies\\": "src/"
39+
"Creacoon\\LaravelCloudfrontCookies\\": "src/"
4040
}
4141
},
4242
"autoload-dev": {
4343
"psr-4": {
44-
"Oneduo\\LaravelCloudfrontCookies\\Tests\\": "tests/"
44+
"Creacoon\\LaravelCloudfrontCookies\\Tests\\": "tests/"
4545
}
4646
},
4747
"scripts": {
@@ -61,10 +61,10 @@
6161
"extra": {
6262
"laravel": {
6363
"providers": [
64-
"Oneduo\\LaravelCloudfrontCookies\\LaravelCloudfrontCookiesServiceProvider"
64+
"Creacoon\\LaravelCloudfrontCookies\\LaravelCloudfrontCookiesServiceProvider"
6565
],
6666
"aliases": {
67-
"LaravelCloudfrontCookies": "Oneduo\\LaravelCloudfrontCookies\\Facades\\LaravelCloudfrontCookies"
67+
"LaravelCloudfrontCookies": "Creacoon\\LaravelCloudfrontCookies\\Facades\\LaravelCloudfrontCookies"
6868
}
6969
}
7070
},
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
return [
66
'version' => env('CLOUDFRONT_VERSION', 'latest'),
77

8-
'region' => env('CLOUDFRONT_REGION'),
8+
'region' => env('CLOUDFRONT_REGION', 'us-east-1'),
99

1010
'key_pair_id' => env('CLOUDFRONT_KEY_PAIR_ID'),
1111

@@ -20,5 +20,5 @@
2020
'value' => 2,
2121
],
2222

23-
'cookies_domain' => 'localhost',
23+
'cookies_domain' => env('CLOUDFRONT_COOKIES_DOMAIN'),
2424
];

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
backupStaticProperties="false"
1717
>
1818
<testsuites>
19-
<testsuite name="Oneduo Test Suite">
19+
<testsuite name="Creacoon Test Suite">
2020
<directory>tests</directory>
2121
</testsuite>
2222
</testsuites>

src/Facades/LaravelCloudfrontCookies.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
declare(strict_types=1);
44

5-
namespace Oneduo\LaravelCloudfrontCookies\Facades;
5+
namespace Creacoon\LaravelCloudfrontCookies\Facades;
66

77
use Illuminate\Support\Facades\Facade;
88

99
/**
10-
* @see \Oneduo\LaravelCloudfrontCookies\LaravelCloudfrontCookies
10+
* @see \Creacoon\LaravelCloudfrontCookies\LaravelCloudfrontCookies
1111
*
12-
* @method static \Oneduo\LaravelCloudfrontCookies\LaravelCloudfrontCookies resource(string $domain)
13-
* @method static \Oneduo\LaravelCloudfrontCookies\LaravelCloudfrontCookies expiresAt(\Illuminate\Support\Carbon $expires_at)
14-
* @method static \Oneduo\LaravelCloudfrontCookies\LaravelCloudfrontCookies policy(?string $policy = null)
12+
* @method static \Creacoon\LaravelCloudfrontCookies\LaravelCloudfrontCookies resource(string $domain)
13+
* @method static \Creacoon\LaravelCloudfrontCookies\LaravelCloudfrontCookies expiresAt(\Illuminate\Support\Carbon $expires_at)
14+
* @method static \Creacoon\LaravelCloudfrontCookies\LaravelCloudfrontCookies policy(?string $policy = null)
1515
* @method static array get()
1616
*/
1717
class LaravelCloudfrontCookies extends Facade
1818
{
1919
protected static function getFacadeAccessor(): string
2020
{
21-
return \Oneduo\LaravelCloudfrontCookies\LaravelCloudfrontCookies::class;
21+
return \Creacoon\LaravelCloudfrontCookies\LaravelCloudfrontCookies::class;
2222
}
2323
}

src/Http/Middleware/CloudfrontSignedCookiesMiddleware.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
declare(strict_types=1);
44

5-
namespace Oneduo\LaravelCloudfrontCookies\Http\Middleware;
5+
namespace Creacoon\LaravelCloudfrontCookies\Http\Middleware;
66

77
use Carbon\CarbonInterval;
88
use Closure;
9+
use Creacoon\LaravelCloudfrontCookies\Facades\LaravelCloudfrontCookies;
910
use Illuminate\Http\Request;
1011
use Illuminate\Support\Facades\Cookie;
11-
use Oneduo\LaravelCloudfrontCookies\Facades\LaravelCloudfrontCookies;
1212

1313
class CloudfrontSignedCookiesMiddleware
1414
{
@@ -24,10 +24,10 @@ public function handle(Request $request, Closure $next)
2424
return $next($request);
2525
}
2626

27-
$resource = config('cloudfront.resource');
27+
$resource = config('cloudfront-cookies.resource');
2828

29-
$intervalValue = config('cloudfront.cookies_expiration.value');
30-
$intervalUnit = config('cloudfront.cookies_expiration.unit');
29+
$intervalValue = config('cloudfront-cookies.cookies_expiration.value');
30+
$intervalUnit = config('cloudfront-cookies.cookies_expiration.unit');
3131

3232
$interval = CarbonInterval::fromString($intervalValue.$intervalUnit);
3333

@@ -38,7 +38,7 @@ public function handle(Request $request, Closure $next)
3838
->policy()
3939
->get();
4040

41-
$host = config('cloudfront-cookies.cookie_domain');
41+
$host = config('cloudfront-cookies-cookies.cookie_domain');
4242

4343
collect($cookies)->each(function (string $value, string $name) use ($host, $interval) {
4444
$cookie = Cookie::make($name, $value, minutes: (int) $interval->totalMinutes, domain: $host);

0 commit comments

Comments
 (0)