Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
Fix PolicyStament
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed Aug 21, 2019
1 parent 0b1bb0a commit ae86c7d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions all/src/test/scala/net/exoego/CloudfrontSignerTest.scala
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}}}]}"""
)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class PolicyStatements(
class PolicyStatement(
var Resource: String,
var Condition: PolicyStatementCondition
)
) extends js.Object

class PolicyStatementCondition(
var DateLessThan: DateLessThan,
Expand Down

0 comments on commit ae86c7d

Please sign in to comment.