Skip to content

Commit

Permalink
feat: add policy bundles for defining max-grant-duration
Browse files Browse the repository at this point in the history
  • Loading branch information
Angie Song committed Feb 13, 2024
1 parent 9771070 commit f7166eb
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions max-grant-duration/1d/.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "roots": ["policy"] }
8 changes: 8 additions & 0 deletions max-grant-duration/1d/policy.rego
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package time

import data.abbey.functions

allow[msg] {
functions.expire_after("24h")
msg := "granting access for 1 day"
}
1 change: 1 addition & 0 deletions max-grant-duration/1h/.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "roots": ["policy"] }
8 changes: 8 additions & 0 deletions max-grant-duration/1h/policy.rego
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package time

import data.abbey.functions

allow[msg] {
functions.expire_after("1h")
msg := "granting access for 1 hour"
}
1 change: 1 addition & 0 deletions max-grant-duration/1w/.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "roots": ["policy"] }
8 changes: 8 additions & 0 deletions max-grant-duration/1w/policy.rego
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package time

import data.abbey.functions

allow[msg] {
functions.expire_after("168h")
msg := "granting access for 1 week"
}
1 change: 1 addition & 0 deletions max-grant-duration/8h/.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "roots": ["policy"] }
8 changes: 8 additions & 0 deletions max-grant-duration/8h/policy.rego
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package time

import data.abbey.functions

allow[msg] {
functions.expire_after("8h")
msg := "granting access for 8 hours"
}

0 comments on commit f7166eb

Please sign in to comment.