Update dependencies (#5518)

This commit is contained in:
hongming
2023-02-12 23:09:20 +08:00
committed by GitHub
parent d3b35fb2da
commit a979342f56
1486 changed files with 126660 additions and 71128 deletions

View File

@@ -164,6 +164,7 @@ var DefaultBuiltins = [...]*Builtin{
ObjectRemove,
ObjectFilter,
ObjectGet,
ObjectKeys,
ObjectSubset,
// JSON Object Manipulation
@@ -194,6 +195,7 @@ var DefaultBuiltins = [...]*Builtin{
ParseNanos,
ParseRFC3339Nanos,
ParseDurationNanos,
Format,
Date,
Clock,
Weekday,
@@ -240,6 +242,10 @@ var DefaultBuiltins = [...]*Builtin{
GraphQLParseQuery,
GraphQLParseSchema,
GraphQLIsValid,
GraphQLSchemaIsValid,
// Cloud Provider Helpers
ProvidersAWSSignReqObj,
// Rego
RegoParseModule,
@@ -260,6 +266,7 @@ var DefaultBuiltins = [...]*Builtin{
NetCIDRExpand,
NetCIDRMerge,
NetLookupIPAddr,
NetCIDRIsValid,
// Glob
GlobMatch,
@@ -1471,7 +1478,9 @@ var JSONRemove = &Builtin{
var JSONPatch = &Builtin{
Name: "json.patch",
Description: "Patches an object according to RFC6902. " +
"For example: `json.patch({\"a\": {\"foo\": 1}}, [{\"op\": \"add\", \"path\": \"/a/bar\", \"value\": 2}])` results in `{\"a\": {\"foo\": 1, \"bar\": 2}`. The patches are applied atomically: if any of them fails, the result will be undefined.",
"For example: `json.patch({\"a\": {\"foo\": 1}}, [{\"op\": \"add\", \"path\": \"/a/bar\", \"value\": 2}])` results in `{\"a\": {\"foo\": 1, \"bar\": 2}`. " +
"The patches are applied atomically: if any of them fails, the result will be undefined. " +
"Additionally works on sets, where a value contained in the set is considered to be its path.",
Decl: types.NewFunction(
types.Args(
types.Named("object", types.A), // TODO(sr): types.A?
@@ -1614,6 +1623,18 @@ var ObjectGet = &Builtin{
),
}
var ObjectKeys = &Builtin{
Name: "object.keys",
Description: "Returns a set of an object's keys. " +
"For example: `object.keys({\"a\": 1, \"b\": true, \"c\": \"d\")` results in `{\"a\", \"b\", \"c\"}`.",
Decl: types.NewFunction(
types.Args(
types.Named("object", types.NewObject(nil, types.NewDynamicProperty(types.A, types.A))).Description("object to get keys from"),
),
types.Named("value", types.NewSet(types.A)).Description("set of `object`'s keys"),
),
}
/*
* Encoding
*/
@@ -2118,12 +2139,27 @@ var ParseDurationNanos = &Builtin{
Description: "Returns the duration in nanoseconds represented by a string.",
Decl: types.NewFunction(
types.Args(
types.Named("duration", types.S).Description("a duration like \"3m\"; seethe [Go `time` package documentation](https://golang.org/pkg/time/#ParseDuration) for more details"),
types.Named("duration", types.S).Description("a duration like \"3m\"; see the [Go `time` package documentation](https://golang.org/pkg/time/#ParseDuration) for more details"),
),
types.Named("ns", types.N).Description("the `duration` in nanoseconds"),
),
}
var Format = &Builtin{
Name: "time.format",
Description: "Returns the formatted timestamp for the nanoseconds since epoch.",
Decl: types.NewFunction(
types.Args(
types.Named("x", types.NewAny(
types.N,
types.NewArray([]types.Type{types.N, types.S}, nil),
types.NewArray([]types.Type{types.N, types.S, types.S}, nil),
)).Description("a number representing the nanoseconds since the epoch (UTC); or a two-element array of the nanoseconds, and a timezone string; or a three-element array of ns, timezone string and a layout string (see golang supported time formats)"),
),
types.Named("formatted timestamp", types.S).Description("the formatted timestamp represented for the nanoseconds since the epoch in the supplied timezone (or UTC)"),
),
}
var Date = &Builtin{
Name: "time.date",
Description: "Returns the `[year, month, day]` for the nanoseconds since epoch.",
@@ -2204,8 +2240,12 @@ var Diff = &Builtin{
*/
var CryptoX509ParseCertificates = &Builtin{
Name: "crypto.x509.parse_certificates",
Description: "Returns one or more certificates from the given base64 encoded string containing DER encoded certificates that have been concatenated.",
Name: "crypto.x509.parse_certificates",
Description: `Returns zero or more certificates from the given encoded string containing
DER certificate data.
If the input is empty, the function will return null. The input string should be a list of one or more
concatenated PEM blocks. The whole input of concatenated PEM blocks can optionally be Base64 encoded.`,
Decl: types.NewFunction(
types.Args(
types.Named("certs", types.S).Description("base64 encoded DER or PEM data containing one or more certificates or a PEM string of one or more certificates"),
@@ -2600,6 +2640,38 @@ var GraphQLIsValid = &Builtin{
),
}
// GraphQLSchemaIsValid returns true if the input is valid GraphQL schema,
// and returns false for all other inputs.
var GraphQLSchemaIsValid = &Builtin{
Name: "graphql.schema_is_valid",
Description: "Checks that the input is a valid GraphQL schema. The schema can be either a GraphQL string or an AST object from the other GraphQL builtin functions.",
Decl: types.NewFunction(
types.Args(
types.Named("schema", types.NewAny(types.S, types.NewObject(nil, types.NewDynamicProperty(types.A, types.A)))),
),
types.Named("output", types.B).Description("`true` if the schema is a valid GraphQL schema. `false` otherwise."),
),
}
/**
* Cloud Provider Helper Functions
*/
var providersAWSCat = category("providers.aws")
var ProvidersAWSSignReqObj = &Builtin{
Name: "providers.aws.sign_req",
Description: "Signs an HTTP request object for Amazon Web Services. Currently implements [AWS Signature Version 4 request signing](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) by the `Authorization` header method.",
Decl: types.NewFunction(
types.Args(
types.Named("request", types.NewObject(nil, types.NewDynamicProperty(types.S, types.A))),
types.Named("aws_config", types.NewObject(nil, types.NewDynamicProperty(types.S, types.A))),
types.Named("time_ns", types.N),
),
types.Named("signed_request", types.NewObject(nil, types.NewDynamicProperty(types.A, types.A))),
),
Categories: providersAWSCat,
}
/**
* Rego
*/
@@ -2771,6 +2843,17 @@ Supports both IPv4 and IPv6 notations. IPv6 inputs need a prefix length (e.g. "/
),
}
var NetCIDRIsValid = &Builtin{
Name: "net.cidr_is_valid",
Description: "Parses an IPv4/IPv6 CIDR and returns a boolean indicating if the provided CIDR is valid.",
Decl: types.NewFunction(
types.Args(
types.Named("cidr", types.S),
),
types.Named("result", types.B),
),
}
var netCidrContainsMatchesOperandType = types.NewAny(
types.S,
types.NewArray(nil, types.NewAny(