Skip to content

Commit 0a2a07c

Browse files
wip
1 parent 4e4bd50 commit 0a2a07c

File tree

3 files changed

+40
-63
lines changed

3 files changed

+40
-63
lines changed

README.md

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,30 @@ This is the contents of the published config file:
3131

3232
```php
3333
return [
34+
/*
35+
|--------------------------------------------------------------------------
36+
| Enabled
37+
|--------------------------------------------------------------------------
38+
|
39+
| Enable or disable CloudFront signed cookies. When disabled, cookies will
40+
| not be set even if the middleware is active.
41+
|
42+
| Default: true
43+
|
44+
*/
45+
'enabled' => env('CLOUDFRONT_ENABLED', true),
46+
3447
/*
3548
|--------------------------------------------------------------------------
3649
| CloudFront API Version
3750
|--------------------------------------------------------------------------
3851
|
3952
| The version of the CloudFront API to use. Use 'latest' for the most
40-
| recent version or specify a specific version like '2020-05-31'.
53+
| recent version.
4154
| Default: 'latest'
4255
|
4356
*/
44-
'version' => env('CLOUDFRONT_VERSION'),
57+
'version' => null,
4558

4659
/*
4760
|--------------------------------------------------------------------------
@@ -53,7 +66,7 @@ return [
5366
| Default: 'us-east-1'
5467
|
5568
*/
56-
'region' => env('CLOUDFRONT_REGION'),
69+
'region' => null,
5770

5871
/*
5972
|--------------------------------------------------------------------------
@@ -74,7 +87,7 @@ return [
7487
|
7588
| The domain for which the signed cookies will be valid. This should
7689
| start with a dot (.) to include all subdomains.
77-
| Example: '.example.com' or '.cloudfront.net'
90+
| Example: '.example.com'
7891
|
7992
*/
8093
'cookie_domain' => env('CLOUDFRONT_COOKIE_DOMAIN'),
@@ -84,8 +97,7 @@ return [
8497
| Private Key
8598
|--------------------------------------------------------------------------
8699
|
87-
| The CloudFront private key used to sign the cookies. This should be
88-
| the full PEM-encoded private key content.
100+
| The CloudFront private key used to sign the cookies.
89101
|
90102
*/
91103
'private_key' => env('CLOUDFRONT_PRIVATE_KEY'),
@@ -96,7 +108,6 @@ return [
96108
|--------------------------------------------------------------------------
97109
|
98110
| The ID of the CloudFront key pair associated with your private key.
99-
| You can find this in the AWS CloudFront console.
100111
|
101112
*/
102113
'key_pair_id' => env('CLOUDFRONT_KEY_PAIR_ID'),
@@ -117,30 +128,8 @@ return [
117128
|
118129
| Default: '1 minutes'
119130
|
120-
| Examples:
121-
| - '30 days'
122-
| - '1 week'
123-
| - '2 hours'
124-
| - '45 minutes'
125-
| - CarbonInterval::make(30, Unit::Day)
126-
| - CarbonInterval::days(30)
127-
| - new DateInterval('P30D')
128-
|
129131
*/
130-
'expiration_interval' => env('CLOUDFRONT_EXPIRATION_INTERVAL'),
131-
132-
/*
133-
|--------------------------------------------------------------------------
134-
| Enabled
135-
|--------------------------------------------------------------------------
136-
|
137-
| Enable or disable CloudFront signed cookies. When disabled, cookies will
138-
| not be set even if the middleware is active.
139-
|
140-
| Default: true
141-
|
142-
*/
143-
'enabled' => env('CLOUDFRONT_ENABLED', true),
132+
'expiration_interval' => null,
144133

145134
/*
146135
|--------------------------------------------------------------------------
@@ -153,7 +142,7 @@ return [
153142
| Default: null (uses default guard)
154143
|
155144
*/
156-
'guard' => env('CLOUDFRONT_GUARD'),
145+
'guard' => null,
157146
];
158147
```
159148

config/cloudfront-cookies.php

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
<?php
22

33
return [
4+
/*
5+
|--------------------------------------------------------------------------
6+
| Enabled
7+
|--------------------------------------------------------------------------
8+
|
9+
| Enable or disable CloudFront signed cookies. When disabled, cookies will
10+
| not be set even if the middleware is active.
11+
|
12+
| Default: true
13+
|
14+
*/
15+
'enabled' => env('CLOUDFRONT_ENABLED', true),
16+
417
/*
518
|--------------------------------------------------------------------------
619
| CloudFront API Version
720
|--------------------------------------------------------------------------
821
|
922
| The version of the CloudFront API to use. Use 'latest' for the most
10-
| recent version or specify a specific version like '2020-05-31'.
23+
| recent version.
1124
| Default: 'latest'
1225
|
1326
*/
14-
'version' => env('CLOUDFRONT_VERSION'),
27+
'version' => null,
1528

1629
/*
1730
|--------------------------------------------------------------------------
@@ -23,7 +36,7 @@
2336
| Default: 'us-east-1'
2437
|
2538
*/
26-
'region' => env('CLOUDFRONT_REGION'),
39+
'region' => null,
2740

2841
/*
2942
|--------------------------------------------------------------------------
@@ -44,7 +57,7 @@
4457
|
4558
| The domain for which the signed cookies will be valid. This should
4659
| start with a dot (.) to include all subdomains.
47-
| Example: '.example.com' or '.cloudfront.net'
60+
| Example: '.example.com'
4861
|
4962
*/
5063
'cookie_domain' => env('CLOUDFRONT_COOKIE_DOMAIN'),
@@ -54,8 +67,7 @@
5467
| Private Key
5568
|--------------------------------------------------------------------------
5669
|
57-
| The CloudFront private key used to sign the cookies. This should be
58-
| the full PEM-encoded private key content.
70+
| The CloudFront private key used to sign the cookies.
5971
|
6072
*/
6173
'private_key' => env('CLOUDFRONT_PRIVATE_KEY'),
@@ -66,7 +78,6 @@
6678
|--------------------------------------------------------------------------
6779
|
6880
| The ID of the CloudFront key pair associated with your private key.
69-
| You can find this in the AWS CloudFront console.
7081
|
7182
*/
7283
'key_pair_id' => env('CLOUDFRONT_KEY_PAIR_ID'),
@@ -87,30 +98,8 @@
8798
|
8899
| Default: '1 minutes'
89100
|
90-
| Examples:
91-
| - '30 days'
92-
| - '1 week'
93-
| - '2 hours'
94-
| - '45 minutes'
95-
| - CarbonInterval::make(30, Unit::Day)
96-
| - CarbonInterval::days(30)
97-
| - new DateInterval('P30D')
98-
|
99101
*/
100-
'expiration_interval' => env('CLOUDFRONT_EXPIRATION_INTERVAL'),
101-
102-
/*
103-
|--------------------------------------------------------------------------
104-
| Enabled
105-
|--------------------------------------------------------------------------
106-
|
107-
| Enable or disable CloudFront signed cookies. When disabled, cookies will
108-
| not be set even if the middleware is active.
109-
|
110-
| Default: true
111-
|
112-
*/
113-
'enabled' => env('CLOUDFRONT_ENABLED', true),
102+
'expiration_interval' => null,
114103

115104
/*
116105
|--------------------------------------------------------------------------
@@ -123,5 +112,5 @@
123112
| Default: null (uses default guard)
124113
|
125114
*/
126-
'guard' => env('CLOUDFRONT_GUARD'),
115+
'guard' => null,
127116
];

src/Support/Config.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public static function getResourceKey(): string
2929

3030
public static function getCookieDomain(): string
3131
{
32-
// TODO: Starts with .
3332
return throw_unless(
3433
config('cloudfront-cookies.cookie_domain'),
3534
Exception::class

0 commit comments

Comments
 (0)