Created
September 20, 2023 12:44
-
-
Save anderseknert/9888f1acea67ad4f31ca0b9c10a268ee to your computer and use it in GitHub Desktop.
Helper functions
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
package policy | |
import future.keywords.if | |
default allow := false | |
allow if { | |
idx := indexof(input.user.email, "@") | |
fullname := substring(input.user.email, 0, idx) | |
firstname := lower(split(fullname, ".")[0]) | |
# Allow "joe" and "jane", but not anyone else. How? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment