This file contains hidden or 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
// Copyright 2017 The OPA Authors. All rights reserved. | |
// Use of this source code is governed by an Apache2 | |
// license that can be found in the LICENSE file. | |
package topdown | |
import ( | |
"crypto" | |
"crypto/ecdsa" | |
"crypto/hmac" |
This file contains hidden or 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
func BenchmarkBuiltinContextCopyCost(b *testing.B) { | |
b.Run("withBctx", func(b *testing.B) { | |
b.ResetTimer() | |
b.ReportAllocs() | |
for range b.N { | |
bctx := BuiltinContext{} | |
withBctx(bctx, "bctx") | |
} |
This file contains hidden or 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 main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"os" | |
"github.com/open-policy-agent/opa/v1/ast" | |
"github.com/open-policy-agent/opa/v1/format" |
This file contains hidden or 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": { | |
"location": "1:1:1:8", | |
"path": [ | |
{ | |
"type": "var", | |
"value": "data" | |
}, | |
{ | |
"location": "1:9:1:14", |
This file contains hidden or 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
version: 2 | |
updates: | |
- package-ecosystem: "github-actions" | |
directory: "/" | |
schedule: | |
interval: "weekly" | |
groups: | |
dependencies: | |
patterns: | |
- "*" |
This file contains hidden or 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 google_sql_database_instance | |
import rego.v1 | |
violations contains db_instance.id if { | |
some db_instance in input.google_sql_database_instance | |
not valid_db_instance(db_instance) | |
} | |
valid_db_instance(db_instance) if every setting in db_instance.config.settings { |
This file contains hidden or 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 accurics | |
import rego.v1 | |
violations contains db_instance.id if { | |
some db_instance in input.google_sql_database_instance | |
some setting in db_instance.config.settings | |
invalid_db_instance_setting(setting) | |
} |
This file contains hidden or 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
arr := [x | some x in input.my_array] |
This file contains hidden or 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
arr = my_array || [] |
This file contains hidden or 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
allow if { | |
# return input.user.name, or "anyomous" if the lookup fails | |
user := object.get(input, ["user", "name"], "anonymous") | |
user != "anonymous" | |
# ... more conditions | |
} |
NewerOlder