Skip to content

Commit b02f590

Browse files
wip
1 parent 79203e7 commit b02f590

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/Support/Config.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,30 @@ public static function getResourceKey(): string
2828

2929
public static function getPrivateKey(): string
3030
{
31-
return throw_unless(
31+
$key = throw_unless(
3232
config('cloudfront-cookies.private_key'),
3333
Exception::class
3434
);
35+
36+
if (file_exists($key) && is_readable($key)) {
37+
return file_get_contents($key);
38+
}
39+
40+
return $key;
3541
}
3642

3743
public static function getKeyPairId(): string
3844
{
39-
return throw_unless(
45+
$key = throw_unless(
4046
config('cloudfront-cookies.key_pair_id'),
4147
Exception::class
4248
);
49+
50+
if (file_exists($key) && is_readable($key)) {
51+
return file_get_contents($key);
52+
}
53+
54+
return $key;
4355
}
4456

4557
public static function getExpires()

0 commit comments

Comments
 (0)