This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
exoego
committed
Aug 21, 2019
1 parent
0b1bb0a
commit ae86c7d
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package net.exoego | ||
|
||
import facade.amazonaws.AWS | ||
import facade.amazonaws.services.cloudfront.signer | ||
import facade.amazonaws.services.s3 | ||
import org.scalatest._ | ||
|
||
import scala.scalajs.js | ||
|
||
class CloudfrontSignerTest extends FunSuite { | ||
|
||
test("can instantiate") { | ||
val tPolicy = new signer.PolicyStatements( | ||
js.Array( | ||
new signer.PolicyStatement( | ||
Resource = "https://example.com/hoge/*", | ||
Condition = new signer.PolicyStatementCondition( | ||
new signer.DateLessThan(100) | ||
) | ||
) | ||
) | ||
) | ||
assert( | ||
signer.SignerOptionsWithPolicy(tPolicy).policy === """{"Statement":[{"Resource":"https://example.com/hoge/*","Condition":{"DateLessThan":{"AWS:EpochTime":100}}}]}""" | ||
) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters