diff --git a/.ci-operator.yaml b/.ci-operator.yaml
index e4a575ddc..ad52b8dee 100644
--- a/.ci-operator.yaml
+++ b/.ci-operator.yaml
@@ -1,4 +1,4 @@
build_root_image:
name: builder
namespace: ocp
- tag: rhel-9-golang-1.24-openshift-4.20
\ No newline at end of file
+ tag: rhel-9-golang-1.25-openshift-4.21
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 7e1338988..e5390006e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
# Build the external-secrets-operator binary
-FROM docker.io/golang:1.24 AS builder
+FROM docker.io/golang:1.25 AS builder
ARG TARGETOS
ARG TARGETARCH
diff --git a/Makefile b/Makefile
index 7b33de677..309667dc9 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,10 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
-VERSION ?= 1.0.0
+VERSION ?= 1.1.0
# EXTERNAL_SECRETS_VERSION defines the external-secrets release version to fetch helm charts.
-EXTERNAL_SECRETS_VERSION ?= v0.19.0
+EXTERNAL_SECRETS_VERSION ?= v0.20.4
# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
diff --git a/bindata/external-secrets/resources/certificate_external-secrets-webhook.yml b/bindata/external-secrets/resources/certificate_external-secrets-webhook.yml
index d3e171dd0..eeaa3c6dc 100644
--- a/bindata/external-secrets/resources/certificate_external-secrets-webhook.yml
+++ b/bindata/external-secrets/resources/certificate_external-secrets-webhook.yml
@@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
external-secrets.io/component: webhook
spec:
diff --git a/bindata/external-secrets/resources/clusterrole_external-secrets-cert-controller.yml b/bindata/external-secrets/resources/clusterrole_external-secrets-cert-controller.yml
index a4882413e..ee6e6e41e 100644
--- a/bindata/external-secrets/resources/clusterrole_external-secrets-cert-controller.yml
+++ b/bindata/external-secrets/resources/clusterrole_external-secrets-cert-controller.yml
@@ -6,7 +6,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rules:
- apiGroups:
@@ -45,6 +45,14 @@ rules:
- "list"
- "get"
- "watch"
+ - apiGroups:
+ - "discovery.k8s.io"
+ resources:
+ - "endpointslices"
+ verbs:
+ - "list"
+ - "get"
+ - "watch"
- apiGroups:
- ""
resources:
diff --git a/bindata/external-secrets/resources/clusterrole_external-secrets-controller.yml b/bindata/external-secrets/resources/clusterrole_external-secrets-controller.yml
index 2716f9869..1e79ddfc2 100644
--- a/bindata/external-secrets/resources/clusterrole_external-secrets-controller.yml
+++ b/bindata/external-secrets/resources/clusterrole_external-secrets-controller.yml
@@ -6,7 +6,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rules:
- apiGroups:
@@ -64,6 +64,7 @@ rules:
- "generators.external-secrets.io"
resources:
- "acraccesstokens"
+ - "cloudsmithaccesstokens"
- "clustergenerators"
- "ecrauthorizationtokens"
- "fakes"
@@ -91,6 +92,13 @@ rules:
- "get"
- "list"
- "watch"
+ - apiGroups:
+ - ""
+ resources:
+ - "namespaces"
+ verbs:
+ - "update"
+ - "patch"
- apiGroups:
- ""
resources:
diff --git a/bindata/external-secrets/resources/clusterrole_external-secrets-edit.yml b/bindata/external-secrets/resources/clusterrole_external-secrets-edit.yml
index 5118579d6..833ca506c 100644
--- a/bindata/external-secrets/resources/clusterrole_external-secrets-edit.yml
+++ b/bindata/external-secrets/resources/clusterrole_external-secrets-edit.yml
@@ -6,7 +6,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
@@ -29,6 +29,7 @@ rules:
- "generators.external-secrets.io"
resources:
- "acraccesstokens"
+ - "cloudsmithaccesstokens"
- "clustergenerators"
- "ecrauthorizationtokens"
- "fakes"
diff --git a/bindata/external-secrets/resources/clusterrole_external-secrets-servicebindings.yml b/bindata/external-secrets/resources/clusterrole_external-secrets-servicebindings.yml
index 7e2623360..048dc25a0 100644
--- a/bindata/external-secrets/resources/clusterrole_external-secrets-servicebindings.yml
+++ b/bindata/external-secrets/resources/clusterrole_external-secrets-servicebindings.yml
@@ -7,7 +7,7 @@ metadata:
servicebinding.io/controller: "true"
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rules:
- apiGroups:
diff --git a/bindata/external-secrets/resources/clusterrole_external-secrets-view.yml b/bindata/external-secrets/resources/clusterrole_external-secrets-view.yml
index b3ae76df7..babf0f8a0 100644
--- a/bindata/external-secrets/resources/clusterrole_external-secrets-view.yml
+++ b/bindata/external-secrets/resources/clusterrole_external-secrets-view.yml
@@ -6,7 +6,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rbac.authorization.k8s.io/aggregate-to-view: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
@@ -28,6 +28,7 @@ rules:
- "generators.external-secrets.io"
resources:
- "acraccesstokens"
+ - "cloudsmithaccesstokens"
- "clustergenerators"
- "ecrauthorizationtokens"
- "fakes"
diff --git a/bindata/external-secrets/resources/clusterrolebinding_external-secrets-cert-controller.yml b/bindata/external-secrets/resources/clusterrolebinding_external-secrets-cert-controller.yml
index 1fd2686bc..d0e4c1f45 100644
--- a/bindata/external-secrets/resources/clusterrolebinding_external-secrets-cert-controller.yml
+++ b/bindata/external-secrets/resources/clusterrolebinding_external-secrets-cert-controller.yml
@@ -6,7 +6,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
diff --git a/bindata/external-secrets/resources/clusterrolebinding_external-secrets-controller.yml b/bindata/external-secrets/resources/clusterrolebinding_external-secrets-controller.yml
index 5d238ab9e..b8bc0f3ed 100644
--- a/bindata/external-secrets/resources/clusterrolebinding_external-secrets-controller.yml
+++ b/bindata/external-secrets/resources/clusterrolebinding_external-secrets-controller.yml
@@ -6,7 +6,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
diff --git a/bindata/external-secrets/resources/deployment_bitwarden-sdk-server.yml b/bindata/external-secrets/resources/deployment_bitwarden-sdk-server.yml
index 58342f011..b6767daff 100644
--- a/bindata/external-secrets/resources/deployment_bitwarden-sdk-server.yml
+++ b/bindata/external-secrets/resources/deployment_bitwarden-sdk-server.yml
@@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: bitwarden-sdk-server
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.5.0"
+ app.kubernetes.io/version: "v0.5.1"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
replicas: 1
@@ -26,7 +26,7 @@ spec:
containers:
- name: bitwarden-sdk-server
securityContext: {}
- image: "ghcr.io/external-secrets/bitwarden-sdk-server:v0.5.0"
+ image: "ghcr.io/external-secrets/bitwarden-sdk-server:v0.5.1"
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /certs
diff --git a/bindata/external-secrets/resources/deployment_external-secrets-cert-controller.yml b/bindata/external-secrets/resources/deployment_external-secrets-cert-controller.yml
index 0c61b1a44..d3c3b43ee 100644
--- a/bindata/external-secrets/resources/deployment_external-secrets-cert-controller.yml
+++ b/bindata/external-secrets/resources/deployment_external-secrets-cert-controller.yml
@@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
replicas: 1
@@ -21,7 +21,7 @@ spec:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
serviceAccountName: external-secrets-cert-controller
@@ -39,7 +39,7 @@ spec:
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
- image: oci.external-secrets.io/external-secrets/external-secrets:v0.19.0
+ image: oci.external-secrets.io/external-secrets/external-secrets:v0.20.4
imagePullPolicy: IfNotPresent
args:
- certcontroller
diff --git a/bindata/external-secrets/resources/deployment_external-secrets-webhook.yml b/bindata/external-secrets/resources/deployment_external-secrets-webhook.yml
index 9159ab401..2f98e7d40 100644
--- a/bindata/external-secrets/resources/deployment_external-secrets-webhook.yml
+++ b/bindata/external-secrets/resources/deployment_external-secrets-webhook.yml
@@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
replicas: 1
@@ -21,7 +21,7 @@ spec:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
hostNetwork: false
@@ -39,7 +39,7 @@ spec:
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
- image: oci.external-secrets.io/external-secrets/external-secrets:v0.19.0
+ image: oci.external-secrets.io/external-secrets/external-secrets:v0.20.4
imagePullPolicy: IfNotPresent
args:
- webhook
diff --git a/bindata/external-secrets/resources/deployment_external-secrets.yml b/bindata/external-secrets/resources/deployment_external-secrets.yml
index ed742cead..12b89538b 100644
--- a/bindata/external-secrets/resources/deployment_external-secrets.yml
+++ b/bindata/external-secrets/resources/deployment_external-secrets.yml
@@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
replicas: 1
@@ -21,7 +21,7 @@ spec:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
serviceAccountName: external-secrets
@@ -39,7 +39,7 @@ spec:
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
- image: oci.external-secrets.io/external-secrets/external-secrets:v0.19.0
+ image: oci.external-secrets.io/external-secrets/external-secrets:v0.20.4
imagePullPolicy: IfNotPresent
args:
- --concurrent=1
diff --git a/bindata/external-secrets/resources/role_external-secrets-leaderelection.yml b/bindata/external-secrets/resources/role_external-secrets-leaderelection.yml
index e960cc8f3..86f68cf2b 100644
--- a/bindata/external-secrets/resources/role_external-secrets-leaderelection.yml
+++ b/bindata/external-secrets/resources/role_external-secrets-leaderelection.yml
@@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rules:
- apiGroups:
diff --git a/bindata/external-secrets/resources/rolebinding_external-secrets-leaderelection.yml b/bindata/external-secrets/resources/rolebinding_external-secrets-leaderelection.yml
index 6cb674463..ff59d0a9a 100644
--- a/bindata/external-secrets/resources/rolebinding_external-secrets-leaderelection.yml
+++ b/bindata/external-secrets/resources/rolebinding_external-secrets-leaderelection.yml
@@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
diff --git a/bindata/external-secrets/resources/secret_external-secrets-webhook.yml b/bindata/external-secrets/resources/secret_external-secrets-webhook.yml
index 741680a9a..096322b3e 100644
--- a/bindata/external-secrets/resources/secret_external-secrets-webhook.yml
+++ b/bindata/external-secrets/resources/secret_external-secrets-webhook.yml
@@ -7,6 +7,6 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
external-secrets.io/component: webhook
diff --git a/bindata/external-secrets/resources/service_bitwarden-sdk-server.yml b/bindata/external-secrets/resources/service_bitwarden-sdk-server.yml
index 016230d22..65d8df545 100644
--- a/bindata/external-secrets/resources/service_bitwarden-sdk-server.yml
+++ b/bindata/external-secrets/resources/service_bitwarden-sdk-server.yml
@@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: bitwarden-sdk-server
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.5.0"
+ app.kubernetes.io/version: "v0.5.1"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
type: ClusterIP
diff --git a/bindata/external-secrets/resources/service_external-secrets-cert-controller-metrics.yml b/bindata/external-secrets/resources/service_external-secrets-cert-controller-metrics.yml
index b20e59f13..733f197bc 100644
--- a/bindata/external-secrets/resources/service_external-secrets-cert-controller-metrics.yml
+++ b/bindata/external-secrets/resources/service_external-secrets-cert-controller-metrics.yml
@@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
type: ClusterIP
diff --git a/bindata/external-secrets/resources/service_external-secrets-metrics.yml b/bindata/external-secrets/resources/service_external-secrets-metrics.yml
index 82a3e1aea..1d4a32eb5 100644
--- a/bindata/external-secrets/resources/service_external-secrets-metrics.yml
+++ b/bindata/external-secrets/resources/service_external-secrets-metrics.yml
@@ -7,7 +7,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
type: ClusterIP
diff --git a/bindata/external-secrets/resources/service_external-secrets-webhook.yml b/bindata/external-secrets/resources/service_external-secrets-webhook.yml
index f04625757..f1c859fd5 100644
--- a/bindata/external-secrets/resources/service_external-secrets-webhook.yml
+++ b/bindata/external-secrets/resources/service_external-secrets-webhook.yml
@@ -7,14 +7,14 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
external-secrets.io/component: webhook
spec:
type: ClusterIP
ports:
- port: 443
- targetPort: 10250
+ targetPort: webhook
protocol: TCP
name: webhook
- port: 8080
diff --git a/bindata/external-secrets/resources/serviceaccount_bitwarden-sdk-server.yml b/bindata/external-secrets/resources/serviceaccount_bitwarden-sdk-server.yml
index ba231426e..253eaba52 100644
--- a/bindata/external-secrets/resources/serviceaccount_bitwarden-sdk-server.yml
+++ b/bindata/external-secrets/resources/serviceaccount_bitwarden-sdk-server.yml
@@ -7,5 +7,5 @@ metadata:
labels:
app.kubernetes.io/name: bitwarden-sdk-server
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.5.0"
+ app.kubernetes.io/version: "v0.5.1"
app.kubernetes.io/managed-by: external-secrets-operator
diff --git a/bindata/external-secrets/resources/serviceaccount_external-secrets-cert-controller.yml b/bindata/external-secrets/resources/serviceaccount_external-secrets-cert-controller.yml
index b84042539..fe142531a 100644
--- a/bindata/external-secrets/resources/serviceaccount_external-secrets-cert-controller.yml
+++ b/bindata/external-secrets/resources/serviceaccount_external-secrets-cert-controller.yml
@@ -7,5 +7,5 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
diff --git a/bindata/external-secrets/resources/serviceaccount_external-secrets-webhook.yml b/bindata/external-secrets/resources/serviceaccount_external-secrets-webhook.yml
index 5f47a4f3d..ba7a3c332 100644
--- a/bindata/external-secrets/resources/serviceaccount_external-secrets-webhook.yml
+++ b/bindata/external-secrets/resources/serviceaccount_external-secrets-webhook.yml
@@ -7,5 +7,5 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
diff --git a/bindata/external-secrets/resources/serviceaccount_external-secrets.yml b/bindata/external-secrets/resources/serviceaccount_external-secrets.yml
index e3e3d34c2..fdf2350c0 100644
--- a/bindata/external-secrets/resources/serviceaccount_external-secrets.yml
+++ b/bindata/external-secrets/resources/serviceaccount_external-secrets.yml
@@ -7,5 +7,5 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
diff --git a/bindata/external-secrets/resources/validatingwebhookconfiguration_externalsecret-validate.yml b/bindata/external-secrets/resources/validatingwebhookconfiguration_externalsecret-validate.yml
index 046fc9fc9..df3493e8a 100644
--- a/bindata/external-secrets/resources/validatingwebhookconfiguration_externalsecret-validate.yml
+++ b/bindata/external-secrets/resources/validatingwebhookconfiguration_externalsecret-validate.yml
@@ -6,7 +6,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
external-secrets.io/component: webhook
webhooks:
diff --git a/bindata/external-secrets/resources/validatingwebhookconfiguration_secretstore-validate.yml b/bindata/external-secrets/resources/validatingwebhookconfiguration_secretstore-validate.yml
index 131099b3d..031a7f347 100644
--- a/bindata/external-secrets/resources/validatingwebhookconfiguration_secretstore-validate.yml
+++ b/bindata/external-secrets/resources/validatingwebhookconfiguration_secretstore-validate.yml
@@ -6,7 +6,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
external-secrets.io/component: webhook
webhooks:
diff --git a/bundle/manifests/external-secrets-operator.clusterserviceversion.yaml b/bundle/manifests/external-secrets-operator.clusterserviceversion.yaml
index 248dd2177..3f076ee39 100644
--- a/bundle/manifests/external-secrets-operator.clusterserviceversion.yaml
+++ b/bundle/manifests/external-secrets-operator.clusterserviceversion.yaml
@@ -231,7 +231,7 @@ metadata:
features.operators.openshift.io/token-auth-aws: "false"
features.operators.openshift.io/token-auth-azure: "false"
features.operators.openshift.io/token-auth-gcp: "false"
- olm.skipRange: <1.0.0
+ olm.skipRange: <1.1.0
operator.openshift.io/uninstall-message: The External Secrets Operator for Red
Hat OpenShift will be removed from external-secrets-operator namespace. If your
Operator configured any off-cluster resources, these will continue to run and
@@ -252,7 +252,7 @@ metadata:
operatorframework.io/arch.ppc64le: supported
operatorframework.io/arch.s390x: supported
operatorframework.io/os.linux: supported
- name: external-secrets-operator.v1.0.0
+ name: external-secrets-operator.v1.1.0
namespace: placeholder
spec:
apiservicedefinitions: {}
@@ -442,11 +442,21 @@ spec:
- ""
resources:
- endpoints
+ verbs:
+ - create
+ - get
+ - list
+ - watch
+ - apiGroups:
+ - ""
+ resources:
- namespaces
verbs:
- create
- get
- list
+ - patch
+ - update
- watch
- apiGroups:
- ""
@@ -510,6 +520,14 @@ spec:
- patch
- update
- watch
+ - apiGroups:
+ - discovery.k8s.io
+ resources:
+ - endpointslices
+ verbs:
+ - get
+ - list
+ - watch
- apiGroups:
- external-secrets.io
resources:
@@ -551,6 +569,7 @@ spec:
- generators.external-secrets.io
resources:
- acraccesstokens
+ - cloudsmithaccesstokens
- clustergenerators
- ecrauthorizationtokens
- fakes
@@ -818,4 +837,4 @@ spec:
name: external-secrets
- image: ghcr.io/external-secrets/bitwarden-sdk-server:v0.5.1
name: bitwarden-sdk-server
- version: 1.0.0
+ version: 1.1.0
diff --git a/bundle/manifests/external-secrets.io_clusterexternalsecrets.yaml b/bundle/manifests/external-secrets.io_clusterexternalsecrets.yaml
index 5a9ce34e6..eaed73a2e 100644
--- a/bundle/manifests/external-secrets.io_clusterexternalsecrets.yaml
+++ b/bundle/manifests/external-secrets.io_clusterexternalsecrets.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -163,6 +163,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -217,6 +218,9 @@ spec:
DataFrom is used to fetch all properties from a specific Provider data
If multiple entries are specified, the Secret keys are merged in the specified order
items:
+ description: |-
+ ExternalSecretDataFromRemoteRef defines the connection between the Kubernetes Secret keys and the Provider data
+ when using DataFrom to fetch multiple values from a Provider.
properties:
extract:
description: |-
@@ -304,6 +308,8 @@ spec:
Used to rewrite secret Keys after getting them from the secret Provider
Multiple Rewrite operations can be provided. They are applied in a layered order (first to last)
items:
+ description: ExternalSecretRewrite defines how to rewrite
+ secret data values before they are written to the Secret.
maxProperties: 1
minProperties: 1
properties:
@@ -316,6 +322,9 @@ spec:
default: Error
description: Used to define the policy to use
in conflict resolution.
+ enum:
+ - Ignore
+ - Error
type: string
into:
default: ""
@@ -329,10 +338,22 @@ spec:
items:
type: string
type: array
+ priorityPolicy:
+ default: Strict
+ description: Used to define the policy when a
+ key in the priority list does not exist in the
+ input.
+ enum:
+ - IgnoreNotFound
+ - Strict
+ type: string
strategy:
default: Extract
description: Used to define the strategy to use
in the merge operation.
+ enum:
+ - Extract
+ - JSON
type: string
type: object
regexp:
@@ -392,6 +413,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -483,8 +505,8 @@ spec:
creationPolicy: Owner
deletionPolicy: Retain
description: |-
- ExternalSecretTarget defines the Kubernetes Secret to be created
- There can be only one target per ExternalSecret.
+ ExternalSecretTarget defines the Kubernetes Secret to be created,
+ there can be only one target per ExternalSecret.
properties:
creationPolicy:
default: Owner
@@ -538,6 +560,8 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how the rendered
+ template should be merged with the existing Secret data.
enum:
- Replace
- Merge
@@ -550,6 +574,10 @@ spec:
additionalProperties:
type: string
type: object
+ finalizers:
+ items:
+ type: string
+ type: array
labels:
additionalProperties:
type: string
@@ -557,13 +585,21 @@ spec:
type: object
templateFrom:
items:
+ description: |-
+ TemplateFrom specifies a source for templates.
+ Each item in the list can either reference a ConfigMap or a Secret resource.
properties:
configMap:
+ description: TemplateRef specifies a reference to
+ either a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key
+ in the ConfigMap/Secret to use as a template
+ for Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -573,6 +609,8 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how
+ the template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -595,11 +633,16 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef specifies a reference to
+ either a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key
+ in the ConfigMap/Secret to use as a template
+ for Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -609,6 +652,8 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how
+ the template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -630,6 +675,8 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget specifies where the
+ rendered templates should be applied.
enum:
- Data
- Annotations
@@ -766,12 +813,16 @@ spec:
properties:
conditions:
items:
+ description: ClusterExternalSecretStatusCondition defines the observed
+ state of a ClusterExternalSecret resource.
properties:
message:
type: string
status:
type: string
type:
+ description: ClusterExternalSecretConditionType defines a value
+ type for ClusterExternalSecret conditions.
type: string
required:
- status
@@ -827,7 +878,7 @@ spec:
name: v1beta1
schema:
openAPIV3Schema:
- description: ClusterExternalSecret is the Schema for the clusterexternalsecrets
+ description: ClusterExternalSecret is the schema for the clusterexternalsecrets
API.
properties:
apiVersion:
@@ -1009,6 +1060,8 @@ spec:
DataFrom is used to fetch all properties from a specific Provider data
If multiple entries are specified, the Secret keys are merged in the specified order
items:
+ description: ExternalSecretDataFromRemoteRef defines a reference
+ to multiple secrets in the provider to be fetched using options.
properties:
extract:
description: |-
@@ -1096,6 +1149,8 @@ spec:
Used to rewrite secret Keys after getting them from the secret Provider
Multiple Rewrite operations can be provided. They are applied in a layered order (first to last)
items:
+ description: ExternalSecretRewrite defines rules on how
+ to rewrite secret keys.
maxProperties: 1
minProperties: 1
properties:
@@ -1301,6 +1356,8 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how template
+ values should be merged when generating a secret.
enum:
- Replace
- Merge
@@ -1320,13 +1377,20 @@ spec:
type: object
templateFrom:
items:
+ description: TemplateFrom defines a source for template
+ data.
properties:
configMap:
+ description: TemplateRef defines a reference to
+ a template source in a ConfigMap or Secret.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem defines which
+ key in the referenced ConfigMap or Secret
+ to use as a template.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -1336,6 +1400,9 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope defines the
+ scope of the template when processing
+ template data.
enum:
- Values
- KeysAndValues
@@ -1358,11 +1425,16 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef defines a reference to
+ a template source in a ConfigMap or Secret.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem defines which
+ key in the referenced ConfigMap or Secret
+ to use as a template.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -1372,6 +1444,9 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope defines the
+ scope of the template when processing
+ template data.
enum:
- Values
- KeysAndValues
@@ -1393,6 +1468,8 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget defines the target field
+ where the template result will be stored.
enum:
- Data
- Annotations
@@ -1528,12 +1605,16 @@ spec:
properties:
conditions:
items:
+ description: ClusterExternalSecretStatusCondition indicates the
+ status of the ClusterExternalSecret.
properties:
message:
type: string
status:
type: string
type:
+ description: ClusterExternalSecretConditionType indicates the
+ condition of the ClusterExternalSecret.
type: string
required:
- status
diff --git a/bundle/manifests/external-secrets.io_clusterpushsecrets.yaml b/bundle/manifests/external-secrets.io_clusterpushsecrets.yaml
index 6a8dde844..a5ae8d031 100644
--- a/bundle/manifests/external-secrets.io_clusterpushsecrets.yaml
+++ b/bundle/manifests/external-secrets.io_clusterpushsecrets.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -29,6 +29,9 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
+ description: ClusterPushSecret is the Schema for the ClusterPushSecrets API
+ that enables cluster-wide management of pushing Kubernetes secrets to external
+ providers.
properties:
apiVersion:
description: |-
@@ -48,6 +51,8 @@ spec:
metadata:
type: object
spec:
+ description: ClusterPushSecretSpec defines the configuration for a ClusterPushSecret
+ resource.
properties:
namespaceSelectors:
description: A list of labels to select by to find the Namespaces
@@ -128,6 +133,8 @@ spec:
data:
description: Secret Data that should be pushed to providers
items:
+ description: PushSecretData defines data to be pushed to the
+ provider and associated metadata.
properties:
conversionStrategy:
default: None
@@ -183,6 +190,8 @@ spec:
type: string
secretStoreRefs:
items:
+ description: PushSecretStoreRef contains a reference on how
+ to sync to a SecretStore.
properties:
kind:
default: SecretStore
@@ -265,6 +274,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -367,6 +377,8 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how the rendered
+ template should be merged with the existing Secret data.
enum:
- Replace
- Merge
@@ -379,6 +391,10 @@ spec:
additionalProperties:
type: string
type: object
+ finalizers:
+ items:
+ type: string
+ type: array
labels:
additionalProperties:
type: string
@@ -386,13 +402,21 @@ spec:
type: object
templateFrom:
items:
+ description: |-
+ TemplateFrom specifies a source for templates.
+ Each item in the list can either reference a ConfigMap or a Secret resource.
properties:
configMap:
+ description: TemplateRef specifies a reference to either
+ a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in
+ the ConfigMap/Secret to use as a template for
+ Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -402,6 +426,8 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the
+ template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -423,11 +449,16 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef specifies a reference to either
+ a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in
+ the ConfigMap/Secret to use as a template for
+ Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -437,6 +468,8 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the
+ template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -457,6 +490,8 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget specifies where the rendered
+ templates should be applied.
enum:
- Data
- Annotations
@@ -486,6 +521,8 @@ spec:
- pushSecretSpec
type: object
status:
+ description: ClusterPushSecretStatus contains the status information for
+ the ClusterPushSecret resource.
properties:
conditions:
items:
diff --git a/bundle/manifests/external-secrets.io_clustersecretstores.yaml b/bundle/manifests/external-secrets.io_clustersecretstores.yaml
index 31745543a..9359a5d83 100644
--- a/bundle/manifests/external-secrets.io_clustersecretstores.yaml
+++ b/bundle/manifests/external-secrets.io_clustersecretstores.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -266,7 +266,7 @@ spec:
type: object
accessType:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -295,7 +295,7 @@ spec:
type: object
accessTypeParam:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -380,7 +380,8 @@ spec:
description: AlibabaAuth contains a secretRef for credentials.
properties:
rrsa:
- description: Authenticate against Alibaba using RRSA.
+ description: AlibabaRRSAAuth authenticates against Alibaba
+ using RRSA.
properties:
oidcProviderArn:
type: string
@@ -484,11 +485,12 @@ spec:
see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
properties:
jwt:
- description: Authenticate against AWS using service account
- tokens.
+ description: AWSJWTAuth stores reference to Authenticate
+ against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -637,7 +639,7 @@ spec:
The number of days from 7 to 30 that Secrets Manager waits before
permanently deleting the secret. You can't use both this parameter and
ForceDeleteWithoutRecovery in the same call. If you don't use either,
- then by default Secrets Manager uses a 30 day recovery window.
+ then by default Secrets Manager uses a 30-day recovery window.
see: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html#SecretsManager-DeleteSecret-request-RecoveryWindowInDays
format: int64
type: integer
@@ -652,6 +654,9 @@ spec:
sessionTags:
description: AWS STS assume role session tags
items:
+ description: |-
+ Tag is a key-value pair that can be attached to an AWS resource.
+ see: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
properties:
key:
type: string
@@ -806,18 +811,47 @@ spec:
- ManagedIdentity
- WorkloadIdentity
type: string
+ customCloudConfig:
+ description: |-
+ CustomCloudConfig defines custom Azure Stack Hub or Azure Stack Edge endpoints.
+ Required when EnvironmentType is AzureStackCloud.
+ IMPORTANT: This feature REQUIRES UseAzureSDK to be set to true. Custom cloud
+ configuration is not supported with the legacy go-autorest SDK.
+ properties:
+ activeDirectoryEndpoint:
+ description: |-
+ ActiveDirectoryEndpoint is the AAD endpoint for authentication
+ Required when using custom cloud configuration
+ type: string
+ keyVaultDNSSuffix:
+ description: KeyVaultDNSSuffix is the DNS suffix for Key
+ Vault URLs
+ type: string
+ keyVaultEndpoint:
+ description: KeyVaultEndpoint is the Key Vault service
+ endpoint
+ type: string
+ resourceManagerEndpoint:
+ description: ResourceManagerEndpoint is the Azure Resource
+ Manager endpoint
+ type: string
+ required:
+ - activeDirectoryEndpoint
+ type: object
environmentType:
default: PublicCloud
description: |-
EnvironmentType specifies the Azure cloud environment endpoints to use for
connecting and authenticating with Azure. By default it points to the public cloud AAD endpoint.
The following endpoints are available, also see here: https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L152
- PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud
+ PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud, AzureStackCloud
+ Use AzureStackCloud when you need to configure custom Azure Stack Hub or Azure Stack Edge endpoints.
enum:
- PublicCloud
- USGovernmentCloud
- ChinaCloud
- GermanCloud
+ - AzureStackCloud
type: string
identityId:
description: If multiple Managed Identity is assigned to the
@@ -859,6 +893,12 @@ spec:
requests to. Required for ServicePrincipal auth type. Optional
for WorkloadIdentity.
type: string
+ useAzureSDK:
+ default: false
+ description: |-
+ UseAzureSDK enables the use of the new Azure SDK for Go (azcore-based) instead of the legacy go-autorest SDK.
+ This is experimental and may have behavioral differences. Defaults to false (legacy SDK).
+ type: boolean
vaultUrl:
description: Vault Url from which the secrets to be fetched
from.
@@ -1644,6 +1684,8 @@ spec:
with a Device42 instance.
properties:
secretRef:
+ description: Device42SecretRef contains the secret reference
+ for accessing the Device42 instance.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -1692,6 +1734,8 @@ spec:
with the Doppler API
properties:
secretRef:
+ description: DopplerAuthSecretRef contains the secret
+ reference for accessing the Doppler API.
properties:
dopplerToken:
description: |-
@@ -1766,6 +1810,8 @@ spec:
properties:
data:
items:
+ description: FakeProviderData defines a key-value pair with
+ optional version for the fake provider.
properties:
key:
type: string
@@ -1778,6 +1824,10 @@ spec:
- value
type: object
type: array
+ validationResult:
+ description: ValidationResult is defined type for the number
+ of validation results.
+ type: integer
required:
- data
type: object
@@ -1830,6 +1880,8 @@ spec:
against GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef contains the secret references
+ for GCP Secret Manager authentication.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -1860,6 +1912,8 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines configuration
+ for workload identity authentication to GCP.
properties:
clusterLocation:
description: |-
@@ -1877,7 +1931,8 @@ spec:
If not specified, it fetches information from the metadata server
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -1908,6 +1963,127 @@ spec:
required:
- serviceAccountRef
type: object
+ workloadIdentityFederation:
+ description: GCPWorkloadIdentityFederation holds the configurations
+ required for generating federated access tokens.
+ properties:
+ audience:
+ description: |-
+ audience is the Secure Token Service (STS) audience which contains the resource name for the workload identity pool and the provider identifier in that pool.
+ If specified, Audience found in the external account credential config will be overridden with the configured value.
+ audience must be provided when serviceAccountRef or awsSecurityCredentials is configured.
+ type: string
+ awsSecurityCredentials:
+ description: |-
+ awsSecurityCredentials is for configuring AWS region and credentials to use for obtaining the access token,
+ when using the AWS metadata server is not an option.
+ properties:
+ awsCredentialsSecretRef:
+ description: |-
+ awsCredentialsSecretRef is the reference to the secret which holds the AWS credentials.
+ Secret should be created with below names for keys
+ - aws_access_key_id: Access Key ID, which is the unique identifier for the AWS account or the IAM user.
+ - aws_secret_access_key: Secret Access Key, which is used to authenticate requests made to AWS services.
+ - aws_session_token: Session Token, is the short-lived token to authenticate requests made to AWS services.
+ properties:
+ name:
+ description: name of the secret.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the secret
+ exists. If empty, secret will looked up
+ in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ region:
+ description: region is for configuring the AWS
+ region to be used.
+ example: ap-south-1
+ maxLength: 50
+ minLength: 1
+ pattern: ^[a-z0-9-]+$
+ type: string
+ required:
+ - awsCredentialsSecretRef
+ - region
+ type: object
+ credConfig:
+ description: |-
+ credConfig holds the configmap reference containing the GCP external account credential configuration in JSON format and the key name containing the json data.
+ For using Kubernetes cluster as the identity provider, use serviceAccountRef instead. Operators mounted serviceaccount token cannot be used as the token source, instead
+ serviceAccountRef must be used by providing operators service account details.
+ properties:
+ key:
+ description: key name holding the external account
+ credential config.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: name of the configmap.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the configmap
+ exists. If empty, configmap will looked up in
+ local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - key
+ - name
+ type: object
+ externalTokenEndpoint:
+ description: |-
+ externalTokenEndpoint is the endpoint explicitly set up to provide tokens, which will be matched against the
+ credential_source.url in the provided credConfig. This field is merely to double-check the external token source
+ URL is having the expected value.
+ type: string
+ serviceAccountRef:
+ description: |-
+ serviceAccountRef is the reference to the kubernetes ServiceAccount to be used for obtaining the tokens,
+ when Kubernetes is configured as provider in workload identity pool.
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource
+ being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ type: object
type: object
location:
description: Location optionally defines a location for a
@@ -1916,10 +2092,20 @@ spec:
projectID:
description: ProjectID project where secret is located
type: string
+ secretVersionSelectionPolicy:
+ default: LatestOrFail
+ description: |-
+ SecretVersionSelectionPolicy specifies how the provider selects a secret version
+ when "latest" is disabled or destroyed.
+ Possible values are:
+ - LatestOrFail: the provider always uses "latest", or fails if that version is disabled/destroyed.
+ - LatestOrFetch: the provider falls back to fetching the latest version if the version is DESTROYED or DISABLED
+ type: string
type: object
github:
- description: Github configures this store to push Github Action
- secrets using Github API provider
+ description: |-
+ Github configures this store to push GitHub Action secrets using GitHub API provider.
+ Note: This provider only supports write operations (PushSecret) and cannot fetch secrets from GitHub
properties:
appID:
description: appID specifies the Github APP that will be used
@@ -1932,7 +2118,7 @@ spec:
properties:
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2003,6 +2189,8 @@ spec:
with a GitLab instance.
properties:
SecretRef:
+ description: GitlabSecretRef contains the secret reference
+ for GitLab authentication credentials.
properties:
accessToken:
description: AccessToken is used for authentication.
@@ -2115,8 +2303,8 @@ spec:
minProperties: 1
properties:
containerAuth:
- description: IBM Container-based auth with IAM Trusted
- Profile.
+ description: IBMAuthContainerAuth defines container-based
+ authentication with IAM Trusted Profile.
properties:
iamEndpoint:
type: string
@@ -2131,6 +2319,8 @@ spec:
- profile
type: object
secretRef:
+ description: IBMAuthSecretRef contains the secret reference
+ for IBM Cloud API key authentication.
properties:
secretApiKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -2176,11 +2366,49 @@ spec:
description: Auth configures how the Operator authenticates
with the Infisical API
properties:
+ awsAuthCredentials:
+ description: AwsAuthCredentials represents the credentials
+ for AWS authentication.
+ properties:
+ identityId:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - identityId
+ type: object
azureAuthCredentials:
+ description: AzureAuthCredentials represents the credentials
+ for Azure authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2209,7 +2437,7 @@ spec:
type: object
resource:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2240,10 +2468,12 @@ spec:
- identityId
type: object
gcpIamAuthCredentials:
+ description: GcpIamAuthCredentials represents the credentials
+ for GCP IAM authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2272,7 +2502,7 @@ spec:
type: object
serviceAccountKeyFilePath:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2304,10 +2534,12 @@ spec:
- serviceAccountKeyFilePath
type: object
gcpIdTokenAuthCredentials:
+ description: GcpIDTokenAuthCredentials represents the
+ credentials for GCP ID token authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2338,10 +2570,12 @@ spec:
- identityId
type: object
jwtAuthCredentials:
+ description: JwtAuthCredentials represents the credentials
+ for JWT authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2370,7 +2604,7 @@ spec:
type: object
jwt:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2401,11 +2635,78 @@ spec:
- identityId
- jwt
type: object
+ kubernetesAuthCredentials:
+ description: KubernetesAuthCredentials represents the
+ credentials for Kubernetes authentication.
+ properties:
+ identityId:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ serviceAccountTokenPath:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - identityId
+ type: object
ldapAuthCredentials:
+ description: LdapAuthCredentials represents the credentials
+ for LDAP authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2434,7 +2735,7 @@ spec:
type: object
ldapPassword:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2463,7 +2764,7 @@ spec:
type: object
ldapUsername:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2496,10 +2797,12 @@ spec:
- ldapUsername
type: object
ociAuthCredentials:
+ description: OciAuthCredentials represents the credentials
+ for OCI authentication.
properties:
fingerprint:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2528,7 +2831,7 @@ spec:
type: object
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2557,7 +2860,7 @@ spec:
type: object
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2586,7 +2889,7 @@ spec:
type: object
privateKeyPassphrase:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2615,7 +2918,7 @@ spec:
type: object
region:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2644,7 +2947,7 @@ spec:
type: object
tenancyId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2673,7 +2976,7 @@ spec:
type: object
userId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2708,11 +3011,49 @@ spec:
- tenancyId
- userId
type: object
+ tokenAuthCredentials:
+ description: TokenAuthCredentials represents the credentials
+ for access token-based authentication.
+ properties:
+ accessToken:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - accessToken
+ type: object
universalAuthCredentials:
+ description: UniversalAuthCredentials represents the client
+ credentials for universal authentication.
properties:
clientId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2741,7 +3082,7 @@ spec:
type: object
clientSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2820,7 +3161,7 @@ spec:
properties:
authRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2868,7 +3209,7 @@ spec:
properties:
clientCert:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2897,7 +3238,7 @@ spec:
type: object
clientKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2960,7 +3301,7 @@ spec:
properties:
bearerToken:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3073,6 +3414,69 @@ spec:
type: string
type: object
type: object
+ ngrok:
+ description: Ngrok configures this store to sync secrets using
+ the ngrok provider.
+ properties:
+ apiUrl:
+ default: https://api.ngrok.com
+ description: APIURL is the URL of the ngrok API.
+ type: string
+ auth:
+ description: Auth configures how the ngrok provider authenticates
+ with the ngrok API.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ apiKey:
+ description: APIKey is the API Key used to authenticate
+ with ngrok. See https://ngrok.com/docs/api/#authentication
+ properties:
+ secretRef:
+ description: SecretRef is a reference to a secret
+ containing the ngrok API key.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ type: object
+ type: object
+ vault:
+ description: Vault configures the ngrok vault to sync secrets
+ with.
+ properties:
+ name:
+ description: Name is the name of the ngrok vault to sync
+ secrets with.
+ type: string
+ required:
+ - name
+ type: object
+ required:
+ - auth
+ - vault
+ type: object
onboardbase:
description: Onboardbase configures this store to sync secrets
using the Onboardbase provider
@@ -3433,6 +3837,9 @@ spec:
- vault
type: object
passbolt:
+ description: |-
+ PassboltProvider provides access to Passbolt secrets manager.
+ See: https://www.passbolt.com.
properties:
auth:
description: Auth defines the information necessary to authenticate
@@ -3440,7 +3847,7 @@ spec:
properties:
passwordSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3469,7 +3876,7 @@ spec:
type: object
privateKeySecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3508,14 +3915,16 @@ spec:
- host
type: object
passworddepot:
- description: Configures a store to sync secrets with a Password
- Depot instance.
+ description: PasswordDepotProvider configures a store to sync
+ secrets with a Password Depot instance.
properties:
auth:
description: Auth configures how secret-manager authenticates
with a Password Depot instance.
properties:
secretRef:
+ description: PasswordDepotSecretRef contains the secret
+ reference for Password Depot authentication.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -3766,6 +4175,9 @@ spec:
SecretServer configures this store to sync secrets using SecretServer provider
https://docs.delinea.com/online-help/secret-server/start.htm
properties:
+ domain:
+ description: Domain is the secret server domain.
+ type: string
password:
description: Password is the secret server account password.
properties:
@@ -3859,7 +4271,7 @@ spec:
type: string
clientSecretSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4031,6 +4443,12 @@ spec:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
type: object
+ path:
+ default: cert
+ description: |-
+ Path where the Certificate authentication backend is mounted
+ in Vault, e.g: "cert"
+ type: string
secretRef:
description: |-
SecretRef to a key in a Secret resource containing client private key to
@@ -4073,7 +4491,8 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -4585,6 +5004,18 @@ spec:
- name
- type
type: object
+ checkAndSet:
+ description: |-
+ CheckAndSet defines the Check-And-Set (CAS) settings for PushSecret operations.
+ Only applies to Vault KV v2 stores. When enabled, write operations must include
+ the current version of the secret to prevent unintentional overwrites.
+ properties:
+ required:
+ description: |-
+ Required when true, all write operations must include a check-and-set parameter.
+ This helps prevent unintentional overwrites of secrets.
+ type: boolean
+ type: object
forwardInconsistent:
description: |-
ForwardInconsistent tells Vault to forward read-after-write requests to the Vault
@@ -4702,6 +5133,116 @@ spec:
required:
- server
type: object
+ volcengine:
+ description: Volcengine configures this store to sync secrets
+ using the Volcengine provider
+ properties:
+ auth:
+ description: |-
+ Auth defines the authentication method to use.
+ If not specified, the provider will try to use IRSA (IAM Role for Service Account).
+ properties:
+ secretRef:
+ description: |-
+ SecretRef defines the static credentials to use for authentication.
+ If not set, IRSA is used.
+ properties:
+ accessKeyID:
+ description: AccessKeyID is the reference to the secret
+ containing the Access Key ID.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ secretAccessKey:
+ description: SecretAccessKey is the reference to the
+ secret containing the Secret Access Key.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ token:
+ description: Token is the reference to the secret
+ containing the STS(Security Token Service) Token.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - accessKeyID
+ - secretAccessKey
+ type: object
+ type: object
+ region:
+ description: Region specifies the Volcengine region to connect
+ to.
+ type: string
+ required:
+ - region
+ type: object
webhook:
description: Webhook configures this store to sync secrets using
a generic templated webhook
@@ -4718,7 +5259,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4747,7 +5288,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4845,6 +5386,8 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret that will be
+ passed to the webhook request.
properties:
name:
description: Name of this secret in templates
@@ -4888,7 +5431,6 @@ spec:
description: Webhook url to call
type: string
required:
- - result
- url
type: object
yandexcertificatemanager:
@@ -4900,7 +5442,7 @@ spec:
type: string
auth:
description: Auth defines the information necessary to authenticate
- against Yandex Certificate Manager
+ against Yandex.Cloud
properties:
authorizedKeySecretRef:
description: The authorized key used for authentication
@@ -4936,7 +5478,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4964,6 +5506,30 @@ spec:
type: string
type: object
type: object
+ fetching:
+ description: FetchingPolicy configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as certificate ID or certificate name
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ byID:
+ description: ByID configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as secret ID.
+ type: object
+ byName:
+ description: ByName configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as secret name.
+ properties:
+ folderID:
+ description: The folder to fetch secrets from
+ type: string
+ required:
+ - folderID
+ type: object
+ type: object
required:
- auth
type: object
@@ -4976,7 +5542,7 @@ spec:
type: string
auth:
description: Auth defines the information necessary to authenticate
- against Yandex Lockbox
+ against Yandex.Cloud
properties:
authorizedKeySecretRef:
description: The authorized key used for authentication
@@ -5012,7 +5578,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -5040,6 +5606,30 @@ spec:
type: string
type: object
type: object
+ fetching:
+ description: FetchingPolicy configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as secret ID or secret name
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ byID:
+ description: ByID configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as secret ID.
+ type: object
+ byName:
+ description: ByName configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as secret name.
+ properties:
+ folderID:
+ description: The folder to fetch secrets from
+ type: string
+ required:
+ - folderID
+ type: object
+ type: object
required:
- auth
type: object
@@ -5069,6 +5659,8 @@ spec:
type: string
conditions:
items:
+ description: SecretStoreStatusCondition contains condition information
+ for a SecretStore.
properties:
lastTransitionTime:
format: date-time
@@ -5080,6 +5672,8 @@ spec:
status:
type: string
type:
+ description: SecretStoreConditionType represents the condition
+ of the SecretStore.
type: string
required:
- status
@@ -5338,7 +5932,7 @@ spec:
type: object
accessType:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -5367,7 +5961,7 @@ spec:
type: object
accessTypeParam:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -5452,7 +6046,8 @@ spec:
description: AlibabaAuth contains a secretRef for credentials.
properties:
rrsa:
- description: Authenticate against Alibaba using RRSA.
+ description: AlibabaRRSAAuth authenticates against Alibaba
+ using RRSA (Resource-oriented RAM-based Service Authentication).
properties:
oidcProviderArn:
type: string
@@ -5556,11 +6151,12 @@ spec:
see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
properties:
jwt:
- description: Authenticate against AWS using service account
- tokens.
+ description: AWSJWTAuth authenticates against AWS using
+ service account tokens from the Kubernetes cluster.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -5724,6 +6320,7 @@ spec:
sessionTags:
description: AWS STS assume role session tags
items:
+ description: Tag defines a tag key and value for AWS resources.
properties:
key:
type: string
@@ -6716,6 +7313,8 @@ spec:
with a Device42 instance.
properties:
secretRef:
+ description: Device42SecretRef defines a reference to
+ a secret containing credentials for the Device42 provider.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -6764,6 +7363,8 @@ spec:
with the Doppler API
properties:
secretRef:
+ description: DopplerAuthSecretRef defines a reference
+ to a secret containing credentials for the Doppler provider.
properties:
dopplerToken:
description: |-
@@ -6838,6 +7439,8 @@ spec:
properties:
data:
items:
+ description: FakeProviderData defines a key-value pair for
+ the fake provider used in testing.
properties:
key:
type: string
@@ -6902,6 +7505,9 @@ spec:
against GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef defines a reference to
+ a secret containing credentials for the GCP Secret Manager
+ provider.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -6932,6 +7538,8 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines configuration
+ for using GCP Workload Identity authentication.
properties:
clusterLocation:
description: |-
@@ -6949,7 +7557,8 @@ spec:
If not specified, it fetches information from the metadata server
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -7004,7 +7613,7 @@ spec:
properties:
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7075,6 +7684,8 @@ spec:
with a GitLab instance.
properties:
SecretRef:
+ description: GitlabSecretRef defines a reference to a
+ secret containing credentials for the GitLab provider.
properties:
accessToken:
description: AccessToken is used for authentication.
@@ -7187,8 +7798,8 @@ spec:
minProperties: 1
properties:
containerAuth:
- description: IBM Container-based auth with IAM Trusted
- Profile.
+ description: IBMAuthContainerAuth defines authentication
+ using IBM Container-based auth with IAM Trusted Profile.
properties:
iamEndpoint:
type: string
@@ -7203,6 +7814,8 @@ spec:
- profile
type: object
secretRef:
+ description: IBMAuthSecretRef defines a reference to a
+ secret containing credentials for the IBM provider.
properties:
secretApiKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -7249,10 +7862,12 @@ spec:
with the Infisical API
properties:
universalAuthCredentials:
+ description: UniversalAuthCredentials defines the credentials
+ for Infisical Universal Auth.
properties:
clientId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7281,7 +7896,7 @@ spec:
type: object
clientSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7360,7 +7975,7 @@ spec:
properties:
authRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7408,7 +8023,7 @@ spec:
properties:
clientCert:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7437,7 +8052,7 @@ spec:
type: object
clientKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7500,7 +8115,7 @@ spec:
properties:
bearerToken:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7912,15 +8527,16 @@ spec:
- vault
type: object
passbolt:
+ description: PassboltProvider defines configuration for the Passbolt
+ provider.
properties:
auth:
description: Auth defines the information necessary to authenticate
against Passbolt Server
properties:
passwordSecretRef:
- description: |-
- A reference to a specific 'key' within a Secret resource.
- In some instances, `key` is a required field.
+ description: PasswordSecretRef is a reference to the secret
+ containing the Passbolt password
properties:
key:
description: |-
@@ -7947,9 +8563,8 @@ spec:
type: string
type: object
privateKeySecretRef:
- description: |-
- A reference to a specific 'key' within a Secret resource.
- In some instances, `key` is a required field.
+ description: PrivateKeySecretRef is a reference to the
+ secret containing the Passbolt private key
properties:
key:
description: |-
@@ -7987,14 +8602,17 @@ spec:
- host
type: object
passworddepot:
- description: Configures a store to sync secrets with a Password
- Depot instance.
+ description: PasswordDepotProvider configures a store to sync
+ secrets with a Password Depot instance.
properties:
auth:
description: Auth configures how secret-manager authenticates
with a Password Depot instance.
properties:
secretRef:
+ description: PasswordDepotSecretRef defines a reference
+ to a secret containing credentials for the Password
+ Depot provider.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -8338,7 +8956,7 @@ spec:
type: string
clientSecretSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -8552,7 +9170,8 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -9197,7 +9816,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -9226,7 +9845,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -9324,6 +9943,8 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret to be used in
+ webhook templates.
properties:
name:
description: Name of this secret in templates
@@ -9415,7 +10036,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -9491,7 +10112,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -9531,9 +10152,11 @@ spec:
description: Used to configure http retries if failed
properties:
maxRetries:
+ description: MaxRetries is the maximum number of retry attempts.
format: int32
type: integer
retryInterval:
+ description: RetryInterval is the interval between retry attempts.
type: string
type: object
required:
@@ -9548,6 +10171,8 @@ spec:
type: string
conditions:
items:
+ description: SecretStoreStatusCondition defines the observed condition
+ of the SecretStore.
properties:
lastTransitionTime:
format: date-time
@@ -9559,6 +10184,8 @@ spec:
status:
type: string
type:
+ description: SecretStoreConditionType represents the condition
+ type of the SecretStore.
type: string
required:
- status
diff --git a/bundle/manifests/external-secrets.io_externalsecrets.yaml b/bundle/manifests/external-secrets.io_externalsecrets.yaml
index d26aa665b..3a7b55949 100644
--- a/bundle/manifests/external-secrets.io_externalsecrets.yaml
+++ b/bundle/manifests/external-secrets.io_externalsecrets.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -40,7 +40,9 @@ spec:
name: v1
schema:
openAPIV3Schema:
- description: ExternalSecret is the Schema for the external-secrets API.
+ description: |-
+ ExternalSecret is the Schema for the external-secrets API.
+ It defines how to fetch data from external APIs and make it available as Kubernetes Secrets.
properties:
apiVersion:
description: |-
@@ -143,6 +145,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -197,6 +200,9 @@ spec:
DataFrom is used to fetch all properties from a specific Provider data
If multiple entries are specified, the Secret keys are merged in the specified order
items:
+ description: |-
+ ExternalSecretDataFromRemoteRef defines the connection between the Kubernetes Secret keys and the Provider data
+ when using DataFrom to fetch multiple values from a Provider.
properties:
extract:
description: |-
@@ -284,6 +290,8 @@ spec:
Used to rewrite secret Keys after getting them from the secret Provider
Multiple Rewrite operations can be provided. They are applied in a layered order (first to last)
items:
+ description: ExternalSecretRewrite defines how to rewrite
+ secret data values before they are written to the Secret.
maxProperties: 1
minProperties: 1
properties:
@@ -296,6 +304,9 @@ spec:
default: Error
description: Used to define the policy to use in conflict
resolution.
+ enum:
+ - Ignore
+ - Error
type: string
into:
default: ""
@@ -309,10 +320,21 @@ spec:
items:
type: string
type: array
+ priorityPolicy:
+ default: Strict
+ description: Used to define the policy when a key
+ in the priority list does not exist in the input.
+ enum:
+ - IgnoreNotFound
+ - Strict
+ type: string
strategy:
default: Extract
description: Used to define the strategy to use in
the merge operation.
+ enum:
+ - Extract
+ - JSON
type: string
type: object
regexp:
@@ -371,6 +393,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -462,8 +485,8 @@ spec:
creationPolicy: Owner
deletionPolicy: Retain
description: |-
- ExternalSecretTarget defines the Kubernetes Secret to be created
- There can be only one target per ExternalSecret.
+ ExternalSecretTarget defines the Kubernetes Secret to be created,
+ there can be only one target per ExternalSecret.
properties:
creationPolicy:
default: Owner
@@ -516,6 +539,8 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how the rendered
+ template should be merged with the existing Secret data.
enum:
- Replace
- Merge
@@ -528,6 +553,10 @@ spec:
additionalProperties:
type: string
type: object
+ finalizers:
+ items:
+ type: string
+ type: array
labels:
additionalProperties:
type: string
@@ -535,13 +564,21 @@ spec:
type: object
templateFrom:
items:
+ description: |-
+ TemplateFrom specifies a source for templates.
+ Each item in the list can either reference a ConfigMap or a Secret resource.
properties:
configMap:
+ description: TemplateRef specifies a reference to either
+ a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in
+ the ConfigMap/Secret to use as a template for
+ Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -551,6 +588,8 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the
+ template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -572,11 +611,16 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef specifies a reference to either
+ a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in
+ the ConfigMap/Secret to use as a template for
+ Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -586,6 +630,8 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the
+ template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -606,6 +652,8 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget specifies where the rendered
+ templates should be applied.
enum:
- Data
- Annotations
@@ -619,6 +667,7 @@ spec:
type: object
type: object
status:
+ description: ExternalSecretStatus defines the observed state of ExternalSecret.
properties:
binding:
description: Binding represents a servicebinding.io Provisioned Service
@@ -637,6 +686,8 @@ spec:
x-kubernetes-map-type: atomic
conditions:
items:
+ description: ExternalSecretStatusCondition defines a status condition
+ of an ExternalSecret resource.
properties:
lastTransitionTime:
format: date-time
@@ -648,6 +699,11 @@ spec:
status:
type: string
type:
+ description: ExternalSecretConditionType defines a value type
+ for ExternalSecret conditions.
+ enum:
+ - Ready
+ - Deleted
type: string
required:
- status
@@ -667,6 +723,11 @@ spec:
type: string
type: object
type: object
+ selectableFields:
+ - jsonPath: .spec.secretStoreRef.name
+ - jsonPath: .spec.secretStoreRef.kind
+ - jsonPath: .spec.target.name
+ - jsonPath: .spec.refreshInterval
served: true
storage: true
subresources:
@@ -691,7 +752,7 @@ spec:
name: v1beta1
schema:
openAPIV3Schema:
- description: ExternalSecret is the Schema for the external-secrets API.
+ description: ExternalSecret is the schema for the external-secrets API.
properties:
apiVersion:
description: |-
@@ -847,6 +908,8 @@ spec:
DataFrom is used to fetch all properties from a specific Provider data
If multiple entries are specified, the Secret keys are merged in the specified order
items:
+ description: ExternalSecretDataFromRemoteRef defines a reference
+ to multiple secrets in the provider to be fetched using options.
properties:
extract:
description: |-
@@ -934,6 +997,8 @@ spec:
Used to rewrite secret Keys after getting them from the secret Provider
Multiple Rewrite operations can be provided. They are applied in a layered order (first to last)
items:
+ description: ExternalSecretRewrite defines rules on how to
+ rewrite secret keys.
maxProperties: 1
minProperties: 1
properties:
@@ -1137,6 +1202,8 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how template values
+ should be merged when generating a secret.
enum:
- Replace
- Merge
@@ -1156,13 +1223,20 @@ spec:
type: object
templateFrom:
items:
+ description: TemplateFrom defines a source for template
+ data.
properties:
configMap:
+ description: TemplateRef defines a reference to a template
+ source in a ConfigMap or Secret.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem defines which key
+ in the referenced ConfigMap or Secret to use
+ as a template.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -1172,6 +1246,9 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope defines the scope
+ of the template when processing template
+ data.
enum:
- Values
- KeysAndValues
@@ -1193,11 +1270,16 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef defines a reference to a template
+ source in a ConfigMap or Secret.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem defines which key
+ in the referenced ConfigMap or Secret to use
+ as a template.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -1207,6 +1289,9 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope defines the scope
+ of the template when processing template
+ data.
enum:
- Values
- KeysAndValues
@@ -1227,6 +1312,8 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget defines the target field
+ where the template result will be stored.
enum:
- Data
- Annotations
@@ -1240,6 +1327,7 @@ spec:
type: object
type: object
status:
+ description: ExternalSecretStatus defines the observed state of ExternalSecret.
properties:
binding:
description: Binding represents a servicebinding.io Provisioned Service
@@ -1258,6 +1346,8 @@ spec:
x-kubernetes-map-type: atomic
conditions:
items:
+ description: ExternalSecretStatusCondition contains condition information
+ for an ExternalSecret.
properties:
lastTransitionTime:
format: date-time
@@ -1269,6 +1359,8 @@ spec:
status:
type: string
type:
+ description: ExternalSecretConditionType defines the condition
+ type for an ExternalSecret.
type: string
required:
- status
diff --git a/bundle/manifests/external-secrets.io_pushsecrets.yaml b/bundle/manifests/external-secrets.io_pushsecrets.yaml
index 1828249a2..342b80dbb 100644
--- a/bundle/manifests/external-secrets.io_pushsecrets.yaml
+++ b/bundle/manifests/external-secrets.io_pushsecrets.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -31,6 +31,8 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
+ description: PushSecret is the Schema for the PushSecrets API that enables
+ pushing Kubernetes secrets to external secret providers.
properties:
apiVersion:
description: |-
@@ -55,6 +57,8 @@ spec:
data:
description: Secret Data that should be pushed to providers
items:
+ description: PushSecretData defines data to be pushed to the provider
+ and associated metadata.
properties:
conversionStrategy:
default: None
@@ -108,6 +112,8 @@ spec:
type: string
secretStoreRefs:
items:
+ description: PushSecretStoreRef contains a reference on how to sync
+ to a SecretStore.
properties:
kind:
default: SecretStore
@@ -189,6 +195,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -290,6 +297,8 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how the rendered template
+ should be merged with the existing Secret data.
enum:
- Replace
- Merge
@@ -302,6 +311,10 @@ spec:
additionalProperties:
type: string
type: object
+ finalizers:
+ items:
+ type: string
+ type: array
labels:
additionalProperties:
type: string
@@ -309,13 +322,21 @@ spec:
type: object
templateFrom:
items:
+ description: |-
+ TemplateFrom specifies a source for templates.
+ Each item in the list can either reference a ConfigMap or a Secret resource.
properties:
configMap:
+ description: TemplateRef specifies a reference to either
+ a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in the
+ ConfigMap/Secret to use as a template for Secret
+ data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -325,6 +346,8 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the template
+ keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -346,11 +369,16 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef specifies a reference to either
+ a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret
to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in the
+ ConfigMap/Secret to use as a template for Secret
+ data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -360,6 +388,8 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the template
+ keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -380,6 +410,8 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget specifies where the rendered
+ templates should be applied.
enum:
- Data
- Annotations
@@ -437,6 +469,8 @@ spec:
syncedPushSecrets:
additionalProperties:
additionalProperties:
+ description: PushSecretData defines data to be pushed to the provider
+ and associated metadata.
properties:
conversionStrategy:
default: None
diff --git a/bundle/manifests/external-secrets.io_secretstores.yaml b/bundle/manifests/external-secrets.io_secretstores.yaml
index 6b8001889..4131bc133 100644
--- a/bundle/manifests/external-secrets.io_secretstores.yaml
+++ b/bundle/manifests/external-secrets.io_secretstores.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -266,7 +266,7 @@ spec:
type: object
accessType:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -295,7 +295,7 @@ spec:
type: object
accessTypeParam:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -380,7 +380,8 @@ spec:
description: AlibabaAuth contains a secretRef for credentials.
properties:
rrsa:
- description: Authenticate against Alibaba using RRSA.
+ description: AlibabaRRSAAuth authenticates against Alibaba
+ using RRSA.
properties:
oidcProviderArn:
type: string
@@ -484,11 +485,12 @@ spec:
see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
properties:
jwt:
- description: Authenticate against AWS using service account
- tokens.
+ description: AWSJWTAuth stores reference to Authenticate
+ against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -637,7 +639,7 @@ spec:
The number of days from 7 to 30 that Secrets Manager waits before
permanently deleting the secret. You can't use both this parameter and
ForceDeleteWithoutRecovery in the same call. If you don't use either,
- then by default Secrets Manager uses a 30 day recovery window.
+ then by default Secrets Manager uses a 30-day recovery window.
see: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html#SecretsManager-DeleteSecret-request-RecoveryWindowInDays
format: int64
type: integer
@@ -652,6 +654,9 @@ spec:
sessionTags:
description: AWS STS assume role session tags
items:
+ description: |-
+ Tag is a key-value pair that can be attached to an AWS resource.
+ see: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
properties:
key:
type: string
@@ -806,18 +811,47 @@ spec:
- ManagedIdentity
- WorkloadIdentity
type: string
+ customCloudConfig:
+ description: |-
+ CustomCloudConfig defines custom Azure Stack Hub or Azure Stack Edge endpoints.
+ Required when EnvironmentType is AzureStackCloud.
+ IMPORTANT: This feature REQUIRES UseAzureSDK to be set to true. Custom cloud
+ configuration is not supported with the legacy go-autorest SDK.
+ properties:
+ activeDirectoryEndpoint:
+ description: |-
+ ActiveDirectoryEndpoint is the AAD endpoint for authentication
+ Required when using custom cloud configuration
+ type: string
+ keyVaultDNSSuffix:
+ description: KeyVaultDNSSuffix is the DNS suffix for Key
+ Vault URLs
+ type: string
+ keyVaultEndpoint:
+ description: KeyVaultEndpoint is the Key Vault service
+ endpoint
+ type: string
+ resourceManagerEndpoint:
+ description: ResourceManagerEndpoint is the Azure Resource
+ Manager endpoint
+ type: string
+ required:
+ - activeDirectoryEndpoint
+ type: object
environmentType:
default: PublicCloud
description: |-
EnvironmentType specifies the Azure cloud environment endpoints to use for
connecting and authenticating with Azure. By default it points to the public cloud AAD endpoint.
The following endpoints are available, also see here: https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L152
- PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud
+ PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud, AzureStackCloud
+ Use AzureStackCloud when you need to configure custom Azure Stack Hub or Azure Stack Edge endpoints.
enum:
- PublicCloud
- USGovernmentCloud
- ChinaCloud
- GermanCloud
+ - AzureStackCloud
type: string
identityId:
description: If multiple Managed Identity is assigned to the
@@ -859,6 +893,12 @@ spec:
requests to. Required for ServicePrincipal auth type. Optional
for WorkloadIdentity.
type: string
+ useAzureSDK:
+ default: false
+ description: |-
+ UseAzureSDK enables the use of the new Azure SDK for Go (azcore-based) instead of the legacy go-autorest SDK.
+ This is experimental and may have behavioral differences. Defaults to false (legacy SDK).
+ type: boolean
vaultUrl:
description: Vault Url from which the secrets to be fetched
from.
@@ -1644,6 +1684,8 @@ spec:
with a Device42 instance.
properties:
secretRef:
+ description: Device42SecretRef contains the secret reference
+ for accessing the Device42 instance.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -1692,6 +1734,8 @@ spec:
with the Doppler API
properties:
secretRef:
+ description: DopplerAuthSecretRef contains the secret
+ reference for accessing the Doppler API.
properties:
dopplerToken:
description: |-
@@ -1766,6 +1810,8 @@ spec:
properties:
data:
items:
+ description: FakeProviderData defines a key-value pair with
+ optional version for the fake provider.
properties:
key:
type: string
@@ -1778,6 +1824,10 @@ spec:
- value
type: object
type: array
+ validationResult:
+ description: ValidationResult is defined type for the number
+ of validation results.
+ type: integer
required:
- data
type: object
@@ -1830,6 +1880,8 @@ spec:
against GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef contains the secret references
+ for GCP Secret Manager authentication.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -1860,6 +1912,8 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines configuration
+ for workload identity authentication to GCP.
properties:
clusterLocation:
description: |-
@@ -1877,7 +1931,8 @@ spec:
If not specified, it fetches information from the metadata server
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -1908,6 +1963,127 @@ spec:
required:
- serviceAccountRef
type: object
+ workloadIdentityFederation:
+ description: GCPWorkloadIdentityFederation holds the configurations
+ required for generating federated access tokens.
+ properties:
+ audience:
+ description: |-
+ audience is the Secure Token Service (STS) audience which contains the resource name for the workload identity pool and the provider identifier in that pool.
+ If specified, Audience found in the external account credential config will be overridden with the configured value.
+ audience must be provided when serviceAccountRef or awsSecurityCredentials is configured.
+ type: string
+ awsSecurityCredentials:
+ description: |-
+ awsSecurityCredentials is for configuring AWS region and credentials to use for obtaining the access token,
+ when using the AWS metadata server is not an option.
+ properties:
+ awsCredentialsSecretRef:
+ description: |-
+ awsCredentialsSecretRef is the reference to the secret which holds the AWS credentials.
+ Secret should be created with below names for keys
+ - aws_access_key_id: Access Key ID, which is the unique identifier for the AWS account or the IAM user.
+ - aws_secret_access_key: Secret Access Key, which is used to authenticate requests made to AWS services.
+ - aws_session_token: Session Token, is the short-lived token to authenticate requests made to AWS services.
+ properties:
+ name:
+ description: name of the secret.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the secret
+ exists. If empty, secret will looked up
+ in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ region:
+ description: region is for configuring the AWS
+ region to be used.
+ example: ap-south-1
+ maxLength: 50
+ minLength: 1
+ pattern: ^[a-z0-9-]+$
+ type: string
+ required:
+ - awsCredentialsSecretRef
+ - region
+ type: object
+ credConfig:
+ description: |-
+ credConfig holds the configmap reference containing the GCP external account credential configuration in JSON format and the key name containing the json data.
+ For using Kubernetes cluster as the identity provider, use serviceAccountRef instead. Operators mounted serviceaccount token cannot be used as the token source, instead
+ serviceAccountRef must be used by providing operators service account details.
+ properties:
+ key:
+ description: key name holding the external account
+ credential config.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: name of the configmap.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the configmap
+ exists. If empty, configmap will looked up in
+ local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - key
+ - name
+ type: object
+ externalTokenEndpoint:
+ description: |-
+ externalTokenEndpoint is the endpoint explicitly set up to provide tokens, which will be matched against the
+ credential_source.url in the provided credConfig. This field is merely to double-check the external token source
+ URL is having the expected value.
+ type: string
+ serviceAccountRef:
+ description: |-
+ serviceAccountRef is the reference to the kubernetes ServiceAccount to be used for obtaining the tokens,
+ when Kubernetes is configured as provider in workload identity pool.
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource
+ being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ type: object
type: object
location:
description: Location optionally defines a location for a
@@ -1916,10 +2092,20 @@ spec:
projectID:
description: ProjectID project where secret is located
type: string
+ secretVersionSelectionPolicy:
+ default: LatestOrFail
+ description: |-
+ SecretVersionSelectionPolicy specifies how the provider selects a secret version
+ when "latest" is disabled or destroyed.
+ Possible values are:
+ - LatestOrFail: the provider always uses "latest", or fails if that version is disabled/destroyed.
+ - LatestOrFetch: the provider falls back to fetching the latest version if the version is DESTROYED or DISABLED
+ type: string
type: object
github:
- description: Github configures this store to push Github Action
- secrets using Github API provider
+ description: |-
+ Github configures this store to push GitHub Action secrets using GitHub API provider.
+ Note: This provider only supports write operations (PushSecret) and cannot fetch secrets from GitHub
properties:
appID:
description: appID specifies the Github APP that will be used
@@ -1932,7 +2118,7 @@ spec:
properties:
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2003,6 +2189,8 @@ spec:
with a GitLab instance.
properties:
SecretRef:
+ description: GitlabSecretRef contains the secret reference
+ for GitLab authentication credentials.
properties:
accessToken:
description: AccessToken is used for authentication.
@@ -2115,8 +2303,8 @@ spec:
minProperties: 1
properties:
containerAuth:
- description: IBM Container-based auth with IAM Trusted
- Profile.
+ description: IBMAuthContainerAuth defines container-based
+ authentication with IAM Trusted Profile.
properties:
iamEndpoint:
type: string
@@ -2131,6 +2319,8 @@ spec:
- profile
type: object
secretRef:
+ description: IBMAuthSecretRef contains the secret reference
+ for IBM Cloud API key authentication.
properties:
secretApiKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -2176,11 +2366,49 @@ spec:
description: Auth configures how the Operator authenticates
with the Infisical API
properties:
+ awsAuthCredentials:
+ description: AwsAuthCredentials represents the credentials
+ for AWS authentication.
+ properties:
+ identityId:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - identityId
+ type: object
azureAuthCredentials:
+ description: AzureAuthCredentials represents the credentials
+ for Azure authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2209,7 +2437,7 @@ spec:
type: object
resource:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2240,10 +2468,12 @@ spec:
- identityId
type: object
gcpIamAuthCredentials:
+ description: GcpIamAuthCredentials represents the credentials
+ for GCP IAM authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2272,7 +2502,7 @@ spec:
type: object
serviceAccountKeyFilePath:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2304,10 +2534,12 @@ spec:
- serviceAccountKeyFilePath
type: object
gcpIdTokenAuthCredentials:
+ description: GcpIDTokenAuthCredentials represents the
+ credentials for GCP ID token authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2338,10 +2570,12 @@ spec:
- identityId
type: object
jwtAuthCredentials:
+ description: JwtAuthCredentials represents the credentials
+ for JWT authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2370,7 +2604,7 @@ spec:
type: object
jwt:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2401,11 +2635,78 @@ spec:
- identityId
- jwt
type: object
+ kubernetesAuthCredentials:
+ description: KubernetesAuthCredentials represents the
+ credentials for Kubernetes authentication.
+ properties:
+ identityId:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ serviceAccountTokenPath:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - identityId
+ type: object
ldapAuthCredentials:
+ description: LdapAuthCredentials represents the credentials
+ for LDAP authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2434,7 +2735,7 @@ spec:
type: object
ldapPassword:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2463,7 +2764,7 @@ spec:
type: object
ldapUsername:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2496,10 +2797,12 @@ spec:
- ldapUsername
type: object
ociAuthCredentials:
+ description: OciAuthCredentials represents the credentials
+ for OCI authentication.
properties:
fingerprint:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2528,7 +2831,7 @@ spec:
type: object
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2557,7 +2860,7 @@ spec:
type: object
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2586,7 +2889,7 @@ spec:
type: object
privateKeyPassphrase:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2615,7 +2918,7 @@ spec:
type: object
region:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2644,7 +2947,7 @@ spec:
type: object
tenancyId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2673,7 +2976,7 @@ spec:
type: object
userId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2708,11 +3011,49 @@ spec:
- tenancyId
- userId
type: object
+ tokenAuthCredentials:
+ description: TokenAuthCredentials represents the credentials
+ for access token-based authentication.
+ properties:
+ accessToken:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - accessToken
+ type: object
universalAuthCredentials:
+ description: UniversalAuthCredentials represents the client
+ credentials for universal authentication.
properties:
clientId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2741,7 +3082,7 @@ spec:
type: object
clientSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2820,7 +3161,7 @@ spec:
properties:
authRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2868,7 +3209,7 @@ spec:
properties:
clientCert:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2897,7 +3238,7 @@ spec:
type: object
clientKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2960,7 +3301,7 @@ spec:
properties:
bearerToken:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3073,6 +3414,69 @@ spec:
type: string
type: object
type: object
+ ngrok:
+ description: Ngrok configures this store to sync secrets using
+ the ngrok provider.
+ properties:
+ apiUrl:
+ default: https://api.ngrok.com
+ description: APIURL is the URL of the ngrok API.
+ type: string
+ auth:
+ description: Auth configures how the ngrok provider authenticates
+ with the ngrok API.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ apiKey:
+ description: APIKey is the API Key used to authenticate
+ with ngrok. See https://ngrok.com/docs/api/#authentication
+ properties:
+ secretRef:
+ description: SecretRef is a reference to a secret
+ containing the ngrok API key.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ type: object
+ type: object
+ vault:
+ description: Vault configures the ngrok vault to sync secrets
+ with.
+ properties:
+ name:
+ description: Name is the name of the ngrok vault to sync
+ secrets with.
+ type: string
+ required:
+ - name
+ type: object
+ required:
+ - auth
+ - vault
+ type: object
onboardbase:
description: Onboardbase configures this store to sync secrets
using the Onboardbase provider
@@ -3433,6 +3837,9 @@ spec:
- vault
type: object
passbolt:
+ description: |-
+ PassboltProvider provides access to Passbolt secrets manager.
+ See: https://www.passbolt.com.
properties:
auth:
description: Auth defines the information necessary to authenticate
@@ -3440,7 +3847,7 @@ spec:
properties:
passwordSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3469,7 +3876,7 @@ spec:
type: object
privateKeySecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3508,14 +3915,16 @@ spec:
- host
type: object
passworddepot:
- description: Configures a store to sync secrets with a Password
- Depot instance.
+ description: PasswordDepotProvider configures a store to sync
+ secrets with a Password Depot instance.
properties:
auth:
description: Auth configures how secret-manager authenticates
with a Password Depot instance.
properties:
secretRef:
+ description: PasswordDepotSecretRef contains the secret
+ reference for Password Depot authentication.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -3766,6 +4175,9 @@ spec:
SecretServer configures this store to sync secrets using SecretServer provider
https://docs.delinea.com/online-help/secret-server/start.htm
properties:
+ domain:
+ description: Domain is the secret server domain.
+ type: string
password:
description: Password is the secret server account password.
properties:
@@ -3859,7 +4271,7 @@ spec:
type: string
clientSecretSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4031,6 +4443,12 @@ spec:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
type: object
+ path:
+ default: cert
+ description: |-
+ Path where the Certificate authentication backend is mounted
+ in Vault, e.g: "cert"
+ type: string
secretRef:
description: |-
SecretRef to a key in a Secret resource containing client private key to
@@ -4073,7 +4491,8 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -4585,6 +5004,18 @@ spec:
- name
- type
type: object
+ checkAndSet:
+ description: |-
+ CheckAndSet defines the Check-And-Set (CAS) settings for PushSecret operations.
+ Only applies to Vault KV v2 stores. When enabled, write operations must include
+ the current version of the secret to prevent unintentional overwrites.
+ properties:
+ required:
+ description: |-
+ Required when true, all write operations must include a check-and-set parameter.
+ This helps prevent unintentional overwrites of secrets.
+ type: boolean
+ type: object
forwardInconsistent:
description: |-
ForwardInconsistent tells Vault to forward read-after-write requests to the Vault
@@ -4702,6 +5133,116 @@ spec:
required:
- server
type: object
+ volcengine:
+ description: Volcengine configures this store to sync secrets
+ using the Volcengine provider
+ properties:
+ auth:
+ description: |-
+ Auth defines the authentication method to use.
+ If not specified, the provider will try to use IRSA (IAM Role for Service Account).
+ properties:
+ secretRef:
+ description: |-
+ SecretRef defines the static credentials to use for authentication.
+ If not set, IRSA is used.
+ properties:
+ accessKeyID:
+ description: AccessKeyID is the reference to the secret
+ containing the Access Key ID.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ secretAccessKey:
+ description: SecretAccessKey is the reference to the
+ secret containing the Secret Access Key.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ token:
+ description: Token is the reference to the secret
+ containing the STS(Security Token Service) Token.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - accessKeyID
+ - secretAccessKey
+ type: object
+ type: object
+ region:
+ description: Region specifies the Volcengine region to connect
+ to.
+ type: string
+ required:
+ - region
+ type: object
webhook:
description: Webhook configures this store to sync secrets using
a generic templated webhook
@@ -4718,7 +5259,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4747,7 +5288,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4845,6 +5386,8 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret that will be
+ passed to the webhook request.
properties:
name:
description: Name of this secret in templates
@@ -4888,7 +5431,6 @@ spec:
description: Webhook url to call
type: string
required:
- - result
- url
type: object
yandexcertificatemanager:
@@ -4900,7 +5442,7 @@ spec:
type: string
auth:
description: Auth defines the information necessary to authenticate
- against Yandex Certificate Manager
+ against Yandex.Cloud
properties:
authorizedKeySecretRef:
description: The authorized key used for authentication
@@ -4936,7 +5478,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4964,6 +5506,30 @@ spec:
type: string
type: object
type: object
+ fetching:
+ description: FetchingPolicy configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as certificate ID or certificate name
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ byID:
+ description: ByID configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as secret ID.
+ type: object
+ byName:
+ description: ByName configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as secret name.
+ properties:
+ folderID:
+ description: The folder to fetch secrets from
+ type: string
+ required:
+ - folderID
+ type: object
+ type: object
required:
- auth
type: object
@@ -4976,7 +5542,7 @@ spec:
type: string
auth:
description: Auth defines the information necessary to authenticate
- against Yandex Lockbox
+ against Yandex.Cloud
properties:
authorizedKeySecretRef:
description: The authorized key used for authentication
@@ -5012,7 +5578,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -5040,6 +5606,30 @@ spec:
type: string
type: object
type: object
+ fetching:
+ description: FetchingPolicy configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as secret ID or secret name
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ byID:
+ description: ByID configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as secret ID.
+ type: object
+ byName:
+ description: ByName configures the provider to interpret
+ the `data.secretKey.remoteRef.key` field in ExternalSecret
+ as secret name.
+ properties:
+ folderID:
+ description: The folder to fetch secrets from
+ type: string
+ required:
+ - folderID
+ type: object
+ type: object
required:
- auth
type: object
@@ -5069,6 +5659,8 @@ spec:
type: string
conditions:
items:
+ description: SecretStoreStatusCondition contains condition information
+ for a SecretStore.
properties:
lastTransitionTime:
format: date-time
@@ -5080,6 +5672,8 @@ spec:
status:
type: string
type:
+ description: SecretStoreConditionType represents the condition
+ of the SecretStore.
type: string
required:
- status
@@ -5338,7 +5932,7 @@ spec:
type: object
accessType:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -5367,7 +5961,7 @@ spec:
type: object
accessTypeParam:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -5452,7 +6046,8 @@ spec:
description: AlibabaAuth contains a secretRef for credentials.
properties:
rrsa:
- description: Authenticate against Alibaba using RRSA.
+ description: AlibabaRRSAAuth authenticates against Alibaba
+ using RRSA (Resource-oriented RAM-based Service Authentication).
properties:
oidcProviderArn:
type: string
@@ -5556,11 +6151,12 @@ spec:
see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
properties:
jwt:
- description: Authenticate against AWS using service account
- tokens.
+ description: AWSJWTAuth authenticates against AWS using
+ service account tokens from the Kubernetes cluster.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -5724,6 +6320,7 @@ spec:
sessionTags:
description: AWS STS assume role session tags
items:
+ description: Tag defines a tag key and value for AWS resources.
properties:
key:
type: string
@@ -6716,6 +7313,8 @@ spec:
with a Device42 instance.
properties:
secretRef:
+ description: Device42SecretRef defines a reference to
+ a secret containing credentials for the Device42 provider.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -6764,6 +7363,8 @@ spec:
with the Doppler API
properties:
secretRef:
+ description: DopplerAuthSecretRef defines a reference
+ to a secret containing credentials for the Doppler provider.
properties:
dopplerToken:
description: |-
@@ -6838,6 +7439,8 @@ spec:
properties:
data:
items:
+ description: FakeProviderData defines a key-value pair for
+ the fake provider used in testing.
properties:
key:
type: string
@@ -6902,6 +7505,9 @@ spec:
against GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef defines a reference to
+ a secret containing credentials for the GCP Secret Manager
+ provider.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -6932,6 +7538,8 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines configuration
+ for using GCP Workload Identity authentication.
properties:
clusterLocation:
description: |-
@@ -6949,7 +7557,8 @@ spec:
If not specified, it fetches information from the metadata server
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -7004,7 +7613,7 @@ spec:
properties:
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7075,6 +7684,8 @@ spec:
with a GitLab instance.
properties:
SecretRef:
+ description: GitlabSecretRef defines a reference to a
+ secret containing credentials for the GitLab provider.
properties:
accessToken:
description: AccessToken is used for authentication.
@@ -7187,8 +7798,8 @@ spec:
minProperties: 1
properties:
containerAuth:
- description: IBM Container-based auth with IAM Trusted
- Profile.
+ description: IBMAuthContainerAuth defines authentication
+ using IBM Container-based auth with IAM Trusted Profile.
properties:
iamEndpoint:
type: string
@@ -7203,6 +7814,8 @@ spec:
- profile
type: object
secretRef:
+ description: IBMAuthSecretRef defines a reference to a
+ secret containing credentials for the IBM provider.
properties:
secretApiKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -7249,10 +7862,12 @@ spec:
with the Infisical API
properties:
universalAuthCredentials:
+ description: UniversalAuthCredentials defines the credentials
+ for Infisical Universal Auth.
properties:
clientId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7281,7 +7896,7 @@ spec:
type: object
clientSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7360,7 +7975,7 @@ spec:
properties:
authRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7408,7 +8023,7 @@ spec:
properties:
clientCert:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7437,7 +8052,7 @@ spec:
type: object
clientKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7500,7 +8115,7 @@ spec:
properties:
bearerToken:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7912,15 +8527,16 @@ spec:
- vault
type: object
passbolt:
+ description: PassboltProvider defines configuration for the Passbolt
+ provider.
properties:
auth:
description: Auth defines the information necessary to authenticate
against Passbolt Server
properties:
passwordSecretRef:
- description: |-
- A reference to a specific 'key' within a Secret resource.
- In some instances, `key` is a required field.
+ description: PasswordSecretRef is a reference to the secret
+ containing the Passbolt password
properties:
key:
description: |-
@@ -7947,9 +8563,8 @@ spec:
type: string
type: object
privateKeySecretRef:
- description: |-
- A reference to a specific 'key' within a Secret resource.
- In some instances, `key` is a required field.
+ description: PrivateKeySecretRef is a reference to the
+ secret containing the Passbolt private key
properties:
key:
description: |-
@@ -7987,14 +8602,17 @@ spec:
- host
type: object
passworddepot:
- description: Configures a store to sync secrets with a Password
- Depot instance.
+ description: PasswordDepotProvider configures a store to sync
+ secrets with a Password Depot instance.
properties:
auth:
description: Auth configures how secret-manager authenticates
with a Password Depot instance.
properties:
secretRef:
+ description: PasswordDepotSecretRef defines a reference
+ to a secret containing credentials for the Password
+ Depot provider.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -8338,7 +8956,7 @@ spec:
type: string
clientSecretSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -8552,7 +9170,8 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -9197,7 +9816,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -9226,7 +9845,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -9324,6 +9943,8 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret to be used in
+ webhook templates.
properties:
name:
description: Name of this secret in templates
@@ -9415,7 +10036,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -9491,7 +10112,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -9531,9 +10152,11 @@ spec:
description: Used to configure http retries if failed
properties:
maxRetries:
+ description: MaxRetries is the maximum number of retry attempts.
format: int32
type: integer
retryInterval:
+ description: RetryInterval is the interval between retry attempts.
type: string
type: object
required:
@@ -9548,6 +10171,8 @@ spec:
type: string
conditions:
items:
+ description: SecretStoreStatusCondition defines the observed condition
+ of the SecretStore.
properties:
lastTransitionTime:
format: date-time
@@ -9559,6 +10184,8 @@ spec:
status:
type: string
type:
+ description: SecretStoreConditionType represents the condition
+ type of the SecretStore.
type: string
required:
- status
diff --git a/bundle/manifests/generators.external-secrets.io_acraccesstokens.yaml b/bundle/manifests/generators.external-secrets.io_acraccesstokens.yaml
index 6ec517e46..12e9f3e29 100644
--- a/bundle/manifests/generators.external-secrets.io_acraccesstokens.yaml
+++ b/bundle/manifests/generators.external-secrets.io_acraccesstokens.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -57,6 +57,8 @@ spec:
see: https://github.com/Azure/acr/blob/main/docs/AAD-OAuth.md#overview
properties:
auth:
+ description: ACRAuth defines the authentication methods for Azure
+ Container Registry.
properties:
managedIdentity:
description: ManagedIdentity uses Azure Managed Identity to authenticate
@@ -73,8 +75,8 @@ spec:
properties:
secretRef:
description: |-
- Configuration used to authenticate with Azure using static
- credentials stored in a Kind=Secret.
+ AzureACRServicePrincipalAuthSecretRef defines the secret references for Azure Service Principal authentication.
+ It uses static credentials stored in a Kind=Secret.
properties:
clientId:
description: The Azure clientId of the service principle
@@ -177,7 +179,7 @@ spec:
default: PublicCloud
description: |-
EnvironmentType specifies the Azure cloud environment endpoints to use for
- connecting and authenticating with Azure. By default it points to the public cloud AAD endpoint.
+ connecting and authenticating with Azure. By default, it points to the public cloud AAD endpoint.
The following endpoints are available, also see here: https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L152
PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud
enum:
@@ -185,6 +187,7 @@ spec:
- USGovernmentCloud
- ChinaCloud
- GermanCloud
+ - AzureStackCloud
type: string
registry:
description: |-
diff --git a/bundle/manifests/generators.external-secrets.io_clustergenerators.yaml b/bundle/manifests/generators.external-secrets.io_clustergenerators.yaml
index 4799c9b10..2683677f6 100644
--- a/bundle/manifests/generators.external-secrets.io_clustergenerators.yaml
+++ b/bundle/manifests/generators.external-secrets.io_clustergenerators.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -44,6 +44,7 @@ spec:
metadata:
type: object
spec:
+ description: ClusterGeneratorSpec defines the desired state of a ClusterGenerator.
properties:
generator:
description: Generator the spec for this generator, must match the
@@ -58,6 +59,8 @@ spec:
see: https://github.com/Azure/acr/blob/main/docs/AAD-OAuth.md#overview
properties:
auth:
+ description: ACRAuth defines the authentication methods for
+ Azure Container Registry.
properties:
managedIdentity:
description: ManagedIdentity uses Azure Managed Identity
@@ -74,8 +77,8 @@ spec:
properties:
secretRef:
description: |-
- Configuration used to authenticate with Azure using static
- credentials stored in a Kind=Secret.
+ AzureACRServicePrincipalAuthSecretRef defines the secret references for Azure Service Principal authentication.
+ It uses static credentials stored in a Kind=Secret.
properties:
clientId:
description: The Azure clientId of the service
@@ -178,7 +181,7 @@ spec:
default: PublicCloud
description: |-
EnvironmentType specifies the Azure cloud environment endpoints to use for
- connecting and authenticating with Azure. By default it points to the public cloud AAD endpoint.
+ connecting and authenticating with Azure. By default, it points to the public cloud AAD endpoint.
The following endpoints are available, also see here: https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L152
PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud
enum:
@@ -186,6 +189,7 @@ spec:
- USGovernmentCloud
- ChinaCloud
- GermanCloud
+ - AzureStackCloud
type: string
registry:
description: |-
@@ -212,17 +216,70 @@ spec:
- auth
- registry
type: object
+ cloudsmithAccessTokenSpec:
+ description: CloudsmithAccessTokenSpec defines the configuration
+ for generating a Cloudsmith access token using OIDC authentication.
+ properties:
+ apiUrl:
+ description: APIURL configures the Cloudsmith API URL. Defaults
+ to https://api.cloudsmith.io.
+ type: string
+ orgSlug:
+ description: OrgSlug is the organization slug in Cloudsmith
+ type: string
+ serviceAccountRef:
+ description: Name of the service account you are federating
+ with
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ serviceSlug:
+ description: ServiceSlug is the service slug in Cloudsmith
+ for OIDC authentication
+ type: string
+ required:
+ - orgSlug
+ - serviceAccountRef
+ - serviceSlug
+ type: object
ecrAuthorizationTokenSpec:
+ description: ECRAuthorizationTokenSpec defines the desired state
+ to generate an AWS ECR authorization token.
properties:
auth:
description: Auth defines how to authenticate with AWS
properties:
jwt:
- description: Authenticate against AWS using service account
- tokens.
+ description: AWSJWTAuth provides configuration to authenticate
+ against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -375,12 +432,16 @@ spec:
type: object
type: object
gcrAccessTokenSpec:
+ description: GCRAccessTokenSpec defines the desired state to generate
+ a Google Container Registry access token.
properties:
auth:
description: Auth defines the means for authenticating with
GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef defines the reference
+ to a secret containing Google Cloud Platform credentials.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -411,6 +472,8 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines the configuration
+ for using GCP Workload Identity authentication.
properties:
clusterLocation:
type: string
@@ -419,7 +482,8 @@ spec:
clusterProjectID:
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -452,6 +516,127 @@ spec:
- clusterName
- serviceAccountRef
type: object
+ workloadIdentityFederation:
+ description: GCPWorkloadIdentityFederation holds the configurations
+ required for generating federated access tokens.
+ properties:
+ audience:
+ description: |-
+ audience is the Secure Token Service (STS) audience which contains the resource name for the workload identity pool and the provider identifier in that pool.
+ If specified, Audience found in the external account credential config will be overridden with the configured value.
+ audience must be provided when serviceAccountRef or awsSecurityCredentials is configured.
+ type: string
+ awsSecurityCredentials:
+ description: |-
+ awsSecurityCredentials is for configuring AWS region and credentials to use for obtaining the access token,
+ when using the AWS metadata server is not an option.
+ properties:
+ awsCredentialsSecretRef:
+ description: |-
+ awsCredentialsSecretRef is the reference to the secret which holds the AWS credentials.
+ Secret should be created with below names for keys
+ - aws_access_key_id: Access Key ID, which is the unique identifier for the AWS account or the IAM user.
+ - aws_secret_access_key: Secret Access Key, which is used to authenticate requests made to AWS services.
+ - aws_session_token: Session Token, is the short-lived token to authenticate requests made to AWS services.
+ properties:
+ name:
+ description: name of the secret.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the secret
+ exists. If empty, secret will looked up
+ in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ region:
+ description: region is for configuring the AWS
+ region to be used.
+ example: ap-south-1
+ maxLength: 50
+ minLength: 1
+ pattern: ^[a-z0-9-]+$
+ type: string
+ required:
+ - awsCredentialsSecretRef
+ - region
+ type: object
+ credConfig:
+ description: |-
+ credConfig holds the configmap reference containing the GCP external account credential configuration in JSON format and the key name containing the json data.
+ For using Kubernetes cluster as the identity provider, use serviceAccountRef instead. Operators mounted serviceaccount token cannot be used as the token source, instead
+ serviceAccountRef must be used by providing operators service account details.
+ properties:
+ key:
+ description: key name holding the external account
+ credential config.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: name of the configmap.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the configmap
+ exists. If empty, configmap will looked up in
+ local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - key
+ - name
+ type: object
+ externalTokenEndpoint:
+ description: |-
+ externalTokenEndpoint is the endpoint explicitly set up to provide tokens, which will be matched against the
+ credential_source.url in the provided credConfig. This field is merely to double-check the external token source
+ URL is having the expected value.
+ type: string
+ serviceAccountRef:
+ description: |-
+ serviceAccountRef is the reference to the kubernetes ServiceAccount to be used for obtaining the tokens,
+ when Kubernetes is configured as provider in workload identity pool.
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource
+ being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ type: object
type: object
projectID:
description: ProjectID defines which project to use to authenticate
@@ -462,6 +647,8 @@ spec:
- projectID
type: object
githubAccessTokenSpec:
+ description: GithubAccessTokenSpec defines the desired state to
+ generate a GitHub access token.
properties:
appID:
type: string
@@ -470,10 +657,12 @@ spec:
Github instance.
properties:
privateKey:
+ description: GithubSecretRef references a secret containing
+ GitHub credentials.
properties:
secretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -522,7 +711,7 @@ spec:
type: string
type: array
url:
- description: URL configures the Github instance URL. Defaults
+ description: URL configures the GitHub instance URL. Defaults
to https://github.com/.
type: string
required:
@@ -685,6 +874,23 @@ spec:
Digits specifies the number of digits in the generated
password. If omitted it defaults to 25% of the length of the password
type: integer
+ encoding:
+ default: raw
+ description: |-
+ Encoding specifies the encoding of the generated password.
+ Valid values are:
+ - "raw" (default): no encoding
+ - "base64": standard base64 encoding
+ - "base64url": base64url encoding
+ - "base32": base32 encoding
+ - "hex": hexadecimal encoding
+ enum:
+ - base64
+ - base64url
+ - base32
+ - hex
+ - raw
+ type: string
length:
default: 24
description: |-
@@ -711,6 +917,8 @@ spec:
- noUpper
type: object
quayAccessTokenSpec:
+ description: QuayAccessTokenSpec defines the desired state to
+ generate a Quay access token.
properties:
robotAccount:
description: Name of the robot account you are federating
@@ -778,16 +986,19 @@ spec:
type: string
type: object
stsSessionTokenSpec:
+ description: STSSessionTokenSpec defines the desired state to
+ generate an AWS STS session token.
properties:
auth:
description: Auth defines how to authenticate with AWS
properties:
jwt:
- description: Authenticate against AWS using service account
- tokens.
+ description: AWSJWTAuth provides configuration to authenticate
+ against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -941,6 +1152,8 @@ spec:
description: UUIDSpec controls the behavior of the uuid generator.
type: object
vaultDynamicSecretSpec:
+ description: VaultDynamicSecretSpec defines the desired spec of
+ VaultDynamicSecret.
properties:
allowEmptyResponse:
default: false
@@ -1085,6 +1298,12 @@ spec:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
type: object
+ path:
+ default: cert
+ description: |-
+ Path where the Certificate authentication backend is mounted
+ in Vault, e.g: "cert"
+ type: string
secretRef:
description: |-
SecretRef to a key in a Secret resource containing client private key to
@@ -1129,8 +1348,8 @@ spec:
enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount
- resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -1643,6 +1862,18 @@ spec:
- name
- type
type: object
+ checkAndSet:
+ description: |-
+ CheckAndSet defines the Check-And-Set (CAS) settings for PushSecret operations.
+ Only applies to Vault KV v2 stores. When enabled, write operations must include
+ the current version of the secret to prevent unintentional overwrites.
+ properties:
+ required:
+ description: |-
+ Required when true, all write operations must include a check-and-set parameter.
+ This helps prevent unintentional overwrites of secrets.
+ type: boolean
+ type: object
forwardInconsistent:
description: |-
ForwardInconsistent tells Vault to forward read-after-write requests to the Vault
@@ -1764,7 +1995,7 @@ spec:
default: Data
description: |-
Result type defines which data is returned from the generator.
- By default it is the "data" section of the Vault API response.
+ By default, it is the "data" section of the Vault API response.
When using e.g. /auth/token/create the "data" section is empty but
the "auth" section contains the generated token.
Please refer to the vault docs regarding the result data structure.
@@ -1804,7 +2035,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -1833,7 +2064,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -1931,6 +2162,8 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret reference that
+ will be used in webhook templates.
properties:
name:
description: Name of this secret in templates
@@ -1972,6 +2205,7 @@ spec:
description: Kind the kind of this generator.
enum:
- ACRAccessToken
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
diff --git a/bundle/manifests/generators.external-secrets.io_ecrauthorizationtokens.yaml b/bundle/manifests/generators.external-secrets.io_ecrauthorizationtokens.yaml
index f79b0260d..af81e64dd 100644
--- a/bundle/manifests/generators.external-secrets.io_ecrauthorizationtokens.yaml
+++ b/bundle/manifests/generators.external-secrets.io_ecrauthorizationtokens.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -24,8 +24,7 @@ spec:
schema:
openAPIV3Schema:
description: |-
- ECRAuthorizationTokenSpec uses the GetAuthorizationToken API to retrieve an
- authorization token.
+ ECRAuthorizationToken uses the GetAuthorizationToken API to retrieve an authorization token.
The authorization token is valid for 12 hours.
The authorizationToken returned is a base64 encoded string that can be decoded
and used in a docker login command to authenticate to a registry.
@@ -49,15 +48,19 @@ spec:
metadata:
type: object
spec:
+ description: ECRAuthorizationTokenSpec defines the desired state to generate
+ an AWS ECR authorization token.
properties:
auth:
description: Auth defines how to authenticate with AWS
properties:
jwt:
- description: Authenticate against AWS using service account tokens.
+ description: AWSJWTAuth provides configuration to authenticate
+ against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount
+ resource.
properties:
audiences:
description: |-
diff --git a/bundle/manifests/generators.external-secrets.io_gcraccesstokens.yaml b/bundle/manifests/generators.external-secrets.io_gcraccesstokens.yaml
index b4fb326b3..b2382b1ee 100644
--- a/bundle/manifests/generators.external-secrets.io_gcraccesstokens.yaml
+++ b/bundle/manifests/generators.external-secrets.io_gcraccesstokens.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -45,11 +45,15 @@ spec:
metadata:
type: object
spec:
+ description: GCRAccessTokenSpec defines the desired state to generate
+ a Google Container Registry access token.
properties:
auth:
description: Auth defines the means for authenticating with GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef defines the reference to a secret
+ containing Google Cloud Platform credentials.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -80,6 +84,8 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines the configuration for
+ using GCP Workload Identity authentication.
properties:
clusterLocation:
type: string
@@ -88,7 +94,8 @@ spec:
clusterProjectID:
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount
+ resource.
properties:
audiences:
description: |-
@@ -121,6 +128,125 @@ spec:
- clusterName
- serviceAccountRef
type: object
+ workloadIdentityFederation:
+ description: GCPWorkloadIdentityFederation holds the configurations
+ required for generating federated access tokens.
+ properties:
+ audience:
+ description: |-
+ audience is the Secure Token Service (STS) audience which contains the resource name for the workload identity pool and the provider identifier in that pool.
+ If specified, Audience found in the external account credential config will be overridden with the configured value.
+ audience must be provided when serviceAccountRef or awsSecurityCredentials is configured.
+ type: string
+ awsSecurityCredentials:
+ description: |-
+ awsSecurityCredentials is for configuring AWS region and credentials to use for obtaining the access token,
+ when using the AWS metadata server is not an option.
+ properties:
+ awsCredentialsSecretRef:
+ description: |-
+ awsCredentialsSecretRef is the reference to the secret which holds the AWS credentials.
+ Secret should be created with below names for keys
+ - aws_access_key_id: Access Key ID, which is the unique identifier for the AWS account or the IAM user.
+ - aws_secret_access_key: Secret Access Key, which is used to authenticate requests made to AWS services.
+ - aws_session_token: Session Token, is the short-lived token to authenticate requests made to AWS services.
+ properties:
+ name:
+ description: name of the secret.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the secret exists.
+ If empty, secret will looked up in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ region:
+ description: region is for configuring the AWS region
+ to be used.
+ example: ap-south-1
+ maxLength: 50
+ minLength: 1
+ pattern: ^[a-z0-9-]+$
+ type: string
+ required:
+ - awsCredentialsSecretRef
+ - region
+ type: object
+ credConfig:
+ description: |-
+ credConfig holds the configmap reference containing the GCP external account credential configuration in JSON format and the key name containing the json data.
+ For using Kubernetes cluster as the identity provider, use serviceAccountRef instead. Operators mounted serviceaccount token cannot be used as the token source, instead
+ serviceAccountRef must be used by providing operators service account details.
+ properties:
+ key:
+ description: key name holding the external account credential
+ config.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: name of the configmap.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the configmap exists.
+ If empty, configmap will looked up in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - key
+ - name
+ type: object
+ externalTokenEndpoint:
+ description: |-
+ externalTokenEndpoint is the endpoint explicitly set up to provide tokens, which will be matched against the
+ credential_source.url in the provided credConfig. This field is merely to double-check the external token source
+ URL is having the expected value.
+ type: string
+ serviceAccountRef:
+ description: |-
+ serviceAccountRef is the reference to the kubernetes ServiceAccount to be used for obtaining the tokens,
+ when Kubernetes is configured as provider in workload identity pool.
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource being
+ referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ type: object
type: object
projectID:
description: ProjectID defines which project to use to authenticate
diff --git a/bundle/manifests/generators.external-secrets.io_generatorstates.yaml b/bundle/manifests/generators.external-secrets.io_generatorstates.yaml
index c3fa2540f..d6055d69a 100644
--- a/bundle/manifests/generators.external-secrets.io_generatorstates.yaml
+++ b/bundle/manifests/generators.external-secrets.io_generatorstates.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -32,6 +32,8 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
+ description: GeneratorState represents the state created and managed by a
+ generator resource.
properties:
apiVersion:
description: |-
@@ -51,6 +53,8 @@ spec:
metadata:
type: object
spec:
+ description: GeneratorStateSpec defines the desired state of a generator
+ state resource.
properties:
garbageCollectionDeadline:
description: |-
@@ -78,9 +82,13 @@ spec:
- state
type: object
status:
+ description: GeneratorStateStatus defines the observed state of a generator
+ state resource.
properties:
conditions:
items:
+ description: GeneratorStateStatusCondition represents the observed
+ condition of a generator state.
properties:
lastTransitionTime:
format: date-time
@@ -92,6 +100,8 @@ spec:
status:
type: string
type:
+ description: GeneratorStateConditionType represents the type
+ of condition for a generator state.
type: string
required:
- status
diff --git a/bundle/manifests/generators.external-secrets.io_githubaccesstokens.yaml b/bundle/manifests/generators.external-secrets.io_githubaccesstokens.yaml
index df6faa111..a3650e438 100644
--- a/bundle/manifests/generators.external-secrets.io_githubaccesstokens.yaml
+++ b/bundle/manifests/generators.external-secrets.io_githubaccesstokens.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -43,6 +43,8 @@ spec:
metadata:
type: object
spec:
+ description: GithubAccessTokenSpec defines the desired state to generate
+ a GitHub access token.
properties:
appID:
type: string
@@ -50,10 +52,12 @@ spec:
description: Auth configures how ESO authenticates with a Github instance.
properties:
privateKey:
+ description: GithubSecretRef references a secret containing GitHub
+ credentials.
properties:
secretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -102,7 +106,7 @@ spec:
type: string
type: array
url:
- description: URL configures the Github instance URL. Defaults to https://github.com/.
+ description: URL configures the GitHub instance URL. Defaults to https://github.com/.
type: string
required:
- appID
diff --git a/bundle/manifests/generators.external-secrets.io_grafanas.yaml b/bundle/manifests/generators.external-secrets.io_grafanas.yaml
index 6a751180c..22bf83313 100644
--- a/bundle/manifests/generators.external-secrets.io_grafanas.yaml
+++ b/bundle/manifests/generators.external-secrets.io_grafanas.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -23,6 +23,7 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
+ description: Grafana represents a generator for Grafana service account tokens.
properties:
apiVersion:
description: |-
diff --git a/bundle/manifests/generators.external-secrets.io_mfas.yaml b/bundle/manifests/generators.external-secrets.io_mfas.yaml
index 34b82a26d..d117a332d 100644
--- a/bundle/manifests/generators.external-secrets.io_mfas.yaml
+++ b/bundle/manifests/generators.external-secrets.io_mfas.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
diff --git a/bundle/manifests/generators.external-secrets.io_passwords.yaml b/bundle/manifests/generators.external-secrets.io_passwords.yaml
index ea2f555a6..a4c72e4af 100644
--- a/bundle/manifests/generators.external-secrets.io_passwords.yaml
+++ b/bundle/manifests/generators.external-secrets.io_passwords.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -57,6 +57,23 @@ spec:
Digits specifies the number of digits in the generated
password. If omitted it defaults to 25% of the length of the password
type: integer
+ encoding:
+ default: raw
+ description: |-
+ Encoding specifies the encoding of the generated password.
+ Valid values are:
+ - "raw" (default): no encoding
+ - "base64": standard base64 encoding
+ - "base64url": base64url encoding
+ - "base32": base32 encoding
+ - "hex": hexadecimal encoding
+ enum:
+ - base64
+ - base64url
+ - base32
+ - hex
+ - raw
+ type: string
length:
default: 24
description: |-
diff --git a/bundle/manifests/generators.external-secrets.io_quayaccesstokens.yaml b/bundle/manifests/generators.external-secrets.io_quayaccesstokens.yaml
index cd10d3307..e547d1567 100644
--- a/bundle/manifests/generators.external-secrets.io_quayaccesstokens.yaml
+++ b/bundle/manifests/generators.external-secrets.io_quayaccesstokens.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -44,6 +44,8 @@ spec:
metadata:
type: object
spec:
+ description: QuayAccessTokenSpec defines the desired state to generate
+ a Quay access token.
properties:
robotAccount:
description: Name of the robot account you are federating with
diff --git a/bundle/manifests/generators.external-secrets.io_sshkeys.yaml b/bundle/manifests/generators.external-secrets.io_sshkeys.yaml
index 327825c11..9c3dd208b 100644
--- a/bundle/manifests/generators.external-secrets.io_sshkeys.yaml
+++ b/bundle/manifests/generators.external-secrets.io_sshkeys.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
diff --git a/bundle/manifests/generators.external-secrets.io_stssessiontokens.yaml b/bundle/manifests/generators.external-secrets.io_stssessiontokens.yaml
index 069a69bd4..7298d0608 100644
--- a/bundle/manifests/generators.external-secrets.io_stssessiontokens.yaml
+++ b/bundle/manifests/generators.external-secrets.io_stssessiontokens.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -47,15 +47,19 @@ spec:
metadata:
type: object
spec:
+ description: STSSessionTokenSpec defines the desired state to generate
+ an AWS STS session token.
properties:
auth:
description: Auth defines how to authenticate with AWS
properties:
jwt:
- description: Authenticate against AWS using service account tokens.
+ description: AWSJWTAuth provides configuration to authenticate
+ against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount
+ resource.
properties:
audiences:
description: |-
diff --git a/bundle/manifests/generators.external-secrets.io_uuids.yaml b/bundle/manifests/generators.external-secrets.io_uuids.yaml
index 40d620515..439e3f011 100644
--- a/bundle/manifests/generators.external-secrets.io_uuids.yaml
+++ b/bundle/manifests/generators.external-secrets.io_uuids.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
diff --git a/bundle/manifests/generators.external-secrets.io_vaultdynamicsecrets.yaml b/bundle/manifests/generators.external-secrets.io_vaultdynamicsecrets.yaml
index a9805b562..1f91aaf7d 100644
--- a/bundle/manifests/generators.external-secrets.io_vaultdynamicsecrets.yaml
+++ b/bundle/manifests/generators.external-secrets.io_vaultdynamicsecrets.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -23,6 +23,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
+ description: VaultDynamicSecret represents a generator that can create dynamic
+ secrets from HashiCorp Vault.
properties:
apiVersion:
description: |-
@@ -42,6 +44,7 @@ spec:
metadata:
type: object
spec:
+ description: VaultDynamicSecretSpec defines the desired spec of VaultDynamicSecret.
properties:
allowEmptyResponse:
default: false
@@ -185,6 +188,12 @@ spec:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
type: object
+ path:
+ default: cert
+ description: |-
+ Path where the Certificate authentication backend is mounted
+ in Vault, e.g: "cert"
+ type: string
secretRef:
description: |-
SecretRef to a key in a Secret resource containing client private key to
@@ -227,7 +236,8 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference
+ to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -738,6 +748,18 @@ spec:
- name
- type
type: object
+ checkAndSet:
+ description: |-
+ CheckAndSet defines the Check-And-Set (CAS) settings for PushSecret operations.
+ Only applies to Vault KV v2 stores. When enabled, write operations must include
+ the current version of the secret to prevent unintentional overwrites.
+ properties:
+ required:
+ description: |-
+ Required when true, all write operations must include a check-and-set parameter.
+ This helps prevent unintentional overwrites of secrets.
+ type: boolean
+ type: object
forwardInconsistent:
description: |-
ForwardInconsistent tells Vault to forward read-after-write requests to the Vault
@@ -859,7 +881,7 @@ spec:
default: Data
description: |-
Result type defines which data is returned from the generator.
- By default it is the "data" section of the Vault API response.
+ By default, it is the "data" section of the Vault API response.
When using e.g. /auth/token/create the "data" section is empty but
the "auth" section contains the generated token.
Please refer to the vault docs regarding the result data structure.
diff --git a/bundle/manifests/generators.external-secrets.io_webhooks.yaml b/bundle/manifests/generators.external-secrets.io_webhooks.yaml
index 1eaf3131b..bcee9c79c 100644
--- a/bundle/manifests/generators.external-secrets.io_webhooks.yaml
+++ b/bundle/manifests/generators.external-secrets.io_webhooks.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app: external-secrets
@@ -63,7 +63,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -92,7 +92,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -189,6 +189,8 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret reference that will
+ be used in webhook templates.
properties:
name:
description: Name of this secret in templates
diff --git a/bundle/manifests/operator.openshift.io_externalsecretsconfigs.yaml b/bundle/manifests/operator.openshift.io_externalsecretsconfigs.yaml
index 770bf48c8..8324edf6c 100644
--- a/bundle/manifests/operator.openshift.io_externalsecretsconfigs.yaml
+++ b/bundle/manifests/operator.openshift.io_externalsecretsconfigs.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.17.3
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app.kubernetes.io/name: externalsecretsconfig
@@ -356,7 +356,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -371,7 +370,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -538,7 +536,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -553,7 +550,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -647,8 +643,8 @@ spec:
most preferred is the one with the greatest sum of weights, i.e.
for each node that meets all of the scheduling requirements (resource
request, requiredDuringScheduling anti-affinity expressions, etc.),
- compute a sum by iterating through the elements of this field and adding
- "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+ compute a sum by iterating through the elements of this field and subtracting
+ "weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the
node(s) with the highest sum are the most preferred.
items:
description: The weights of all of the matched WeightedPodAffinityTerm
@@ -718,7 +714,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -733,7 +728,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -900,7 +894,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -915,7 +908,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1061,7 +1053,7 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
- This is an alpha field and requires enabling the
+ This field depends on the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
diff --git a/bundle/manifests/operator.openshift.io_externalsecretsmanagers.yaml b/bundle/manifests/operator.openshift.io_externalsecretsmanagers.yaml
index 11a2023cd..fb31cbfeb 100644
--- a/bundle/manifests/operator.openshift.io_externalsecretsmanagers.yaml
+++ b/bundle/manifests/operator.openshift.io_externalsecretsmanagers.yaml
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.17.3
+ controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
labels:
app.kubernetes.io/name: externalsecretsmanager
@@ -350,7 +350,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -365,7 +364,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -532,7 +530,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -547,7 +544,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -641,8 +637,8 @@ spec:
most preferred is the one with the greatest sum of weights, i.e.
for each node that meets all of the scheduling requirements (resource
request, requiredDuringScheduling anti-affinity expressions, etc.),
- compute a sum by iterating through the elements of this field and adding
- "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+ compute a sum by iterating through the elements of this field and subtracting
+ "weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the
node(s) with the highest sum are the most preferred.
items:
description: The weights of all of the matched WeightedPodAffinityTerm
@@ -712,7 +708,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -727,7 +722,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -894,7 +888,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -909,7 +902,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1058,7 +1050,7 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
- This is an alpha field and requires enabling the
+ This field depends on the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
diff --git a/config/crd/bases/customresourcedefinition_acraccesstokens.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_acraccesstokens.generators.external-secrets.io.yml
index 88ee1461c..cd0b10a5d 100644
--- a/config/crd/bases/customresourcedefinition_acraccesstokens.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_acraccesstokens.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -57,6 +57,7 @@ spec:
see: https://github.com/Azure/acr/blob/main/docs/AAD-OAuth.md#overview
properties:
auth:
+ description: ACRAuth defines the authentication methods for Azure Container Registry.
properties:
managedIdentity:
description: ManagedIdentity uses Azure Managed Identity to authenticate with Azure.
@@ -70,8 +71,8 @@ spec:
properties:
secretRef:
description: |-
- Configuration used to authenticate with Azure using static
- credentials stored in a Kind=Secret.
+ AzureACRServicePrincipalAuthSecretRef defines the secret references for Azure Service Principal authentication.
+ It uses static credentials stored in a Kind=Secret.
properties:
clientId:
description: The Azure clientId of the service principle used for authentication.
@@ -168,7 +169,7 @@ spec:
default: PublicCloud
description: |-
EnvironmentType specifies the Azure cloud environment endpoints to use for
- connecting and authenticating with Azure. By default it points to the public cloud AAD endpoint.
+ connecting and authenticating with Azure. By default, it points to the public cloud AAD endpoint.
The following endpoints are available, also see here: https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L152
PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud
enum:
@@ -176,6 +177,7 @@ spec:
- USGovernmentCloud
- ChinaCloud
- GermanCloud
+ - AzureStackCloud
type: string
registry:
description: |-
diff --git a/config/crd/bases/customresourcedefinition_cloudsmithaccesstokens.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_cloudsmithaccesstokens.generators.external-secrets.io.yml
new file mode 100644
index 000000000..f43be409c
--- /dev/null
+++ b/config/crd/bases/customresourcedefinition_cloudsmithaccesstokens.generators.external-secrets.io.yml
@@ -0,0 +1,94 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.19.0
+ labels:
+ external-secrets.io/component: controller
+ app: external-secrets
+ name: cloudsmithaccesstokens.generators.external-secrets.io
+spec:
+ group: generators.external-secrets.io
+ names:
+ categories:
+ - external-secrets
+ - external-secrets-generators
+ kind: CloudsmithAccessToken
+ listKind: CloudsmithAccessTokenList
+ plural: cloudsmithaccesstokens
+ singular: cloudsmithaccesstoken
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ schema:
+ openAPIV3Schema:
+ description: CloudsmithAccessToken generates Cloudsmith access token using OIDC authentication
+ properties:
+ apiVersion:
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
+ type: string
+ kind:
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: CloudsmithAccessTokenSpec defines the configuration for generating a Cloudsmith access token using OIDC authentication.
+ properties:
+ apiUrl:
+ description: APIURL configures the Cloudsmith API URL. Defaults to https://api.cloudsmith.io.
+ type: string
+ orgSlug:
+ description: OrgSlug is the organization slug in Cloudsmith
+ type: string
+ serviceAccountRef:
+ description: Name of the service account you are federating with
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ serviceSlug:
+ description: ServiceSlug is the service slug in Cloudsmith for OIDC authentication
+ type: string
+ required:
+ - orgSlug
+ - serviceAccountRef
+ - serviceSlug
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/config/crd/bases/customresourcedefinition_clusterexternalsecrets.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_clusterexternalsecrets.external-secrets.io.yml
index 42fec8698..8422f2e69 100644
--- a/config/crd/bases/customresourcedefinition_clusterexternalsecrets.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_clusterexternalsecrets.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -153,6 +153,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -206,6 +207,9 @@ spec:
DataFrom is used to fetch all properties from a specific Provider data
If multiple entries are specified, the Secret keys are merged in the specified order
items:
+ description: |-
+ ExternalSecretDataFromRemoteRef defines the connection between the Kubernetes Secret keys and the Provider data
+ when using DataFrom to fetch multiple values from a Provider.
properties:
extract:
description: |-
@@ -289,6 +293,7 @@ spec:
Used to rewrite secret Keys after getting them from the secret Provider
Multiple Rewrite operations can be provided. They are applied in a layered order (first to last)
items:
+ description: ExternalSecretRewrite defines how to rewrite secret data values before they are written to the Secret.
maxProperties: 1
minProperties: 1
properties:
@@ -300,6 +305,9 @@ spec:
conflictPolicy:
default: Error
description: Used to define the policy to use in conflict resolution.
+ enum:
+ - Ignore
+ - Error
type: string
into:
default: ""
@@ -312,9 +320,19 @@ spec:
items:
type: string
type: array
+ priorityPolicy:
+ default: Strict
+ description: Used to define the policy when a key in the priority list does not exist in the input.
+ enum:
+ - IgnoreNotFound
+ - Strict
+ type: string
strategy:
default: Extract
description: Used to define the strategy to use in the merge operation.
+ enum:
+ - Extract
+ - JSON
type: string
type: object
regexp:
@@ -370,6 +388,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -459,8 +478,8 @@ spec:
creationPolicy: Owner
deletionPolicy: Retain
description: |-
- ExternalSecretTarget defines the Kubernetes Secret to be created
- There can be only one target per ExternalSecret.
+ ExternalSecretTarget defines the Kubernetes Secret to be created,
+ there can be only one target per ExternalSecret.
properties:
creationPolicy:
default: Owner
@@ -512,6 +531,7 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how the rendered template should be merged with the existing Secret data.
enum:
- Replace
- Merge
@@ -523,6 +543,10 @@ spec:
additionalProperties:
type: string
type: object
+ finalizers:
+ items:
+ type: string
+ type: array
labels:
additionalProperties:
type: string
@@ -530,12 +554,17 @@ spec:
type: object
templateFrom:
items:
+ description: |-
+ TemplateFrom specifies a source for templates.
+ Each item in the list can either reference a ConfigMap or a Secret resource.
properties:
configMap:
+ description: TemplateRef specifies a reference to either a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in the ConfigMap/Secret to use as a template for Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -545,6 +574,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -566,10 +596,12 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef specifies a reference to either a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in the ConfigMap/Secret to use as a template for Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -579,6 +611,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -599,6 +632,7 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget specifies where the rendered templates should be applied.
enum:
- Data
- Annotations
@@ -728,12 +762,14 @@ spec:
properties:
conditions:
items:
+ description: ClusterExternalSecretStatusCondition defines the observed state of a ClusterExternalSecret resource.
properties:
message:
type: string
status:
type: string
type:
+ description: ClusterExternalSecretConditionType defines a value type for ClusterExternalSecret conditions.
type: string
required:
- status
@@ -783,7 +819,7 @@ spec:
name: v1beta1
schema:
openAPIV3Schema:
- description: ClusterExternalSecret is the Schema for the clusterexternalsecrets API.
+ description: ClusterExternalSecret is the schema for the clusterexternalsecrets API.
properties:
apiVersion:
description: |-
@@ -954,6 +990,7 @@ spec:
DataFrom is used to fetch all properties from a specific Provider data
If multiple entries are specified, the Secret keys are merged in the specified order
items:
+ description: ExternalSecretDataFromRemoteRef defines a reference to multiple secrets in the provider to be fetched using options.
properties:
extract:
description: |-
@@ -1037,6 +1074,7 @@ spec:
Used to rewrite secret Keys after getting them from the secret Provider
Multiple Rewrite operations can be provided. They are applied in a layered order (first to last)
items:
+ description: ExternalSecretRewrite defines rules on how to rewrite secret keys.
maxProperties: 1
minProperties: 1
properties:
@@ -1234,6 +1272,7 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how template values should be merged when generating a secret.
enum:
- Replace
- Merge
@@ -1252,12 +1291,15 @@ spec:
type: object
templateFrom:
items:
+ description: TemplateFrom defines a source for template data.
properties:
configMap:
+ description: TemplateRef defines a reference to a template source in a ConfigMap or Secret.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem defines which key in the referenced ConfigMap or Secret to use as a template.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -1267,6 +1309,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope defines the scope of the template when processing template data.
enum:
- Values
- KeysAndValues
@@ -1288,10 +1331,12 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef defines a reference to a template source in a ConfigMap or Secret.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem defines which key in the referenced ConfigMap or Secret to use as a template.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -1301,6 +1346,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope defines the scope of the template when processing template data.
enum:
- Values
- KeysAndValues
@@ -1321,6 +1367,7 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget defines the target field where the template result will be stored.
enum:
- Data
- Annotations
@@ -1448,12 +1495,14 @@ spec:
properties:
conditions:
items:
+ description: ClusterExternalSecretStatusCondition indicates the status of the ClusterExternalSecret.
properties:
message:
type: string
status:
type: string
type:
+ description: ClusterExternalSecretConditionType indicates the condition of the ClusterExternalSecret.
type: string
required:
- status
diff --git a/config/crd/bases/customresourcedefinition_clustergenerators.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_clustergenerators.generators.external-secrets.io.yml
index aaaf43d1f..ce87da69a 100644
--- a/config/crd/bases/customresourcedefinition_clustergenerators.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_clustergenerators.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -43,6 +43,7 @@ spec:
metadata:
type: object
spec:
+ description: ClusterGeneratorSpec defines the desired state of a ClusterGenerator.
properties:
generator:
description: Generator the spec for this generator, must match the kind.
@@ -56,6 +57,7 @@ spec:
see: https://github.com/Azure/acr/blob/main/docs/AAD-OAuth.md#overview
properties:
auth:
+ description: ACRAuth defines the authentication methods for Azure Container Registry.
properties:
managedIdentity:
description: ManagedIdentity uses Azure Managed Identity to authenticate with Azure.
@@ -69,8 +71,8 @@ spec:
properties:
secretRef:
description: |-
- Configuration used to authenticate with Azure using static
- credentials stored in a Kind=Secret.
+ AzureACRServicePrincipalAuthSecretRef defines the secret references for Azure Service Principal authentication.
+ It uses static credentials stored in a Kind=Secret.
properties:
clientId:
description: The Azure clientId of the service principle used for authentication.
@@ -167,7 +169,7 @@ spec:
default: PublicCloud
description: |-
EnvironmentType specifies the Azure cloud environment endpoints to use for
- connecting and authenticating with Azure. By default it points to the public cloud AAD endpoint.
+ connecting and authenticating with Azure. By default, it points to the public cloud AAD endpoint.
The following endpoints are available, also see here: https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L152
PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud
enum:
@@ -175,6 +177,7 @@ spec:
- USGovernmentCloud
- ChinaCloud
- GermanCloud
+ - AzureStackCloud
type: string
registry:
description: |-
@@ -200,16 +203,62 @@ spec:
- auth
- registry
type: object
+ cloudsmithAccessTokenSpec:
+ description: CloudsmithAccessTokenSpec defines the configuration for generating a Cloudsmith access token using OIDC authentication.
+ properties:
+ apiUrl:
+ description: APIURL configures the Cloudsmith API URL. Defaults to https://api.cloudsmith.io.
+ type: string
+ orgSlug:
+ description: OrgSlug is the organization slug in Cloudsmith
+ type: string
+ serviceAccountRef:
+ description: Name of the service account you are federating with
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ serviceSlug:
+ description: ServiceSlug is the service slug in Cloudsmith for OIDC authentication
+ type: string
+ required:
+ - orgSlug
+ - serviceAccountRef
+ - serviceSlug
+ type: object
ecrAuthorizationTokenSpec:
+ description: ECRAuthorizationTokenSpec defines the desired state to generate an AWS ECR authorization token.
properties:
auth:
description: Auth defines how to authenticate with AWS
properties:
jwt:
- description: Authenticate against AWS using service account tokens.
+ description: AWSJWTAuth provides configuration to authenticate against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -358,11 +407,13 @@ spec:
type: object
type: object
gcrAccessTokenSpec:
+ description: GCRAccessTokenSpec defines the desired state to generate a Google Container Registry access token.
properties:
auth:
description: Auth defines the means for authenticating with GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef defines the reference to a secret containing Google Cloud Platform credentials.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -392,6 +443,7 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines the configuration for using GCP Workload Identity authentication.
properties:
clusterLocation:
type: string
@@ -400,7 +452,7 @@ spec:
clusterProjectID:
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -432,6 +484,119 @@ spec:
- clusterName
- serviceAccountRef
type: object
+ workloadIdentityFederation:
+ description: GCPWorkloadIdentityFederation holds the configurations required for generating federated access tokens.
+ properties:
+ audience:
+ description: |-
+ audience is the Secure Token Service (STS) audience which contains the resource name for the workload identity pool and the provider identifier in that pool.
+ If specified, Audience found in the external account credential config will be overridden with the configured value.
+ audience must be provided when serviceAccountRef or awsSecurityCredentials is configured.
+ type: string
+ awsSecurityCredentials:
+ description: |-
+ awsSecurityCredentials is for configuring AWS region and credentials to use for obtaining the access token,
+ when using the AWS metadata server is not an option.
+ properties:
+ awsCredentialsSecretRef:
+ description: |-
+ awsCredentialsSecretRef is the reference to the secret which holds the AWS credentials.
+ Secret should be created with below names for keys
+ - aws_access_key_id: Access Key ID, which is the unique identifier for the AWS account or the IAM user.
+ - aws_secret_access_key: Secret Access Key, which is used to authenticate requests made to AWS services.
+ - aws_session_token: Session Token, is the short-lived token to authenticate requests made to AWS services.
+ properties:
+ name:
+ description: name of the secret.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the secret exists. If empty, secret will looked up in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ region:
+ description: region is for configuring the AWS region to be used.
+ example: ap-south-1
+ maxLength: 50
+ minLength: 1
+ pattern: ^[a-z0-9-]+$
+ type: string
+ required:
+ - awsCredentialsSecretRef
+ - region
+ type: object
+ credConfig:
+ description: |-
+ credConfig holds the configmap reference containing the GCP external account credential configuration in JSON format and the key name containing the json data.
+ For using Kubernetes cluster as the identity provider, use serviceAccountRef instead. Operators mounted serviceaccount token cannot be used as the token source, instead
+ serviceAccountRef must be used by providing operators service account details.
+ properties:
+ key:
+ description: key name holding the external account credential config.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: name of the configmap.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the configmap exists. If empty, configmap will looked up in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - key
+ - name
+ type: object
+ externalTokenEndpoint:
+ description: |-
+ externalTokenEndpoint is the endpoint explicitly set up to provide tokens, which will be matched against the
+ credential_source.url in the provided credConfig. This field is merely to double-check the external token source
+ URL is having the expected value.
+ type: string
+ serviceAccountRef:
+ description: |-
+ serviceAccountRef is the reference to the kubernetes ServiceAccount to be used for obtaining the tokens,
+ when Kubernetes is configured as provider in workload identity pool.
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ type: object
type: object
projectID:
description: ProjectID defines which project to use to authenticate with
@@ -441,6 +606,7 @@ spec:
- projectID
type: object
githubAccessTokenSpec:
+ description: GithubAccessTokenSpec defines the desired state to generate a GitHub access token.
properties:
appID:
type: string
@@ -448,10 +614,11 @@ spec:
description: Auth configures how ESO authenticates with a Github instance.
properties:
privateKey:
+ description: GithubSecretRef references a secret containing GitHub credentials.
properties:
secretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -498,7 +665,7 @@ spec:
type: string
type: array
url:
- description: URL configures the Github instance URL. Defaults to https://github.com/.
+ description: URL configures the GitHub instance URL. Defaults to https://github.com/.
type: string
required:
- appID
@@ -647,6 +814,23 @@ spec:
Digits specifies the number of digits in the generated
password. If omitted it defaults to 25% of the length of the password
type: integer
+ encoding:
+ default: raw
+ description: |-
+ Encoding specifies the encoding of the generated password.
+ Valid values are:
+ - "raw" (default): no encoding
+ - "base64": standard base64 encoding
+ - "base64url": base64url encoding
+ - "base32": base32 encoding
+ - "hex": hexadecimal encoding
+ enum:
+ - base64
+ - base64url
+ - base32
+ - hex
+ - raw
+ type: string
length:
default: 24
description: |-
@@ -673,6 +857,7 @@ spec:
- noUpper
type: object
quayAccessTokenSpec:
+ description: QuayAccessTokenSpec defines the desired state to generate a Quay access token.
properties:
robotAccount:
description: Name of the robot account you are federating with
@@ -735,15 +920,16 @@ spec:
type: string
type: object
stsSessionTokenSpec:
+ description: STSSessionTokenSpec defines the desired state to generate an AWS STS session token.
properties:
auth:
description: Auth defines how to authenticate with AWS
properties:
jwt:
- description: Authenticate against AWS using service account tokens.
+ description: AWSJWTAuth provides configuration to authenticate against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -891,6 +1077,7 @@ spec:
description: UUIDSpec controls the behavior of the uuid generator.
type: object
vaultDynamicSecretSpec:
+ description: VaultDynamicSecretSpec defines the desired spec of VaultDynamicSecret.
properties:
allowEmptyResponse:
default: false
@@ -1029,6 +1216,12 @@ spec:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
type: object
+ path:
+ default: cert
+ description: |-
+ Path where the Certificate authentication backend is mounted
+ in Vault, e.g: "cert"
+ type: string
secretRef:
description: |-
SecretRef to a key in a Secret resource containing client private key to
@@ -1070,7 +1263,7 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -1556,6 +1749,18 @@ spec:
- name
- type
type: object
+ checkAndSet:
+ description: |-
+ CheckAndSet defines the Check-And-Set (CAS) settings for PushSecret operations.
+ Only applies to Vault KV v2 stores. When enabled, write operations must include
+ the current version of the secret to prevent unintentional overwrites.
+ properties:
+ required:
+ description: |-
+ Required when true, all write operations must include a check-and-set parameter.
+ This helps prevent unintentional overwrites of secrets.
+ type: boolean
+ type: object
forwardInconsistent:
description: |-
ForwardInconsistent tells Vault to forward read-after-write requests to the Vault
@@ -1674,7 +1879,7 @@ spec:
default: Data
description: |-
Result type defines which data is returned from the generator.
- By default it is the "data" section of the Vault API response.
+ By default, it is the "data" section of the Vault API response.
When using e.g. /auth/token/create the "data" section is empty but
the "auth" section contains the generated token.
Please refer to the vault docs regarding the result data structure.
@@ -1710,7 +1915,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -1738,7 +1943,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -1831,6 +2036,7 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret reference that will be used in webhook templates.
properties:
name:
description: Name of this secret in templates
@@ -1871,6 +2077,7 @@ spec:
description: Kind the kind of this generator.
enum:
- ACRAccessToken
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
diff --git a/config/crd/bases/customresourcedefinition_clusterpushsecrets.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_clusterpushsecrets.external-secrets.io.yml
index 07aaf44f6..717b03d90 100644
--- a/config/crd/bases/customresourcedefinition_clusterpushsecrets.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_clusterpushsecrets.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -29,6 +29,7 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
+ description: ClusterPushSecret is the Schema for the ClusterPushSecrets API that enables cluster-wide management of pushing Kubernetes secrets to external providers.
properties:
apiVersion:
description: |-
@@ -48,6 +49,7 @@ spec:
metadata:
type: object
spec:
+ description: ClusterPushSecretSpec defines the configuration for a ClusterPushSecret resource.
properties:
namespaceSelectors:
description: A list of labels to select by to find the Namespaces to create the ExternalSecrets in. The selectors are ORed.
@@ -125,6 +127,7 @@ spec:
data:
description: Secret Data that should be pushed to providers
items:
+ description: PushSecretData defines data to be pushed to the provider and associated metadata.
properties:
conversionStrategy:
default: None
@@ -176,6 +179,7 @@ spec:
type: string
secretStoreRefs:
items:
+ description: PushSecretStoreRef contains a reference on how to sync to a SecretStore.
properties:
kind:
default: SecretStore
@@ -253,6 +257,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -352,6 +357,7 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how the rendered template should be merged with the existing Secret data.
enum:
- Replace
- Merge
@@ -363,6 +369,10 @@ spec:
additionalProperties:
type: string
type: object
+ finalizers:
+ items:
+ type: string
+ type: array
labels:
additionalProperties:
type: string
@@ -370,12 +380,17 @@ spec:
type: object
templateFrom:
items:
+ description: |-
+ TemplateFrom specifies a source for templates.
+ Each item in the list can either reference a ConfigMap or a Secret resource.
properties:
configMap:
+ description: TemplateRef specifies a reference to either a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in the ConfigMap/Secret to use as a template for Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -385,6 +400,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -406,10 +422,12 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef specifies a reference to either a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in the ConfigMap/Secret to use as a template for Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -419,6 +437,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -439,6 +458,7 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget specifies where the rendered templates should be applied.
enum:
- Data
- Annotations
@@ -467,6 +487,7 @@ spec:
- pushSecretSpec
type: object
status:
+ description: ClusterPushSecretStatus contains the status information for the ClusterPushSecret resource.
properties:
conditions:
items:
diff --git a/config/crd/bases/customresourcedefinition_clustersecretstores.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_clustersecretstores.external-secrets.io.yml
index 96e539fb3..9acde3a78 100644
--- a/config/crd/bases/customresourcedefinition_clustersecretstores.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_clustersecretstores.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -254,7 +254,7 @@ spec:
type: object
accessType:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -282,7 +282,7 @@ spec:
type: object
accessTypeParam:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -361,7 +361,7 @@ spec:
description: AlibabaAuth contains a secretRef for credentials.
properties:
rrsa:
- description: Authenticate against Alibaba using RRSA.
+ description: AlibabaRRSAAuth authenticates against Alibaba using RRSA.
properties:
oidcProviderArn:
type: string
@@ -459,10 +459,10 @@ spec:
see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
properties:
jwt:
- description: Authenticate against AWS using service account tokens.
+ description: AWSJWTAuth stores reference to Authenticate against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -606,7 +606,7 @@ spec:
The number of days from 7 to 30 that Secrets Manager waits before
permanently deleting the secret. You can't use both this parameter and
ForceDeleteWithoutRecovery in the same call. If you don't use either,
- then by default Secrets Manager uses a 30 day recovery window.
+ then by default Secrets Manager uses a 30-day recovery window.
see: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html#SecretsManager-DeleteSecret-request-RecoveryWindowInDays
format: int64
type: integer
@@ -620,6 +620,9 @@ spec:
sessionTags:
description: AWS STS assume role session tags
items:
+ description: |-
+ Tag is a key-value pair that can be attached to an AWS resource.
+ see: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
properties:
key:
type: string
@@ -762,18 +765,44 @@ spec:
- ManagedIdentity
- WorkloadIdentity
type: string
+ customCloudConfig:
+ description: |-
+ CustomCloudConfig defines custom Azure Stack Hub or Azure Stack Edge endpoints.
+ Required when EnvironmentType is AzureStackCloud.
+ IMPORTANT: This feature REQUIRES UseAzureSDK to be set to true. Custom cloud
+ configuration is not supported with the legacy go-autorest SDK.
+ properties:
+ activeDirectoryEndpoint:
+ description: |-
+ ActiveDirectoryEndpoint is the AAD endpoint for authentication
+ Required when using custom cloud configuration
+ type: string
+ keyVaultDNSSuffix:
+ description: KeyVaultDNSSuffix is the DNS suffix for Key Vault URLs
+ type: string
+ keyVaultEndpoint:
+ description: KeyVaultEndpoint is the Key Vault service endpoint
+ type: string
+ resourceManagerEndpoint:
+ description: ResourceManagerEndpoint is the Azure Resource Manager endpoint
+ type: string
+ required:
+ - activeDirectoryEndpoint
+ type: object
environmentType:
default: PublicCloud
description: |-
EnvironmentType specifies the Azure cloud environment endpoints to use for
connecting and authenticating with Azure. By default it points to the public cloud AAD endpoint.
The following endpoints are available, also see here: https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L152
- PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud
+ PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud, AzureStackCloud
+ Use AzureStackCloud when you need to configure custom Azure Stack Hub or Azure Stack Edge endpoints.
enum:
- PublicCloud
- USGovernmentCloud
- ChinaCloud
- GermanCloud
+ - AzureStackCloud
type: string
identityId:
description: If multiple Managed Identity is assigned to the pod, you can select the one to be used
@@ -811,6 +840,12 @@ spec:
tenantId:
description: TenantID configures the Azure Tenant to send requests to. Required for ServicePrincipal auth type. Optional for WorkloadIdentity.
type: string
+ useAzureSDK:
+ default: false
+ description: |-
+ UseAzureSDK enables the use of the new Azure SDK for Go (azcore-based) instead of the legacy go-autorest SDK.
+ This is experimental and may have behavioral differences. Defaults to false (legacy SDK).
+ type: boolean
vaultUrl:
description: Vault Url from which the secrets to be fetched from.
type: string
@@ -1529,6 +1564,7 @@ spec:
description: Auth configures how secret-manager authenticates with a Device42 instance.
properties:
secretRef:
+ description: Device42SecretRef contains the secret reference for accessing the Device42 instance.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -1574,6 +1610,7 @@ spec:
description: Auth configures how the Operator authenticates with the Doppler API
properties:
secretRef:
+ description: DopplerAuthSecretRef contains the secret reference for accessing the Doppler API.
properties:
dopplerToken:
description: |-
@@ -1643,6 +1680,7 @@ spec:
properties:
data:
items:
+ description: FakeProviderData defines a key-value pair with optional version for the fake provider.
properties:
key:
type: string
@@ -1655,6 +1693,9 @@ spec:
- value
type: object
type: array
+ validationResult:
+ description: ValidationResult is defined type for the number of validation results.
+ type: integer
required:
- data
type: object
@@ -1702,6 +1743,7 @@ spec:
description: Auth defines the information necessary to authenticate against GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef contains the secret references for GCP Secret Manager authentication.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -1731,6 +1773,7 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines configuration for workload identity authentication to GCP.
properties:
clusterLocation:
description: |-
@@ -1748,7 +1791,7 @@ spec:
If not specified, it fetches information from the metadata server
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -1778,6 +1821,119 @@ spec:
required:
- serviceAccountRef
type: object
+ workloadIdentityFederation:
+ description: GCPWorkloadIdentityFederation holds the configurations required for generating federated access tokens.
+ properties:
+ audience:
+ description: |-
+ audience is the Secure Token Service (STS) audience which contains the resource name for the workload identity pool and the provider identifier in that pool.
+ If specified, Audience found in the external account credential config will be overridden with the configured value.
+ audience must be provided when serviceAccountRef or awsSecurityCredentials is configured.
+ type: string
+ awsSecurityCredentials:
+ description: |-
+ awsSecurityCredentials is for configuring AWS region and credentials to use for obtaining the access token,
+ when using the AWS metadata server is not an option.
+ properties:
+ awsCredentialsSecretRef:
+ description: |-
+ awsCredentialsSecretRef is the reference to the secret which holds the AWS credentials.
+ Secret should be created with below names for keys
+ - aws_access_key_id: Access Key ID, which is the unique identifier for the AWS account or the IAM user.
+ - aws_secret_access_key: Secret Access Key, which is used to authenticate requests made to AWS services.
+ - aws_session_token: Session Token, is the short-lived token to authenticate requests made to AWS services.
+ properties:
+ name:
+ description: name of the secret.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the secret exists. If empty, secret will looked up in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ region:
+ description: region is for configuring the AWS region to be used.
+ example: ap-south-1
+ maxLength: 50
+ minLength: 1
+ pattern: ^[a-z0-9-]+$
+ type: string
+ required:
+ - awsCredentialsSecretRef
+ - region
+ type: object
+ credConfig:
+ description: |-
+ credConfig holds the configmap reference containing the GCP external account credential configuration in JSON format and the key name containing the json data.
+ For using Kubernetes cluster as the identity provider, use serviceAccountRef instead. Operators mounted serviceaccount token cannot be used as the token source, instead
+ serviceAccountRef must be used by providing operators service account details.
+ properties:
+ key:
+ description: key name holding the external account credential config.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: name of the configmap.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the configmap exists. If empty, configmap will looked up in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - key
+ - name
+ type: object
+ externalTokenEndpoint:
+ description: |-
+ externalTokenEndpoint is the endpoint explicitly set up to provide tokens, which will be matched against the
+ credential_source.url in the provided credConfig. This field is merely to double-check the external token source
+ URL is having the expected value.
+ type: string
+ serviceAccountRef:
+ description: |-
+ serviceAccountRef is the reference to the kubernetes ServiceAccount to be used for obtaining the tokens,
+ when Kubernetes is configured as provider in workload identity pool.
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ type: object
type: object
location:
description: Location optionally defines a location for a secret
@@ -1785,9 +1941,20 @@ spec:
projectID:
description: ProjectID project where secret is located
type: string
+ secretVersionSelectionPolicy:
+ default: LatestOrFail
+ description: |-
+ SecretVersionSelectionPolicy specifies how the provider selects a secret version
+ when "latest" is disabled or destroyed.
+ Possible values are:
+ - LatestOrFail: the provider always uses "latest", or fails if that version is disabled/destroyed.
+ - LatestOrFetch: the provider falls back to fetching the latest version if the version is DESTROYED or DISABLED
+ type: string
type: object
github:
- description: Github configures this store to push Github Action secrets using Github API provider
+ description: |-
+ Github configures this store to push GitHub Action secrets using GitHub API provider.
+ Note: This provider only supports write operations (PushSecret) and cannot fetch secrets from GitHub
properties:
appID:
description: appID specifies the Github APP that will be used to authenticate the client
@@ -1798,7 +1965,7 @@ spec:
properties:
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -1860,6 +2027,7 @@ spec:
description: Auth configures how secret-manager authenticates with a GitLab instance.
properties:
SecretRef:
+ description: GitlabSecretRef contains the secret reference for GitLab authentication credentials.
properties:
accessToken:
description: AccessToken is used for authentication.
@@ -1959,7 +2127,7 @@ spec:
minProperties: 1
properties:
containerAuth:
- description: IBM Container-based auth with IAM Trusted Profile.
+ description: IBMAuthContainerAuth defines container-based authentication with IAM Trusted Profile.
properties:
iamEndpoint:
type: string
@@ -1973,6 +2141,7 @@ spec:
- profile
type: object
secretRef:
+ description: IBMAuthSecretRef contains the secret reference for IBM Cloud API key authentication.
properties:
secretApiKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -2014,11 +2183,46 @@ spec:
auth:
description: Auth configures how the Operator authenticates with the Infisical API
properties:
+ awsAuthCredentials:
+ description: AwsAuthCredentials represents the credentials for AWS authentication.
+ properties:
+ identityId:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - identityId
+ type: object
azureAuthCredentials:
+ description: AzureAuthCredentials represents the credentials for Azure authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2046,7 +2250,7 @@ spec:
type: object
resource:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2076,10 +2280,11 @@ spec:
- identityId
type: object
gcpIamAuthCredentials:
+ description: GcpIamAuthCredentials represents the credentials for GCP IAM authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2107,7 +2312,7 @@ spec:
type: object
serviceAccountKeyFilePath:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2138,10 +2343,11 @@ spec:
- serviceAccountKeyFilePath
type: object
gcpIdTokenAuthCredentials:
+ description: GcpIDTokenAuthCredentials represents the credentials for GCP ID token authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2171,10 +2377,11 @@ spec:
- identityId
type: object
jwtAuthCredentials:
+ description: JwtAuthCredentials represents the credentials for JWT authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2202,7 +2409,7 @@ spec:
type: object
jwt:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2232,11 +2439,74 @@ spec:
- identityId
- jwt
type: object
+ kubernetesAuthCredentials:
+ description: KubernetesAuthCredentials represents the credentials for Kubernetes authentication.
+ properties:
+ identityId:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ serviceAccountTokenPath:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - identityId
+ type: object
ldapAuthCredentials:
+ description: LdapAuthCredentials represents the credentials for LDAP authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2264,7 +2534,7 @@ spec:
type: object
ldapPassword:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2292,7 +2562,7 @@ spec:
type: object
ldapUsername:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2324,10 +2594,11 @@ spec:
- ldapUsername
type: object
ociAuthCredentials:
+ description: OciAuthCredentials represents the credentials for OCI authentication.
properties:
fingerprint:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2355,7 +2626,7 @@ spec:
type: object
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2383,7 +2654,7 @@ spec:
type: object
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2411,7 +2682,7 @@ spec:
type: object
privateKeyPassphrase:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2439,7 +2710,7 @@ spec:
type: object
region:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2467,7 +2738,7 @@ spec:
type: object
tenancyId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2495,7 +2766,7 @@ spec:
type: object
userId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2529,11 +2800,46 @@ spec:
- tenancyId
- userId
type: object
+ tokenAuthCredentials:
+ description: TokenAuthCredentials represents the credentials for access token-based authentication.
+ properties:
+ accessToken:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - accessToken
+ type: object
universalAuthCredentials:
+ description: UniversalAuthCredentials represents the client credentials for universal authentication.
properties:
clientId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2561,7 +2867,7 @@ spec:
type: object
clientSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2630,7 +2936,7 @@ spec:
properties:
authRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2675,7 +2981,7 @@ spec:
properties:
clientCert:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2703,7 +3009,7 @@ spec:
type: object
clientKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2763,7 +3069,7 @@ spec:
properties:
bearerToken:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2870,6 +3176,62 @@ spec:
type: string
type: object
type: object
+ ngrok:
+ description: Ngrok configures this store to sync secrets using the ngrok provider.
+ properties:
+ apiUrl:
+ default: https://api.ngrok.com
+ description: APIURL is the URL of the ngrok API.
+ type: string
+ auth:
+ description: Auth configures how the ngrok provider authenticates with the ngrok API.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ apiKey:
+ description: APIKey is the API Key used to authenticate with ngrok. See https://ngrok.com/docs/api/#authentication
+ properties:
+ secretRef:
+ description: SecretRef is a reference to a secret containing the ngrok API key.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ type: object
+ type: object
+ vault:
+ description: Vault configures the ngrok vault to sync secrets with.
+ properties:
+ name:
+ description: Name is the name of the ngrok vault to sync secrets with.
+ type: string
+ required:
+ - name
+ type: object
+ required:
+ - auth
+ - vault
+ type: object
onboardbase:
description: Onboardbase configures this store to sync secrets using the Onboardbase provider
properties:
@@ -3202,13 +3564,16 @@ spec:
- vault
type: object
passbolt:
+ description: |-
+ PassboltProvider provides access to Passbolt secrets manager.
+ See: https://www.passbolt.com.
properties:
auth:
description: Auth defines the information necessary to authenticate against Passbolt Server
properties:
passwordSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3236,7 +3601,7 @@ spec:
type: object
privateKeySecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3274,12 +3639,13 @@ spec:
- host
type: object
passworddepot:
- description: Configures a store to sync secrets with a Password Depot instance.
+ description: PasswordDepotProvider configures a store to sync secrets with a Password Depot instance.
properties:
auth:
description: Auth configures how secret-manager authenticates with a Password Depot instance.
properties:
secretRef:
+ description: PasswordDepotSecretRef contains the secret reference for Password Depot authentication.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -3513,6 +3879,9 @@ spec:
SecretServer configures this store to sync secrets using SecretServer provider
https://docs.delinea.com/online-help/secret-server/start.htm
properties:
+ domain:
+ description: Domain is the secret server domain.
+ type: string
password:
description: Password is the secret server account password.
properties:
@@ -3599,7 +3968,7 @@ spec:
type: string
clientSecretSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3763,6 +4132,12 @@ spec:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
type: object
+ path:
+ default: cert
+ description: |-
+ Path where the Certificate authentication backend is mounted
+ in Vault, e.g: "cert"
+ type: string
secretRef:
description: |-
SecretRef to a key in a Secret resource containing client private key to
@@ -3804,7 +4179,7 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -4290,6 +4665,18 @@ spec:
- name
- type
type: object
+ checkAndSet:
+ description: |-
+ CheckAndSet defines the Check-And-Set (CAS) settings for PushSecret operations.
+ Only applies to Vault KV v2 stores. When enabled, write operations must include
+ the current version of the secret to prevent unintentional overwrites.
+ properties:
+ required:
+ description: |-
+ Required when true, all write operations must include a check-and-set parameter.
+ This helps prevent unintentional overwrites of secrets.
+ type: boolean
+ type: object
forwardInconsistent:
description: |-
ForwardInconsistent tells Vault to forward read-after-write requests to the Vault
@@ -4404,6 +4791,108 @@ spec:
required:
- server
type: object
+ volcengine:
+ description: Volcengine configures this store to sync secrets using the Volcengine provider
+ properties:
+ auth:
+ description: |-
+ Auth defines the authentication method to use.
+ If not specified, the provider will try to use IRSA (IAM Role for Service Account).
+ properties:
+ secretRef:
+ description: |-
+ SecretRef defines the static credentials to use for authentication.
+ If not set, IRSA is used.
+ properties:
+ accessKeyID:
+ description: AccessKeyID is the reference to the secret containing the Access Key ID.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ secretAccessKey:
+ description: SecretAccessKey is the reference to the secret containing the Secret Access Key.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ token:
+ description: Token is the reference to the secret containing the STS(Security Token Service) Token.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - accessKeyID
+ - secretAccessKey
+ type: object
+ type: object
+ region:
+ description: Region specifies the Volcengine region to connect to.
+ type: string
+ required:
+ - region
+ type: object
webhook:
description: Webhook configures this store to sync secrets using a generic templated webhook
properties:
@@ -4417,7 +4906,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4445,7 +4934,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4538,6 +5027,7 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret that will be passed to the webhook request.
properties:
name:
description: Name of this secret in templates
@@ -4580,7 +5070,6 @@ spec:
description: Webhook url to call
type: string
required:
- - result
- url
type: object
yandexcertificatemanager:
@@ -4590,7 +5079,7 @@ spec:
description: Yandex.Cloud API endpoint (e.g. 'api.cloud.yandex.net:443')
type: string
auth:
- description: Auth defines the information necessary to authenticate against Yandex Certificate Manager
+ description: Auth defines the information necessary to authenticate against Yandex.Cloud
properties:
authorizedKeySecretRef:
description: The authorized key used for authentication
@@ -4624,7 +5113,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4651,6 +5140,24 @@ spec:
type: string
type: object
type: object
+ fetching:
+ description: FetchingPolicy configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as certificate ID or certificate name
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ byID:
+ description: ByID configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as secret ID.
+ type: object
+ byName:
+ description: ByName configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as secret name.
+ properties:
+ folderID:
+ description: The folder to fetch secrets from
+ type: string
+ required:
+ - folderID
+ type: object
+ type: object
required:
- auth
type: object
@@ -4661,7 +5168,7 @@ spec:
description: Yandex.Cloud API endpoint (e.g. 'api.cloud.yandex.net:443')
type: string
auth:
- description: Auth defines the information necessary to authenticate against Yandex Lockbox
+ description: Auth defines the information necessary to authenticate against Yandex.Cloud
properties:
authorizedKeySecretRef:
description: The authorized key used for authentication
@@ -4695,7 +5202,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4722,6 +5229,24 @@ spec:
type: string
type: object
type: object
+ fetching:
+ description: FetchingPolicy configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as secret ID or secret name
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ byID:
+ description: ByID configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as secret ID.
+ type: object
+ byName:
+ description: ByName configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as secret name.
+ properties:
+ folderID:
+ description: The folder to fetch secrets from
+ type: string
+ required:
+ - folderID
+ type: object
+ type: object
required:
- auth
type: object
@@ -4749,6 +5274,7 @@ spec:
type: string
conditions:
items:
+ description: SecretStoreStatusCondition contains condition information for a SecretStore.
properties:
lastTransitionTime:
format: date-time
@@ -4760,6 +5286,7 @@ spec:
status:
type: string
type:
+ description: SecretStoreConditionType represents the condition of the SecretStore.
type: string
required:
- status
@@ -5006,7 +5533,7 @@ spec:
type: object
accessType:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -5034,7 +5561,7 @@ spec:
type: object
accessTypeParam:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -5113,7 +5640,7 @@ spec:
description: AlibabaAuth contains a secretRef for credentials.
properties:
rrsa:
- description: Authenticate against Alibaba using RRSA.
+ description: AlibabaRRSAAuth authenticates against Alibaba using RRSA (Resource-oriented RAM-based Service Authentication).
properties:
oidcProviderArn:
type: string
@@ -5211,10 +5738,10 @@ spec:
see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
properties:
jwt:
- description: Authenticate against AWS using service account tokens.
+ description: AWSJWTAuth authenticates against AWS using service account tokens from the Kubernetes cluster.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -5372,6 +5899,7 @@ spec:
sessionTags:
description: AWS STS assume role session tags
items:
+ description: Tag defines a tag key and value for AWS resources.
properties:
key:
type: string
@@ -6281,6 +6809,7 @@ spec:
description: Auth configures how secret-manager authenticates with a Device42 instance.
properties:
secretRef:
+ description: Device42SecretRef defines a reference to a secret containing credentials for the Device42 provider.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -6326,6 +6855,7 @@ spec:
description: Auth configures how the Operator authenticates with the Doppler API
properties:
secretRef:
+ description: DopplerAuthSecretRef defines a reference to a secret containing credentials for the Doppler provider.
properties:
dopplerToken:
description: |-
@@ -6395,6 +6925,7 @@ spec:
properties:
data:
items:
+ description: FakeProviderData defines a key-value pair for the fake provider used in testing.
properties:
key:
type: string
@@ -6454,6 +6985,7 @@ spec:
description: Auth defines the information necessary to authenticate against GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef defines a reference to a secret containing credentials for the GCP Secret Manager provider.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -6483,6 +7015,7 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines configuration for using GCP Workload Identity authentication.
properties:
clusterLocation:
description: |-
@@ -6500,7 +7033,7 @@ spec:
If not specified, it fetches information from the metadata server
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -6550,7 +7083,7 @@ spec:
properties:
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -6612,6 +7145,7 @@ spec:
description: Auth configures how secret-manager authenticates with a GitLab instance.
properties:
SecretRef:
+ description: GitlabSecretRef defines a reference to a secret containing credentials for the GitLab provider.
properties:
accessToken:
description: AccessToken is used for authentication.
@@ -6711,7 +7245,7 @@ spec:
minProperties: 1
properties:
containerAuth:
- description: IBM Container-based auth with IAM Trusted Profile.
+ description: IBMAuthContainerAuth defines authentication using IBM Container-based auth with IAM Trusted Profile.
properties:
iamEndpoint:
type: string
@@ -6725,6 +7259,7 @@ spec:
- profile
type: object
secretRef:
+ description: IBMAuthSecretRef defines a reference to a secret containing credentials for the IBM provider.
properties:
secretApiKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -6767,10 +7302,11 @@ spec:
description: Auth configures how the Operator authenticates with the Infisical API
properties:
universalAuthCredentials:
+ description: UniversalAuthCredentials defines the credentials for Infisical Universal Auth.
properties:
clientId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -6798,7 +7334,7 @@ spec:
type: object
clientSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -6867,7 +7403,7 @@ spec:
properties:
authRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -6912,7 +7448,7 @@ spec:
properties:
clientCert:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -6940,7 +7476,7 @@ spec:
type: object
clientKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7000,7 +7536,7 @@ spec:
properties:
bearerToken:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7383,14 +7919,13 @@ spec:
- vault
type: object
passbolt:
+ description: PassboltProvider defines configuration for the Passbolt provider.
properties:
auth:
description: Auth defines the information necessary to authenticate against Passbolt Server
properties:
passwordSecretRef:
- description: |-
- A reference to a specific 'key' within a Secret resource.
- In some instances, `key` is a required field.
+ description: PasswordSecretRef is a reference to the secret containing the Passbolt password
properties:
key:
description: |-
@@ -7416,9 +7951,7 @@ spec:
type: string
type: object
privateKeySecretRef:
- description: |-
- A reference to a specific 'key' within a Secret resource.
- In some instances, `key` is a required field.
+ description: PrivateKeySecretRef is a reference to the secret containing the Passbolt private key
properties:
key:
description: |-
@@ -7455,12 +7988,13 @@ spec:
- host
type: object
passworddepot:
- description: Configures a store to sync secrets with a Password Depot instance.
+ description: PasswordDepotProvider configures a store to sync secrets with a Password Depot instance.
properties:
auth:
description: Auth configures how secret-manager authenticates with a Password Depot instance.
properties:
secretRef:
+ description: PasswordDepotSecretRef defines a reference to a secret containing credentials for the Password Depot provider.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -7780,7 +8314,7 @@ spec:
type: string
clientSecretSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7985,7 +8519,7 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -8598,7 +9132,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -8626,7 +9160,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -8719,6 +9253,7 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret to be used in webhook templates.
properties:
name:
description: Name of this secret in templates
@@ -8805,7 +9340,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -8876,7 +9411,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -8914,9 +9449,11 @@ spec:
description: Used to configure http retries if failed
properties:
maxRetries:
+ description: MaxRetries is the maximum number of retry attempts.
format: int32
type: integer
retryInterval:
+ description: RetryInterval is the interval between retry attempts.
type: string
type: object
required:
@@ -8930,6 +9467,7 @@ spec:
type: string
conditions:
items:
+ description: SecretStoreStatusCondition defines the observed condition of the SecretStore.
properties:
lastTransitionTime:
format: date-time
@@ -8941,6 +9479,7 @@ spec:
status:
type: string
type:
+ description: SecretStoreConditionType represents the condition type of the SecretStore.
type: string
required:
- status
diff --git a/config/crd/bases/customresourcedefinition_ecrauthorizationtokens.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_ecrauthorizationtokens.generators.external-secrets.io.yml
index 0b2a4ce6f..56c153cd3 100644
--- a/config/crd/bases/customresourcedefinition_ecrauthorizationtokens.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_ecrauthorizationtokens.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -24,8 +24,7 @@ spec:
schema:
openAPIV3Schema:
description: |-
- ECRAuthorizationTokenSpec uses the GetAuthorizationToken API to retrieve an
- authorization token.
+ ECRAuthorizationToken uses the GetAuthorizationToken API to retrieve an authorization token.
The authorization token is valid for 12 hours.
The authorizationToken returned is a base64 encoded string that can be decoded
and used in a docker login command to authenticate to a registry.
@@ -49,15 +48,16 @@ spec:
metadata:
type: object
spec:
+ description: ECRAuthorizationTokenSpec defines the desired state to generate an AWS ECR authorization token.
properties:
auth:
description: Auth defines how to authenticate with AWS
properties:
jwt:
- description: Authenticate against AWS using service account tokens.
+ description: AWSJWTAuth provides configuration to authenticate against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
diff --git a/config/crd/bases/customresourcedefinition_externalsecrets.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_externalsecrets.external-secrets.io.yml
index 0570847a4..8303841f5 100644
--- a/config/crd/bases/customresourcedefinition_externalsecrets.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_externalsecrets.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -40,7 +40,9 @@ spec:
name: v1
schema:
openAPIV3Schema:
- description: ExternalSecret is the Schema for the external-secrets API.
+ description: |-
+ ExternalSecret is the Schema for the external-secrets API.
+ It defines how to fetch data from external APIs and make it available as Kubernetes Secrets.
properties:
apiVersion:
description: |-
@@ -136,6 +138,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -189,6 +192,9 @@ spec:
DataFrom is used to fetch all properties from a specific Provider data
If multiple entries are specified, the Secret keys are merged in the specified order
items:
+ description: |-
+ ExternalSecretDataFromRemoteRef defines the connection between the Kubernetes Secret keys and the Provider data
+ when using DataFrom to fetch multiple values from a Provider.
properties:
extract:
description: |-
@@ -272,6 +278,7 @@ spec:
Used to rewrite secret Keys after getting them from the secret Provider
Multiple Rewrite operations can be provided. They are applied in a layered order (first to last)
items:
+ description: ExternalSecretRewrite defines how to rewrite secret data values before they are written to the Secret.
maxProperties: 1
minProperties: 1
properties:
@@ -283,6 +290,9 @@ spec:
conflictPolicy:
default: Error
description: Used to define the policy to use in conflict resolution.
+ enum:
+ - Ignore
+ - Error
type: string
into:
default: ""
@@ -295,9 +305,19 @@ spec:
items:
type: string
type: array
+ priorityPolicy:
+ default: Strict
+ description: Used to define the policy when a key in the priority list does not exist in the input.
+ enum:
+ - IgnoreNotFound
+ - Strict
+ type: string
strategy:
default: Extract
description: Used to define the strategy to use in the merge operation.
+ enum:
+ - Extract
+ - JSON
type: string
type: object
regexp:
@@ -353,6 +373,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -442,8 +463,8 @@ spec:
creationPolicy: Owner
deletionPolicy: Retain
description: |-
- ExternalSecretTarget defines the Kubernetes Secret to be created
- There can be only one target per ExternalSecret.
+ ExternalSecretTarget defines the Kubernetes Secret to be created,
+ there can be only one target per ExternalSecret.
properties:
creationPolicy:
default: Owner
@@ -495,6 +516,7 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how the rendered template should be merged with the existing Secret data.
enum:
- Replace
- Merge
@@ -506,6 +528,10 @@ spec:
additionalProperties:
type: string
type: object
+ finalizers:
+ items:
+ type: string
+ type: array
labels:
additionalProperties:
type: string
@@ -513,12 +539,17 @@ spec:
type: object
templateFrom:
items:
+ description: |-
+ TemplateFrom specifies a source for templates.
+ Each item in the list can either reference a ConfigMap or a Secret resource.
properties:
configMap:
+ description: TemplateRef specifies a reference to either a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in the ConfigMap/Secret to use as a template for Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -528,6 +559,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -549,10 +581,12 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef specifies a reference to either a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in the ConfigMap/Secret to use as a template for Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -562,6 +596,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -582,6 +617,7 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget specifies where the rendered templates should be applied.
enum:
- Data
- Annotations
@@ -595,6 +631,7 @@ spec:
type: object
type: object
status:
+ description: ExternalSecretStatus defines the observed state of ExternalSecret.
properties:
binding:
description: Binding represents a servicebinding.io Provisioned Service reference to the secret
@@ -612,6 +649,7 @@ spec:
x-kubernetes-map-type: atomic
conditions:
items:
+ description: ExternalSecretStatusCondition defines a status condition of an ExternalSecret resource.
properties:
lastTransitionTime:
format: date-time
@@ -623,6 +661,10 @@ spec:
status:
type: string
type:
+ description: ExternalSecretConditionType defines a value type for ExternalSecret conditions.
+ enum:
+ - Ready
+ - Deleted
type: string
required:
- status
@@ -641,6 +683,11 @@ spec:
type: string
type: object
type: object
+ selectableFields:
+ - jsonPath: .spec.secretStoreRef.name
+ - jsonPath: .spec.secretStoreRef.kind
+ - jsonPath: .spec.target.name
+ - jsonPath: .spec.refreshInterval
served: true
storage: true
subresources:
@@ -665,7 +712,7 @@ spec:
name: v1beta1
schema:
openAPIV3Schema:
- description: ExternalSecret is the Schema for the external-secrets API.
+ description: ExternalSecret is the schema for the external-secrets API.
properties:
apiVersion:
description: |-
@@ -813,6 +860,7 @@ spec:
DataFrom is used to fetch all properties from a specific Provider data
If multiple entries are specified, the Secret keys are merged in the specified order
items:
+ description: ExternalSecretDataFromRemoteRef defines a reference to multiple secrets in the provider to be fetched using options.
properties:
extract:
description: |-
@@ -896,6 +944,7 @@ spec:
Used to rewrite secret Keys after getting them from the secret Provider
Multiple Rewrite operations can be provided. They are applied in a layered order (first to last)
items:
+ description: ExternalSecretRewrite defines rules on how to rewrite secret keys.
maxProperties: 1
minProperties: 1
properties:
@@ -1093,6 +1142,7 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how template values should be merged when generating a secret.
enum:
- Replace
- Merge
@@ -1111,12 +1161,15 @@ spec:
type: object
templateFrom:
items:
+ description: TemplateFrom defines a source for template data.
properties:
configMap:
+ description: TemplateRef defines a reference to a template source in a ConfigMap or Secret.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem defines which key in the referenced ConfigMap or Secret to use as a template.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -1126,6 +1179,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope defines the scope of the template when processing template data.
enum:
- Values
- KeysAndValues
@@ -1147,10 +1201,12 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef defines a reference to a template source in a ConfigMap or Secret.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem defines which key in the referenced ConfigMap or Secret to use as a template.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -1160,6 +1216,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope defines the scope of the template when processing template data.
enum:
- Values
- KeysAndValues
@@ -1180,6 +1237,7 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget defines the target field where the template result will be stored.
enum:
- Data
- Annotations
@@ -1193,6 +1251,7 @@ spec:
type: object
type: object
status:
+ description: ExternalSecretStatus defines the observed state of ExternalSecret.
properties:
binding:
description: Binding represents a servicebinding.io Provisioned Service reference to the secret
@@ -1210,6 +1269,7 @@ spec:
x-kubernetes-map-type: atomic
conditions:
items:
+ description: ExternalSecretStatusCondition contains condition information for an ExternalSecret.
properties:
lastTransitionTime:
format: date-time
@@ -1221,6 +1281,7 @@ spec:
status:
type: string
type:
+ description: ExternalSecretConditionType defines the condition type for an ExternalSecret.
type: string
required:
- status
diff --git a/config/crd/bases/customresourcedefinition_gcraccesstokens.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_gcraccesstokens.generators.external-secrets.io.yml
index 864631a66..4d7da6831 100644
--- a/config/crd/bases/customresourcedefinition_gcraccesstokens.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_gcraccesstokens.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -45,11 +45,13 @@ spec:
metadata:
type: object
spec:
+ description: GCRAccessTokenSpec defines the desired state to generate a Google Container Registry access token.
properties:
auth:
description: Auth defines the means for authenticating with GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef defines the reference to a secret containing Google Cloud Platform credentials.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -79,6 +81,7 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines the configuration for using GCP Workload Identity authentication.
properties:
clusterLocation:
type: string
@@ -87,7 +90,7 @@ spec:
clusterProjectID:
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -119,6 +122,119 @@ spec:
- clusterName
- serviceAccountRef
type: object
+ workloadIdentityFederation:
+ description: GCPWorkloadIdentityFederation holds the configurations required for generating federated access tokens.
+ properties:
+ audience:
+ description: |-
+ audience is the Secure Token Service (STS) audience which contains the resource name for the workload identity pool and the provider identifier in that pool.
+ If specified, Audience found in the external account credential config will be overridden with the configured value.
+ audience must be provided when serviceAccountRef or awsSecurityCredentials is configured.
+ type: string
+ awsSecurityCredentials:
+ description: |-
+ awsSecurityCredentials is for configuring AWS region and credentials to use for obtaining the access token,
+ when using the AWS metadata server is not an option.
+ properties:
+ awsCredentialsSecretRef:
+ description: |-
+ awsCredentialsSecretRef is the reference to the secret which holds the AWS credentials.
+ Secret should be created with below names for keys
+ - aws_access_key_id: Access Key ID, which is the unique identifier for the AWS account or the IAM user.
+ - aws_secret_access_key: Secret Access Key, which is used to authenticate requests made to AWS services.
+ - aws_session_token: Session Token, is the short-lived token to authenticate requests made to AWS services.
+ properties:
+ name:
+ description: name of the secret.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the secret exists. If empty, secret will looked up in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ region:
+ description: region is for configuring the AWS region to be used.
+ example: ap-south-1
+ maxLength: 50
+ minLength: 1
+ pattern: ^[a-z0-9-]+$
+ type: string
+ required:
+ - awsCredentialsSecretRef
+ - region
+ type: object
+ credConfig:
+ description: |-
+ credConfig holds the configmap reference containing the GCP external account credential configuration in JSON format and the key name containing the json data.
+ For using Kubernetes cluster as the identity provider, use serviceAccountRef instead. Operators mounted serviceaccount token cannot be used as the token source, instead
+ serviceAccountRef must be used by providing operators service account details.
+ properties:
+ key:
+ description: key name holding the external account credential config.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: name of the configmap.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the configmap exists. If empty, configmap will looked up in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - key
+ - name
+ type: object
+ externalTokenEndpoint:
+ description: |-
+ externalTokenEndpoint is the endpoint explicitly set up to provide tokens, which will be matched against the
+ credential_source.url in the provided credConfig. This field is merely to double-check the external token source
+ URL is having the expected value.
+ type: string
+ serviceAccountRef:
+ description: |-
+ serviceAccountRef is the reference to the kubernetes ServiceAccount to be used for obtaining the tokens,
+ when Kubernetes is configured as provider in workload identity pool.
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ type: object
type: object
projectID:
description: ProjectID defines which project to use to authenticate with
diff --git a/config/crd/bases/customresourcedefinition_generatorstates.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_generatorstates.generators.external-secrets.io.yml
index ffa3faff1..1cf501e31 100644
--- a/config/crd/bases/customresourcedefinition_generatorstates.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_generatorstates.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -32,6 +32,7 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
+ description: GeneratorState represents the state created and managed by a generator resource.
properties:
apiVersion:
description: |-
@@ -51,6 +52,7 @@ spec:
metadata:
type: object
spec:
+ description: GeneratorStateSpec defines the desired state of a generator state resource.
properties:
garbageCollectionDeadline:
description: |-
@@ -77,9 +79,11 @@ spec:
- state
type: object
status:
+ description: GeneratorStateStatus defines the observed state of a generator state resource.
properties:
conditions:
items:
+ description: GeneratorStateStatusCondition represents the observed condition of a generator state.
properties:
lastTransitionTime:
format: date-time
@@ -91,6 +95,7 @@ spec:
status:
type: string
type:
+ description: GeneratorStateConditionType represents the type of condition for a generator state.
type: string
required:
- status
diff --git a/config/crd/bases/customresourcedefinition_githubaccesstokens.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_githubaccesstokens.generators.external-secrets.io.yml
index 4a92154b9..c7149ba6d 100644
--- a/config/crd/bases/customresourcedefinition_githubaccesstokens.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_githubaccesstokens.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -43,6 +43,7 @@ spec:
metadata:
type: object
spec:
+ description: GithubAccessTokenSpec defines the desired state to generate a GitHub access token.
properties:
appID:
type: string
@@ -50,10 +51,11 @@ spec:
description: Auth configures how ESO authenticates with a Github instance.
properties:
privateKey:
+ description: GithubSecretRef references a secret containing GitHub credentials.
properties:
secretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -100,7 +102,7 @@ spec:
type: string
type: array
url:
- description: URL configures the Github instance URL. Defaults to https://github.com/.
+ description: URL configures the GitHub instance URL. Defaults to https://github.com/.
type: string
required:
- appID
diff --git a/config/crd/bases/customresourcedefinition_grafanas.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_grafanas.generators.external-secrets.io.yml
index 497dd9b30..e1cbf6f04 100644
--- a/config/crd/bases/customresourcedefinition_grafanas.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_grafanas.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -23,6 +23,7 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
+ description: Grafana represents a generator for Grafana service account tokens.
properties:
apiVersion:
description: |-
diff --git a/config/crd/bases/customresourcedefinition_mfas.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_mfas.generators.external-secrets.io.yml
index 473a58180..dff34e68f 100644
--- a/config/crd/bases/customresourcedefinition_mfas.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_mfas.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
diff --git a/config/crd/bases/customresourcedefinition_passwords.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_passwords.generators.external-secrets.io.yml
index ad2716977..cec8c5780 100644
--- a/config/crd/bases/customresourcedefinition_passwords.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_passwords.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -57,6 +57,23 @@ spec:
Digits specifies the number of digits in the generated
password. If omitted it defaults to 25% of the length of the password
type: integer
+ encoding:
+ default: raw
+ description: |-
+ Encoding specifies the encoding of the generated password.
+ Valid values are:
+ - "raw" (default): no encoding
+ - "base64": standard base64 encoding
+ - "base64url": base64url encoding
+ - "base32": base32 encoding
+ - "hex": hexadecimal encoding
+ enum:
+ - base64
+ - base64url
+ - base32
+ - hex
+ - raw
+ type: string
length:
default: 24
description: |-
diff --git a/config/crd/bases/customresourcedefinition_pushsecrets.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_pushsecrets.external-secrets.io.yml
index e81c920da..2804bfb81 100644
--- a/config/crd/bases/customresourcedefinition_pushsecrets.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_pushsecrets.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -31,6 +31,7 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
+ description: PushSecret is the Schema for the PushSecrets API that enables pushing Kubernetes secrets to external secret providers.
properties:
apiVersion:
description: |-
@@ -55,6 +56,7 @@ spec:
data:
description: Secret Data that should be pushed to providers
items:
+ description: PushSecretData defines data to be pushed to the provider and associated metadata.
properties:
conversionStrategy:
default: None
@@ -106,6 +108,7 @@ spec:
type: string
secretStoreRefs:
items:
+ description: PushSecretStoreRef contains a reference on how to sync to a SecretStore.
properties:
kind:
default: SecretStore
@@ -183,6 +186,7 @@ spec:
enum:
- ACRAccessToken
- ClusterGenerator
+ - CloudsmithAccessToken
- ECRAuthorizationToken
- Fake
- GCRAccessToken
@@ -282,6 +286,7 @@ spec:
type: string
mergePolicy:
default: Replace
+ description: TemplateMergePolicy defines how the rendered template should be merged with the existing Secret data.
enum:
- Replace
- Merge
@@ -293,6 +298,10 @@ spec:
additionalProperties:
type: string
type: object
+ finalizers:
+ items:
+ type: string
+ type: array
labels:
additionalProperties:
type: string
@@ -300,12 +309,17 @@ spec:
type: object
templateFrom:
items:
+ description: |-
+ TemplateFrom specifies a source for templates.
+ Each item in the list can either reference a ConfigMap or a Secret resource.
properties:
configMap:
+ description: TemplateRef specifies a reference to either a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in the ConfigMap/Secret to use as a template for Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -315,6 +329,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -336,10 +351,12 @@ spec:
literal:
type: string
secret:
+ description: TemplateRef specifies a reference to either a ConfigMap or a Secret resource.
properties:
items:
description: A list of keys in the ConfigMap/Secret to use as templates for Secret data
items:
+ description: TemplateRefItem specifies a key in the ConfigMap/Secret to use as a template for Secret data.
properties:
key:
description: A key in the ConfigMap/Secret
@@ -349,6 +366,7 @@ spec:
type: string
templateAs:
default: Values
+ description: TemplateScope specifies how the template keys should be interpreted.
enum:
- Values
- KeysAndValues
@@ -369,6 +387,7 @@ spec:
type: object
target:
default: Data
+ description: TemplateTarget specifies where the rendered templates should be applied.
enum:
- Data
- Annotations
@@ -424,6 +443,7 @@ spec:
syncedPushSecrets:
additionalProperties:
additionalProperties:
+ description: PushSecretData defines data to be pushed to the provider and associated metadata.
properties:
conversionStrategy:
default: None
diff --git a/config/crd/bases/customresourcedefinition_quayaccesstokens.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_quayaccesstokens.generators.external-secrets.io.yml
index e493e29bf..b1bfe750d 100644
--- a/config/crd/bases/customresourcedefinition_quayaccesstokens.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_quayaccesstokens.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -43,6 +43,7 @@ spec:
metadata:
type: object
spec:
+ description: QuayAccessTokenSpec defines the desired state to generate a Quay access token.
properties:
robotAccount:
description: Name of the robot account you are federating with
diff --git a/config/crd/bases/customresourcedefinition_secretstores.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_secretstores.external-secrets.io.yml
index b27e6b89f..9fd87691d 100644
--- a/config/crd/bases/customresourcedefinition_secretstores.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_secretstores.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -254,7 +254,7 @@ spec:
type: object
accessType:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -282,7 +282,7 @@ spec:
type: object
accessTypeParam:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -361,7 +361,7 @@ spec:
description: AlibabaAuth contains a secretRef for credentials.
properties:
rrsa:
- description: Authenticate against Alibaba using RRSA.
+ description: AlibabaRRSAAuth authenticates against Alibaba using RRSA.
properties:
oidcProviderArn:
type: string
@@ -459,10 +459,10 @@ spec:
see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
properties:
jwt:
- description: Authenticate against AWS using service account tokens.
+ description: AWSJWTAuth stores reference to Authenticate against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -606,7 +606,7 @@ spec:
The number of days from 7 to 30 that Secrets Manager waits before
permanently deleting the secret. You can't use both this parameter and
ForceDeleteWithoutRecovery in the same call. If you don't use either,
- then by default Secrets Manager uses a 30 day recovery window.
+ then by default Secrets Manager uses a 30-day recovery window.
see: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html#SecretsManager-DeleteSecret-request-RecoveryWindowInDays
format: int64
type: integer
@@ -620,6 +620,9 @@ spec:
sessionTags:
description: AWS STS assume role session tags
items:
+ description: |-
+ Tag is a key-value pair that can be attached to an AWS resource.
+ see: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
properties:
key:
type: string
@@ -762,18 +765,44 @@ spec:
- ManagedIdentity
- WorkloadIdentity
type: string
+ customCloudConfig:
+ description: |-
+ CustomCloudConfig defines custom Azure Stack Hub or Azure Stack Edge endpoints.
+ Required when EnvironmentType is AzureStackCloud.
+ IMPORTANT: This feature REQUIRES UseAzureSDK to be set to true. Custom cloud
+ configuration is not supported with the legacy go-autorest SDK.
+ properties:
+ activeDirectoryEndpoint:
+ description: |-
+ ActiveDirectoryEndpoint is the AAD endpoint for authentication
+ Required when using custom cloud configuration
+ type: string
+ keyVaultDNSSuffix:
+ description: KeyVaultDNSSuffix is the DNS suffix for Key Vault URLs
+ type: string
+ keyVaultEndpoint:
+ description: KeyVaultEndpoint is the Key Vault service endpoint
+ type: string
+ resourceManagerEndpoint:
+ description: ResourceManagerEndpoint is the Azure Resource Manager endpoint
+ type: string
+ required:
+ - activeDirectoryEndpoint
+ type: object
environmentType:
default: PublicCloud
description: |-
EnvironmentType specifies the Azure cloud environment endpoints to use for
connecting and authenticating with Azure. By default it points to the public cloud AAD endpoint.
The following endpoints are available, also see here: https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L152
- PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud
+ PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud, AzureStackCloud
+ Use AzureStackCloud when you need to configure custom Azure Stack Hub or Azure Stack Edge endpoints.
enum:
- PublicCloud
- USGovernmentCloud
- ChinaCloud
- GermanCloud
+ - AzureStackCloud
type: string
identityId:
description: If multiple Managed Identity is assigned to the pod, you can select the one to be used
@@ -811,6 +840,12 @@ spec:
tenantId:
description: TenantID configures the Azure Tenant to send requests to. Required for ServicePrincipal auth type. Optional for WorkloadIdentity.
type: string
+ useAzureSDK:
+ default: false
+ description: |-
+ UseAzureSDK enables the use of the new Azure SDK for Go (azcore-based) instead of the legacy go-autorest SDK.
+ This is experimental and may have behavioral differences. Defaults to false (legacy SDK).
+ type: boolean
vaultUrl:
description: Vault Url from which the secrets to be fetched from.
type: string
@@ -1529,6 +1564,7 @@ spec:
description: Auth configures how secret-manager authenticates with a Device42 instance.
properties:
secretRef:
+ description: Device42SecretRef contains the secret reference for accessing the Device42 instance.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -1574,6 +1610,7 @@ spec:
description: Auth configures how the Operator authenticates with the Doppler API
properties:
secretRef:
+ description: DopplerAuthSecretRef contains the secret reference for accessing the Doppler API.
properties:
dopplerToken:
description: |-
@@ -1643,6 +1680,7 @@ spec:
properties:
data:
items:
+ description: FakeProviderData defines a key-value pair with optional version for the fake provider.
properties:
key:
type: string
@@ -1655,6 +1693,9 @@ spec:
- value
type: object
type: array
+ validationResult:
+ description: ValidationResult is defined type for the number of validation results.
+ type: integer
required:
- data
type: object
@@ -1702,6 +1743,7 @@ spec:
description: Auth defines the information necessary to authenticate against GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef contains the secret references for GCP Secret Manager authentication.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -1731,6 +1773,7 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines configuration for workload identity authentication to GCP.
properties:
clusterLocation:
description: |-
@@ -1748,7 +1791,7 @@ spec:
If not specified, it fetches information from the metadata server
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -1778,6 +1821,119 @@ spec:
required:
- serviceAccountRef
type: object
+ workloadIdentityFederation:
+ description: GCPWorkloadIdentityFederation holds the configurations required for generating federated access tokens.
+ properties:
+ audience:
+ description: |-
+ audience is the Secure Token Service (STS) audience which contains the resource name for the workload identity pool and the provider identifier in that pool.
+ If specified, Audience found in the external account credential config will be overridden with the configured value.
+ audience must be provided when serviceAccountRef or awsSecurityCredentials is configured.
+ type: string
+ awsSecurityCredentials:
+ description: |-
+ awsSecurityCredentials is for configuring AWS region and credentials to use for obtaining the access token,
+ when using the AWS metadata server is not an option.
+ properties:
+ awsCredentialsSecretRef:
+ description: |-
+ awsCredentialsSecretRef is the reference to the secret which holds the AWS credentials.
+ Secret should be created with below names for keys
+ - aws_access_key_id: Access Key ID, which is the unique identifier for the AWS account or the IAM user.
+ - aws_secret_access_key: Secret Access Key, which is used to authenticate requests made to AWS services.
+ - aws_session_token: Session Token, is the short-lived token to authenticate requests made to AWS services.
+ properties:
+ name:
+ description: name of the secret.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the secret exists. If empty, secret will looked up in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ region:
+ description: region is for configuring the AWS region to be used.
+ example: ap-south-1
+ maxLength: 50
+ minLength: 1
+ pattern: ^[a-z0-9-]+$
+ type: string
+ required:
+ - awsCredentialsSecretRef
+ - region
+ type: object
+ credConfig:
+ description: |-
+ credConfig holds the configmap reference containing the GCP external account credential configuration in JSON format and the key name containing the json data.
+ For using Kubernetes cluster as the identity provider, use serviceAccountRef instead. Operators mounted serviceaccount token cannot be used as the token source, instead
+ serviceAccountRef must be used by providing operators service account details.
+ properties:
+ key:
+ description: key name holding the external account credential config.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: name of the configmap.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: namespace in which the configmap exists. If empty, configmap will looked up in local namespace.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - key
+ - name
+ type: object
+ externalTokenEndpoint:
+ description: |-
+ externalTokenEndpoint is the endpoint explicitly set up to provide tokens, which will be matched against the
+ credential_source.url in the provided credConfig. This field is merely to double-check the external token source
+ URL is having the expected value.
+ type: string
+ serviceAccountRef:
+ description: |-
+ serviceAccountRef is the reference to the kubernetes ServiceAccount to be used for obtaining the tokens,
+ when Kubernetes is configured as provider in workload identity pool.
+ properties:
+ audiences:
+ description: |-
+ Audience specifies the `aud` claim for the service account token
+ If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity
+ then this audiences will be appended to the list
+ items:
+ type: string
+ type: array
+ name:
+ description: The name of the ServiceAccount resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ Namespace of the resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ required:
+ - name
+ type: object
+ type: object
type: object
location:
description: Location optionally defines a location for a secret
@@ -1785,9 +1941,20 @@ spec:
projectID:
description: ProjectID project where secret is located
type: string
+ secretVersionSelectionPolicy:
+ default: LatestOrFail
+ description: |-
+ SecretVersionSelectionPolicy specifies how the provider selects a secret version
+ when "latest" is disabled or destroyed.
+ Possible values are:
+ - LatestOrFail: the provider always uses "latest", or fails if that version is disabled/destroyed.
+ - LatestOrFetch: the provider falls back to fetching the latest version if the version is DESTROYED or DISABLED
+ type: string
type: object
github:
- description: Github configures this store to push Github Action secrets using Github API provider
+ description: |-
+ Github configures this store to push GitHub Action secrets using GitHub API provider.
+ Note: This provider only supports write operations (PushSecret) and cannot fetch secrets from GitHub
properties:
appID:
description: appID specifies the Github APP that will be used to authenticate the client
@@ -1798,7 +1965,7 @@ spec:
properties:
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -1860,6 +2027,7 @@ spec:
description: Auth configures how secret-manager authenticates with a GitLab instance.
properties:
SecretRef:
+ description: GitlabSecretRef contains the secret reference for GitLab authentication credentials.
properties:
accessToken:
description: AccessToken is used for authentication.
@@ -1959,7 +2127,7 @@ spec:
minProperties: 1
properties:
containerAuth:
- description: IBM Container-based auth with IAM Trusted Profile.
+ description: IBMAuthContainerAuth defines container-based authentication with IAM Trusted Profile.
properties:
iamEndpoint:
type: string
@@ -1973,6 +2141,7 @@ spec:
- profile
type: object
secretRef:
+ description: IBMAuthSecretRef contains the secret reference for IBM Cloud API key authentication.
properties:
secretApiKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -2014,11 +2183,46 @@ spec:
auth:
description: Auth configures how the Operator authenticates with the Infisical API
properties:
+ awsAuthCredentials:
+ description: AwsAuthCredentials represents the credentials for AWS authentication.
+ properties:
+ identityId:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - identityId
+ type: object
azureAuthCredentials:
+ description: AzureAuthCredentials represents the credentials for Azure authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2046,7 +2250,7 @@ spec:
type: object
resource:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2076,10 +2280,11 @@ spec:
- identityId
type: object
gcpIamAuthCredentials:
+ description: GcpIamAuthCredentials represents the credentials for GCP IAM authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2107,7 +2312,7 @@ spec:
type: object
serviceAccountKeyFilePath:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2138,10 +2343,11 @@ spec:
- serviceAccountKeyFilePath
type: object
gcpIdTokenAuthCredentials:
+ description: GcpIDTokenAuthCredentials represents the credentials for GCP ID token authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2171,10 +2377,11 @@ spec:
- identityId
type: object
jwtAuthCredentials:
+ description: JwtAuthCredentials represents the credentials for JWT authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2202,7 +2409,7 @@ spec:
type: object
jwt:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2232,11 +2439,74 @@ spec:
- identityId
- jwt
type: object
+ kubernetesAuthCredentials:
+ description: KubernetesAuthCredentials represents the credentials for Kubernetes authentication.
+ properties:
+ identityId:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ serviceAccountTokenPath:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - identityId
+ type: object
ldapAuthCredentials:
+ description: LdapAuthCredentials represents the credentials for LDAP authentication.
properties:
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2264,7 +2534,7 @@ spec:
type: object
ldapPassword:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2292,7 +2562,7 @@ spec:
type: object
ldapUsername:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2324,10 +2594,11 @@ spec:
- ldapUsername
type: object
ociAuthCredentials:
+ description: OciAuthCredentials represents the credentials for OCI authentication.
properties:
fingerprint:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2355,7 +2626,7 @@ spec:
type: object
identityId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2383,7 +2654,7 @@ spec:
type: object
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2411,7 +2682,7 @@ spec:
type: object
privateKeyPassphrase:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2439,7 +2710,7 @@ spec:
type: object
region:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2467,7 +2738,7 @@ spec:
type: object
tenancyId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2495,7 +2766,7 @@ spec:
type: object
userId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2529,11 +2800,46 @@ spec:
- tenancyId
- userId
type: object
+ tokenAuthCredentials:
+ description: TokenAuthCredentials represents the credentials for access token-based authentication.
+ properties:
+ accessToken:
+ description: |-
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
+ In some instances, `key` is a required field.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - accessToken
+ type: object
universalAuthCredentials:
+ description: UniversalAuthCredentials represents the client credentials for universal authentication.
properties:
clientId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2561,7 +2867,7 @@ spec:
type: object
clientSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2630,7 +2936,7 @@ spec:
properties:
authRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2675,7 +2981,7 @@ spec:
properties:
clientCert:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2703,7 +3009,7 @@ spec:
type: object
clientKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2763,7 +3069,7 @@ spec:
properties:
bearerToken:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -2870,6 +3176,62 @@ spec:
type: string
type: object
type: object
+ ngrok:
+ description: Ngrok configures this store to sync secrets using the ngrok provider.
+ properties:
+ apiUrl:
+ default: https://api.ngrok.com
+ description: APIURL is the URL of the ngrok API.
+ type: string
+ auth:
+ description: Auth configures how the ngrok provider authenticates with the ngrok API.
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ apiKey:
+ description: APIKey is the API Key used to authenticate with ngrok. See https://ngrok.com/docs/api/#authentication
+ properties:
+ secretRef:
+ description: SecretRef is a reference to a secret containing the ngrok API key.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ type: object
+ type: object
+ vault:
+ description: Vault configures the ngrok vault to sync secrets with.
+ properties:
+ name:
+ description: Name is the name of the ngrok vault to sync secrets with.
+ type: string
+ required:
+ - name
+ type: object
+ required:
+ - auth
+ - vault
+ type: object
onboardbase:
description: Onboardbase configures this store to sync secrets using the Onboardbase provider
properties:
@@ -3202,13 +3564,16 @@ spec:
- vault
type: object
passbolt:
+ description: |-
+ PassboltProvider provides access to Passbolt secrets manager.
+ See: https://www.passbolt.com.
properties:
auth:
description: Auth defines the information necessary to authenticate against Passbolt Server
properties:
passwordSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3236,7 +3601,7 @@ spec:
type: object
privateKeySecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3274,12 +3639,13 @@ spec:
- host
type: object
passworddepot:
- description: Configures a store to sync secrets with a Password Depot instance.
+ description: PasswordDepotProvider configures a store to sync secrets with a Password Depot instance.
properties:
auth:
description: Auth configures how secret-manager authenticates with a Password Depot instance.
properties:
secretRef:
+ description: PasswordDepotSecretRef contains the secret reference for Password Depot authentication.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -3513,6 +3879,9 @@ spec:
SecretServer configures this store to sync secrets using SecretServer provider
https://docs.delinea.com/online-help/secret-server/start.htm
properties:
+ domain:
+ description: Domain is the secret server domain.
+ type: string
password:
description: Password is the secret server account password.
properties:
@@ -3599,7 +3968,7 @@ spec:
type: string
clientSecretSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -3763,6 +4132,12 @@ spec:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
type: object
+ path:
+ default: cert
+ description: |-
+ Path where the Certificate authentication backend is mounted
+ in Vault, e.g: "cert"
+ type: string
secretRef:
description: |-
SecretRef to a key in a Secret resource containing client private key to
@@ -3804,7 +4179,7 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -4290,6 +4665,18 @@ spec:
- name
- type
type: object
+ checkAndSet:
+ description: |-
+ CheckAndSet defines the Check-And-Set (CAS) settings for PushSecret operations.
+ Only applies to Vault KV v2 stores. When enabled, write operations must include
+ the current version of the secret to prevent unintentional overwrites.
+ properties:
+ required:
+ description: |-
+ Required when true, all write operations must include a check-and-set parameter.
+ This helps prevent unintentional overwrites of secrets.
+ type: boolean
+ type: object
forwardInconsistent:
description: |-
ForwardInconsistent tells Vault to forward read-after-write requests to the Vault
@@ -4404,6 +4791,108 @@ spec:
required:
- server
type: object
+ volcengine:
+ description: Volcengine configures this store to sync secrets using the Volcengine provider
+ properties:
+ auth:
+ description: |-
+ Auth defines the authentication method to use.
+ If not specified, the provider will try to use IRSA (IAM Role for Service Account).
+ properties:
+ secretRef:
+ description: |-
+ SecretRef defines the static credentials to use for authentication.
+ If not set, IRSA is used.
+ properties:
+ accessKeyID:
+ description: AccessKeyID is the reference to the secret containing the Access Key ID.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ secretAccessKey:
+ description: SecretAccessKey is the reference to the secret containing the Secret Access Key.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ token:
+ description: Token is the reference to the secret containing the STS(Security Token Service) Token.
+ properties:
+ key:
+ description: |-
+ A key in the referenced Secret.
+ Some instances of this field may be defaulted, in others it may be required.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[-._a-zA-Z0-9]+$
+ type: string
+ name:
+ description: The name of the Secret resource being referred to.
+ maxLength: 253
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
+ type: string
+ namespace:
+ description: |-
+ The namespace of the Secret resource being referred to.
+ Ignored if referent is not cluster-scoped, otherwise defaults to the namespace of the referent.
+ maxLength: 63
+ minLength: 1
+ pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
+ type: string
+ type: object
+ required:
+ - accessKeyID
+ - secretAccessKey
+ type: object
+ type: object
+ region:
+ description: Region specifies the Volcengine region to connect to.
+ type: string
+ required:
+ - region
+ type: object
webhook:
description: Webhook configures this store to sync secrets using a generic templated webhook
properties:
@@ -4417,7 +4906,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4445,7 +4934,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4538,6 +5027,7 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret that will be passed to the webhook request.
properties:
name:
description: Name of this secret in templates
@@ -4580,7 +5070,6 @@ spec:
description: Webhook url to call
type: string
required:
- - result
- url
type: object
yandexcertificatemanager:
@@ -4590,7 +5079,7 @@ spec:
description: Yandex.Cloud API endpoint (e.g. 'api.cloud.yandex.net:443')
type: string
auth:
- description: Auth defines the information necessary to authenticate against Yandex Certificate Manager
+ description: Auth defines the information necessary to authenticate against Yandex.Cloud
properties:
authorizedKeySecretRef:
description: The authorized key used for authentication
@@ -4624,7 +5113,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4651,6 +5140,24 @@ spec:
type: string
type: object
type: object
+ fetching:
+ description: FetchingPolicy configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as certificate ID or certificate name
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ byID:
+ description: ByID configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as secret ID.
+ type: object
+ byName:
+ description: ByName configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as secret name.
+ properties:
+ folderID:
+ description: The folder to fetch secrets from
+ type: string
+ required:
+ - folderID
+ type: object
+ type: object
required:
- auth
type: object
@@ -4661,7 +5168,7 @@ spec:
description: Yandex.Cloud API endpoint (e.g. 'api.cloud.yandex.net:443')
type: string
auth:
- description: Auth defines the information necessary to authenticate against Yandex Lockbox
+ description: Auth defines the information necessary to authenticate against Yandex.Cloud
properties:
authorizedKeySecretRef:
description: The authorized key used for authentication
@@ -4695,7 +5202,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -4722,6 +5229,24 @@ spec:
type: string
type: object
type: object
+ fetching:
+ description: FetchingPolicy configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as secret ID or secret name
+ maxProperties: 1
+ minProperties: 1
+ properties:
+ byID:
+ description: ByID configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as secret ID.
+ type: object
+ byName:
+ description: ByName configures the provider to interpret the `data.secretKey.remoteRef.key` field in ExternalSecret as secret name.
+ properties:
+ folderID:
+ description: The folder to fetch secrets from
+ type: string
+ required:
+ - folderID
+ type: object
+ type: object
required:
- auth
type: object
@@ -4749,6 +5274,7 @@ spec:
type: string
conditions:
items:
+ description: SecretStoreStatusCondition contains condition information for a SecretStore.
properties:
lastTransitionTime:
format: date-time
@@ -4760,6 +5286,7 @@ spec:
status:
type: string
type:
+ description: SecretStoreConditionType represents the condition of the SecretStore.
type: string
required:
- status
@@ -5006,7 +5533,7 @@ spec:
type: object
accessType:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -5034,7 +5561,7 @@ spec:
type: object
accessTypeParam:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -5113,7 +5640,7 @@ spec:
description: AlibabaAuth contains a secretRef for credentials.
properties:
rrsa:
- description: Authenticate against Alibaba using RRSA.
+ description: AlibabaRRSAAuth authenticates against Alibaba using RRSA (Resource-oriented RAM-based Service Authentication).
properties:
oidcProviderArn:
type: string
@@ -5211,10 +5738,10 @@ spec:
see: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials
properties:
jwt:
- description: Authenticate against AWS using service account tokens.
+ description: AWSJWTAuth authenticates against AWS using service account tokens from the Kubernetes cluster.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -5372,6 +5899,7 @@ spec:
sessionTags:
description: AWS STS assume role session tags
items:
+ description: Tag defines a tag key and value for AWS resources.
properties:
key:
type: string
@@ -6281,6 +6809,7 @@ spec:
description: Auth configures how secret-manager authenticates with a Device42 instance.
properties:
secretRef:
+ description: Device42SecretRef defines a reference to a secret containing credentials for the Device42 provider.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -6326,6 +6855,7 @@ spec:
description: Auth configures how the Operator authenticates with the Doppler API
properties:
secretRef:
+ description: DopplerAuthSecretRef defines a reference to a secret containing credentials for the Doppler provider.
properties:
dopplerToken:
description: |-
@@ -6395,6 +6925,7 @@ spec:
properties:
data:
items:
+ description: FakeProviderData defines a key-value pair for the fake provider used in testing.
properties:
key:
type: string
@@ -6454,6 +6985,7 @@ spec:
description: Auth defines the information necessary to authenticate against GCP
properties:
secretRef:
+ description: GCPSMAuthSecretRef defines a reference to a secret containing credentials for the GCP Secret Manager provider.
properties:
secretAccessKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -6483,6 +7015,7 @@ spec:
type: object
type: object
workloadIdentity:
+ description: GCPWorkloadIdentity defines configuration for using GCP Workload Identity authentication.
properties:
clusterLocation:
description: |-
@@ -6500,7 +7033,7 @@ spec:
If not specified, it fetches information from the metadata server
type: string
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -6550,7 +7083,7 @@ spec:
properties:
privateKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -6612,6 +7145,7 @@ spec:
description: Auth configures how secret-manager authenticates with a GitLab instance.
properties:
SecretRef:
+ description: GitlabSecretRef defines a reference to a secret containing credentials for the GitLab provider.
properties:
accessToken:
description: AccessToken is used for authentication.
@@ -6711,7 +7245,7 @@ spec:
minProperties: 1
properties:
containerAuth:
- description: IBM Container-based auth with IAM Trusted Profile.
+ description: IBMAuthContainerAuth defines authentication using IBM Container-based auth with IAM Trusted Profile.
properties:
iamEndpoint:
type: string
@@ -6725,6 +7259,7 @@ spec:
- profile
type: object
secretRef:
+ description: IBMAuthSecretRef defines a reference to a secret containing credentials for the IBM provider.
properties:
secretApiKeySecretRef:
description: The SecretAccessKey is used for authentication
@@ -6767,10 +7302,11 @@ spec:
description: Auth configures how the Operator authenticates with the Infisical API
properties:
universalAuthCredentials:
+ description: UniversalAuthCredentials defines the credentials for Infisical Universal Auth.
properties:
clientId:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -6798,7 +7334,7 @@ spec:
type: object
clientSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -6867,7 +7403,7 @@ spec:
properties:
authRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -6912,7 +7448,7 @@ spec:
properties:
clientCert:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -6940,7 +7476,7 @@ spec:
type: object
clientKey:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7000,7 +7536,7 @@ spec:
properties:
bearerToken:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7383,14 +7919,13 @@ spec:
- vault
type: object
passbolt:
+ description: PassboltProvider defines configuration for the Passbolt provider.
properties:
auth:
description: Auth defines the information necessary to authenticate against Passbolt Server
properties:
passwordSecretRef:
- description: |-
- A reference to a specific 'key' within a Secret resource.
- In some instances, `key` is a required field.
+ description: PasswordSecretRef is a reference to the secret containing the Passbolt password
properties:
key:
description: |-
@@ -7416,9 +7951,7 @@ spec:
type: string
type: object
privateKeySecretRef:
- description: |-
- A reference to a specific 'key' within a Secret resource.
- In some instances, `key` is a required field.
+ description: PrivateKeySecretRef is a reference to the secret containing the Passbolt private key
properties:
key:
description: |-
@@ -7455,12 +7988,13 @@ spec:
- host
type: object
passworddepot:
- description: Configures a store to sync secrets with a Password Depot instance.
+ description: PasswordDepotProvider configures a store to sync secrets with a Password Depot instance.
properties:
auth:
description: Auth configures how secret-manager authenticates with a Password Depot instance.
properties:
secretRef:
+ description: PasswordDepotSecretRef defines a reference to a secret containing credentials for the Password Depot provider.
properties:
credentials:
description: Username / Password is used for authentication.
@@ -7780,7 +8314,7 @@ spec:
type: string
clientSecretSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -7985,7 +8519,7 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -8598,7 +9132,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -8626,7 +9160,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -8719,6 +9253,7 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret to be used in webhook templates.
properties:
name:
description: Name of this secret in templates
@@ -8805,7 +9340,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -8876,7 +9411,7 @@ spec:
properties:
certSecretRef:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -8914,9 +9449,11 @@ spec:
description: Used to configure http retries if failed
properties:
maxRetries:
+ description: MaxRetries is the maximum number of retry attempts.
format: int32
type: integer
retryInterval:
+ description: RetryInterval is the interval between retry attempts.
type: string
type: object
required:
@@ -8930,6 +9467,7 @@ spec:
type: string
conditions:
items:
+ description: SecretStoreStatusCondition defines the observed condition of the SecretStore.
properties:
lastTransitionTime:
format: date-time
@@ -8941,6 +9479,7 @@ spec:
status:
type: string
type:
+ description: SecretStoreConditionType represents the condition type of the SecretStore.
type: string
required:
- status
diff --git a/config/crd/bases/customresourcedefinition_sshkeys.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_sshkeys.generators.external-secrets.io.yml
index e314bebf7..4190a0e40 100644
--- a/config/crd/bases/customresourcedefinition_sshkeys.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_sshkeys.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
diff --git a/config/crd/bases/customresourcedefinition_stssessiontokens.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_stssessiontokens.generators.external-secrets.io.yml
index 81dd1e124..a4db84732 100644
--- a/config/crd/bases/customresourcedefinition_stssessiontokens.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_stssessiontokens.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -47,15 +47,16 @@ spec:
metadata:
type: object
spec:
+ description: STSSessionTokenSpec defines the desired state to generate an AWS STS session token.
properties:
auth:
description: Auth defines how to authenticate with AWS
properties:
jwt:
- description: Authenticate against AWS using service account tokens.
+ description: AWSJWTAuth provides configuration to authenticate against AWS using service account tokens.
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
diff --git a/config/crd/bases/customresourcedefinition_uuids.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_uuids.generators.external-secrets.io.yml
index d6edd7ad0..f2fefd125 100644
--- a/config/crd/bases/customresourcedefinition_uuids.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_uuids.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
diff --git a/config/crd/bases/customresourcedefinition_vaultdynamicsecrets.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_vaultdynamicsecrets.generators.external-secrets.io.yml
index 30596cd25..79a3ffdc3 100644
--- a/config/crd/bases/customresourcedefinition_vaultdynamicsecrets.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_vaultdynamicsecrets.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -23,6 +23,7 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
+ description: VaultDynamicSecret represents a generator that can create dynamic secrets from HashiCorp Vault.
properties:
apiVersion:
description: |-
@@ -42,6 +43,7 @@ spec:
metadata:
type: object
spec:
+ description: VaultDynamicSecretSpec defines the desired spec of VaultDynamicSecret.
properties:
allowEmptyResponse:
default: false
@@ -180,6 +182,12 @@ spec:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
type: object
+ path:
+ default: cert
+ description: |-
+ Path where the Certificate authentication backend is mounted
+ in Vault, e.g: "cert"
+ type: string
secretRef:
description: |-
SecretRef to a key in a Secret resource containing client private key to
@@ -221,7 +229,7 @@ spec:
description: Specify a service account with IRSA enabled
properties:
serviceAccountRef:
- description: A reference to a ServiceAccount resource.
+ description: ServiceAccountSelector is a reference to a ServiceAccount resource.
properties:
audiences:
description: |-
@@ -707,6 +715,18 @@ spec:
- name
- type
type: object
+ checkAndSet:
+ description: |-
+ CheckAndSet defines the Check-And-Set (CAS) settings for PushSecret operations.
+ Only applies to Vault KV v2 stores. When enabled, write operations must include
+ the current version of the secret to prevent unintentional overwrites.
+ properties:
+ required:
+ description: |-
+ Required when true, all write operations must include a check-and-set parameter.
+ This helps prevent unintentional overwrites of secrets.
+ type: boolean
+ type: object
forwardInconsistent:
description: |-
ForwardInconsistent tells Vault to forward read-after-write requests to the Vault
@@ -825,7 +845,7 @@ spec:
default: Data
description: |-
Result type defines which data is returned from the generator.
- By default it is the "data" section of the Vault API response.
+ By default, it is the "data" section of the Vault API response.
When using e.g. /auth/token/create the "data" section is empty but
the "auth" section contains the generated token.
Please refer to the vault docs regarding the result data structure.
diff --git a/config/crd/bases/customresourcedefinition_webhooks.generators.external-secrets.io.yml b/config/crd/bases/customresourcedefinition_webhooks.generators.external-secrets.io.yml
index 5200d75e0..c0c1f31ac 100644
--- a/config/crd/bases/customresourcedefinition_webhooks.generators.external-secrets.io.yml
+++ b/config/crd/bases/customresourcedefinition_webhooks.generators.external-secrets.io.yml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.18.0
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
external-secrets.io/component: controller
app: external-secrets
@@ -59,7 +59,7 @@ spec:
properties:
passwordSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -87,7 +87,7 @@ spec:
type: object
usernameSecret:
description: |-
- A reference to a specific 'key' within a Secret resource.
+ SecretKeySelector is a reference to a specific 'key' within a Secret resource.
In some instances, `key` is a required field.
properties:
key:
@@ -180,6 +180,7 @@ spec:
Secrets to fill in templates
These secrets will be passed to the templating function as key value pairs under the given name
items:
+ description: WebhookSecret defines a secret reference that will be used in webhook templates.
properties:
name:
description: Name of this secret in templates
diff --git a/config/crd/bases/operator.openshift.io_externalsecretsconfigs.yaml b/config/crd/bases/operator.openshift.io_externalsecretsconfigs.yaml
index ae6890cdc..7596d1f16 100644
--- a/config/crd/bases/operator.openshift.io_externalsecretsconfigs.yaml
+++ b/config/crd/bases/operator.openshift.io_externalsecretsconfigs.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.17.3
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
app.kubernetes.io/name: externalsecretsconfig
app.kubernetes.io/part-of: external-secrets-operator
@@ -356,7 +356,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -371,7 +370,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -538,7 +536,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -553,7 +550,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -647,8 +643,8 @@ spec:
most preferred is the one with the greatest sum of weights, i.e.
for each node that meets all of the scheduling requirements (resource
request, requiredDuringScheduling anti-affinity expressions, etc.),
- compute a sum by iterating through the elements of this field and adding
- "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+ compute a sum by iterating through the elements of this field and subtracting
+ "weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the
node(s) with the highest sum are the most preferred.
items:
description: The weights of all of the matched WeightedPodAffinityTerm
@@ -718,7 +714,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -733,7 +728,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -900,7 +894,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -915,7 +908,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1061,7 +1053,7 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
- This is an alpha field and requires enabling the
+ This field depends on the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
diff --git a/config/crd/bases/operator.openshift.io_externalsecretsmanagers.yaml b/config/crd/bases/operator.openshift.io_externalsecretsmanagers.yaml
index 600b11ce9..296187982 100644
--- a/config/crd/bases/operator.openshift.io_externalsecretsmanagers.yaml
+++ b/config/crd/bases/operator.openshift.io_externalsecretsmanagers.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.17.3
+ controller-gen.kubebuilder.io/version: v0.19.0
labels:
app.kubernetes.io/name: externalsecretsmanager
app.kubernetes.io/part-of: external-secrets-operator
@@ -350,7 +350,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -365,7 +364,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -532,7 +530,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -547,7 +544,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -641,8 +637,8 @@ spec:
most preferred is the one with the greatest sum of weights, i.e.
for each node that meets all of the scheduling requirements (resource
request, requiredDuringScheduling anti-affinity expressions, etc.),
- compute a sum by iterating through the elements of this field and adding
- "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+ compute a sum by iterating through the elements of this field and subtracting
+ "weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the
node(s) with the highest sum are the most preferred.
items:
description: The weights of all of the matched WeightedPodAffinityTerm
@@ -712,7 +708,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -727,7 +722,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -894,7 +888,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
Also, matchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -909,7 +902,6 @@ spec:
pod labels will be ignored. The default value is empty.
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
- This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
items:
type: string
type: array
@@ -1058,7 +1050,7 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
- This is an alpha field and requires enabling the
+ This field depends on the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
diff --git a/config/manifests/bases/external-secrets-operator.clusterserviceversion.yaml b/config/manifests/bases/external-secrets-operator.clusterserviceversion.yaml
index 0605c2c97..119ace31f 100644
--- a/config/manifests/bases/external-secrets-operator.clusterserviceversion.yaml
+++ b/config/manifests/bases/external-secrets-operator.clusterserviceversion.yaml
@@ -18,7 +18,7 @@ metadata:
features.operators.openshift.io/token-auth-aws: "false"
features.operators.openshift.io/token-auth-azure: "false"
features.operators.openshift.io/token-auth-gcp: "false"
- olm.skipRange: <1.0.0
+ olm.skipRange: <1.1.0
operator.openshift.io/uninstall-message: The External Secrets Operator for Red
Hat OpenShift will be removed from external-secrets-operator namespace. If your
Operator configured any off-cluster resources, these will continue to run and
@@ -38,7 +38,7 @@ metadata:
operatorframework.io/arch.ppc64le: supported
operatorframework.io/arch.s390x: supported
operatorframework.io/os.linux: supported
- name: external-secrets-operator.v1.0.0
+ name: external-secrets-operator.v1.1.0
namespace: placeholder
spec:
apiservicedefinitions: {}
@@ -234,4 +234,4 @@ spec:
minKubeVersion: 1.32.0
provider:
name: Red Hat, Inc.
- version: 1.0.0
+ version: 1.1.0
diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml
index f0b7386b7..433d3694f 100644
--- a/config/rbac/role.yaml
+++ b/config/rbac/role.yaml
@@ -24,11 +24,21 @@ rules:
- ""
resources:
- endpoints
+ verbs:
+ - create
+ - get
+ - list
+ - watch
+- apiGroups:
+ - ""
+ resources:
- namespaces
verbs:
- create
- get
- list
+ - patch
+ - update
- watch
- apiGroups:
- ""
@@ -92,6 +102,14 @@ rules:
- patch
- update
- watch
+- apiGroups:
+ - discovery.k8s.io
+ resources:
+ - endpointslices
+ verbs:
+ - get
+ - list
+ - watch
- apiGroups:
- external-secrets.io
resources:
@@ -133,6 +151,7 @@ rules:
- generators.external-secrets.io
resources:
- acraccesstokens
+ - cloudsmithaccesstokens
- clustergenerators
- ecrauthorizationtokens
- fakes
diff --git a/go.mod b/go.mod
index b3b75d489..a5de9b315 100644
--- a/go.mod
+++ b/go.mod
@@ -1,35 +1,35 @@
module github.com/openshift/external-secrets-operator
-go 1.24.4
+go 1.25.3
require (
- github.com/aws/aws-sdk-go v1.55.7
+ github.com/aws/aws-sdk-go v1.55.8
github.com/cert-manager/cert-manager v1.18.2
github.com/elastic/crd-ref-docs v0.1.0
github.com/ghodss/yaml v1.0.0
github.com/go-bindata/go-bindata v3.1.2+incompatible
github.com/go-logr/logr v1.4.3
- github.com/golangci/golangci-lint/v2 v2.6.2
- github.com/maxbrunsfeld/counterfeiter/v6 v6.11.2
- github.com/onsi/ginkgo/v2 v2.26.0
+ github.com/golangci/golangci-lint/v2 v2.7.2
+ github.com/maxbrunsfeld/counterfeiter/v6 v6.12.0
+ github.com/onsi/ginkgo/v2 v2.27.2
github.com/onsi/gomega v1.38.2
github.com/openshift/build-machinery-go v0.0.0-20250806130835-622c0378eb0d
github.com/stretchr/testify v1.11.1
github.com/vmware-archive/yaml-patch v0.0.11
go.uber.org/zap v1.27.0
golang.org/x/vuln v1.1.4
- k8s.io/api v0.32.3
- k8s.io/apiextensions-apiserver v0.32.3
- k8s.io/apimachinery v0.32.3
- k8s.io/client-go v0.32.3
+ k8s.io/api v0.34.1
+ k8s.io/apiextensions-apiserver v0.34.1
+ k8s.io/apimachinery v0.34.1
+ k8s.io/client-go v0.34.1
k8s.io/klog/v2 v2.130.1
- k8s.io/kubernetes v1.32.8
- k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
- sigs.k8s.io/controller-runtime v0.20.5-0.20250517180713-32e5e9e948a5
+ k8s.io/kubernetes v1.34.1
+ k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
+ sigs.k8s.io/controller-runtime v0.22.3
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250308055145-5fe7bb3edc86
- sigs.k8s.io/controller-tools v0.17.3
- sigs.k8s.io/kube-api-linter v0.0.0-20251203203220-2d0643557c8d
- sigs.k8s.io/kustomize/kustomize/v5 v5.5.0
+ sigs.k8s.io/controller-tools v0.19.0
+ sigs.k8s.io/kube-api-linter v0.0.0-20251208100930-d3015c953951
+ sigs.k8s.io/kustomize/kustomize/v5 v5.7.1
)
require (
@@ -52,8 +52,7 @@ require (
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
- github.com/MirrexOne/unqueryvet v1.2.1 // indirect
- github.com/NYTimes/gziphandler v1.1.1 // indirect
+ github.com/MirrexOne/unqueryvet v1.3.0 // indirect
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect
github.com/alecthomas/chroma/v2 v2.20.0 // indirect
github.com/alecthomas/go-check-sumtype v0.3.1 // indirect
@@ -63,7 +62,6 @@ require (
github.com/alingse/asasalint v0.0.11 // indirect
github.com/alingse/nilnesserr v0.2.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
- github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/ashanbrown/forbidigo/v2 v2.3.0 // indirect
github.com/ashanbrown/makezero/v2 v2.1.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
@@ -77,7 +75,7 @@ require (
github.com/breml/errchkjson v0.4.1 // indirect
github.com/butuzov/ireturn v0.4.0 // indirect
github.com/butuzov/mirror v1.3.0 // indirect
- github.com/catenacyber/perfsprint v0.10.0 // indirect
+ github.com/catenacyber/perfsprint v0.10.1 // indirect
github.com/ccojocar/zxcvbn-go v1.0.4 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
@@ -88,8 +86,6 @@ require (
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/ckaznocha/intrange v0.3.1 // indirect
- github.com/coreos/go-semver v0.3.1 // indirect
- github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/curioswitch/go-reassign v0.3.0 // indirect
github.com/daixiang0/gci v0.13.7 // indirect
github.com/dave/dst v0.27.3 // indirect
@@ -97,7 +93,7 @@ require (
github.com/denis-tingaikin/go-header v0.5.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/dlclark/regexp2 v1.11.5 // indirect
- github.com/emicklei/go-restful/v3 v3.12.2 // indirect
+ github.com/emicklei/go-restful/v3 v3.13.0 // indirect
github.com/ettle/strcase v0.2.0 // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/fatih/color v1.18.0 // indirect
@@ -112,9 +108,20 @@ require (
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
- github.com/go-openapi/jsonpointer v0.21.1 // indirect
- github.com/go-openapi/jsonreference v0.21.0 // indirect
- github.com/go-openapi/swag v0.23.1 // indirect
+ github.com/go-openapi/jsonpointer v0.22.0 // indirect
+ github.com/go-openapi/jsonreference v0.21.1 // indirect
+ github.com/go-openapi/swag v0.24.1 // indirect
+ github.com/go-openapi/swag/cmdutils v0.24.0 // indirect
+ github.com/go-openapi/swag/conv v0.24.0 // indirect
+ github.com/go-openapi/swag/fileutils v0.24.0 // indirect
+ github.com/go-openapi/swag/jsonname v0.24.0 // indirect
+ github.com/go-openapi/swag/jsonutils v0.24.0 // indirect
+ github.com/go-openapi/swag/loading v0.24.0 // indirect
+ github.com/go-openapi/swag/mangling v0.24.0 // indirect
+ github.com/go-openapi/swag/netutils v0.24.0 // indirect
+ github.com/go-openapi/swag/stringutils v0.24.0 // indirect
+ github.com/go-openapi/swag/typeutils v0.24.0 // indirect
+ github.com/go-openapi/swag/yamlutils v0.24.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/go-toolsmith/astcast v1.1.0 // indirect
github.com/go-toolsmith/astcopy v1.1.0 // indirect
@@ -128,10 +135,9 @@ require (
github.com/gobuffalo/flect v1.0.3 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/goccy/go-yaml v1.18.0 // indirect
- github.com/godoc-lint/godoc-lint v0.10.1 // indirect
+ github.com/godoc-lint/godoc-lint v0.10.2 // indirect
github.com/gofrs/flock v0.13.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang/protobuf v1.5.4 // indirect
github.com/golangci/asciicheck v0.5.0 // indirect
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect
github.com/golangci/go-printf-func-name v0.1.1 // indirect
@@ -143,22 +149,19 @@ require (
github.com/golangci/swaggoswag v0.0.0-20250504205917-77f2aca3143e // indirect
github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e // indirect
github.com/google/btree v1.1.3 // indirect
- github.com/google/cel-go v0.22.1 // indirect
+ github.com/google/cel-go v0.26.1 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
- github.com/google/gofuzz v1.2.0 // indirect
- github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6 // indirect
- github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
+ github.com/google/pprof v0.0.0-20250903194437-c28834ac2320 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gordonklaus/ineffassign v0.2.0 // indirect
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
github.com/gostaticanalysis/comment v1.5.0 // indirect
github.com/gostaticanalysis/forcetypeassert v0.2.0 // indirect
github.com/gostaticanalysis/nilerr v0.1.2 // indirect
- github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
github.com/hashicorp/go-immutable-radix/v2 v2.1.0 // indirect
- github.com/hashicorp/go-version v1.7.0 // indirect
+ github.com/hashicorp/go-version v1.8.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.1-vault-7 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
@@ -178,7 +181,6 @@ require (
github.com/krishicks/yaml-patch v0.0.10 // indirect
github.com/kulti/thelper v0.7.1 // indirect
github.com/kunwardeep/paralleltest v1.0.15 // indirect
- github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lasiar/canonicalheader v1.1.2 // indirect
github.com/ldez/exptostd v0.4.5 // indirect
github.com/ldez/gomoddirectives v0.7.1 // indirect
@@ -198,13 +200,13 @@ require (
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
- github.com/mgechev/revive v1.12.0 // indirect
+ github.com/mgechev/revive v1.13.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
- github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/moricho/tparallel v0.3.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
@@ -217,12 +219,11 @@ require (
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
- github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/polyfloyd/go-errorlint v1.8.0 // indirect
- github.com/prometheus/client_golang v1.22.0 // indirect
+ github.com/prometheus/client_golang v1.23.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
- github.com/prometheus/common v0.65.0 // indirect
+ github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/quasilyte/go-ruleguard v0.4.5 // indirect
github.com/quasilyte/go-ruleguard/dsl v0.3.23 // indirect
@@ -238,27 +239,27 @@ require (
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
github.com/sashamelentyev/usestdlibvars v1.29.0 // indirect
- github.com/securego/gosec/v2 v2.22.10 // indirect
+ github.com/securego/gosec/v2 v2.22.11-0.20251204091113-daccba6b93d7 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sivchari/containedctx v1.0.3 // indirect
github.com/sonatard/noctx v0.4.0 // indirect
github.com/sourcegraph/go-diff v0.7.0 // indirect
- github.com/spf13/afero v1.14.0 // indirect
- github.com/spf13/cast v1.9.2 // indirect
- github.com/spf13/cobra v1.10.1 // indirect
+ github.com/spf13/afero v1.15.0 // indirect
+ github.com/spf13/cast v1.10.0 // indirect
+ github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/spf13/viper v1.12.0 // indirect
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
- github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect
- github.com/stoewer/go-strcase v1.3.0 // indirect
+ github.com/stbenjam/no-sprintf-host-port v0.3.1 // indirect
+ github.com/stoewer/go-strcase v1.3.1 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/tetafro/godot v1.5.4 // indirect
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect
github.com/timonwong/loggercheck v0.11.0 // indirect
- github.com/tomarrell/wrapcheck/v2 v2.11.0 // indirect
+ github.com/tomarrell/wrapcheck/v2 v2.12.0 // indirect
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
github.com/ultraware/funlen v0.2.0 // indirect
github.com/ultraware/whitespace v0.2.0 // indirect
@@ -276,71 +277,64 @@ require (
go-simpler.org/sloglint v0.11.1 // indirect
go.augendre.info/arangolint v0.3.1 // indirect
go.augendre.info/fatcontext v0.9.0 // indirect
- go.etcd.io/etcd/api/v3 v3.5.21 // indirect
- go.etcd.io/etcd/client/pkg/v3 v3.5.21 // indirect
- go.etcd.io/etcd/client/v3 v3.5.21 // indirect
- go.opentelemetry.io/auto/sdk v1.1.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect
- go.opentelemetry.io/otel v1.37.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 // indirect
- go.opentelemetry.io/otel/metric v1.37.0 // indirect
- go.opentelemetry.io/otel/sdk v1.37.0 // indirect
- go.opentelemetry.io/otel/trace v1.37.0 // indirect
- go.opentelemetry.io/proto/otlp v1.7.0 // indirect
+ go.opentelemetry.io/auto/sdk v1.2.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
+ go.opentelemetry.io/otel v1.38.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
+ go.opentelemetry.io/otel/metric v1.38.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.38.0 // indirect
+ go.opentelemetry.io/otel/trace v1.38.0 // indirect
+ go.opentelemetry.io/proto/otlp v1.8.0 // indirect
go.uber.org/automaxprocs v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- go.yaml.in/yaml/v2 v2.4.2 // indirect
+ go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
- golang.org/x/crypto v0.43.0 // indirect
- golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect
+ golang.org/x/crypto v0.45.0 // indirect
+ golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect
golang.org/x/exp/typeparams v0.0.0-20251023183803-a4bb9ffd2546 // indirect
- golang.org/x/mod v0.29.0 // indirect
- golang.org/x/net v0.46.0 // indirect
- golang.org/x/oauth2 v0.30.0 // indirect
+ golang.org/x/mod v0.30.0 // indirect
+ golang.org/x/net v0.47.0 // indirect
+ golang.org/x/oauth2 v0.31.0 // indirect
golang.org/x/sync v0.18.0 // indirect
- golang.org/x/sys v0.37.0 // indirect
- golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 // indirect
- golang.org/x/term v0.36.0 // indirect
- golang.org/x/text v0.30.0 // indirect
- golang.org/x/time v0.12.0 // indirect
- golang.org/x/tools v0.38.0 // indirect
+ golang.org/x/sys v0.38.0 // indirect
+ golang.org/x/telemetry v0.0.0-20251111182119-bc8e575c7b54 // indirect
+ golang.org/x/term v0.37.0 // indirect
+ golang.org/x/text v0.31.0 // indirect
+ golang.org/x/time v0.13.0 // indirect
+ golang.org/x/tools v0.39.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
- google.golang.org/genproto v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect
- google.golang.org/grpc v1.75.0 // indirect
- google.golang.org/protobuf v1.36.8 // indirect
- gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20250908214217-97024824d090 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 // indirect
+ google.golang.org/grpc v1.75.1 // indirect
+ google.golang.org/protobuf v1.36.9 // indirect
+ gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
- gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.6.1 // indirect
- k8s.io/apiserver v0.32.3 // indirect
- k8s.io/cloud-provider v0.32.1 // indirect
- k8s.io/component-base v0.32.3 // indirect
+ k8s.io/apiserver v0.34.1 // indirect
+ k8s.io/code-generator v0.34.1 // indirect
+ k8s.io/component-base v0.34.1 // indirect
k8s.io/component-helpers v0.32.1 // indirect
k8s.io/controller-manager v0.32.1 // indirect
k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b // indirect
- k8s.io/kms v0.33.2 // indirect
- k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 // indirect
+ k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
k8s.io/kubelet v0.32.1 //indirect
mvdan.cc/gofumpt v0.9.2 // indirect
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
sigs.k8s.io/gateway-api v1.1.0 // indirect
- sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
- sigs.k8s.io/kustomize/api v0.18.0 // indirect
- sigs.k8s.io/kustomize/cmd/config v0.15.0 // indirect
- sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect
+ sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
+ sigs.k8s.io/kustomize/api v0.20.1 // indirect
+ sigs.k8s.io/kustomize/cmd/config v0.20.1 // indirect
+ sigs.k8s.io/kustomize/kyaml v0.20.1 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
- sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
- sigs.k8s.io/yaml v1.5.0 // indirect
+ sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
+ sigs.k8s.io/yaml v1.6.0 // indirect
)
-replace github.com/external-secrets/external-secrets => github.com/openshift/external-secrets v0.19.0
+replace github.com/external-secrets/external-secrets => github.com/openshift/external-secrets v0.20.4
replace github.com/tdakkota/asciicheck => github.com/golangci/asciicheck v0.4.1
diff --git a/go.sum b/go.sum
index c615158aa..3be2751c4 100644
--- a/go.sum
+++ b/go.sum
@@ -36,10 +36,8 @@ github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60=
github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
-github.com/MirrexOne/unqueryvet v1.2.1 h1:M+zdXMq84g+E1YOLa7g7ExN3dWfZQrdDSTCM7gC+m/A=
-github.com/MirrexOne/unqueryvet v1.2.1/go.mod h1:IWwCwMQlSWjAIteW0t+28Q5vouyktfujzYznSIWiuOg=
-github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
-github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
+github.com/MirrexOne/unqueryvet v1.3.0 h1:5slWSomgqpYU4zFuZ3NNOfOUxVPlXFDBPAVasZOGlAY=
+github.com/MirrexOne/unqueryvet v1.3.0/go.mod h1:IWwCwMQlSWjAIteW0t+28Q5vouyktfujzYznSIWiuOg=
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 h1:vckeWVESWp6Qog7UZSARNqfu/cZqvki8zsuj3piCMx4=
github.com/OpenPeeDeeP/depguard/v2 v2.2.1/go.mod h1:q4DKzC4UcVaAvcfd41CZh0PWpGgzrVxUYBlgKNGquUo=
github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
@@ -62,14 +60,12 @@ github.com/alingse/nilnesserr v0.2.0 h1:raLem5KG7EFVb4UIDAXgrv3N2JIaffeKNtcEXkEW
github.com/alingse/nilnesserr v0.2.0/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg=
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
-github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
-github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/ashanbrown/forbidigo/v2 v2.3.0 h1:OZZDOchCgsX5gvToVtEBoV2UWbFfI6RKQTir2UZzSxo=
github.com/ashanbrown/forbidigo/v2 v2.3.0/go.mod h1:5p6VmsG5/1xx3E785W9fouMxIOkvY2rRV9nMdWadd6c=
github.com/ashanbrown/makezero/v2 v2.1.0 h1:snuKYMbqosNokUKm+R6/+vOPs8yVAi46La7Ck6QYSaE=
github.com/ashanbrown/makezero/v2 v2.1.0/go.mod h1:aEGT/9q3S8DHeE57C88z2a6xydvgx8J5hgXIGWgo0MY=
-github.com/aws/aws-sdk-go v1.55.7 h1:UJrkFq7es5CShfBwlWAC8DA077vp8PyVbQd3lqLiztE=
-github.com/aws/aws-sdk-go v1.55.7/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
+github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ=
+github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@@ -92,8 +88,8 @@ github.com/butuzov/ireturn v0.4.0 h1:+s76bF/PfeKEdbG8b54aCocxXmi0wvYdOVsWxVO7n8E
github.com/butuzov/ireturn v0.4.0/go.mod h1:ghI0FrCmap8pDWZwfPisFD1vEc56VKH4NpQUxDHta70=
github.com/butuzov/mirror v1.3.0 h1:HdWCXzmwlQHdVhwvsfBb2Au0r3HyINry3bDWLYXiKoc=
github.com/butuzov/mirror v1.3.0/go.mod h1:AEij0Z8YMALaq4yQj9CPPVYOyJQyiexpQEQgihajRfI=
-github.com/catenacyber/perfsprint v0.10.0 h1:AZj1mYyxbxLRqmnYOeguZXEQwWOgQGm2wzLI5d7Hl/0=
-github.com/catenacyber/perfsprint v0.10.0/go.mod h1:DJTGsi/Zufpuus6XPGJyKOTMELe347o6akPvWG9Zcsc=
+github.com/catenacyber/perfsprint v0.10.1 h1:u7Riei30bk46XsG8nknMhKLXG9BcXz3+3tl/WpKm0PQ=
+github.com/catenacyber/perfsprint v0.10.1/go.mod h1:DJTGsi/Zufpuus6XPGJyKOTMELe347o6akPvWG9Zcsc=
github.com/ccojocar/zxcvbn-go v1.0.4 h1:FWnCIRMXPj43ukfX000kvBZvV6raSxakYr1nzyNrUcc=
github.com/ccojocar/zxcvbn-go v1.0.4/go.mod h1:3GxGX+rHmueTUMvm5ium7irpyjmm7ikxYFOSJB21Das=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
@@ -116,10 +112,6 @@ github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQ
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
github.com/ckaznocha/intrange v0.3.1 h1:j1onQyXvHUsPWujDH6WIjhyH26gkRt/txNlV7LspvJs=
github.com/ckaznocha/intrange v0.3.1/go.mod h1:QVepyz1AkUoFQkpEqksSYpNpUo3c5W7nWh/s6SHIJJk=
-github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
-github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
-github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
-github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/curioswitch/go-reassign v0.3.0 h1:dh3kpQHuADL3cobV/sSGETA8DOv457dwl+fbBAhrQPs=
github.com/curioswitch/go-reassign v0.3.0/go.mod h1:nApPCCTtqLJN/s8HfItCcKV0jIPwluBOvZP+dsJGA88=
@@ -139,12 +131,10 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ=
github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
-github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
-github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/elastic/crd-ref-docs v0.1.0 h1:Cr5kz89QB3Iuuj7dhAfLMApCrChEGAaIBTxGk/xuRKw=
github.com/elastic/crd-ref-docs v0.1.0/go.mod h1:X83mMBdJt05heJUYiS3T0yJ/JkCuliuhSUNav5Gjo/U=
-github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=
-github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
+github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes=
+github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q=
github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A=
github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls=
@@ -176,8 +166,8 @@ github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BN
github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo=
github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M=
github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk=
-github.com/gkampitakis/go-snaps v0.5.14 h1:3fAqdB6BCPKHDMHAKRwtPUwYexKtGrNuw8HX/T/4neo=
-github.com/gkampitakis/go-snaps v0.5.14/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc=
+github.com/gkampitakis/go-snaps v0.5.15 h1:amyJrvM1D33cPHwVrjo9jQxX8g/7E2wYdZ+01KS3zGE=
+github.com/gkampitakis/go-snaps v0.5.15/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc=
github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE=
github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo=
github.com/go-critic/go-critic v0.14.2 h1:PMvP5f+LdR8p6B29npvChUXbD1vrNlKDf60NJtgMBOo=
@@ -191,12 +181,34 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
-github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic=
-github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
-github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
-github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
-github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU=
-github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0=
+github.com/go-openapi/jsonpointer v0.22.0 h1:TmMhghgNef9YXxTu1tOopo+0BGEytxA+okbry0HjZsM=
+github.com/go-openapi/jsonpointer v0.22.0/go.mod h1:xt3jV88UtExdIkkL7NloURjRQjbeUgcxFblMjq2iaiU=
+github.com/go-openapi/jsonreference v0.21.1 h1:bSKrcl8819zKiOgxkbVNRUBIr6Wwj9KYrDbMjRs0cDA=
+github.com/go-openapi/jsonreference v0.21.1/go.mod h1:PWs8rO4xxTUqKGu+lEvvCxD5k2X7QYkKAepJyCmSTT8=
+github.com/go-openapi/swag v0.24.1 h1:DPdYTZKo6AQCRqzwr/kGkxJzHhpKxZ9i/oX0zag+MF8=
+github.com/go-openapi/swag v0.24.1/go.mod h1:sm8I3lCPlspsBBwUm1t5oZeWZS0s7m/A+Psg0ooRU0A=
+github.com/go-openapi/swag/cmdutils v0.24.0 h1:KlRCffHwXFI6E5MV9n8o8zBRElpY4uK4yWyAMWETo9I=
+github.com/go-openapi/swag/cmdutils v0.24.0/go.mod h1:uxib2FAeQMByyHomTlsP8h1TtPd54Msu2ZDU/H5Vuf8=
+github.com/go-openapi/swag/conv v0.24.0 h1:ejB9+7yogkWly6pnruRX45D1/6J+ZxRu92YFivx54ik=
+github.com/go-openapi/swag/conv v0.24.0/go.mod h1:jbn140mZd7EW2g8a8Y5bwm8/Wy1slLySQQ0ND6DPc2c=
+github.com/go-openapi/swag/fileutils v0.24.0 h1:U9pCpqp4RUytnD689Ek/N1d2N/a//XCeqoH508H5oak=
+github.com/go-openapi/swag/fileutils v0.24.0/go.mod h1:3SCrCSBHyP1/N+3oErQ1gP+OX1GV2QYFSnrTbzwli90=
+github.com/go-openapi/swag/jsonname v0.24.0 h1:2wKS9bgRV/xB8c62Qg16w4AUiIrqqiniJFtZGi3dg5k=
+github.com/go-openapi/swag/jsonname v0.24.0/go.mod h1:GXqrPzGJe611P7LG4QB9JKPtUZ7flE4DOVechNaDd7Q=
+github.com/go-openapi/swag/jsonutils v0.24.0 h1:F1vE1q4pg1xtO3HTyJYRmEuJ4jmIp2iZ30bzW5XgZts=
+github.com/go-openapi/swag/jsonutils v0.24.0/go.mod h1:vBowZtF5Z4DDApIoxcIVfR8v0l9oq5PpYRUuteVu6f0=
+github.com/go-openapi/swag/loading v0.24.0 h1:ln/fWTwJp2Zkj5DdaX4JPiddFC5CHQpvaBKycOlceYc=
+github.com/go-openapi/swag/loading v0.24.0/go.mod h1:gShCN4woKZYIxPxbfbyHgjXAhO61m88tmjy0lp/LkJk=
+github.com/go-openapi/swag/mangling v0.24.0 h1:PGOQpViCOUroIeak/Uj/sjGAq9LADS3mOyjznmHy2pk=
+github.com/go-openapi/swag/mangling v0.24.0/go.mod h1:Jm5Go9LHkycsz0wfoaBDkdc4CkpuSnIEf62brzyCbhc=
+github.com/go-openapi/swag/netutils v0.24.0 h1:Bz02HRjYv8046Ycg/w80q3g9QCWeIqTvlyOjQPDjD8w=
+github.com/go-openapi/swag/netutils v0.24.0/go.mod h1:WRgiHcYTnx+IqfMCtu0hy9oOaPR0HnPbmArSRN1SkZM=
+github.com/go-openapi/swag/stringutils v0.24.0 h1:i4Z/Jawf9EvXOLUbT97O0HbPUja18VdBxeadyAqS1FM=
+github.com/go-openapi/swag/stringutils v0.24.0/go.mod h1:5nUXB4xA0kw2df5PRipZDslPJgJut+NjL7D25zPZ/4w=
+github.com/go-openapi/swag/typeutils v0.24.0 h1:d3szEGzGDf4L2y1gYOSSLeK6h46F+zibnEas2Jm/wIw=
+github.com/go-openapi/swag/typeutils v0.24.0/go.mod h1:q8C3Kmk/vh2VhpCLaoR2MVWOGP8y7Jc8l82qCTd1DYI=
+github.com/go-openapi/swag/yamlutils v0.24.0 h1:bhw4894A7Iw6ne+639hsBNRHg9iZg/ISrOVr+sJGp4c=
+github.com/go-openapi/swag/yamlutils v0.24.0/go.mod h1:DpKv5aYuaGm/sULePoeiG8uwMpZSfReo1HR3Ik0yaG8=
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
@@ -230,15 +242,12 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
-github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
-github.com/godoc-lint/godoc-lint v0.10.1 h1:ZPUVzlDtJfA+P688JfPJPkI/SuzcBr/753yGIk5bOPA=
-github.com/godoc-lint/godoc-lint v0.10.1/go.mod h1:KleLcHu/CGSvkjUH2RvZyoK1MBC7pDQg4NxMYLcBBsw=
+github.com/godoc-lint/godoc-lint v0.10.2 h1:dksNgK+zebnVlj4Fx83CRnCmPO0qRat/9xfFsir1nfg=
+github.com/godoc-lint/godoc-lint v0.10.2/go.mod h1:KleLcHu/CGSvkjUH2RvZyoK1MBC7pDQg4NxMYLcBBsw=
github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw=
github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
-github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golangci/asciicheck v0.5.0 h1:jczN/BorERZwK8oiFBOGvlGPknhvq0bjnysTj4nUfo0=
@@ -249,8 +258,8 @@ github.com/golangci/go-printf-func-name v0.1.1 h1:hIYTFJqAGp1iwoIfsNTpoq1xZAarog
github.com/golangci/go-printf-func-name v0.1.1/go.mod h1:Es64MpWEZbh0UBtTAICOZiB+miW53w/K9Or/4QogJss=
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d h1:viFft9sS/dxoYY0aiOTsLKO2aZQAPT4nlQCsimGcSGE=
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d/go.mod h1:ivJ9QDg0XucIkmwhzCDsqcnxxlDStoTl89jDMIoNxKY=
-github.com/golangci/golangci-lint/v2 v2.6.2 h1:jkMSVv36JmyTENcEertckvimvjPcD5qxNM7W7qhECvI=
-github.com/golangci/golangci-lint/v2 v2.6.2/go.mod h1:fSIMDiBt9kzdpnvvV7GO6iWzyv5uaeZ+iPor+2uRczE=
+github.com/golangci/golangci-lint/v2 v2.7.2 h1:AhBC+YeEueec4AGlIbvPym5C70Thx0JykIqXbdIXWx0=
+github.com/golangci/golangci-lint/v2 v2.7.2/go.mod h1:pDijleoBu7e8sejMqyZ3L5n6geqe+cVvOAz2QImqqVc=
github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 h1:AkK+w9FZBXlU/xUmBtSJN1+tAI4FIvy5WtnUnY8e4p8=
github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95/go.mod h1:k9mmcyWKSTMcPPvQUCfRWWQ9VHJ1U9Dc0R7kaXAgtnQ=
github.com/golangci/misspell v0.7.0 h1:4GOHr/T1lTW0hhR4tgaaV1WS/lJ+ncvYCoFKmqJsj0c=
@@ -265,8 +274,8 @@ github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e h1:gD6P7NEo7Eqt
github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e/go.mod h1:h+wZwLjUTJnm/P2rwlbJdRPZXOzaT36/FwnPnY2inzc=
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
-github.com/google/cel-go v0.22.1 h1:AfVXx3chM2qwoSbM7Da8g8hX8OVSkBFwX+rz2+PcK40=
-github.com/google/cel-go v0.22.1/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8=
+github.com/google/cel-go v0.26.1 h1:iPbVVEdkhTX++hpe3lzSk7D3G3QSYqLGoHOcEio+UXQ=
+github.com/google/cel-go v0.26.1/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM=
github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=
github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ=
github.com/google/go-cmdtest v0.4.1-0.20220921163831-55ab3332a786 h1:rcv+Ippz6RAtvaGgKxc+8FQIpxHgsF+HBzPyYL2cyVU=
@@ -274,24 +283,19 @@ github.com/google/go-cmdtest v0.4.1-0.20220921163831-55ab3332a786/go.mod h1:apVn
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6 h1:EEHtgt9IwisQ2AZ4pIsMjahcegHh6rmhqxzIRQIyepY=
-github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6/go.mod h1:I6V7YzU0XDpsHqbsyrghnFZLO1gwK6NPTNvmetQIk9U=
+github.com/google/pprof v0.0.0-20250903194437-c28834ac2320 h1:c7ayAhbRP9HnEl/hg/WQOM9s0snWztfW6feWXZbGHw0=
+github.com/google/pprof v0.0.0-20250903194437-c28834ac2320/go.mod h1:I6V7YzU0XDpsHqbsyrghnFZLO1gwK6NPTNvmetQIk9U=
github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
-github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
-github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gordonklaus/ineffassign v0.2.0 h1:Uths4KnmwxNJNzq87fwQQDDnbNb7De00VOk9Nu0TySs=
github.com/gordonklaus/ineffassign v0.2.0/go.mod h1:TIpymnagPSexySzs7F9FnO1XFTy8IT3a59vmZp5Y9Lw=
-github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
-github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk=
github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc=
github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM=
@@ -304,21 +308,15 @@ github.com/gostaticanalysis/nilerr v0.1.2/go.mod h1:A19UHhoY3y8ahoL7YKz6sdjDtduw
github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M=
github.com/gostaticanalysis/testutil v0.5.0 h1:Dq4wT1DdTwTGCQQv3rl3IvD5Ld0E6HiY+3Zh0sUGqw8=
github.com/gostaticanalysis/testutil v0.5.0/go.mod h1:OLQSbuM6zw2EvCcXTz1lVq5unyoNft372msDY0nY5Hs=
-github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
-github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
-github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
-github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
-github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
-github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 h1:8Tjv8EJ+pM1xP8mK6egEbD1OgnVTyacbefKhmbLhIhU=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2/go.mod h1:pkJQ2tZHJ0aFOVEEot6oZmaVEZcRme73eIFmhiVuRWs=
github.com/hashicorp/go-immutable-radix/v2 v2.1.0 h1:CUW5RYIcysz+D3B+l1mDeXrQ7fUvGGCwJfdASSzbrfo=
github.com/hashicorp/go-immutable-radix/v2 v2.1.0/go.mod h1:hgdqLXA4f6NIjRVisM1TJ9aOJVNRqKZj+xDGF6m7PBw=
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
-github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
-github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
+github.com/hashicorp/go-version v1.8.0 h1:KAkNb1HAiZd1ukkxDFGmokVZe1Xy9HG6NUp+bPle2i4=
+github.com/hashicorp/go-version v1.8.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.1-vault-7 h1:ag5OxFVy3QYTFTJODRzTKVZ6xvdfLLCA1cy/Y6xGI0I=
@@ -341,8 +339,6 @@ github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 h1:liMMTbpW
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
-github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
-github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE=
@@ -418,12 +414,12 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
-github.com/maxbrunsfeld/counterfeiter/v6 v6.11.2 h1:yVCLo4+ACVroOEr4iFU1iH46Ldlzz2rTuu18Ra7M8sU=
-github.com/maxbrunsfeld/counterfeiter/v6 v6.11.2/go.mod h1:VzB2VoMh1Y32/QqDfg9ZJYHj99oM4LiGtqPZydTiQSQ=
+github.com/maxbrunsfeld/counterfeiter/v6 v6.12.0 h1:aOeI7xAOVdK+R6xbVsZuU9HmCZYmQVmZgPf9xJUd2Sg=
+github.com/maxbrunsfeld/counterfeiter/v6 v6.12.0/go.mod h1:0hZWbtfeCYUQeAQdPLUzETiBhUSns7O6LDj9vH88xKA=
github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE=
github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A=
-github.com/mgechev/revive v1.12.0 h1:Q+/kkbbwerrVYPv9d9efaPGmAO/NsxwW/nE6ahpQaCU=
-github.com/mgechev/revive v1.12.0/go.mod h1:VXsY2LsTigk8XU9BpZauVLjVrhICMOV3k1lpB3CXrp8=
+github.com/mgechev/revive v1.13.0 h1:yFbEVliCVKRXY8UgwEO7EOYNopvjb1BFbmYqm9hZjBM=
+github.com/mgechev/revive v1.13.0/go.mod h1:efJfeBVCX2JUumNQ7dtOLDja+QKj9mYGgEZA7rt5u+0=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
@@ -435,8 +431,9 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
+github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=
+github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI=
@@ -457,8 +454,8 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
-github.com/onsi/ginkgo/v2 v2.26.0 h1:1J4Wut1IlYZNEAWIV3ALrT9NfiaGW2cDCJQSFQMs/gE=
-github.com/onsi/ginkgo/v2 v2.26.0/go.mod h1:qhEywmzWTBUY88kfO0BRvX4py7scov9yR+Az2oavUzw=
+github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
+github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
@@ -485,12 +482,12 @@ github.com/polyfloyd/go-errorlint v1.8.0 h1:DL4RestQqRLr8U4LygLw8g2DX6RN1eBJOpa2
github.com/polyfloyd/go-errorlint v1.8.0/go.mod h1:G2W0Q5roxbLCt0ZQbdoxQxXktTjwNyDbEaj3n7jvl4s=
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
-github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q=
-github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
+github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
+github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
-github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE=
-github.com/prometheus/common v0.65.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8=
+github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=
+github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=
github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
github.com/quasilyte/go-ruleguard v0.4.5 h1:AGY0tiOT5hJX9BTdx/xBdoCubQUAE2grkqY2lSwvZcA=
@@ -525,8 +522,8 @@ github.com/sashamelentyev/usestdlibvars v1.29.0 h1:8J0MoRrw4/NAXtjQqTHrbW9NN+3iM
github.com/sashamelentyev/usestdlibvars v1.29.0/go.mod h1:8PpnjHMk5VdeWlVb4wCdrB8PNbLqZ3wBZTZWkrpZZL8=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
-github.com/securego/gosec/v2 v2.22.10 h1:ntbBqdWXnu46DUOXn+R2SvPo3PiJCDugTCgTW2g4tQg=
-github.com/securego/gosec/v2 v2.22.10/go.mod h1:9UNjK3tLpv/w2b0+7r82byV43wCJDNtEDQMeS+H/g2w=
+github.com/securego/gosec/v2 v2.22.11-0.20251204091113-daccba6b93d7 h1:rZg6IGn0ySYZwCX8LHwZoYm03JhG/cVAJJ3O+u3Vclo=
+github.com/securego/gosec/v2 v2.22.11-0.20251204091113-daccba6b93d7/go.mod h1:9sr22NZO5Kfh7unW/xZxkGYTmj2484/fCiE54gw7UTY=
github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
@@ -535,18 +532,16 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE=
github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4=
-github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
-github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
github.com/sonatard/noctx v0.4.0 h1:7MC/5Gg4SQ4lhLYR6mvOP6mQVSxCrdyiExo7atBs27o=
github.com/sonatard/noctx v0.4.0/go.mod h1:64XdbzFb18XL4LporKXp8poqZtPKbCrqQ402CV+kJas=
github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0=
github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs=
-github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
-github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
-github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE=
-github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
-github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
-github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
+github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
+github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
+github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
+github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
+github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
+github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
@@ -557,10 +552,10 @@ github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ=
github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI=
github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0=
github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I=
-github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8Bg8etvARQ1rpyl4=
-github.com/stbenjam/no-sprintf-host-port v0.2.0/go.mod h1:eL0bQ9PasS0hsyTyfTjjG+E80QIyPnBVQbYZyv20Jfk=
-github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
-github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
+github.com/stbenjam/no-sprintf-host-port v0.3.1 h1:AyX7+dxI4IdLBPtDbsGAyqiTSLpCP9hWRrXQDU4Cm/g=
+github.com/stbenjam/no-sprintf-host-port v0.3.1/go.mod h1:ODbZesTCHMVKthBHskvUUexdcNHAQRXk9NpSsL8p/HQ=
+github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs=
+github.com/stoewer/go-strcase v1.3.1/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -595,10 +590,8 @@ github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 h1:9LPGD+jzxMlnk
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460=
github.com/timonwong/loggercheck v0.11.0 h1:jdaMpYBl+Uq9mWPXv1r8jc5fC3gyXx4/WGwTnnNKn4M=
github.com/timonwong/loggercheck v0.11.0/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8=
-github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
-github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
-github.com/tomarrell/wrapcheck/v2 v2.11.0 h1:BJSt36snX9+4WTIXeJ7nvHBQBcm1h2SjQMSlmQ6aFSU=
-github.com/tomarrell/wrapcheck/v2 v2.11.0/go.mod h1:wFL9pDWDAbXhhPZZt+nG8Fu+h29TtnZ2MW6Lx4BRXIU=
+github.com/tomarrell/wrapcheck/v2 v2.12.0 h1:H/qQ1aNWz/eeIhxKAFvkfIA+N7YDvq6TWVFL27Of9is=
+github.com/tomarrell/wrapcheck/v2 v2.12.0/go.mod h1:AQhQuZd0p7b6rfW+vUwHm5OMCGgp63moQ9Qr/0BpIWo=
github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw=
github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw=
github.com/ultraware/funlen v0.2.0 h1:gCHmCn+d2/1SemTdYMiKLAHFYxTYz7z9VIDRaTGyLkI=
@@ -615,8 +608,6 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xen0n/gosmopolitan v1.3.0 h1:zAZI1zefvo7gcpbCOrPSHJZJYA9ZgLfJqtKzZ5pHqQM=
github.com/xen0n/gosmopolitan v1.3.0/go.mod h1:rckfr5T6o4lBtM1ga7mLGKZmLxswUoH1zxHgNXOsEt4=
-github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chqDkyE9Z4N61UnQd+KOfgp5Iu53llk=
-github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
@@ -646,44 +637,26 @@ go.augendre.info/arangolint v0.3.1 h1:n2E6p8f+zfXSFLa2e2WqFPp4bfvcuRdd50y6cT65pS
go.augendre.info/arangolint v0.3.1/go.mod h1:6ZKzEzIZuBQwoSvlKT+qpUfIbBfFCE5gbAoTg0/117g=
go.augendre.info/fatcontext v0.9.0 h1:Gt5jGD4Zcj8CDMVzjOJITlSb9cEch54hjRRlN3qDojE=
go.augendre.info/fatcontext v0.9.0/go.mod h1:L94brOAT1OOUNue6ph/2HnwxoNlds9aXDF2FcUntbNw=
-go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
-go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
-go.etcd.io/etcd/api/v3 v3.5.21 h1:A6O2/JDb3tvHhiIz3xf9nJ7REHvtEFJJ3veW3FbCnS8=
-go.etcd.io/etcd/api/v3 v3.5.21/go.mod h1:c3aH5wcvXv/9dqIw2Y810LDXJfhSYdHQ0vxmP3CCHVY=
-go.etcd.io/etcd/client/pkg/v3 v3.5.21 h1:lPBu71Y7osQmzlflM9OfeIV2JlmpBjqBNlLtcoBqUTc=
-go.etcd.io/etcd/client/pkg/v3 v3.5.21/go.mod h1:BgqT/IXPjK9NkeSDjbzwsHySX3yIle2+ndz28nVsjUs=
-go.etcd.io/etcd/client/v2 v2.305.16 h1:kQrn9o5czVNaukf2A2At43cE9ZtWauOtf9vRZuiKXow=
-go.etcd.io/etcd/client/v2 v2.305.16/go.mod h1:h9YxWCzcdvZENbfzBTFCnoNumr2ax3F19sKMqHFmXHE=
-go.etcd.io/etcd/client/v3 v3.5.21 h1:T6b1Ow6fNjOLOtM0xSoKNQt1ASPCLWrF9XMHcH9pEyY=
-go.etcd.io/etcd/client/v3 v3.5.21/go.mod h1:mFYy67IOqmbRf/kRUvsHixzo3iG+1OF2W2+jVIQRAnU=
-go.etcd.io/etcd/pkg/v3 v3.5.16 h1:cnavs5WSPWeK4TYwPYfmcr3Joz9BH+TZ6qoUtz6/+mc=
-go.etcd.io/etcd/pkg/v3 v3.5.16/go.mod h1:+lutCZHG5MBBFI/U4eYT5yL7sJfnexsoM20Y0t2uNuY=
-go.etcd.io/etcd/raft/v3 v3.5.16 h1:zBXA3ZUpYs1AwiLGPafYAKKl/CORn/uaxYDwlNwndAk=
-go.etcd.io/etcd/raft/v3 v3.5.16/go.mod h1:P4UP14AxofMJ/54boWilabqqWoW9eLodl6I5GdGzazI=
-go.etcd.io/etcd/server/v3 v3.5.16 h1:d0/SAdJ3vVsZvF8IFVb1k8zqMZ+heGcNfft71ul9GWE=
-go.etcd.io/etcd/server/v3 v3.5.16/go.mod h1:ynhyZZpdDp1Gq49jkUg5mfkDWZwXnn3eIqCqtJnrD/s=
-go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
-go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 h1:rgMkmiGfix9vFJDcDi1PK8WEQP4FLQwLDfhp5ZLpFeE=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0/go.mod h1:ijPqXp5P6IRRByFVVg9DY8P5HkxkHE5ARIa+86aXPf4=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 h1:Hf9xI/XLML9ElpiHVDNwvqI0hIFlzV8dgIr35kV1kRU=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0/go.mod h1:NfchwuyNoMcZ5MLHwPrODwUF1HWCXWrL31s8gSAdIKY=
-go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
-go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 h1:Vh5HayB/0HHfOQA7Ctx69E/Y/DcQSMPpKANYVMQ7fBA=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0/go.mod h1:cpgtDBaqD/6ok/UG0jT15/uKjAY8mRA53diogHBg3UI=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 h1:5pojmb1U1AogINhN3SurB+zm/nIcusopeBNp42f45QM=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0/go.mod h1:57gTHJSE5S1tqg+EKsLPlTWhpHMsWlVmer+LA926XiA=
-go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
-go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
-go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
-go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
-go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
-go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
-go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
-go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
-go.opentelemetry.io/proto/otlp v1.7.0 h1:jX1VolD6nHuFzOYso2E73H85i92Mv8JQYk0K9vz09os=
-go.opentelemetry.io/proto/otlp v1.7.0/go.mod h1:fSKjH6YJ7HDlwzltzyMj036AJ3ejJLCgCSHGj4efDDo=
+go.opentelemetry.io/auto/sdk v1.2.0 h1:YpRtUFjvhSymycLS2T81lT6IGhcUP+LUPtv0iv1N8bM=
+go.opentelemetry.io/auto/sdk v1.2.0/go.mod h1:1deq2zL7rwjwC8mR7XgY2N+tlIl6pjmEUoLDENMEzwk=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg=
+go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
+go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE=
+go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=
+go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=
+go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=
+go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=
+go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=
+go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
+go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=
+go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
+go.opentelemetry.io/proto/otlp v1.8.0 h1:fRAZQDcAFHySxpJ1TwlA1cJ4tvcrw7nXl9xWWC8N5CE=
+go.opentelemetry.io/proto/otlp v1.8.0/go.mod h1:tIeYOeNBU4cvmPqpaji1P+KbB4Oloai8wN4rWzRrFF0=
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
@@ -692,8 +665,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
-go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
-go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
+go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
+go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@@ -702,10 +675,10 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
-golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
-golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
-golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc h1:TS73t7x3KarrNd5qAipmspBDS1rkMcgVG/fS1aRb4Rc=
-golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc=
+golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
+golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
+golang.org/x/exp v0.0.0-20250911091902-df9299821621 h1:2id6c1/gto0kaHYyrixvknJ8tUK/Qs5IsmBtrc+FtgU=
+golang.org/x/exp v0.0.0-20250911091902-df9299821621/go.mod h1:TwQYMMnGpvZyc+JpB/UAuTNIsVJifOlSkrZkhcvpVUk=
golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
golang.org/x/exp/typeparams v0.0.0-20251023183803-a4bb9ffd2546 h1:HDjDiATsGqvuqvkDvgJjD1IgPrVekcSXVVE21JwvzGE=
@@ -719,8 +692,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
-golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
+golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
+golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -734,10 +707,10 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
-golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
-golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
-golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
-golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
+golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
+golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
+golang.org/x/oauth2 v0.31.0 h1:8Fq0yVZLh4j4YA47vHKFTa9Ew5XIrCP8LC6UeNZnLxo=
+golang.org/x/oauth2 v0.31.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -770,18 +743,18 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
-golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
-golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 h1:LvzTn0GQhWuvKH/kVRS3R3bVAsdQWI7hvfLHGgh9+lU=
-golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE=
+golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
+golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
+golang.org/x/telemetry v0.0.0-20251111182119-bc8e575c7b54 h1:E2/AqCUMZGgd73TQkxUMcMla25GB9i/5HOdLr+uH7Vo=
+golang.org/x/telemetry v0.0.0-20251111182119-bc8e575c7b54/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
-golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q=
-golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss=
+golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
+golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -790,10 +763,10 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
-golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
-golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
-golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
-golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
+golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
+golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
+golang.org/x/time v0.13.0 h1:eUlYslOIt32DgYD6utsuUeHs4d7AsEYLuIAdg7FlYgI=
+golang.org/x/time v0.13.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
@@ -808,8 +781,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
-golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
-golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
+golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=
+golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ=
golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM=
golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=
golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM=
@@ -824,28 +797,24 @@ gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0
gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
-google.golang.org/genproto v0.0.0-20250707201910-8d1bb00bc6a7 h1:FGOcxvKlJgRBVbXeugjljCfCgfKWhC42FBoYmTCWVBs=
-google.golang.org/genproto v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:249YoW4b1INqFTEop2T4aJgiO7UBYJrpejsaLvjWfI8=
-google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 h1:FiusG7LWj+4byqhbvmB+Q93B/mOxJLN2DTozDuZm4EU=
-google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:kXqgZtrWaf6qS3jZOCnCH7WYfrvFjkC51bM8fz3RsCA=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c h1:qXWI/sQtv5UKboZ/zUk7h+mrf/lXORyI+n9DKDAusdg=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c/go.mod h1:gw1tLEfykwDz2ET4a12jcXt4couGAm7IwsVaTy0Sflo=
-google.golang.org/grpc v1.75.0 h1:+TW+dqTd2Biwe6KKfhE5JpiYIBWq865PhKGSXiivqt4=
-google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ=
-google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
-google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
+google.golang.org/genproto/googleapis/api v0.0.0-20250908214217-97024824d090 h1:d8Nakh1G+ur7+P3GcMjpRDEkoLUcLW2iU92XVqR+XMQ=
+google.golang.org/genproto/googleapis/api v0.0.0-20250908214217-97024824d090/go.mod h1:U8EXRNSd8sUYyDfs/It7KVWodQr+Hf9xtxyxWudSwEw=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 h1:/OQuEa4YWtDt7uQWHd3q3sUMb+QOLQUg1xa8CEsRv5w=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090/go.mod h1:GmFNa4BdJZ2a8G+wCe9Bg3wwThLrJun751XstdJt5Og=
+google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI=
+google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ=
+google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=
+google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
-gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
+gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo=
+gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
-gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
-gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -857,20 +826,20 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI=
honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4=
-k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls=
-k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k=
-k8s.io/apiextensions-apiserver v0.32.3 h1:4D8vy+9GWerlErCwVIbcQjsWunF9SUGNu7O7hiQTyPY=
-k8s.io/apiextensions-apiserver v0.32.3/go.mod h1:8YwcvVRMVzw0r1Stc7XfGAzB/SIVLunqApySV5V7Dss=
-k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U=
-k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
-k8s.io/apiserver v0.32.3 h1:kOw2KBuHOA+wetX1MkmrxgBr648ksz653j26ESuWNY8=
-k8s.io/apiserver v0.32.3/go.mod h1:q1x9B8E/WzShF49wh3ADOh6muSfpmFL0I2t+TG0Zdgc=
-k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU=
-k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY=
-k8s.io/cloud-provider v0.32.1 h1:74rRhnfca3o4CsjjnIp/C3ARVuSmyNsxgWPtH0yc9Z0=
-k8s.io/cloud-provider v0.32.1/go.mod h1:GECSanFT+EeZ/ToX3xlasjETzMUI+VFu92zHUDUsGHw=
-k8s.io/component-base v0.32.3 h1:98WJvvMs3QZ2LYHBzvltFSeJjEx7t5+8s71P7M74u8k=
-k8s.io/component-base v0.32.3/go.mod h1:LWi9cR+yPAv7cu2X9rZanTiFKB2kHA+JjmhkKjCZRpI=
+k8s.io/api v0.34.1 h1:jC+153630BMdlFukegoEL8E/yT7aLyQkIVuwhmwDgJM=
+k8s.io/api v0.34.1/go.mod h1:SB80FxFtXn5/gwzCoN6QCtPD7Vbu5w2n1S0J5gFfTYk=
+k8s.io/apiextensions-apiserver v0.34.1 h1:NNPBva8FNAPt1iSVwIE0FsdrVriRXMsaWFMqJbII2CI=
+k8s.io/apiextensions-apiserver v0.34.1/go.mod h1:hP9Rld3zF5Ay2Of3BeEpLAToP+l4s5UlxiHfqRaRcMc=
+k8s.io/apimachinery v0.34.1 h1:dTlxFls/eikpJxmAC7MVE8oOeP1zryV7iRyIjB0gky4=
+k8s.io/apimachinery v0.34.1/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
+k8s.io/apiserver v0.34.1 h1:U3JBGdgANK3dfFcyknWde1G6X1F4bg7PXuvlqt8lITA=
+k8s.io/apiserver v0.34.1/go.mod h1:eOOc9nrVqlBI1AFCvVzsob0OxtPZUCPiUJL45JOTBG0=
+k8s.io/client-go v0.34.1 h1:ZUPJKgXsnKwVwmKKdPfw4tB58+7/Ik3CrjOEhsiZ7mY=
+k8s.io/client-go v0.34.1/go.mod h1:kA8v0FP+tk6sZA0yKLRG67LWjqufAoSHA2xVGKw9Of8=
+k8s.io/code-generator v0.34.1 h1:WpphT26E+j7tEgIUfFr5WfbJrktCGzB3JoJH9149xYc=
+k8s.io/code-generator v0.34.1/go.mod h1:DeWjekbDnJWRwpw3s0Jat87c+e0TgkxoR4ar608yqvg=
+k8s.io/component-base v0.34.1 h1:v7xFgG+ONhytZNFpIz5/kecwD+sUhVE6HU7qQUiRM4A=
+k8s.io/component-base v0.34.1/go.mod h1:mknCpLlTSKHzAQJJnnHVKqjxR7gBeHRv0rPXA7gdtQ0=
k8s.io/component-helpers v0.32.1 h1:TwdsSM1vW9GjnfX18lkrZbwE5G9psCIS2/rhenTDXd8=
k8s.io/component-helpers v0.32.1/go.mod h1:1JT1Ei3FD29yFQ18F3laj1WyvxYdHIhyxx6adKMFQXI=
k8s.io/controller-manager v0.32.1 h1:z3oQp1O5l0cSzM/MKf8V4olhJ9TmnELoJRPcV/v1s+Y=
@@ -879,47 +848,43 @@ k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b h1:gMplByicHV/TJBizHd9aVEsTYo
k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b/go.mod h1:CgujABENc3KuTrcsdpGmrrASjtQsWCT7R99mEV4U/fM=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
-k8s.io/kms v0.33.2 h1:GFwNXX4CZGQCg9DPOaJi1/+iKidCtB9/OIAGdzRo8FI=
-k8s.io/kms v0.33.2/go.mod h1:C1I8mjFFBNzfUZXYt9FZVJ8MJl7ynFbGgZFbBzkBJ3E=
-k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 h1:gAXU86Fmbr/ktY17lkHwSjw5aoThQvhnstGGIYKlKYc=
-k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911/go.mod h1:GLOk5B+hDbRROvt0X2+hqX64v/zO3vXN7J78OUmBSKw=
+k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE=
+k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ=
k8s.io/kubelet v0.32.1 h1:bB91GvMsZb+LfzBxnjPEr1Fal/sdxZtYphlfwAaRJGw=
k8s.io/kubelet v0.32.1/go.mod h1:4sAEZ6PlewD0GroV3zscY7llym6kmNNTVmUI/Qshm6w=
-k8s.io/kubernetes v1.32.8 h1:NePHsWPIT9NQZ9w5QT/chJMuwjFFGGZxalvD6FlOjlw=
-k8s.io/kubernetes v1.32.8/go.mod h1:REY0Gok66BTTrbGyZaFMNKO9JhxvgBDW9B7aksWRFoY=
-k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
-k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+k8s.io/kubernetes v1.34.1 h1:F3p8dtpv+i8zQoebZeK5zBqM1g9x1aIdnA5vthvcuUk=
+k8s.io/kubernetes v1.34.1/go.mod h1:iu+FhII+Oc/1gGWLJcer6wpyih441aNFHl7Pvm8yPto=
+k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
+k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
mvdan.cc/gofumpt v0.9.2 h1:zsEMWL8SVKGHNztrx6uZrXdp7AX8r421Vvp23sz7ik4=
mvdan.cc/gofumpt v0.9.2/go.mod h1:iB7Hn+ai8lPvofHd9ZFGVg2GOr8sBUw1QUWjNbmIL/s=
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 h1:ssMzja7PDPJV8FStj7hq9IKiuiKhgz9ErWw+m68e7DI=
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15/go.mod h1:4M5MMXl2kW6fivUT6yRGpLLPNfuGtU2Z0cPvFquGDYU=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
-sigs.k8s.io/controller-runtime v0.20.5-0.20250517180713-32e5e9e948a5 h1:gWRqA5IcpiKl9jSzd+gzZVJWEDmJAXjZNYbo3owIzYc=
-sigs.k8s.io/controller-runtime v0.20.5-0.20250517180713-32e5e9e948a5/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
+sigs.k8s.io/controller-runtime v0.22.3 h1:I7mfqz/a/WdmDCEnXmSPm8/b/yRTy6JsKKENTijTq8Y=
+sigs.k8s.io/controller-runtime v0.22.3/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8=
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250308055145-5fe7bb3edc86 h1:96TA+X7D58V3065duUfj+p+Pp17q8U02+cSCmE3IsaU=
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250308055145-5fe7bb3edc86/go.mod h1:IaDsO8xSPRxRG1/rm9CP7+jPmj0nMNAuNi/yiHnLX8k=
-sigs.k8s.io/controller-tools v0.17.3 h1:lwFPLicpBKLgIepah+c8ikRBubFW5kOQyT88r3EwfNw=
-sigs.k8s.io/controller-tools v0.17.3/go.mod h1:1ii+oXcYZkxcBXzwv3YZBlzjt1fvkrCGjVF73blosJI=
+sigs.k8s.io/controller-tools v0.19.0 h1:OU7jrPPiZusryu6YK0jYSjPqg8Vhf8cAzluP9XGI5uk=
+sigs.k8s.io/controller-tools v0.19.0/go.mod h1:y5HY/iNDFkmFla2CfQoVb2AQXMsBk4ad84iR1PLANB0=
sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM=
sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs=
-sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
-sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
-sigs.k8s.io/kube-api-linter v0.0.0-20251203203220-2d0643557c8d h1:rUyZxT1+iT/8AVRJ4DYzcvtXKUbhbJibz4tfh0uy8CU=
-sigs.k8s.io/kube-api-linter v0.0.0-20251203203220-2d0643557c8d/go.mod h1:5mP60UakkCye+eOcZ5p98VnV2O49qreW1gq9TdsUf7Q=
-sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo=
-sigs.k8s.io/kustomize/api v0.18.0/go.mod h1:f8isXnX+8b+SGLHQ6yO4JG1rdkZlvhaCf/uZbLVMb0U=
-sigs.k8s.io/kustomize/cmd/config v0.15.0 h1:WkdY8V2+8J+W00YbImXa2ke9oegfrHH79e+kywW7EdU=
-sigs.k8s.io/kustomize/cmd/config v0.15.0/go.mod h1:Jq57b0nPaoYUlOqg//0JtAh6iibboqMcfbtCYoWPM00=
-sigs.k8s.io/kustomize/kustomize/v5 v5.5.0 h1:o1mtt6vpxsxDYaZKrw3BnEtc+pAjLz7UffnIvHNbvW0=
-sigs.k8s.io/kustomize/kustomize/v5 v5.5.0/go.mod h1:AeFCmgCrXzmvjWWaeZCyBp6XzG1Y0w1svYus8GhJEOE=
-sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E=
-sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo=
-sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
+sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
+sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
+sigs.k8s.io/kube-api-linter v0.0.0-20251208100930-d3015c953951 h1:pjOeiLsYwEPaSRYTiMtVfdn7gSoRilw7Peyjw6kyUu4=
+sigs.k8s.io/kube-api-linter v0.0.0-20251208100930-d3015c953951/go.mod h1:5mP60UakkCye+eOcZ5p98VnV2O49qreW1gq9TdsUf7Q=
+sigs.k8s.io/kustomize/api v0.20.1 h1:iWP1Ydh3/lmldBnH/S5RXgT98vWYMaTUL1ADcr+Sv7I=
+sigs.k8s.io/kustomize/api v0.20.1/go.mod h1:t6hUFxO+Ph0VxIk1sKp1WS0dOjbPCtLJ4p8aADLwqjM=
+sigs.k8s.io/kustomize/cmd/config v0.20.1 h1:4APUORmZe2BYrsqgGfEKdd/r7gM6i43egLrUzilpiFo=
+sigs.k8s.io/kustomize/cmd/config v0.20.1/go.mod h1:R7rQ8kxknVlXWVUIbxWtMgu8DCCNVtl8V0KrmeVd/KE=
+sigs.k8s.io/kustomize/kustomize/v5 v5.7.1 h1:sYJsarwy/SDJfjjLMUqwFDGPwzUtMOQ1i1Ed49+XSbw=
+sigs.k8s.io/kustomize/kustomize/v5 v5.7.1/go.mod h1:+5/SrBcJ4agx1SJknGuR/c9thwRSKLxnKoI5BzXFaLU=
+sigs.k8s.io/kustomize/kyaml v0.20.1 h1:PCMnA2mrVbRP3NIB6v9kYCAc38uvFLVs8j/CD567A78=
+sigs.k8s.io/kustomize/kyaml v0.20.1/go.mod h1:0EmkQHRUsJxY8Ug9Niig1pUMSCGHxQ5RklbpV/Ri6po=
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
-sigs.k8s.io/structured-merge-diff/v4 v4.7.0 h1:qPeWmscJcXP0snki5IYF79Z8xrl8ETFxgMd7wez1XkI=
-sigs.k8s.io/structured-merge-diff/v4 v4.7.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
-sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
-sigs.k8s.io/yaml v1.5.0 h1:M10b2U7aEUY6hRtU870n2VTPgR5RZiL/I6Lcc2F4NUQ=
-sigs.k8s.io/yaml v1.5.0/go.mod h1:wZs27Rbxoai4C0f8/9urLZtZtF3avA3gKvGyPdDqTO4=
+sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco=
+sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
+sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
+sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
diff --git a/images/ci/Dockerfile b/images/ci/Dockerfile
index a4dcd312d..663fa943e 100644
--- a/images/ci/Dockerfile
+++ b/images/ci/Dockerfile
@@ -1,5 +1,5 @@
# Build the external-secrets-operator binary
-FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.20 AS builder
+FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.21 AS builder
ARG SRC_DIR=/go/src/github.com/openshift/external-secrets-operator
ENV GO_BUILD_TAGS=strictfipsruntime,openssl
diff --git a/images/ci/operand.Dockerfile b/images/ci/operand.Dockerfile
index 6431fa600..edaccc35e 100644
--- a/images/ci/operand.Dockerfile
+++ b/images/ci/operand.Dockerfile
@@ -1,4 +1,4 @@
-FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.20 AS builder
+FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.21 AS builder
ARG RELEASE_BRANCH=v0.19.0
ARG GO_BUILD_TAGS=strictfipsruntime,openssl
diff --git a/pkg/controller/external_secrets/controller.go b/pkg/controller/external_secrets/controller.go
index e5771c823..3fef51aad 100644
--- a/pkg/controller/external_secrets/controller.go
+++ b/pkg/controller/external_secrets/controller.go
@@ -105,16 +105,17 @@ type Reconciler struct {
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update
// +kubebuilder:rbac:groups=cert-manager.io,resources=certificates;clusterissuers;issuers,verbs=get;list;watch;create;update
// +kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies,verbs=get;list;watch;create;update
-// +kubebuilder:rbac:groups="",resources=namespaces,verbs=get;list;watch;create
+// +kubebuilder:rbac:groups="",resources=namespaces,verbs=get;list;watch;create;update;patch
// +kubebuilder:rbac:groups="",resources=endpoints,verbs=get;list;watch;create
// +kubebuilder:rbac:groups="",resources=serviceaccounts/token,verbs=create
// +kubebuilder:rbac:groups="",resources=configmaps,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch;create;update;patch;delete
+// +kubebuilder:rbac:groups=discovery.k8s.io,resources=endpointslices,verbs=get;list;watch
// +kubebuilder:rbac:groups=external-secrets.io,resources=clusterexternalsecrets;clustersecretstores;clusterpushsecrets;externalsecrets;secretstores;pushsecrets,verbs=get;list;watch;create;update;patch;delete;deletecollection
// +kubebuilder:rbac:groups=external-secrets.io,resources=clusterexternalsecrets/finalizers;clustersecretstores/finalizers;externalsecrets/finalizers;pushsecrets/finalizers;secretstores/finalizers;clusterpushsecrets/finalizers,verbs=get;update;patch
// +kubebuilder:rbac:groups=external-secrets.io,resources=clusterexternalsecrets/status;clustersecretstores/status;externalsecrets/status;pushsecrets/status;secretstores/status;clusterpushsecrets/status,verbs=get;update;patch
-// +kubebuilder:rbac:groups=generators.external-secrets.io,resources=acraccesstokens;clustergenerators;ecrauthorizationtokens;fakes;gcraccesstokens;generatorstates;sshkeys;mfas,verbs=get;list;watch;create;delete;update;patch;deletecollection
+// +kubebuilder:rbac:groups=generators.external-secrets.io,resources=acraccesstokens;cloudsmithaccesstokens;clustergenerators;ecrauthorizationtokens;fakes;gcraccesstokens;generatorstates;sshkeys;mfas,verbs=get;list;watch;create;delete;update;patch;deletecollection
// +kubebuilder:rbac:groups=generators.external-secrets.io,resources=githubaccesstokens;grafanas;passwords;quayaccesstokens;stssessiontokens;uuids;vaultdynamicsecrets;webhooks,verbs=get;list;watch;create;delete;update;patch;deletecollection
// New is for building the reconciler instance consumed by the Reconcile method.
diff --git a/pkg/controller/external_secrets/deployments_test.go b/pkg/controller/external_secrets/deployments_test.go
index a9f015791..36fab23b7 100644
--- a/pkg/controller/external_secrets/deployments_test.go
+++ b/pkg/controller/external_secrets/deployments_test.go
@@ -469,7 +469,7 @@ func TestCreateOrApplyDeployments(t *testing.T) {
},
}
},
- wantErr: `failed to update resource requirements: invalid resource requirements: [spec.resources.requests[test]: Invalid value: test: must be a standard resource type or fully qualified, spec.resources.requests[test]: Invalid value: test: must be a standard resource for containers]`,
+ wantErr: `failed to update resource requirements: invalid resource requirements: [spec.resources.requests[test]: Invalid value: "test": must be a standard resource type or fully qualified, spec.resources.requests[test]: Invalid value: "test": must be a standard resource for containers]`,
},
{
name: "bitwarden is enabled with secretRef for certificates",
diff --git a/pkg/operator/assets/bindata.go b/pkg/operator/assets/bindata.go
index 4b9004789..017f7c021 100644
--- a/pkg/operator/assets/bindata.go
+++ b/pkg/operator/assets/bindata.go
@@ -431,7 +431,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
external-secrets.io/component: webhook
spec:
@@ -471,7 +471,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rules:
- apiGroups:
@@ -510,6 +510,14 @@ rules:
- "list"
- "get"
- "watch"
+ - apiGroups:
+ - "discovery.k8s.io"
+ resources:
+ - "endpointslices"
+ verbs:
+ - "list"
+ - "get"
+ - "watch"
- apiGroups:
- ""
resources:
@@ -561,7 +569,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rules:
- apiGroups:
@@ -619,6 +627,7 @@ rules:
- "generators.external-secrets.io"
resources:
- "acraccesstokens"
+ - "cloudsmithaccesstokens"
- "clustergenerators"
- "ecrauthorizationtokens"
- "fakes"
@@ -646,6 +655,13 @@ rules:
- "get"
- "list"
- "watch"
+ - apiGroups:
+ - ""
+ resources:
+ - "namespaces"
+ verbs:
+ - "update"
+ - "patch"
- apiGroups:
- ""
resources:
@@ -720,7 +736,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
@@ -743,6 +759,7 @@ rules:
- "generators.external-secrets.io"
resources:
- "acraccesstokens"
+ - "cloudsmithaccesstokens"
- "clustergenerators"
- "ecrauthorizationtokens"
- "fakes"
@@ -789,7 +806,7 @@ metadata:
servicebinding.io/controller: "true"
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rules:
- apiGroups:
@@ -826,7 +843,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rbac.authorization.k8s.io/aggregate-to-view: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
@@ -848,6 +865,7 @@ rules:
- "generators.external-secrets.io"
resources:
- "acraccesstokens"
+ - "cloudsmithaccesstokens"
- "clustergenerators"
- "ecrauthorizationtokens"
- "fakes"
@@ -891,7 +909,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
@@ -926,7 +944,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
@@ -962,7 +980,7 @@ metadata:
labels:
app.kubernetes.io/name: bitwarden-sdk-server
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.5.0"
+ app.kubernetes.io/version: "v0.5.1"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
replicas: 1
@@ -981,7 +999,7 @@ spec:
containers:
- name: bitwarden-sdk-server
securityContext: {}
- image: "ghcr.io/external-secrets/bitwarden-sdk-server:v0.5.0"
+ image: "ghcr.io/external-secrets/bitwarden-sdk-server:v0.5.1"
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /certs
@@ -1038,7 +1056,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
replicas: 1
@@ -1052,7 +1070,7 @@ spec:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
serviceAccountName: external-secrets-cert-controller
@@ -1070,7 +1088,7 @@ spec:
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
- image: oci.external-secrets.io/external-secrets/external-secrets:v0.19.0
+ image: oci.external-secrets.io/external-secrets/external-secrets:v0.20.4
imagePullPolicy: IfNotPresent
args:
- certcontroller
@@ -1120,7 +1138,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
replicas: 1
@@ -1134,7 +1152,7 @@ spec:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
hostNetwork: false
@@ -1152,7 +1170,7 @@ spec:
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
- image: oci.external-secrets.io/external-secrets/external-secrets:v0.19.0
+ image: oci.external-secrets.io/external-secrets/external-secrets:v0.20.4
imagePullPolicy: IfNotPresent
args:
- webhook
@@ -1211,7 +1229,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
replicas: 1
@@ -1225,7 +1243,7 @@ spec:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
serviceAccountName: external-secrets
@@ -1243,7 +1261,7 @@ spec:
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
- image: oci.external-secrets.io/external-secrets/external-secrets:v0.19.0
+ image: oci.external-secrets.io/external-secrets/external-secrets:v0.20.4
imagePullPolicy: IfNotPresent
args:
- --concurrent=1
@@ -1285,7 +1303,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
rules:
- apiGroups:
@@ -1339,7 +1357,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
@@ -1375,7 +1393,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
external-secrets.io/component: webhook
`)
@@ -1404,7 +1422,7 @@ metadata:
labels:
app.kubernetes.io/name: bitwarden-sdk-server
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.5.0"
+ app.kubernetes.io/version: "v0.5.1"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
type: ClusterIP
@@ -1441,7 +1459,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
type: ClusterIP
@@ -1479,7 +1497,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
spec:
type: ClusterIP
@@ -1517,14 +1535,14 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
external-secrets.io/component: webhook
spec:
type: ClusterIP
ports:
- port: 443
- targetPort: 10250
+ targetPort: webhook
protocol: TCP
name: webhook
- port: 8080
@@ -1560,7 +1578,7 @@ metadata:
labels:
app.kubernetes.io/name: bitwarden-sdk-server
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.5.0"
+ app.kubernetes.io/version: "v0.5.1"
app.kubernetes.io/managed-by: external-secrets-operator
`)
@@ -1588,7 +1606,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-cert-controller
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
`)
@@ -1616,7 +1634,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
`)
@@ -1644,7 +1662,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
`)
@@ -1671,7 +1689,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
external-secrets.io/component: webhook
webhooks:
@@ -1716,7 +1734,7 @@ metadata:
labels:
app.kubernetes.io/name: external-secrets-webhook
app.kubernetes.io/instance: external-secrets
- app.kubernetes.io/version: "v0.19.0"
+ app.kubernetes.io/version: "v0.20.4"
app.kubernetes.io/managed-by: external-secrets-operator
external-secrets.io/component: webhook
webhooks:
diff --git a/rebase-automation.sh b/rebase-automation.sh
new file mode 100755
index 000000000..a5015a8ac
--- /dev/null
+++ b/rebase-automation.sh
@@ -0,0 +1,256 @@
+#!/bin/bash
+set -euo pipefail
+RED='\033[0;31m'
+GREEN='\033[0;32m'
+YELLOW='\033[1;33m'
+BLUE='\033[0;34m'
+NC='\033[0m'
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+REPO_ROOT="$SCRIPT_DIR"
+NEW_EXTERNAL_SECRETS_VERSION="${NEW_EXTERNAL_SECRETS_VERSION:-}"
+NEW_BUNDLE_VERSION="${NEW_BUNDLE_VERSION:-}"
+OLD_BUNDLE_VERSION="${OLD_BUNDLE_VERSION:-}"
+OLD_EXTERNAL_SECRETS_VERSION="${OLD_EXTERNAL_SECRETS_VERSION:-}"
+TARGET_BRANCH="${TARGET_BRANCH:-master}"
+
+log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
+log_success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; }
+log_warning() { echo -e "${YELLOW}[WARNING]${NC} $1"; }
+log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
+
+usage() {
+ cat << EOF
+Usage: $0 [OPTIONS]
+Automates the external-secrets-operator rebase process.
+Environment Variables:
+ NEW_EXTERNAL_SECRETS_VERSION New external-secrets version (e.g., v0.20.1, v0.20.4)
+ NEW_BUNDLE_VERSION New bundle version (e.g., 1.1.0)
+ OLD_BUNDLE_VERSION Old bundle version to replace (optional - auto-detected)
+ OLD_EXTERNAL_SECRETS_VERSION Old external-secrets version (optional - auto-detected)
+ TARGET_BRANCH Target git branch for PR (default: master)
+Options:
+ -h, --help Show this help message
+ -d, --dry-run Show what would be done without making changes
+ -s, --step STEP Run only specific step (1-5)
+ --skip-commit Skip git commits (useful for testing)
+Steps:
+ 1. Bump deps with upstream external-secrets
+ 2. Update Makefile: VERSION, EXTERNAL_SECRETS_VERSION
+ 3. Update operand manifests (external-secrets helm charts)
+ 4. Update CSV: OLM bundle name, version, replaces, skipRange
+ 5. Generate bundle and bindata
+EOF
+}
+
+check_prerequisites() {
+ log_info "Checking prerequisites..."
+ if ! git rev-parse --git-dir > /dev/null 2>&1; then log_error "Not in a git repository"; exit 1; fi
+ local required_tools=("go" "make" "sed" "grep")
+ for tool in "${required_tools[@]}"; do
+ if ! command -v "$tool" &> /dev/null; then log_error "$tool is not installed"; exit 1; fi
+ done
+ if [[ -z "$NEW_EXTERNAL_SECRETS_VERSION" ]]; then log_error "NEW_EXTERNAL_SECRETS_VERSION is not set"; log_info "Example: export NEW_EXTERNAL_SECRETS_VERSION=v0.20.1"; exit 1; fi
+ if [[ -z "$NEW_BUNDLE_VERSION" ]]; then log_error "NEW_BUNDLE_VERSION is not set"; log_info "Example: export NEW_BUNDLE_VERSION=1.1.0"; exit 1; fi
+ if [[ ! "$NEW_EXTERNAL_SECRETS_VERSION" =~ ^v ]]; then NEW_EXTERNAL_SECRETS_VERSION="v${NEW_EXTERNAL_SECRETS_VERSION}"; log_warning "Added 'v' prefix to external-secrets version: $NEW_EXTERNAL_SECRETS_VERSION"; fi
+ log_success "Prerequisites check passed"
+}
+
+detect_current_versions() {
+ log_info "Auto-detecting current versions..."
+ if [[ -z "$OLD_BUNDLE_VERSION" ]]; then OLD_BUNDLE_VERSION=$(grep "^VERSION" Makefile | head -1 | cut -d'=' -f2 | tr -d ' ?'); log_info "Auto-detected OLD_BUNDLE_VERSION: $OLD_BUNDLE_VERSION"; fi
+ if [[ -z "$OLD_EXTERNAL_SECRETS_VERSION" ]]; then OLD_EXTERNAL_SECRETS_VERSION=$(grep "^EXTERNAL_SECRETS_VERSION" Makefile | cut -d'=' -f2 | tr -d ' ?'); log_info "Auto-detected OLD_EXTERNAL_SECRETS_VERSION: $OLD_EXTERNAL_SECRETS_VERSION"; fi
+ if [[ -z "$OLD_BUNDLE_VERSION" || -z "$OLD_EXTERNAL_SECRETS_VERSION" ]]; then log_error "Failed to auto-detect current versions"; exit 1; fi
+ log_success "Version detection completed"
+ log_info "OLD_BUNDLE_VERSION: $OLD_BUNDLE_VERSION"
+ log_info "OLD_EXTERNAL_SECRETS_VERSION: $OLD_EXTERNAL_SECRETS_VERSION"
+ log_info "NEW_BUNDLE_VERSION: $NEW_BUNDLE_VERSION"
+ log_info "NEW_EXTERNAL_SECRETS_VERSION: $NEW_EXTERNAL_SECRETS_VERSION"
+}
+
+backup_current_state() {
+ log_info "Creating backup of current state..."
+ local backup_branch="backup-$(date +%Y%m%d-%H%M%S)"
+ git branch "$backup_branch"
+ log_success "Created backup branch: $backup_branch"
+}
+
+step1_bump_deps() {
+ log_info "Step 1: Bumping deps with upstream external-secrets@$NEW_EXTERNAL_SECRETS_VERSION"
+ if [[ "$DRY_RUN" == "true" ]]; then
+ log_warning "[DRY RUN] Would execute:"
+ echo " go get github.com/external-secrets/external-secrets@$NEW_EXTERNAL_SECRETS_VERSION"
+ echo " go mod edit -replace github.com/external-secrets/external-secrets=github.com/openshift/external-secrets@$NEW_EXTERNAL_SECRETS_VERSION"
+ echo " go mod tidy && go mod vendor"
+ return 0
+ fi
+ log_info "Running: go get github.com/external-secrets/external-secrets@$NEW_EXTERNAL_SECRETS_VERSION"
+ go get "github.com/external-secrets/external-secrets@$NEW_EXTERNAL_SECRETS_VERSION"
+ log_info "Running: go mod edit -replace github.com/external-secrets/external-secrets=github.com/openshift/external-secrets@$NEW_EXTERNAL_SECRETS_VERSION"
+ go mod edit -replace "github.com/external-secrets/external-secrets=github.com/openshift/external-secrets@$NEW_EXTERNAL_SECRETS_VERSION"
+ log_info "Running: go mod tidy && go mod vendor"
+ go mod tidy
+ go mod vendor
+ if [[ "$SKIP_COMMIT" != "true" ]]; then
+ git add go.mod go.sum vendor/
+ git commit -m "Bump deps with upstream external-secrets@$NEW_EXTERNAL_SECRETS_VERSION"
+ log_success "Step 1 committed"
+ fi
+ log_success "Step 1 completed"
+}
+
+step2_update_makefile() {
+ log_info "Step 2: Update Makefile: VERSION, EXTERNAL_SECRETS_VERSION"
+ if [[ "$DRY_RUN" == "true" ]]; then
+ log_warning "[DRY RUN] Would update Makefile:"
+ echo " VERSION: $OLD_BUNDLE_VERSION -> $NEW_BUNDLE_VERSION"
+ echo " EXTERNAL_SECRETS_VERSION: $OLD_EXTERNAL_SECRETS_VERSION -> $NEW_EXTERNAL_SECRETS_VERSION"
+ return 0
+ fi
+ log_info "Updating VERSION: $OLD_BUNDLE_VERSION -> $NEW_BUNDLE_VERSION"
+ sed -i "s/^VERSION ?= $OLD_BUNDLE_VERSION/VERSION ?= $NEW_BUNDLE_VERSION/" Makefile
+ log_info "Updating EXTERNAL_SECRETS_VERSION: $OLD_EXTERNAL_SECRETS_VERSION -> $NEW_EXTERNAL_SECRETS_VERSION"
+ sed -i "s|^EXTERNAL_SECRETS_VERSION ?= $OLD_EXTERNAL_SECRETS_VERSION|EXTERNAL_SECRETS_VERSION ?= $NEW_EXTERNAL_SECRETS_VERSION|" Makefile
+ if [[ "$SKIP_COMMIT" != "true" ]]; then
+ git add Makefile
+ git commit -m "Update Makefile: VERSION, EXTERNAL_SECRETS_VERSION"
+ log_success "Step 2 committed"
+ fi
+ log_success "Step 2 completed"
+}
+
+step3_update_operand_manifests() {
+ log_info "Step 3: Update operand manifests from external-secrets helm charts"
+ if [[ "$DRY_RUN" == "true" ]]; then
+ log_warning "[DRY RUN] Would execute:"
+ echo " make update-operand-manifests"
+ echo " This fetches external-secrets helm charts for version $NEW_EXTERNAL_SECRETS_VERSION"
+ return 0
+ fi
+ log_info "Running: make update-operand-manifests"
+ make update-operand-manifests
+ if [[ "$SKIP_COMMIT" != "true" ]]; then
+ git add bindata/
+ git commit -m "Update operand manifests for external-secrets@$NEW_EXTERNAL_SECRETS_VERSION"
+ log_success "Step 3 committed"
+ fi
+ log_success "Step 3 completed"
+}
+
+step4_update_csv() {
+ log_info "Step 4: Update CSV: OLM bundle name, version, replaces, skipRange"
+ if [[ "$DRY_RUN" == "true" ]]; then
+ log_warning "[DRY RUN] Would update CSV files:"
+ echo " version: $OLD_BUNDLE_VERSION -> $NEW_BUNDLE_VERSION"
+ echo " name: external-secrets-operator.v$OLD_BUNDLE_VERSION -> external-secrets-operator.v$NEW_BUNDLE_VERSION"
+ echo " replaces: external-secrets-operator.v[previous] -> external-secrets-operator.v$OLD_BUNDLE_VERSION"
+ echo " skipRange: <$OLD_BUNDLE_VERSION -> <$NEW_BUNDLE_VERSION"
+ return 0
+ fi
+ local csv_file="config/manifests/bases/external-secrets-operator.clusterserviceversion.yaml"
+ if [[ -f "$csv_file" ]]; then
+ log_info "Updating $csv_file"
+ sed -i "s/version: $OLD_BUNDLE_VERSION/version: $NEW_BUNDLE_VERSION/" "$csv_file"
+ sed -i "s/name: external-secrets-operator\.v$OLD_BUNDLE_VERSION/name: external-secrets-operator.v$NEW_BUNDLE_VERSION/" "$csv_file"
+ if grep -q "replaces:" "$csv_file"; then
+ sed -i "s/replaces: external-secrets-operator\.v[0-9]\+\.[0-9]\+\.[0-9]\+/replaces: external-secrets-operator.v$OLD_BUNDLE_VERSION/" "$csv_file"
+ else
+ if [[ "$OLD_BUNDLE_VERSION" != "0.0.0" ]]; then
+ sed -i "/name: external-secrets-operator\.v$NEW_BUNDLE_VERSION/a\ replaces: external-secrets-operator.v$OLD_BUNDLE_VERSION" "$csv_file"
+ fi
+ fi
+ sed -i "s/olm\.skipRange: <[0-9]\+\.[0-9]\+\.[0-9]\+/olm.skipRange: <$NEW_BUNDLE_VERSION/" "$csv_file"
+ fi
+ if [[ "$SKIP_COMMIT" != "true" ]]; then
+ git add "$csv_file"
+ git commit -m "Update CSV: version, name, replaces, skipRange for v$NEW_BUNDLE_VERSION"
+ log_success "Step 4 committed"
+ fi
+ log_success "Step 4 completed"
+}
+
+step5_generate_bundle() {
+ log_info "Step 5: Generate bundle manifests and update bindata"
+ if [[ "$DRY_RUN" == "true" ]]; then
+ log_warning "[DRY RUN] Would execute:"
+ echo " make manifests"
+ echo " make bundle"
+ echo " make update-bindata"
+ return 0
+ fi
+ log_info "Running: make manifests"
+ make manifests
+ log_info "Running: make bundle"
+ make bundle
+ log_info "Running: make update-bindata"
+ make update-bindata
+ if [[ "$SKIP_COMMIT" != "true" ]] && [[ -n "$(git status --porcelain)" ]]; then
+ git add .
+ git commit -m "Generate bundle manifests and update bindata for v$NEW_BUNDLE_VERSION"
+ log_success "Step 5 committed"
+ else
+ log_info "No changes to commit in Step 5"
+ fi
+ log_success "Step 5 completed"
+}
+
+run_all_steps() {
+ log_info "Running all rebase steps..."
+ step1_bump_deps
+ step2_update_makefile
+ step3_update_operand_manifests
+ step4_update_csv
+ step5_generate_bundle
+ log_success "All steps completed successfully!"
+ log_info "Summary of changes:"
+ log_info " - Bumped external-secrets from $OLD_EXTERNAL_SECRETS_VERSION to $NEW_EXTERNAL_SECRETS_VERSION"
+ log_info " - Updated bundle version from $OLD_BUNDLE_VERSION to $NEW_BUNDLE_VERSION"
+ log_info " - Updated operand manifests (helm charts)"
+ log_info " - Updated CSV metadata and skipRange"
+ log_info " - Generated bundle manifests and bindata"
+ log_info ""
+ log_info "Next steps:"
+ log_info " 1. Review the changes: git diff"
+ log_info " 2. Run tests: make test"
+ log_info " 3. Create PR targeting '$TARGET_BRANCH' branch"
+}
+
+main() {
+ local DRY_RUN=false
+ local SKIP_COMMIT=false
+ local SPECIFIC_STEP=""
+ while [[ $# -gt 0 ]]; do
+ case $1 in
+ -h|--help) usage; exit 0 ;;
+ -d|--dry-run) DRY_RUN=true; shift ;;
+ -s|--step) SPECIFIC_STEP="$2"; shift 2 ;;
+ --skip-commit) SKIP_COMMIT=true; shift ;;
+ *) log_error "Unknown option: $1"; usage; exit 1 ;;
+ esac
+ done
+ export DRY_RUN SKIP_COMMIT
+ log_info "Starting external-secrets-operator rebase automation"
+ check_prerequisites
+ detect_current_versions
+ if [[ "$DRY_RUN" != "true" ]]; then
+ backup_current_state
+ fi
+ if [[ -n "$SPECIFIC_STEP" ]]; then
+ case "$SPECIFIC_STEP" in
+ 1) step1_bump_deps ;;
+ 2) step2_update_makefile ;;
+ 3) step3_update_operand_manifests ;;
+ 4) step4_update_csv ;;
+ 5) step5_generate_bundle ;;
+ *) log_error "Invalid step: $SPECIFIC_STEP. Must be 1-5"; exit 1 ;;
+ esac
+ else
+ run_all_steps
+ fi
+ if [[ "$DRY_RUN" == "true" ]]; then
+ log_info "Dry run completed. No changes were made."
+ else
+ log_success "Rebase automation completed successfully!"
+ fi
+}
+
+main "$@"
diff --git a/vendor/github.com/MirrexOne/unqueryvet/.golangci.yml b/vendor/github.com/MirrexOne/unqueryvet/.golangci.yml
new file mode 100644
index 000000000..d604d323f
--- /dev/null
+++ b/vendor/github.com/MirrexOne/unqueryvet/.golangci.yml
@@ -0,0 +1,20 @@
+version: "2"
+
+formatters:
+ enable:
+ - gofumpt
+ - goimports
+ settings:
+ gofumpt:
+ extra-rules: true
+
+linters:
+ exclusions:
+ warn-unused: true
+ presets:
+ - comments
+ - std-error-handling
+
+issues:
+ max-issues-per-linter: 0
+ max-same-issues: 0
diff --git a/vendor/github.com/MirrexOne/unqueryvet/README.md b/vendor/github.com/MirrexOne/unqueryvet/README.md
index 6c00223f7..407f9d289 100644
--- a/vendor/github.com/MirrexOne/unqueryvet/README.md
+++ b/vendor/github.com/MirrexOne/unqueryvet/README.md
@@ -9,6 +9,7 @@ unqueryvet is a Go static analysis tool (linter) that detects `SELECT *` usage i
## Features
- **Detects `SELECT *` in string literals** - Finds problematic queries in your Go code
+- **Constants and variables support** - Detects `SELECT *` in const and var declarations
- **SQL Builder support** - Works with popular SQL builders like Squirrel, GORM, etc.
- **Highly configurable** - Extensive configuration options for different use cases
- **Supports `//nolint:unqueryvet`** - Standard Go linting suppression
@@ -55,20 +56,22 @@ unqueryvet ./...
Add to your `.golangci.yml`:
```yaml
+version: "2"
+
linters:
enable:
- unqueryvet
-linters-settings:
- unqueryvet:
- check-sql-builders: true
- # By default, no functions are ignored - minimal configuration
- # ignored-functions:
- # - "fmt.Printf"
- # - "log.Printf"
- # allowed-patterns:
- # - "SELECT \\* FROM information_schema\\..*"
- # - "SELECT \\* FROM pg_catalog\\..*"
+ settings:
+ unqueryvet:
+ check-sql-builders: true
+ # By default, no functions are ignored - minimal configuration
+ # ignored-functions:
+ # - "fmt.Printf"
+ # - "log.Printf"
+ # allowed-patterns:
+ # - "SELECT \\* FROM information_schema\\..*"
+ # - "SELECT \\* FROM pg_catalog\\..*"
```
## Examples
@@ -76,6 +79,12 @@ linters-settings:
### Problematic code (will trigger warnings)
```go
+// Constants with SELECT *
+const QueryUsers = "SELECT * FROM users"
+
+// Variables with SELECT *
+var QueryOrders = "SELECT * FROM orders"
+
// String literals with SELECT *
query := "SELECT * FROM users"
rows, err := db.Query("SELECT * FROM orders WHERE status = ?", "active")
@@ -88,7 +97,13 @@ query := builder.Select().Columns("*").From("inventory")
### Good code (recommended)
```go
-// Explicit column selection
+// Constants with explicit columns
+const QueryUsers = "SELECT id, name, email FROM users"
+
+// Variables with explicit columns
+var QueryOrders = "SELECT id, status, total FROM orders"
+
+// String literals with explicit column selection
query := "SELECT id, name, email FROM users"
rows, err := db.Query("SELECT id, total FROM orders WHERE status = ?", "active")
@@ -117,40 +132,20 @@ query := "SELECT * FROM debug_table" //nolint:unqueryvet
Unqueryvet is highly configurable to fit your project's needs:
```yaml
-linters-settings:
- unqueryvet:
- # Enable/disable SQL builder checking (default: true)
- check-sql-builders: true
-
- # Optional: Functions to ignore during analysis (empty by default - minimal config)
- # ignored-functions:
- # - "fmt.Printf"
- # - "log.Printf"
- # - "debug.Query"
-
- # Optional: Packages to ignore completely (empty by default)
- # ignored-packages:
- # - "testing"
- # - "debug"
-
- # Default allowed patterns (automatically included):
- # - COUNT(*), MAX(*), MIN(*) functions
- # - information_schema, pg_catalog, sys schema queries
- # You can add more patterns if needed:
- # allowed-patterns:
- # - "SELECT \\* FROM temp_.*"
-
- # Default ignored file patterns (automatically included):
- # *_test.go, *.pb.go, *_gen.go, *.gen.go, *_generated.go
- # You can add more patterns if needed:
- # ignored-file-patterns:
- # - "my_special_pattern.go"
+version: "2"
+
+linters:
+ settings:
+ unqueryvet:
+ # Enable/disable SQL builder checking (default: true)
+ check-sql-builders: true
- # Default ignored directories (automatically included):
- # vendor, testdata, migrations, generated, .git, node_modules
- # You can add more directories if needed:
- # ignored-directories:
- # - "my_special_dir"
+ # Default allowed patterns (automatically included):
+ # - COUNT(*), MAX(*), MIN(*) functions
+ # - information_schema, pg_catalog, sys schema queries
+ # You can add more patterns if needed:
+ # allowed-patterns:
+ # - "SELECT \\* FROM temp_.*"
```
## Supported SQL Builders
@@ -173,12 +168,10 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v5
- with:
- go-version: 1.23
+ - uses: actions/checkout@v5
+ - uses: actions/setup-go@v6
- name: golangci-lint
- uses: golangci/golangci-lint-action@v6
+ uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --enable unqueryvet
@@ -206,10 +199,10 @@ unqueryvet -v ./...
Unqueryvet is designed to be fast and lightweight:
-- **Parallel processing** - Analyzes multiple files concurrently
-- **Incremental analysis** - Only analyzes changed files when possible
-- **Minimal memory footprint** - Efficient AST traversal
-- **Smart caching** - Reuses analysis results when appropriate
+- **Parallel processing**: Analyzes multiple files concurrently
+- **Incremental analysis**: Only analyzes changed files when possible
+- **Minimal memory footprint**: Efficient AST traversal
+- **Smart caching**: Reuses analysis results when appropriate
## Advanced Usage
@@ -265,5 +258,3 @@ MIT License - see [LICENSE](LICENSE) file for details.
## Support
- **Bug Reports**: [GitHub Issues](https://github.com/MirrexOne/unqueryvet/issues)
-
----
diff --git a/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/analyzer.go b/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/analyzer.go
index 1627ee144..ce9b9874c 100644
--- a/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/analyzer.go
+++ b/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/analyzer.go
@@ -64,11 +64,11 @@ func RunWithConfig(pass *analysis.Pass, cfg *config.UnqueryvetSettings) (any, er
(*ast.CallExpr)(nil), // Function/method calls
(*ast.File)(nil), // Files (for SQL builder analysis)
(*ast.AssignStmt)(nil), // Assignment statements for standalone literals
+ (*ast.GenDecl)(nil), // General declarations (const, var, type)
}
// Walk through all AST nodes and analyze them
insp.Preorder(nodeFilter, func(n ast.Node) {
-
switch node := n.(type) {
case *ast.File:
// Analyze SQL builders only if enabled in configuration
@@ -78,6 +78,9 @@ func RunWithConfig(pass *analysis.Pass, cfg *config.UnqueryvetSettings) (any, er
case *ast.AssignStmt:
// Check assignment statements for standalone SQL literals
checkAssignStmt(pass, node, cfg)
+ case *ast.GenDecl:
+ // Check constant and variable declarations
+ checkGenDecl(pass, node, cfg)
case *ast.CallExpr:
// Analyze function calls for SQL with SELECT * usage
checkCallExpr(pass, node, cfg)
@@ -96,6 +99,7 @@ func run(pass *analysis.Pass) (any, error) {
(*ast.CallExpr)(nil), // Function/method calls
(*ast.File)(nil), // Files (for SQL builder analysis)
(*ast.AssignStmt)(nil), // Assignment statements for standalone literals
+ (*ast.GenDecl)(nil), // General declarations (const, var)
}
// Always use default settings since passing settings through ResultOf doesn't work reliably
@@ -104,7 +108,6 @@ func run(pass *analysis.Pass) (any, error) {
// Walk through all AST nodes and analyze them
insp.Preorder(nodeFilter, func(n ast.Node) {
-
switch node := n.(type) {
case *ast.File:
// Analyze SQL builders only if enabled in configuration
@@ -114,6 +117,9 @@ func run(pass *analysis.Pass) (any, error) {
case *ast.AssignStmt:
// Check assignment statements for standalone SQL literals
checkAssignStmt(pass, node, cfg)
+ case *ast.GenDecl:
+ // Check constant and variable declarations
+ checkGenDecl(pass, node, cfg)
case *ast.CallExpr:
// Analyze function calls for SQL with SELECT * usage
checkCallExpr(pass, node, cfg)
@@ -140,10 +146,40 @@ func checkAssignStmt(pass *analysis.Pass, stmt *ast.AssignStmt, cfg *config.Unqu
}
}
+// checkGenDecl checks general declarations (const, var) for SELECT * in SQL queries
+func checkGenDecl(pass *analysis.Pass, decl *ast.GenDecl, cfg *config.UnqueryvetSettings) {
+ // Only check const and var declarations
+ if decl.Tok != token.CONST && decl.Tok != token.VAR {
+ return
+ }
+
+ // Iterate through all specifications in the declaration
+ for _, spec := range decl.Specs {
+ // Type assert to ValueSpec (const/var specifications)
+ valueSpec, ok := spec.(*ast.ValueSpec)
+ if !ok {
+ continue
+ }
+
+ // Check all values in the specification
+ for _, value := range valueSpec.Values {
+ // Only check direct string literals
+ if lit, ok := value.(*ast.BasicLit); ok && lit.Kind == token.STRING {
+ content := normalizeSQLQuery(lit.Value)
+ if isSelectStarQuery(content, cfg) {
+ pass.Report(analysis.Diagnostic{
+ Pos: lit.Pos(),
+ Message: getWarningMessage(),
+ })
+ }
+ }
+ }
+ }
+}
+
// checkCallExpr analyzes function calls for SQL with SELECT * usage
// Includes checking arguments and SQL builders
func checkCallExpr(pass *analysis.Pass, call *ast.CallExpr, cfg *config.UnqueryvetSettings) {
-
// Check SQL builders for SELECT * in arguments
if cfg.CheckSQLBuilders && isSQLBuilderSelectStar(call) {
pass.Report(analysis.Diagnostic{
diff --git a/vendor/github.com/NYTimes/gziphandler/.gitignore b/vendor/github.com/NYTimes/gziphandler/.gitignore
deleted file mode 100644
index 1377554eb..000000000
--- a/vendor/github.com/NYTimes/gziphandler/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.swp
diff --git a/vendor/github.com/NYTimes/gziphandler/.travis.yml b/vendor/github.com/NYTimes/gziphandler/.travis.yml
deleted file mode 100644
index 94dfae362..000000000
--- a/vendor/github.com/NYTimes/gziphandler/.travis.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-language: go
-go:
- - 1.x
- - tip
-env:
- - GO111MODULE=on
-install:
- - go mod download
-script:
- - go test -race -v
diff --git a/vendor/github.com/NYTimes/gziphandler/CODE_OF_CONDUCT.md b/vendor/github.com/NYTimes/gziphandler/CODE_OF_CONDUCT.md
deleted file mode 100644
index cdbca194c..000000000
--- a/vendor/github.com/NYTimes/gziphandler/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,75 +0,0 @@
----
-layout: code-of-conduct
-version: v1.0
----
-
-This code of conduct outlines our expectations for participants within the **NYTimes/gziphandler** community, as well as steps to reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored. Anyone who violates this code of conduct may be banned from the community.
-
-Our open source community strives to:
-
-* **Be friendly and patient.**
-* **Be welcoming**: We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
-* **Be considerate**: Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language.
-* **Be respectful**: Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one.
-* **Be careful in the words that we choose**: we are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable.
-* **Try to understand why we disagree**: Disagreements, both social and technical, happen all the time. It is important that we resolve disagreements and differing views constructively. Remember that we’re different. The strength of our community comes from its diversity, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes.
-
-## Definitions
-
-Harassment includes, but is not limited to:
-
-- Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, neuro(a)typicality, physical appearance, body size, race, age, regional discrimination, political or religious affiliation
-- Unwelcome comments regarding a person’s lifestyle choices and practices, including those related to food, health, parenting, drugs, and employment
-- Deliberate misgendering. This includes deadnaming or persistently using a pronoun that does not correctly reflect a person's gender identity. You must address people by the name they give you when not addressing them by their username or handle
-- Physical contact and simulated physical contact (eg, textual descriptions like “*hug*” or “*backrub*”) without consent or after a request to stop
-- Threats of violence, both physical and psychological
-- Incitement of violence towards any individual, including encouraging a person to commit suicide or to engage in self-harm
-- Deliberate intimidation
-- Stalking or following
-- Harassing photography or recording, including logging online activity for harassment purposes
-- Sustained disruption of discussion
-- Unwelcome sexual attention, including gratuitous or off-topic sexual images or behaviour
-- Pattern of inappropriate social contact, such as requesting/assuming inappropriate levels of intimacy with others
-- Continued one-on-one communication after requests to cease
-- Deliberate “outing” of any aspect of a person’s identity without their consent except as necessary to protect others from intentional abuse
-- Publication of non-harassing private communication
-
-Our open source community prioritizes marginalized people’s safety over privileged people’s comfort. We will not act on complaints regarding:
-
-- ‘Reverse’ -isms, including ‘reverse racism,’ ‘reverse sexism,’ and ‘cisphobia’
-- Reasonable communication of boundaries, such as “leave me alone,” “go away,” or “I’m not discussing this with you”
-- Refusal to explain or debate social justice concepts
-- Communicating in a ‘tone’ you don’t find congenial
-- Criticizing racist, sexist, cissexist, or otherwise oppressive behavior or assumptions
-
-
-### Diversity Statement
-
-We encourage everyone to participate and are committed to building a community for all. Although we will fail at times, we seek to treat everyone both as fairly and equally as possible. Whenever a participant has made a mistake, we expect them to take responsibility for it. If someone has been harmed or offended, it is our responsibility to listen carefully and respectfully, and do our best to right the wrong.
-
-Although this list cannot be exhaustive, we explicitly honor diversity in age, gender, gender identity or expression, culture, ethnicity, language, national origin, political beliefs, profession, race, religion, sexual orientation, socioeconomic status, and technical ability. We will not tolerate discrimination based on any of the protected
-characteristics above, including participants with disabilities.
-
-### Reporting Issues
-
-If you experience or witness unacceptable behavior—or have any other concerns—please report it by contacting us via **code@nytimes.com**. All reports will be handled with discretion. In your report please include:
-
-- Your contact information.
-- Names (real, nicknames, or pseudonyms) of any individuals involved. If there are additional witnesses, please
-include them as well. Your account of what occurred, and if you believe the incident is ongoing. If there is a publicly available record (e.g. a mailing list archive or a public IRC logger), please include a link.
-- Any additional information that may be helpful.
-
-After filing a report, a representative will contact you personally, review the incident, follow up with any additional questions, and make a decision as to how to respond. If the person who is harassing you is part of the response team, they will recuse themselves from handling your incident. If the complaint originates from a member of the response team, it will be handled by a different member of the response team. We will respect confidentiality requests for the purpose of protecting victims of abuse.
-
-### Attribution & Acknowledgements
-
-We all stand on the shoulders of giants across many open source communities. We'd like to thank the communities and projects that established code of conducts and diversity statements as our inspiration:
-
-* [Django](https://www.djangoproject.com/conduct/reporting/)
-* [Python](https://www.python.org/community/diversity/)
-* [Ubuntu](http://www.ubuntu.com/about/about-ubuntu/conduct)
-* [Contributor Covenant](http://contributor-covenant.org/)
-* [Geek Feminism](http://geekfeminism.org/about/code-of-conduct/)
-* [Citizen Code of Conduct](http://citizencodeofconduct.org/)
-
-This Code of Conduct was based on https://github.com/todogroup/opencodeofconduct
diff --git a/vendor/github.com/NYTimes/gziphandler/CONTRIBUTING.md b/vendor/github.com/NYTimes/gziphandler/CONTRIBUTING.md
deleted file mode 100644
index b89a9eb4f..000000000
--- a/vendor/github.com/NYTimes/gziphandler/CONTRIBUTING.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Contributing to NYTimes/gziphandler
-
-This is an open source project started by handful of developers at The New York Times and open to the entire Go community.
-
-We really appreciate your help!
-
-## Filing issues
-
-When filing an issue, make sure to answer these five questions:
-
-1. What version of Go are you using (`go version`)?
-2. What operating system and processor architecture are you using?
-3. What did you do?
-4. What did you expect to see?
-5. What did you see instead?
-
-## Contributing code
-
-Before submitting changes, please follow these guidelines:
-
-1. Check the open issues and pull requests for existing discussions.
-2. Open an issue to discuss a new feature.
-3. Write tests.
-4. Make sure code follows the ['Go Code Review Comments'](https://github.com/golang/go/wiki/CodeReviewComments).
-5. Make sure your changes pass `go test`.
-6. Make sure the entire test suite passes locally and on Travis CI.
-7. Open a Pull Request.
-8. [Squash your commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) after receiving feedback and add a [great commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
-
-Unless otherwise noted, the gziphandler source files are distributed under the Apache 2.0-style license found in the LICENSE.md file.
diff --git a/vendor/github.com/NYTimes/gziphandler/LICENSE b/vendor/github.com/NYTimes/gziphandler/LICENSE
deleted file mode 100644
index df6192d36..000000000
--- a/vendor/github.com/NYTimes/gziphandler/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 2016-2017 The New York Times Company
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/vendor/github.com/NYTimes/gziphandler/README.md b/vendor/github.com/NYTimes/gziphandler/README.md
deleted file mode 100644
index 6259acaca..000000000
--- a/vendor/github.com/NYTimes/gziphandler/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-Gzip Handler
-============
-
-This is a tiny Go package which wraps HTTP handlers to transparently gzip the
-response body, for clients which support it. Although it's usually simpler to
-leave that to a reverse proxy (like nginx or Varnish), this package is useful
-when that's undesirable.
-
-## Install
-```bash
-go get -u github.com/NYTimes/gziphandler
-```
-
-## Usage
-
-Call `GzipHandler` with any handler (an object which implements the
-`http.Handler` interface), and it'll return a new handler which gzips the
-response. For example:
-
-```go
-package main
-
-import (
- "io"
- "net/http"
- "github.com/NYTimes/gziphandler"
-)
-
-func main() {
- withoutGz := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Header().Set("Content-Type", "text/plain")
- io.WriteString(w, "Hello, World")
- })
-
- withGz := gziphandler.GzipHandler(withoutGz)
-
- http.Handle("/", withGz)
- http.ListenAndServe("0.0.0.0:8000", nil)
-}
-```
-
-
-## Documentation
-
-The docs can be found at [godoc.org][docs], as usual.
-
-
-## License
-
-[Apache 2.0][license].
-
-
-
-
-[docs]: https://godoc.org/github.com/NYTimes/gziphandler
-[license]: https://github.com/NYTimes/gziphandler/blob/master/LICENSE
diff --git a/vendor/github.com/NYTimes/gziphandler/gzip.go b/vendor/github.com/NYTimes/gziphandler/gzip.go
deleted file mode 100644
index c112bbdf8..000000000
--- a/vendor/github.com/NYTimes/gziphandler/gzip.go
+++ /dev/null
@@ -1,532 +0,0 @@
-package gziphandler // import "github.com/NYTimes/gziphandler"
-
-import (
- "bufio"
- "compress/gzip"
- "fmt"
- "io"
- "mime"
- "net"
- "net/http"
- "strconv"
- "strings"
- "sync"
-)
-
-const (
- vary = "Vary"
- acceptEncoding = "Accept-Encoding"
- contentEncoding = "Content-Encoding"
- contentType = "Content-Type"
- contentLength = "Content-Length"
-)
-
-type codings map[string]float64
-
-const (
- // DefaultQValue is the default qvalue to assign to an encoding if no explicit qvalue is set.
- // This is actually kind of ambiguous in RFC 2616, so hopefully it's correct.
- // The examples seem to indicate that it is.
- DefaultQValue = 1.0
-
- // DefaultMinSize is the default minimum size until we enable gzip compression.
- // 1500 bytes is the MTU size for the internet since that is the largest size allowed at the network layer.
- // If you take a file that is 1300 bytes and compress it to 800 bytes, it’s still transmitted in that same 1500 byte packet regardless, so you’ve gained nothing.
- // That being the case, you should restrict the gzip compression to files with a size greater than a single packet, 1400 bytes (1.4KB) is a safe value.
- DefaultMinSize = 1400
-)
-
-// gzipWriterPools stores a sync.Pool for each compression level for reuse of
-// gzip.Writers. Use poolIndex to covert a compression level to an index into
-// gzipWriterPools.
-var gzipWriterPools [gzip.BestCompression - gzip.BestSpeed + 2]*sync.Pool
-
-func init() {
- for i := gzip.BestSpeed; i <= gzip.BestCompression; i++ {
- addLevelPool(i)
- }
- addLevelPool(gzip.DefaultCompression)
-}
-
-// poolIndex maps a compression level to its index into gzipWriterPools. It
-// assumes that level is a valid gzip compression level.
-func poolIndex(level int) int {
- // gzip.DefaultCompression == -1, so we need to treat it special.
- if level == gzip.DefaultCompression {
- return gzip.BestCompression - gzip.BestSpeed + 1
- }
- return level - gzip.BestSpeed
-}
-
-func addLevelPool(level int) {
- gzipWriterPools[poolIndex(level)] = &sync.Pool{
- New: func() interface{} {
- // NewWriterLevel only returns error on a bad level, we are guaranteeing
- // that this will be a valid level so it is okay to ignore the returned
- // error.
- w, _ := gzip.NewWriterLevel(nil, level)
- return w
- },
- }
-}
-
-// GzipResponseWriter provides an http.ResponseWriter interface, which gzips
-// bytes before writing them to the underlying response. This doesn't close the
-// writers, so don't forget to do that.
-// It can be configured to skip response smaller than minSize.
-type GzipResponseWriter struct {
- http.ResponseWriter
- index int // Index for gzipWriterPools.
- gw *gzip.Writer
-
- code int // Saves the WriteHeader value.
-
- minSize int // Specifed the minimum response size to gzip. If the response length is bigger than this value, it is compressed.
- buf []byte // Holds the first part of the write before reaching the minSize or the end of the write.
- ignore bool // If true, then we immediately passthru writes to the underlying ResponseWriter.
-
- contentTypes []parsedContentType // Only compress if the response is one of these content-types. All are accepted if empty.
-}
-
-type GzipResponseWriterWithCloseNotify struct {
- *GzipResponseWriter
-}
-
-func (w GzipResponseWriterWithCloseNotify) CloseNotify() <-chan bool {
- return w.ResponseWriter.(http.CloseNotifier).CloseNotify()
-}
-
-// Write appends data to the gzip writer.
-func (w *GzipResponseWriter) Write(b []byte) (int, error) {
- // GZIP responseWriter is initialized. Use the GZIP responseWriter.
- if w.gw != nil {
- return w.gw.Write(b)
- }
-
- // If we have already decided not to use GZIP, immediately passthrough.
- if w.ignore {
- return w.ResponseWriter.Write(b)
- }
-
- // Save the write into a buffer for later use in GZIP responseWriter (if content is long enough) or at close with regular responseWriter.
- // On the first write, w.buf changes from nil to a valid slice
- w.buf = append(w.buf, b...)
-
- var (
- cl, _ = strconv.Atoi(w.Header().Get(contentLength))
- ct = w.Header().Get(contentType)
- ce = w.Header().Get(contentEncoding)
- )
- // Only continue if they didn't already choose an encoding or a known unhandled content length or type.
- if ce == "" && (cl == 0 || cl >= w.minSize) && (ct == "" || handleContentType(w.contentTypes, ct)) {
- // If the current buffer is less than minSize and a Content-Length isn't set, then wait until we have more data.
- if len(w.buf) < w.minSize && cl == 0 {
- return len(b), nil
- }
- // If the Content-Length is larger than minSize or the current buffer is larger than minSize, then continue.
- if cl >= w.minSize || len(w.buf) >= w.minSize {
- // If a Content-Type wasn't specified, infer it from the current buffer.
- if ct == "" {
- ct = http.DetectContentType(w.buf)
- w.Header().Set(contentType, ct)
- }
- // If the Content-Type is acceptable to GZIP, initialize the GZIP writer.
- if handleContentType(w.contentTypes, ct) {
- if err := w.startGzip(); err != nil {
- return 0, err
- }
- return len(b), nil
- }
- }
- }
- // If we got here, we should not GZIP this response.
- if err := w.startPlain(); err != nil {
- return 0, err
- }
- return len(b), nil
-}
-
-// startGzip initializes a GZIP writer and writes the buffer.
-func (w *GzipResponseWriter) startGzip() error {
- // Set the GZIP header.
- w.Header().Set(contentEncoding, "gzip")
-
- // if the Content-Length is already set, then calls to Write on gzip
- // will fail to set the Content-Length header since its already set
- // See: https://github.com/golang/go/issues/14975.
- w.Header().Del(contentLength)
-
- // Write the header to gzip response.
- if w.code != 0 {
- w.ResponseWriter.WriteHeader(w.code)
- // Ensure that no other WriteHeader's happen
- w.code = 0
- }
-
- // Initialize and flush the buffer into the gzip response if there are any bytes.
- // If there aren't any, we shouldn't initialize it yet because on Close it will
- // write the gzip header even if nothing was ever written.
- if len(w.buf) > 0 {
- // Initialize the GZIP response.
- w.init()
- n, err := w.gw.Write(w.buf)
-
- // This should never happen (per io.Writer docs), but if the write didn't
- // accept the entire buffer but returned no specific error, we have no clue
- // what's going on, so abort just to be safe.
- if err == nil && n < len(w.buf) {
- err = io.ErrShortWrite
- }
- return err
- }
- return nil
-}
-
-// startPlain writes to sent bytes and buffer the underlying ResponseWriter without gzip.
-func (w *GzipResponseWriter) startPlain() error {
- if w.code != 0 {
- w.ResponseWriter.WriteHeader(w.code)
- // Ensure that no other WriteHeader's happen
- w.code = 0
- }
- w.ignore = true
- // If Write was never called then don't call Write on the underlying ResponseWriter.
- if w.buf == nil {
- return nil
- }
- n, err := w.ResponseWriter.Write(w.buf)
- w.buf = nil
- // This should never happen (per io.Writer docs), but if the write didn't
- // accept the entire buffer but returned no specific error, we have no clue
- // what's going on, so abort just to be safe.
- if err == nil && n < len(w.buf) {
- err = io.ErrShortWrite
- }
- return err
-}
-
-// WriteHeader just saves the response code until close or GZIP effective writes.
-func (w *GzipResponseWriter) WriteHeader(code int) {
- if w.code == 0 {
- w.code = code
- }
-}
-
-// init graps a new gzip writer from the gzipWriterPool and writes the correct
-// content encoding header.
-func (w *GzipResponseWriter) init() {
- // Bytes written during ServeHTTP are redirected to this gzip writer
- // before being written to the underlying response.
- gzw := gzipWriterPools[w.index].Get().(*gzip.Writer)
- gzw.Reset(w.ResponseWriter)
- w.gw = gzw
-}
-
-// Close will close the gzip.Writer and will put it back in the gzipWriterPool.
-func (w *GzipResponseWriter) Close() error {
- if w.ignore {
- return nil
- }
-
- if w.gw == nil {
- // GZIP not triggered yet, write out regular response.
- err := w.startPlain()
- // Returns the error if any at write.
- if err != nil {
- err = fmt.Errorf("gziphandler: write to regular responseWriter at close gets error: %q", err.Error())
- }
- return err
- }
-
- err := w.gw.Close()
- gzipWriterPools[w.index].Put(w.gw)
- w.gw = nil
- return err
-}
-
-// Flush flushes the underlying *gzip.Writer and then the underlying
-// http.ResponseWriter if it is an http.Flusher. This makes GzipResponseWriter
-// an http.Flusher.
-func (w *GzipResponseWriter) Flush() {
- if w.gw == nil && !w.ignore {
- // Only flush once startGzip or startPlain has been called.
- //
- // Flush is thus a no-op until we're certain whether a plain
- // or gzipped response will be served.
- return
- }
-
- if w.gw != nil {
- w.gw.Flush()
- }
-
- if fw, ok := w.ResponseWriter.(http.Flusher); ok {
- fw.Flush()
- }
-}
-
-// Hijack implements http.Hijacker. If the underlying ResponseWriter is a
-// Hijacker, its Hijack method is returned. Otherwise an error is returned.
-func (w *GzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
- if hj, ok := w.ResponseWriter.(http.Hijacker); ok {
- return hj.Hijack()
- }
- return nil, nil, fmt.Errorf("http.Hijacker interface is not supported")
-}
-
-// verify Hijacker interface implementation
-var _ http.Hijacker = &GzipResponseWriter{}
-
-// MustNewGzipLevelHandler behaves just like NewGzipLevelHandler except that in
-// an error case it panics rather than returning an error.
-func MustNewGzipLevelHandler(level int) func(http.Handler) http.Handler {
- wrap, err := NewGzipLevelHandler(level)
- if err != nil {
- panic(err)
- }
- return wrap
-}
-
-// NewGzipLevelHandler returns a wrapper function (often known as middleware)
-// which can be used to wrap an HTTP handler to transparently gzip the response
-// body if the client supports it (via the Accept-Encoding header). Responses will
-// be encoded at the given gzip compression level. An error will be returned only
-// if an invalid gzip compression level is given, so if one can ensure the level
-// is valid, the returned error can be safely ignored.
-func NewGzipLevelHandler(level int) (func(http.Handler) http.Handler, error) {
- return NewGzipLevelAndMinSize(level, DefaultMinSize)
-}
-
-// NewGzipLevelAndMinSize behave as NewGzipLevelHandler except it let the caller
-// specify the minimum size before compression.
-func NewGzipLevelAndMinSize(level, minSize int) (func(http.Handler) http.Handler, error) {
- return GzipHandlerWithOpts(CompressionLevel(level), MinSize(minSize))
-}
-
-func GzipHandlerWithOpts(opts ...option) (func(http.Handler) http.Handler, error) {
- c := &config{
- level: gzip.DefaultCompression,
- minSize: DefaultMinSize,
- }
-
- for _, o := range opts {
- o(c)
- }
-
- if err := c.validate(); err != nil {
- return nil, err
- }
-
- return func(h http.Handler) http.Handler {
- index := poolIndex(c.level)
-
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Header().Add(vary, acceptEncoding)
- if acceptsGzip(r) {
- gw := &GzipResponseWriter{
- ResponseWriter: w,
- index: index,
- minSize: c.minSize,
- contentTypes: c.contentTypes,
- }
- defer gw.Close()
-
- if _, ok := w.(http.CloseNotifier); ok {
- gwcn := GzipResponseWriterWithCloseNotify{gw}
- h.ServeHTTP(gwcn, r)
- } else {
- h.ServeHTTP(gw, r)
- }
-
- } else {
- h.ServeHTTP(w, r)
- }
- })
- }, nil
-}
-
-// Parsed representation of one of the inputs to ContentTypes.
-// See https://golang.org/pkg/mime/#ParseMediaType
-type parsedContentType struct {
- mediaType string
- params map[string]string
-}
-
-// equals returns whether this content type matches another content type.
-func (pct parsedContentType) equals(mediaType string, params map[string]string) bool {
- if pct.mediaType != mediaType {
- return false
- }
- // if pct has no params, don't care about other's params
- if len(pct.params) == 0 {
- return true
- }
-
- // if pct has any params, they must be identical to other's.
- if len(pct.params) != len(params) {
- return false
- }
- for k, v := range pct.params {
- if w, ok := params[k]; !ok || v != w {
- return false
- }
- }
- return true
-}
-
-// Used for functional configuration.
-type config struct {
- minSize int
- level int
- contentTypes []parsedContentType
-}
-
-func (c *config) validate() error {
- if c.level != gzip.DefaultCompression && (c.level < gzip.BestSpeed || c.level > gzip.BestCompression) {
- return fmt.Errorf("invalid compression level requested: %d", c.level)
- }
-
- if c.minSize < 0 {
- return fmt.Errorf("minimum size must be more than zero")
- }
-
- return nil
-}
-
-type option func(c *config)
-
-func MinSize(size int) option {
- return func(c *config) {
- c.minSize = size
- }
-}
-
-func CompressionLevel(level int) option {
- return func(c *config) {
- c.level = level
- }
-}
-
-// ContentTypes specifies a list of content types to compare
-// the Content-Type header to before compressing. If none
-// match, the response will be returned as-is.
-//
-// Content types are compared in a case-insensitive, whitespace-ignored
-// manner.
-//
-// A MIME type without any other directive will match a content type
-// that has the same MIME type, regardless of that content type's other
-// directives. I.e., "text/html" will match both "text/html" and
-// "text/html; charset=utf-8".
-//
-// A MIME type with any other directive will only match a content type
-// that has the same MIME type and other directives. I.e.,
-// "text/html; charset=utf-8" will only match "text/html; charset=utf-8".
-//
-// By default, responses are gzipped regardless of
-// Content-Type.
-func ContentTypes(types []string) option {
- return func(c *config) {
- c.contentTypes = []parsedContentType{}
- for _, v := range types {
- mediaType, params, err := mime.ParseMediaType(v)
- if err == nil {
- c.contentTypes = append(c.contentTypes, parsedContentType{mediaType, params})
- }
- }
- }
-}
-
-// GzipHandler wraps an HTTP handler, to transparently gzip the response body if
-// the client supports it (via the Accept-Encoding header). This will compress at
-// the default compression level.
-func GzipHandler(h http.Handler) http.Handler {
- wrapper, _ := NewGzipLevelHandler(gzip.DefaultCompression)
- return wrapper(h)
-}
-
-// acceptsGzip returns true if the given HTTP request indicates that it will
-// accept a gzipped response.
-func acceptsGzip(r *http.Request) bool {
- acceptedEncodings, _ := parseEncodings(r.Header.Get(acceptEncoding))
- return acceptedEncodings["gzip"] > 0.0
-}
-
-// returns true if we've been configured to compress the specific content type.
-func handleContentType(contentTypes []parsedContentType, ct string) bool {
- // If contentTypes is empty we handle all content types.
- if len(contentTypes) == 0 {
- return true
- }
-
- mediaType, params, err := mime.ParseMediaType(ct)
- if err != nil {
- return false
- }
-
- for _, c := range contentTypes {
- if c.equals(mediaType, params) {
- return true
- }
- }
-
- return false
-}
-
-// parseEncodings attempts to parse a list of codings, per RFC 2616, as might
-// appear in an Accept-Encoding header. It returns a map of content-codings to
-// quality values, and an error containing the errors encountered. It's probably
-// safe to ignore those, because silently ignoring errors is how the internet
-// works.
-//
-// See: http://tools.ietf.org/html/rfc2616#section-14.3.
-func parseEncodings(s string) (codings, error) {
- c := make(codings)
- var e []string
-
- for _, ss := range strings.Split(s, ",") {
- coding, qvalue, err := parseCoding(ss)
-
- if err != nil {
- e = append(e, err.Error())
- } else {
- c[coding] = qvalue
- }
- }
-
- // TODO (adammck): Use a proper multi-error struct, so the individual errors
- // can be extracted if anyone cares.
- if len(e) > 0 {
- return c, fmt.Errorf("errors while parsing encodings: %s", strings.Join(e, ", "))
- }
-
- return c, nil
-}
-
-// parseCoding parses a single conding (content-coding with an optional qvalue),
-// as might appear in an Accept-Encoding header. It attempts to forgive minor
-// formatting errors.
-func parseCoding(s string) (coding string, qvalue float64, err error) {
- for n, part := range strings.Split(s, ";") {
- part = strings.TrimSpace(part)
- qvalue = DefaultQValue
-
- if n == 0 {
- coding = strings.ToLower(part)
- } else if strings.HasPrefix(part, "q=") {
- qvalue, err = strconv.ParseFloat(strings.TrimPrefix(part, "q="), 64)
-
- if qvalue < 0.0 {
- qvalue = 0.0
- } else if qvalue > 1.0 {
- qvalue = 1.0
- }
- }
- }
-
- if coding == "" {
- err = fmt.Errorf("empty content-coding")
- }
-
- return
-}
diff --git a/vendor/github.com/NYTimes/gziphandler/gzip_go18.go b/vendor/github.com/NYTimes/gziphandler/gzip_go18.go
deleted file mode 100644
index fa9665b7e..000000000
--- a/vendor/github.com/NYTimes/gziphandler/gzip_go18.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// +build go1.8
-
-package gziphandler
-
-import "net/http"
-
-// Push initiates an HTTP/2 server push.
-// Push returns ErrNotSupported if the client has disabled push or if push
-// is not supported on the underlying connection.
-func (w *GzipResponseWriter) Push(target string, opts *http.PushOptions) error {
- pusher, ok := w.ResponseWriter.(http.Pusher)
- if ok && pusher != nil {
- return pusher.Push(target, setAcceptEncodingForPushOptions(opts))
- }
- return http.ErrNotSupported
-}
-
-// setAcceptEncodingForPushOptions sets "Accept-Encoding" : "gzip" for PushOptions without overriding existing headers.
-func setAcceptEncodingForPushOptions(opts *http.PushOptions) *http.PushOptions {
-
- if opts == nil {
- opts = &http.PushOptions{
- Header: http.Header{
- acceptEncoding: []string{"gzip"},
- },
- }
- return opts
- }
-
- if opts.Header == nil {
- opts.Header = http.Header{
- acceptEncoding: []string{"gzip"},
- }
- return opts
- }
-
- if encoding := opts.Header.Get(acceptEncoding); encoding == "" {
- opts.Header.Add(acceptEncoding, "gzip")
- return opts
- }
-
- return opts
-}
diff --git a/vendor/github.com/asaskevich/govalidator/.gitignore b/vendor/github.com/asaskevich/govalidator/.gitignore
deleted file mode 100644
index 8d69a9418..000000000
--- a/vendor/github.com/asaskevich/govalidator/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-bin/
-.idea/
-# Binaries for programs and plugins
-*.exe
-*.exe~
-*.dll
-*.so
-*.dylib
-
-# Test binary, built with `go test -c`
-*.test
-
-# Output of the go coverage tool, specifically when used with LiteIDE
-*.out
-
diff --git a/vendor/github.com/asaskevich/govalidator/.travis.yml b/vendor/github.com/asaskevich/govalidator/.travis.yml
deleted file mode 100644
index bb83c6670..000000000
--- a/vendor/github.com/asaskevich/govalidator/.travis.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-language: go
-dist: xenial
-go:
- - '1.10'
- - '1.11'
- - '1.12'
- - '1.13'
- - 'tip'
-
-script:
- - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s
- - bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md b/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md
deleted file mode 100644
index 4b462b0d8..000000000
--- a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Contributor Code of Conduct
-
-This project adheres to [The Code Manifesto](http://codemanifesto.com)
-as its guidelines for contributor interactions.
-
-## The Code Manifesto
-
-We want to work in an ecosystem that empowers developers to reach their
-potential — one that encourages growth and effective collaboration. A space
-that is safe for all.
-
-A space such as this benefits everyone that participates in it. It encourages
-new developers to enter our field. It is through discussion and collaboration
-that we grow, and through growth that we improve.
-
-In the effort to create such a place, we hold to these values:
-
-1. **Discrimination limits us.** This includes discrimination on the basis of
- race, gender, sexual orientation, gender identity, age, nationality,
- technology and any other arbitrary exclusion of a group of people.
-2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort
- levels. Remember that, and if brought to your attention, heed it.
-3. **We are our biggest assets.** None of us were born masters of our trade.
- Each of us has been helped along the way. Return that favor, when and where
- you can.
-4. **We are resources for the future.** As an extension of #3, share what you
- know. Make yourself a resource to help those that come after you.
-5. **Respect defines us.** Treat others as you wish to be treated. Make your
- discussions, criticisms and debates from a position of respectfulness. Ask
- yourself, is it true? Is it necessary? Is it constructive? Anything less is
- unacceptable.
-6. **Reactions require grace.** Angry responses are valid, but abusive language
- and vindictive actions are toxic. When something happens that offends you,
- handle it assertively, but be respectful. Escalate reasonably, and try to
- allow the offender an opportunity to explain themselves, and possibly
- correct the issue.
-7. **Opinions are just that: opinions.** Each and every one of us, due to our
- background and upbringing, have varying opinions. That is perfectly
- acceptable. Remember this: if you respect your own opinions, you should
- respect the opinions of others.
-8. **To err is human.** You might not intend it, but mistakes do happen and
- contribute to build experience. Tolerate honest mistakes, and don't
- hesitate to apologize if you make one yourself.
diff --git a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md b/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md
deleted file mode 100644
index 7ed268a1e..000000000
--- a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md
+++ /dev/null
@@ -1,63 +0,0 @@
-#### Support
-If you do have a contribution to the package, feel free to create a Pull Request or an Issue.
-
-#### What to contribute
-If you don't know what to do, there are some features and functions that need to be done
-
-- [ ] Refactor code
-- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check
-- [ ] Create actual list of contributors and projects that currently using this package
-- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues)
-- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions)
-- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new
-- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc
-- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224)
-- [ ] Implement fuzzing testing
-- [ ] Implement some struct/map/array utilities
-- [ ] Implement map/array validation
-- [ ] Implement benchmarking
-- [ ] Implement batch of examples
-- [ ] Look at forks for new features and fixes
-
-#### Advice
-Feel free to create what you want, but keep in mind when you implement new features:
-- Code must be clear and readable, names of variables/constants clearly describes what they are doing
-- Public functions must be documented and described in source file and added to README.md to the list of available functions
-- There are must be unit-tests for any new functions and improvements
-
-## Financial contributions
-
-We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator).
-Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.
-
-
-## Credits
-
-
-### Contributors
-
-Thank you to all the people who have already contributed to govalidator!
-
-
-
-### Backers
-
-Thank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)]
-
-
-
-
-### Sponsors
-
-Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor))
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vendor/github.com/asaskevich/govalidator/LICENSE b/vendor/github.com/asaskevich/govalidator/LICENSE
deleted file mode 100644
index cacba9102..000000000
--- a/vendor/github.com/asaskevich/govalidator/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014-2020 Alex Saskevich
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
diff --git a/vendor/github.com/asaskevich/govalidator/README.md b/vendor/github.com/asaskevich/govalidator/README.md
deleted file mode 100644
index 2c3fc35eb..000000000
--- a/vendor/github.com/asaskevich/govalidator/README.md
+++ /dev/null
@@ -1,622 +0,0 @@
-govalidator
-===========
-[](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](https://godoc.org/github.com/asaskevich/govalidator)
-[](https://travis-ci.org/asaskevich/govalidator)
-[](https://codecov.io/gh/asaskevich/govalidator) [](https://goreportcard.com/report/github.com/asaskevich/govalidator) [](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [](#backers) [](#sponsors) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield)
-
-A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js).
-
-#### Installation
-Make sure that Go is installed on your computer.
-Type the following command in your terminal:
-
- go get github.com/asaskevich/govalidator
-
-or you can get specified release of the package with `gopkg.in`:
-
- go get gopkg.in/asaskevich/govalidator.v10
-
-After it the package is ready to use.
-
-
-#### Import package in your project
-Add following line in your `*.go` file:
-```go
-import "github.com/asaskevich/govalidator"
-```
-If you are unhappy to use long `govalidator`, you can do something like this:
-```go
-import (
- valid "github.com/asaskevich/govalidator"
-)
-```
-
-#### Activate behavior to require all fields have a validation tag by default
-`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). A good place to activate this is a package init function or the main() function.
-
-`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors.
-
-```go
-import "github.com/asaskevich/govalidator"
-
-func init() {
- govalidator.SetFieldsRequiredByDefault(true)
-}
-```
-
-Here's some code to explain it:
-```go
-// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter):
-type exampleStruct struct {
- Name string ``
- Email string `valid:"email"`
-}
-
-// this, however, will only fail when Email is empty or an invalid email address:
-type exampleStruct2 struct {
- Name string `valid:"-"`
- Email string `valid:"email"`
-}
-
-// lastly, this will only fail when Email is an invalid email address but not when it's empty:
-type exampleStruct2 struct {
- Name string `valid:"-"`
- Email string `valid:"email,optional"`
-}
-```
-
-#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123))
-##### Custom validator function signature
-A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible.
-```go
-import "github.com/asaskevich/govalidator"
-
-// old signature
-func(i interface{}) bool
-
-// new signature
-func(i interface{}, o interface{}) bool
-```
-
-##### Adding a custom validator
-This was changed to prevent data races when accessing custom validators.
-```go
-import "github.com/asaskevich/govalidator"
-
-// before
-govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool {
- // ...
-}
-
-// after
-govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, o interface{}) bool {
- // ...
-})
-```
-
-#### List of functions:
-```go
-func Abs(value float64) float64
-func BlackList(str, chars string) string
-func ByteLength(str string, params ...string) bool
-func CamelCaseToUnderscore(str string) string
-func Contains(str, substring string) bool
-func Count(array []interface{}, iterator ConditionIterator) int
-func Each(array []interface{}, iterator Iterator)
-func ErrorByField(e error, field string) string
-func ErrorsByField(e error) map[string]string
-func Filter(array []interface{}, iterator ConditionIterator) []interface{}
-func Find(array []interface{}, iterator ConditionIterator) interface{}
-func GetLine(s string, index int) (string, error)
-func GetLines(s string) []string
-func HasLowerCase(str string) bool
-func HasUpperCase(str string) bool
-func HasWhitespace(str string) bool
-func HasWhitespaceOnly(str string) bool
-func InRange(value interface{}, left interface{}, right interface{}) bool
-func InRangeFloat32(value, left, right float32) bool
-func InRangeFloat64(value, left, right float64) bool
-func InRangeInt(value, left, right interface{}) bool
-func IsASCII(str string) bool
-func IsAlpha(str string) bool
-func IsAlphanumeric(str string) bool
-func IsBase64(str string) bool
-func IsByteLength(str string, min, max int) bool
-func IsCIDR(str string) bool
-func IsCRC32(str string) bool
-func IsCRC32b(str string) bool
-func IsCreditCard(str string) bool
-func IsDNSName(str string) bool
-func IsDataURI(str string) bool
-func IsDialString(str string) bool
-func IsDivisibleBy(str, num string) bool
-func IsEmail(str string) bool
-func IsExistingEmail(email string) bool
-func IsFilePath(str string) (bool, int)
-func IsFloat(str string) bool
-func IsFullWidth(str string) bool
-func IsHalfWidth(str string) bool
-func IsHash(str string, algorithm string) bool
-func IsHexadecimal(str string) bool
-func IsHexcolor(str string) bool
-func IsHost(str string) bool
-func IsIP(str string) bool
-func IsIPv4(str string) bool
-func IsIPv6(str string) bool
-func IsISBN(str string, version int) bool
-func IsISBN10(str string) bool
-func IsISBN13(str string) bool
-func IsISO3166Alpha2(str string) bool
-func IsISO3166Alpha3(str string) bool
-func IsISO4217(str string) bool
-func IsISO693Alpha2(str string) bool
-func IsISO693Alpha3b(str string) bool
-func IsIn(str string, params ...string) bool
-func IsInRaw(str string, params ...string) bool
-func IsInt(str string) bool
-func IsJSON(str string) bool
-func IsLatitude(str string) bool
-func IsLongitude(str string) bool
-func IsLowerCase(str string) bool
-func IsMAC(str string) bool
-func IsMD4(str string) bool
-func IsMD5(str string) bool
-func IsMagnetURI(str string) bool
-func IsMongoID(str string) bool
-func IsMultibyte(str string) bool
-func IsNatural(value float64) bool
-func IsNegative(value float64) bool
-func IsNonNegative(value float64) bool
-func IsNonPositive(value float64) bool
-func IsNotNull(str string) bool
-func IsNull(str string) bool
-func IsNumeric(str string) bool
-func IsPort(str string) bool
-func IsPositive(value float64) bool
-func IsPrintableASCII(str string) bool
-func IsRFC3339(str string) bool
-func IsRFC3339WithoutZone(str string) bool
-func IsRGBcolor(str string) bool
-func IsRegex(str string) bool
-func IsRequestURI(rawurl string) bool
-func IsRequestURL(rawurl string) bool
-func IsRipeMD128(str string) bool
-func IsRipeMD160(str string) bool
-func IsRsaPub(str string, params ...string) bool
-func IsRsaPublicKey(str string, keylen int) bool
-func IsSHA1(str string) bool
-func IsSHA256(str string) bool
-func IsSHA384(str string) bool
-func IsSHA512(str string) bool
-func IsSSN(str string) bool
-func IsSemver(str string) bool
-func IsTiger128(str string) bool
-func IsTiger160(str string) bool
-func IsTiger192(str string) bool
-func IsTime(str string, format string) bool
-func IsType(v interface{}, params ...string) bool
-func IsURL(str string) bool
-func IsUTFDigit(str string) bool
-func IsUTFLetter(str string) bool
-func IsUTFLetterNumeric(str string) bool
-func IsUTFNumeric(str string) bool
-func IsUUID(str string) bool
-func IsUUIDv3(str string) bool
-func IsUUIDv4(str string) bool
-func IsUUIDv5(str string) bool
-func IsULID(str string) bool
-func IsUnixTime(str string) bool
-func IsUpperCase(str string) bool
-func IsVariableWidth(str string) bool
-func IsWhole(value float64) bool
-func LeftTrim(str, chars string) string
-func Map(array []interface{}, iterator ResultIterator) []interface{}
-func Matches(str, pattern string) bool
-func MaxStringLength(str string, params ...string) bool
-func MinStringLength(str string, params ...string) bool
-func NormalizeEmail(str string) (string, error)
-func PadBoth(str string, padStr string, padLen int) string
-func PadLeft(str string, padStr string, padLen int) string
-func PadRight(str string, padStr string, padLen int) string
-func PrependPathToErrors(err error, path string) error
-func Range(str string, params ...string) bool
-func RemoveTags(s string) string
-func ReplacePattern(str, pattern, replace string) string
-func Reverse(s string) string
-func RightTrim(str, chars string) string
-func RuneLength(str string, params ...string) bool
-func SafeFileName(str string) string
-func SetFieldsRequiredByDefault(value bool)
-func SetNilPtrAllowedByRequired(value bool)
-func Sign(value float64) float64
-func StringLength(str string, params ...string) bool
-func StringMatches(s string, params ...string) bool
-func StripLow(str string, keepNewLines bool) string
-func ToBoolean(str string) (bool, error)
-func ToFloat(str string) (float64, error)
-func ToInt(value interface{}) (res int64, err error)
-func ToJSON(obj interface{}) (string, error)
-func ToString(obj interface{}) string
-func Trim(str, chars string) string
-func Truncate(str string, length int, ending string) string
-func TruncatingErrorf(str string, args ...interface{}) error
-func UnderscoreToCamelCase(s string) string
-func ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error)
-func ValidateStruct(s interface{}) (bool, error)
-func WhiteList(str, chars string) string
-type ConditionIterator
-type CustomTypeValidator
-type Error
-func (e Error) Error() string
-type Errors
-func (es Errors) Error() string
-func (es Errors) Errors() []error
-type ISO3166Entry
-type ISO693Entry
-type InterfaceParamValidator
-type Iterator
-type ParamValidator
-type ResultIterator
-type UnsupportedTypeError
-func (e *UnsupportedTypeError) Error() string
-type Validator
-```
-
-#### Examples
-###### IsURL
-```go
-println(govalidator.IsURL(`http://user@pass:domain.com/path/page`))
-```
-###### IsType
-```go
-println(govalidator.IsType("Bob", "string"))
-println(govalidator.IsType(1, "int"))
-i := 1
-println(govalidator.IsType(&i, "*int"))
-```
-
-IsType can be used through the tag `type` which is essential for map validation:
-```go
-type User struct {
- Name string `valid:"type(string)"`
- Age int `valid:"type(int)"`
- Meta interface{} `valid:"type(string)"`
-}
-result, err := govalidator.ValidateStruct(User{"Bob", 20, "meta"})
-if err != nil {
- println("error: " + err.Error())
-}
-println(result)
-```
-###### ToString
-```go
-type User struct {
- FirstName string
- LastName string
-}
-
-str := govalidator.ToString(&User{"John", "Juan"})
-println(str)
-```
-###### Each, Map, Filter, Count for slices
-Each iterates over the slice/array and calls Iterator for every item
-```go
-data := []interface{}{1, 2, 3, 4, 5}
-var fn govalidator.Iterator = func(value interface{}, index int) {
- println(value.(int))
-}
-govalidator.Each(data, fn)
-```
-```go
-data := []interface{}{1, 2, 3, 4, 5}
-var fn govalidator.ResultIterator = func(value interface{}, index int) interface{} {
- return value.(int) * 3
-}
-_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15}
-```
-```go
-data := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
-var fn govalidator.ConditionIterator = func(value interface{}, index int) bool {
- return value.(int)%2 == 0
-}
-_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10}
-_ = govalidator.Count(data, fn) // result = 5
-```
-###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2)
-If you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this:
-```go
-govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool {
- return str == "duck"
-})
-```
-For completely custom validators (interface-based), see below.
-
-Here is a list of available validators for struct fields (validator - used function):
-```go
-"email": IsEmail,
-"url": IsURL,
-"dialstring": IsDialString,
-"requrl": IsRequestURL,
-"requri": IsRequestURI,
-"alpha": IsAlpha,
-"utfletter": IsUTFLetter,
-"alphanum": IsAlphanumeric,
-"utfletternum": IsUTFLetterNumeric,
-"numeric": IsNumeric,
-"utfnumeric": IsUTFNumeric,
-"utfdigit": IsUTFDigit,
-"hexadecimal": IsHexadecimal,
-"hexcolor": IsHexcolor,
-"rgbcolor": IsRGBcolor,
-"lowercase": IsLowerCase,
-"uppercase": IsUpperCase,
-"int": IsInt,
-"float": IsFloat,
-"null": IsNull,
-"uuid": IsUUID,
-"uuidv3": IsUUIDv3,
-"uuidv4": IsUUIDv4,
-"uuidv5": IsUUIDv5,
-"creditcard": IsCreditCard,
-"isbn10": IsISBN10,
-"isbn13": IsISBN13,
-"json": IsJSON,
-"multibyte": IsMultibyte,
-"ascii": IsASCII,
-"printableascii": IsPrintableASCII,
-"fullwidth": IsFullWidth,
-"halfwidth": IsHalfWidth,
-"variablewidth": IsVariableWidth,
-"base64": IsBase64,
-"datauri": IsDataURI,
-"ip": IsIP,
-"port": IsPort,
-"ipv4": IsIPv4,
-"ipv6": IsIPv6,
-"dns": IsDNSName,
-"host": IsHost,
-"mac": IsMAC,
-"latitude": IsLatitude,
-"longitude": IsLongitude,
-"ssn": IsSSN,
-"semver": IsSemver,
-"rfc3339": IsRFC3339,
-"rfc3339WithoutZone": IsRFC3339WithoutZone,
-"ISO3166Alpha2": IsISO3166Alpha2,
-"ISO3166Alpha3": IsISO3166Alpha3,
-"ulid": IsULID,
-```
-Validators with parameters
-
-```go
-"range(min|max)": Range,
-"length(min|max)": ByteLength,
-"runelength(min|max)": RuneLength,
-"stringlength(min|max)": StringLength,
-"matches(pattern)": StringMatches,
-"in(string1|string2|...|stringN)": IsIn,
-"rsapub(keylength)" : IsRsaPub,
-"minstringlength(int): MinStringLength,
-"maxstringlength(int): MaxStringLength,
-```
-Validators with parameters for any type
-
-```go
-"type(type)": IsType,
-```
-
-And here is small example of usage:
-```go
-type Post struct {
- Title string `valid:"alphanum,required"`
- Message string `valid:"duck,ascii"`
- Message2 string `valid:"animal(dog)"`
- AuthorIP string `valid:"ipv4"`
- Date string `valid:"-"`
-}
-post := &Post{
- Title: "My Example Post",
- Message: "duck",
- Message2: "dog",
- AuthorIP: "123.234.54.3",
-}
-
-// Add your own struct validation tags
-govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool {
- return str == "duck"
-})
-
-// Add your own struct validation tags with parameter
-govalidator.ParamTagMap["animal"] = govalidator.ParamValidator(func(str string, params ...string) bool {
- species := params[0]
- return str == species
-})
-govalidator.ParamTagRegexMap["animal"] = regexp.MustCompile("^animal\\((\\w+)\\)$")
-
-result, err := govalidator.ValidateStruct(post)
-if err != nil {
- println("error: " + err.Error())
-}
-println(result)
-```
-###### ValidateMap [#2](https://github.com/asaskevich/govalidator/pull/338)
-If you want to validate maps, you can use the map to be validated and a validation map that contain the same tags used in ValidateStruct, both maps have to be in the form `map[string]interface{}`
-
-So here is small example of usage:
-```go
-var mapTemplate = map[string]interface{}{
- "name":"required,alpha",
- "family":"required,alpha",
- "email":"required,email",
- "cell-phone":"numeric",
- "address":map[string]interface{}{
- "line1":"required,alphanum",
- "line2":"alphanum",
- "postal-code":"numeric",
- },
-}
-
-var inputMap = map[string]interface{}{
- "name":"Bob",
- "family":"Smith",
- "email":"foo@bar.baz",
- "address":map[string]interface{}{
- "line1":"",
- "line2":"",
- "postal-code":"",
- },
-}
-
-result, err := govalidator.ValidateMap(inputMap, mapTemplate)
-if err != nil {
- println("error: " + err.Error())
-}
-println(result)
-```
-
-###### WhiteList
-```go
-// Remove all characters from string ignoring characters between "a" and "z"
-println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaaaaa")
-```
-
-###### Custom validation functions
-Custom validation using your own domain specific validators is also available - here's an example of how to use it:
-```go
-import "github.com/asaskevich/govalidator"
-
-type CustomByteArray [6]byte // custom types are supported and can be validated
-
-type StructWithCustomByteArray struct {
- ID CustomByteArray `valid:"customByteArrayValidator,customMinLengthValidator"` // multiple custom validators are possible as well and will be evaluated in sequence
- Email string `valid:"email"`
- CustomMinLength int `valid:"-"`
-}
-
-govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, context interface{}) bool {
- switch v := context.(type) { // you can type switch on the context interface being validated
- case StructWithCustomByteArray:
- // you can check and validate against some other field in the context,
- // return early or not validate against the context at all – your choice
- case SomeOtherType:
- // ...
- default:
- // expecting some other type? Throw/panic here or continue
- }
-
- switch v := i.(type) { // type switch on the struct field being validated
- case CustomByteArray:
- for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes
- if e != 0 {
- return true
- }
- }
- }
- return false
-})
-govalidator.CustomTypeTagMap.Set("customMinLengthValidator", func(i interface{}, context interface{}) bool {
- switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation
- case StructWithCustomByteArray:
- return len(v.ID) >= v.CustomMinLength
- }
- return false
-})
-```
-
-###### Loop over Error()
-By default .Error() returns all errors in a single String. To access each error you can do this:
-```go
- if err != nil {
- errs := err.(govalidator.Errors).Errors()
- for _, e := range errs {
- fmt.Println(e.Error())
- }
- }
-```
-
-###### Custom error messages
-Custom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it:
-```go
-type Ticket struct {
- Id int64 `json:"id"`
- FirstName string `json:"firstname" valid:"required~First name is blank"`
-}
-```
-
-#### Notes
-Documentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator).
-Full information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator).
-
-#### Support
-If you do have a contribution to the package, feel free to create a Pull Request or an Issue.
-
-#### What to contribute
-If you don't know what to do, there are some features and functions that need to be done
-
-- [ ] Refactor code
-- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check
-- [ ] Create actual list of contributors and projects that currently using this package
-- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues)
-- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions)
-- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new
-- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc
-- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224)
-- [ ] Implement fuzzing testing
-- [ ] Implement some struct/map/array utilities
-- [ ] Implement map/array validation
-- [ ] Implement benchmarking
-- [ ] Implement batch of examples
-- [ ] Look at forks for new features and fixes
-
-#### Advice
-Feel free to create what you want, but keep in mind when you implement new features:
-- Code must be clear and readable, names of variables/constants clearly describes what they are doing
-- Public functions must be documented and described in source file and added to README.md to the list of available functions
-- There are must be unit-tests for any new functions and improvements
-
-## Credits
-### Contributors
-
-This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
-
-#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors)
-* [Daniel Lohse](https://github.com/annismckenzie)
-* [Attila Oláh](https://github.com/attilaolah)
-* [Daniel Korner](https://github.com/Dadie)
-* [Steven Wilkin](https://github.com/stevenwilkin)
-* [Deiwin Sarjas](https://github.com/deiwin)
-* [Noah Shibley](https://github.com/slugmobile)
-* [Nathan Davies](https://github.com/nathj07)
-* [Matt Sanford](https://github.com/mzsanford)
-* [Simon ccl1115](https://github.com/ccl1115)
-
-
-
-
-### Backers
-
-Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)]
-
-
-
-
-### Sponsors
-
-Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## License
-[](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large)
diff --git a/vendor/github.com/asaskevich/govalidator/arrays.go b/vendor/github.com/asaskevich/govalidator/arrays.go
deleted file mode 100644
index 3e1da7cb4..000000000
--- a/vendor/github.com/asaskevich/govalidator/arrays.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package govalidator
-
-// Iterator is the function that accepts element of slice/array and its index
-type Iterator func(interface{}, int)
-
-// ResultIterator is the function that accepts element of slice/array and its index and returns any result
-type ResultIterator func(interface{}, int) interface{}
-
-// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean
-type ConditionIterator func(interface{}, int) bool
-
-// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values
-type ReduceIterator func(interface{}, interface{}) interface{}
-
-// Some validates that any item of array corresponds to ConditionIterator. Returns boolean.
-func Some(array []interface{}, iterator ConditionIterator) bool {
- res := false
- for index, data := range array {
- res = res || iterator(data, index)
- }
- return res
-}
-
-// Every validates that every item of array corresponds to ConditionIterator. Returns boolean.
-func Every(array []interface{}, iterator ConditionIterator) bool {
- res := true
- for index, data := range array {
- res = res && iterator(data, index)
- }
- return res
-}
-
-// Reduce boils down a list of values into a single value by ReduceIterator
-func Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} {
- for _, data := range array {
- initialValue = iterator(initialValue, data)
- }
- return initialValue
-}
-
-// Each iterates over the slice and apply Iterator to every item
-func Each(array []interface{}, iterator Iterator) {
- for index, data := range array {
- iterator(data, index)
- }
-}
-
-// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result.
-func Map(array []interface{}, iterator ResultIterator) []interface{} {
- var result = make([]interface{}, len(array))
- for index, data := range array {
- result[index] = iterator(data, index)
- }
- return result
-}
-
-// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise.
-func Find(array []interface{}, iterator ConditionIterator) interface{} {
- for index, data := range array {
- if iterator(data, index) {
- return data
- }
- }
- return nil
-}
-
-// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice.
-func Filter(array []interface{}, iterator ConditionIterator) []interface{} {
- var result = make([]interface{}, 0)
- for index, data := range array {
- if iterator(data, index) {
- result = append(result, data)
- }
- }
- return result
-}
-
-// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator.
-func Count(array []interface{}, iterator ConditionIterator) int {
- count := 0
- for index, data := range array {
- if iterator(data, index) {
- count = count + 1
- }
- }
- return count
-}
diff --git a/vendor/github.com/asaskevich/govalidator/converter.go b/vendor/github.com/asaskevich/govalidator/converter.go
deleted file mode 100644
index d68e990fc..000000000
--- a/vendor/github.com/asaskevich/govalidator/converter.go
+++ /dev/null
@@ -1,81 +0,0 @@
-package govalidator
-
-import (
- "encoding/json"
- "fmt"
- "reflect"
- "strconv"
-)
-
-// ToString convert the input to a string.
-func ToString(obj interface{}) string {
- res := fmt.Sprintf("%v", obj)
- return res
-}
-
-// ToJSON convert the input to a valid JSON string
-func ToJSON(obj interface{}) (string, error) {
- res, err := json.Marshal(obj)
- if err != nil {
- res = []byte("")
- }
- return string(res), err
-}
-
-// ToFloat convert the input string to a float, or 0.0 if the input is not a float.
-func ToFloat(value interface{}) (res float64, err error) {
- val := reflect.ValueOf(value)
-
- switch value.(type) {
- case int, int8, int16, int32, int64:
- res = float64(val.Int())
- case uint, uint8, uint16, uint32, uint64:
- res = float64(val.Uint())
- case float32, float64:
- res = val.Float()
- case string:
- res, err = strconv.ParseFloat(val.String(), 64)
- if err != nil {
- res = 0
- }
- default:
- err = fmt.Errorf("ToInt: unknown interface type %T", value)
- res = 0
- }
-
- return
-}
-
-// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer.
-func ToInt(value interface{}) (res int64, err error) {
- val := reflect.ValueOf(value)
-
- switch value.(type) {
- case int, int8, int16, int32, int64:
- res = val.Int()
- case uint, uint8, uint16, uint32, uint64:
- res = int64(val.Uint())
- case float32, float64:
- res = int64(val.Float())
- case string:
- if IsInt(val.String()) {
- res, err = strconv.ParseInt(val.String(), 0, 64)
- if err != nil {
- res = 0
- }
- } else {
- err = fmt.Errorf("ToInt: invalid numeric format %g", value)
- res = 0
- }
- default:
- err = fmt.Errorf("ToInt: unknown interface type %T", value)
- res = 0
- }
-
- return
-}
-
-// ToBoolean convert the input string to a boolean.
-func ToBoolean(str string) (bool, error) {
- return strconv.ParseBool(str)
-}
diff --git a/vendor/github.com/asaskevich/govalidator/doc.go b/vendor/github.com/asaskevich/govalidator/doc.go
deleted file mode 100644
index 55dce62dc..000000000
--- a/vendor/github.com/asaskevich/govalidator/doc.go
+++ /dev/null
@@ -1,3 +0,0 @@
-package govalidator
-
-// A package of validators and sanitizers for strings, structures and collections.
diff --git a/vendor/github.com/asaskevich/govalidator/error.go b/vendor/github.com/asaskevich/govalidator/error.go
deleted file mode 100644
index 1da2336f4..000000000
--- a/vendor/github.com/asaskevich/govalidator/error.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package govalidator
-
-import (
- "sort"
- "strings"
-)
-
-// Errors is an array of multiple errors and conforms to the error interface.
-type Errors []error
-
-// Errors returns itself.
-func (es Errors) Errors() []error {
- return es
-}
-
-func (es Errors) Error() string {
- var errs []string
- for _, e := range es {
- errs = append(errs, e.Error())
- }
- sort.Strings(errs)
- return strings.Join(errs, ";")
-}
-
-// Error encapsulates a name, an error and whether there's a custom error message or not.
-type Error struct {
- Name string
- Err error
- CustomErrorMessageExists bool
-
- // Validator indicates the name of the validator that failed
- Validator string
- Path []string
-}
-
-func (e Error) Error() string {
- if e.CustomErrorMessageExists {
- return e.Err.Error()
- }
-
- errName := e.Name
- if len(e.Path) > 0 {
- errName = strings.Join(append(e.Path, e.Name), ".")
- }
-
- return errName + ": " + e.Err.Error()
-}
diff --git a/vendor/github.com/asaskevich/govalidator/numerics.go b/vendor/github.com/asaskevich/govalidator/numerics.go
deleted file mode 100644
index 5041d9e86..000000000
--- a/vendor/github.com/asaskevich/govalidator/numerics.go
+++ /dev/null
@@ -1,100 +0,0 @@
-package govalidator
-
-import (
- "math"
-)
-
-// Abs returns absolute value of number
-func Abs(value float64) float64 {
- return math.Abs(value)
-}
-
-// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise
-func Sign(value float64) float64 {
- if value > 0 {
- return 1
- } else if value < 0 {
- return -1
- } else {
- return 0
- }
-}
-
-// IsNegative returns true if value < 0
-func IsNegative(value float64) bool {
- return value < 0
-}
-
-// IsPositive returns true if value > 0
-func IsPositive(value float64) bool {
- return value > 0
-}
-
-// IsNonNegative returns true if value >= 0
-func IsNonNegative(value float64) bool {
- return value >= 0
-}
-
-// IsNonPositive returns true if value <= 0
-func IsNonPositive(value float64) bool {
- return value <= 0
-}
-
-// InRangeInt returns true if value lies between left and right border
-func InRangeInt(value, left, right interface{}) bool {
- value64, _ := ToInt(value)
- left64, _ := ToInt(left)
- right64, _ := ToInt(right)
- if left64 > right64 {
- left64, right64 = right64, left64
- }
- return value64 >= left64 && value64 <= right64
-}
-
-// InRangeFloat32 returns true if value lies between left and right border
-func InRangeFloat32(value, left, right float32) bool {
- if left > right {
- left, right = right, left
- }
- return value >= left && value <= right
-}
-
-// InRangeFloat64 returns true if value lies between left and right border
-func InRangeFloat64(value, left, right float64) bool {
- if left > right {
- left, right = right, left
- }
- return value >= left && value <= right
-}
-
-// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string.
-// All types must the same type.
-// False if value doesn't lie in range or if it incompatible or not comparable
-func InRange(value interface{}, left interface{}, right interface{}) bool {
- switch value.(type) {
- case int:
- intValue, _ := ToInt(value)
- intLeft, _ := ToInt(left)
- intRight, _ := ToInt(right)
- return InRangeInt(intValue, intLeft, intRight)
- case float32, float64:
- intValue, _ := ToFloat(value)
- intLeft, _ := ToFloat(left)
- intRight, _ := ToFloat(right)
- return InRangeFloat64(intValue, intLeft, intRight)
- case string:
- return value.(string) >= left.(string) && value.(string) <= right.(string)
- default:
- return false
- }
-}
-
-// IsWhole returns true if value is whole number
-func IsWhole(value float64) bool {
- return math.Remainder(value, 1) == 0
-}
-
-// IsNatural returns true if value is natural number (positive and whole)
-func IsNatural(value float64) bool {
- return IsWhole(value) && IsPositive(value)
-}
diff --git a/vendor/github.com/asaskevich/govalidator/patterns.go b/vendor/github.com/asaskevich/govalidator/patterns.go
deleted file mode 100644
index bafc3765e..000000000
--- a/vendor/github.com/asaskevich/govalidator/patterns.go
+++ /dev/null
@@ -1,113 +0,0 @@
-package govalidator
-
-import "regexp"
-
-// Basic regular expressions for validating strings
-const (
- Email string = "^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$"
- CreditCard string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$"
- ISBN10 string = "^(?:[0-9]{9}X|[0-9]{10})$"
- ISBN13 string = "^(?:[0-9]{13})$"
- UUID3 string = "^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$"
- UUID4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
- UUID5 string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
- UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
- Alpha string = "^[a-zA-Z]+$"
- Alphanumeric string = "^[a-zA-Z0-9]+$"
- Numeric string = "^[0-9]+$"
- Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$"
- Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"
- Hexadecimal string = "^[0-9a-fA-F]+$"
- Hexcolor string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"
- RGBcolor string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$"
- ASCII string = "^[\x00-\x7F]+$"
- Multibyte string = "[^\x00-\x7F]"
- FullWidth string = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]"
- HalfWidth string = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]"
- Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$"
- PrintableASCII string = "^[\x20-\x7E]+$"
- DataURI string = "^data:.+\\/(.+);base64$"
- MagnetURI string = "^magnet:\\?xt=urn:[a-zA-Z0-9]+:[a-zA-Z0-9]{32,40}&dn=.+&tr=.+$"
- Latitude string = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$"
- Longitude string = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$"
- DNSName string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$`
- IP string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))`
- URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)`
- URLUsername string = `(\S+(:\S*)?@)`
- URLPath string = `((\/|\?|#)[^\s]*)`
- URLPort string = `(:(\d{1,5}))`
- URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3]|24\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-5]))`
- URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))`
- URL = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$`
- SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$`
- WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$`
- UnixPath string = `^(/[^/\x00]*)+/?$`
- WinARPath string = `^(?:(?:[a-zA-Z]:|\\\\[a-z0-9_.$●-]+\\[a-z0-9_.$●-]+)\\|\\?[^\\/:*?"<>|\r\n]+\\?)(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$`
- UnixARPath string = `^((\.{0,2}/)?([^/\x00]*))+/?$`
- Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$"
- tagName string = "valid"
- hasLowerCase string = ".*[[:lower:]]"
- hasUpperCase string = ".*[[:upper:]]"
- hasWhitespace string = ".*[[:space:]]"
- hasWhitespaceOnly string = "^[[:space:]]+$"
- IMEI string = "^[0-9a-f]{14}$|^\\d{15}$|^\\d{18}$"
- IMSI string = "^\\d{14,15}$"
- E164 string = `^\+?[1-9]\d{1,14}$`
-)
-
-// Used by IsFilePath func
-const (
- // Unknown is unresolved OS type
- Unknown = iota
- // Win is Windows type
- Win
- // Unix is *nix OS types
- Unix
-)
-
-var (
- userRegexp = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$")
- hostRegexp = regexp.MustCompile("^[^\\s]+\\.[^\\s]+$")
- userDotRegexp = regexp.MustCompile("(^[.]{1})|([.]{1}$)|([.]{2,})")
- rxEmail = regexp.MustCompile(Email)
- rxCreditCard = regexp.MustCompile(CreditCard)
- rxISBN10 = regexp.MustCompile(ISBN10)
- rxISBN13 = regexp.MustCompile(ISBN13)
- rxUUID3 = regexp.MustCompile(UUID3)
- rxUUID4 = regexp.MustCompile(UUID4)
- rxUUID5 = regexp.MustCompile(UUID5)
- rxUUID = regexp.MustCompile(UUID)
- rxAlpha = regexp.MustCompile(Alpha)
- rxAlphanumeric = regexp.MustCompile(Alphanumeric)
- rxNumeric = regexp.MustCompile(Numeric)
- rxInt = regexp.MustCompile(Int)
- rxFloat = regexp.MustCompile(Float)
- rxHexadecimal = regexp.MustCompile(Hexadecimal)
- rxHexcolor = regexp.MustCompile(Hexcolor)
- rxRGBcolor = regexp.MustCompile(RGBcolor)
- rxASCII = regexp.MustCompile(ASCII)
- rxPrintableASCII = regexp.MustCompile(PrintableASCII)
- rxMultibyte = regexp.MustCompile(Multibyte)
- rxFullWidth = regexp.MustCompile(FullWidth)
- rxHalfWidth = regexp.MustCompile(HalfWidth)
- rxBase64 = regexp.MustCompile(Base64)
- rxDataURI = regexp.MustCompile(DataURI)
- rxMagnetURI = regexp.MustCompile(MagnetURI)
- rxLatitude = regexp.MustCompile(Latitude)
- rxLongitude = regexp.MustCompile(Longitude)
- rxDNSName = regexp.MustCompile(DNSName)
- rxURL = regexp.MustCompile(URL)
- rxSSN = regexp.MustCompile(SSN)
- rxWinPath = regexp.MustCompile(WinPath)
- rxUnixPath = regexp.MustCompile(UnixPath)
- rxARWinPath = regexp.MustCompile(WinARPath)
- rxARUnixPath = regexp.MustCompile(UnixARPath)
- rxSemver = regexp.MustCompile(Semver)
- rxHasLowerCase = regexp.MustCompile(hasLowerCase)
- rxHasUpperCase = regexp.MustCompile(hasUpperCase)
- rxHasWhitespace = regexp.MustCompile(hasWhitespace)
- rxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly)
- rxIMEI = regexp.MustCompile(IMEI)
- rxIMSI = regexp.MustCompile(IMSI)
- rxE164 = regexp.MustCompile(E164)
-)
diff --git a/vendor/github.com/asaskevich/govalidator/types.go b/vendor/github.com/asaskevich/govalidator/types.go
deleted file mode 100644
index c573abb51..000000000
--- a/vendor/github.com/asaskevich/govalidator/types.go
+++ /dev/null
@@ -1,656 +0,0 @@
-package govalidator
-
-import (
- "reflect"
- "regexp"
- "sort"
- "sync"
-)
-
-// Validator is a wrapper for a validator function that returns bool and accepts string.
-type Validator func(str string) bool
-
-// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type.
-// The second parameter should be the context (in the case of validating a struct: the whole object being validated).
-type CustomTypeValidator func(i interface{}, o interface{}) bool
-
-// ParamValidator is a wrapper for validator functions that accept additional parameters.
-type ParamValidator func(str string, params ...string) bool
-
-// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value
-type InterfaceParamValidator func(in interface{}, params ...string) bool
-type tagOptionsMap map[string]tagOption
-
-func (t tagOptionsMap) orderedKeys() []string {
- var keys []string
- for k := range t {
- keys = append(keys, k)
- }
-
- sort.Slice(keys, func(a, b int) bool {
- return t[keys[a]].order < t[keys[b]].order
- })
-
- return keys
-}
-
-type tagOption struct {
- name string
- customErrorMessage string
- order int
-}
-
-// UnsupportedTypeError is a wrapper for reflect.Type
-type UnsupportedTypeError struct {
- Type reflect.Type
-}
-
-// stringValues is a slice of reflect.Value holding *reflect.StringValue.
-// It implements the methods to sort by string.
-type stringValues []reflect.Value
-
-// InterfaceParamTagMap is a map of functions accept variants parameters for an interface value
-var InterfaceParamTagMap = map[string]InterfaceParamValidator{
- "type": IsType,
-}
-
-// InterfaceParamTagRegexMap maps interface param tags to their respective regexes.
-var InterfaceParamTagRegexMap = map[string]*regexp.Regexp{
- "type": regexp.MustCompile(`^type\((.*)\)$`),
-}
-
-// ParamTagMap is a map of functions accept variants parameters
-var ParamTagMap = map[string]ParamValidator{
- "length": ByteLength,
- "range": Range,
- "runelength": RuneLength,
- "stringlength": StringLength,
- "matches": StringMatches,
- "in": IsInRaw,
- "rsapub": IsRsaPub,
- "minstringlength": MinStringLength,
- "maxstringlength": MaxStringLength,
-}
-
-// ParamTagRegexMap maps param tags to their respective regexes.
-var ParamTagRegexMap = map[string]*regexp.Regexp{
- "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"),
- "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"),
- "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"),
- "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"),
- "in": regexp.MustCompile(`^in\((.*)\)`),
- "matches": regexp.MustCompile(`^matches\((.+)\)$`),
- "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"),
- "minstringlength": regexp.MustCompile("^minstringlength\\((\\d+)\\)$"),
- "maxstringlength": regexp.MustCompile("^maxstringlength\\((\\d+)\\)$"),
-}
-
-type customTypeTagMap struct {
- validators map[string]CustomTypeValidator
-
- sync.RWMutex
-}
-
-func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) {
- tm.RLock()
- defer tm.RUnlock()
- v, ok := tm.validators[name]
- return v, ok
-}
-
-func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) {
- tm.Lock()
- defer tm.Unlock()
- tm.validators[name] = ctv
-}
-
-// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function.
-// Use this to validate compound or custom types that need to be handled as a whole, e.g.
-// `type UUID [16]byte` (this would be handled as an array of bytes).
-var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)}
-
-// TagMap is a map of functions, that can be used as tags for ValidateStruct function.
-var TagMap = map[string]Validator{
- "email": IsEmail,
- "url": IsURL,
- "dialstring": IsDialString,
- "requrl": IsRequestURL,
- "requri": IsRequestURI,
- "alpha": IsAlpha,
- "utfletter": IsUTFLetter,
- "alphanum": IsAlphanumeric,
- "utfletternum": IsUTFLetterNumeric,
- "numeric": IsNumeric,
- "utfnumeric": IsUTFNumeric,
- "utfdigit": IsUTFDigit,
- "hexadecimal": IsHexadecimal,
- "hexcolor": IsHexcolor,
- "rgbcolor": IsRGBcolor,
- "lowercase": IsLowerCase,
- "uppercase": IsUpperCase,
- "int": IsInt,
- "float": IsFloat,
- "null": IsNull,
- "notnull": IsNotNull,
- "uuid": IsUUID,
- "uuidv3": IsUUIDv3,
- "uuidv4": IsUUIDv4,
- "uuidv5": IsUUIDv5,
- "creditcard": IsCreditCard,
- "isbn10": IsISBN10,
- "isbn13": IsISBN13,
- "json": IsJSON,
- "multibyte": IsMultibyte,
- "ascii": IsASCII,
- "printableascii": IsPrintableASCII,
- "fullwidth": IsFullWidth,
- "halfwidth": IsHalfWidth,
- "variablewidth": IsVariableWidth,
- "base64": IsBase64,
- "datauri": IsDataURI,
- "ip": IsIP,
- "port": IsPort,
- "ipv4": IsIPv4,
- "ipv6": IsIPv6,
- "dns": IsDNSName,
- "host": IsHost,
- "mac": IsMAC,
- "latitude": IsLatitude,
- "longitude": IsLongitude,
- "ssn": IsSSN,
- "semver": IsSemver,
- "rfc3339": IsRFC3339,
- "rfc3339WithoutZone": IsRFC3339WithoutZone,
- "ISO3166Alpha2": IsISO3166Alpha2,
- "ISO3166Alpha3": IsISO3166Alpha3,
- "ISO4217": IsISO4217,
- "IMEI": IsIMEI,
- "ulid": IsULID,
-}
-
-// ISO3166Entry stores country codes
-type ISO3166Entry struct {
- EnglishShortName string
- FrenchShortName string
- Alpha2Code string
- Alpha3Code string
- Numeric string
-}
-
-//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes"
-var ISO3166List = []ISO3166Entry{
- {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"},
- {"Albania", "Albanie (l')", "AL", "ALB", "008"},
- {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"},
- {"Algeria", "Algérie (l')", "DZ", "DZA", "012"},
- {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"},
- {"Andorra", "Andorre (l')", "AD", "AND", "020"},
- {"Angola", "Angola (l')", "AO", "AGO", "024"},
- {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"},
- {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"},
- {"Argentina", "Argentine (l')", "AR", "ARG", "032"},
- {"Australia", "Australie (l')", "AU", "AUS", "036"},
- {"Austria", "Autriche (l')", "AT", "AUT", "040"},
- {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"},
- {"Bahrain", "Bahreïn", "BH", "BHR", "048"},
- {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"},
- {"Armenia", "Arménie (l')", "AM", "ARM", "051"},
- {"Barbados", "Barbade (la)", "BB", "BRB", "052"},
- {"Belgium", "Belgique (la)", "BE", "BEL", "056"},
- {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"},
- {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"},
- {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"},
- {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"},
- {"Botswana", "Botswana (le)", "BW", "BWA", "072"},
- {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"},
- {"Brazil", "Brésil (le)", "BR", "BRA", "076"},
- {"Belize", "Belize (le)", "BZ", "BLZ", "084"},
- {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"},
- {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"},
- {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"},
- {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"},
- {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"},
- {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"},
- {"Burundi", "Burundi (le)", "BI", "BDI", "108"},
- {"Belarus", "Bélarus (le)", "BY", "BLR", "112"},
- {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"},
- {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"},
- {"Canada", "Canada (le)", "CA", "CAN", "124"},
- {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"},
- {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"},
- {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"},
- {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"},
- {"Chad", "Tchad (le)", "TD", "TCD", "148"},
- {"Chile", "Chili (le)", "CL", "CHL", "152"},
- {"China", "Chine (la)", "CN", "CHN", "156"},
- {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"},
- {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"},
- {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"},
- {"Colombia", "Colombie (la)", "CO", "COL", "170"},
- {"Comoros (the)", "Comores (les)", "KM", "COM", "174"},
- {"Mayotte", "Mayotte", "YT", "MYT", "175"},
- {"Congo (the)", "Congo (le)", "CG", "COG", "178"},
- {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"},
- {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"},
- {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"},
- {"Croatia", "Croatie (la)", "HR", "HRV", "191"},
- {"Cuba", "Cuba", "CU", "CUB", "192"},
- {"Cyprus", "Chypre", "CY", "CYP", "196"},
- {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"},
- {"Benin", "Bénin (le)", "BJ", "BEN", "204"},
- {"Denmark", "Danemark (le)", "DK", "DNK", "208"},
- {"Dominica", "Dominique (la)", "DM", "DMA", "212"},
- {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"},
- {"Ecuador", "Équateur (l')", "EC", "ECU", "218"},
- {"El Salvador", "El Salvador", "SV", "SLV", "222"},
- {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"},
- {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"},
- {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"},
- {"Estonia", "Estonie (l')", "EE", "EST", "233"},
- {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"},
- {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"},
- {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"},
- {"Fiji", "Fidji (les)", "FJ", "FJI", "242"},
- {"Finland", "Finlande (la)", "FI", "FIN", "246"},
- {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"},
- {"France", "France (la)", "FR", "FRA", "250"},
- {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"},
- {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"},
- {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"},
- {"Djibouti", "Djibouti", "DJ", "DJI", "262"},
- {"Gabon", "Gabon (le)", "GA", "GAB", "266"},
- {"Georgia", "Géorgie (la)", "GE", "GEO", "268"},
- {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"},
- {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"},
- {"Germany", "Allemagne (l')", "DE", "DEU", "276"},
- {"Ghana", "Ghana (le)", "GH", "GHA", "288"},
- {"Gibraltar", "Gibraltar", "GI", "GIB", "292"},
- {"Kiribati", "Kiribati", "KI", "KIR", "296"},
- {"Greece", "Grèce (la)", "GR", "GRC", "300"},
- {"Greenland", "Groenland (le)", "GL", "GRL", "304"},
- {"Grenada", "Grenade (la)", "GD", "GRD", "308"},
- {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"},
- {"Guam", "Guam", "GU", "GUM", "316"},
- {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"},
- {"Guinea", "Guinée (la)", "GN", "GIN", "324"},
- {"Guyana", "Guyana (le)", "GY", "GUY", "328"},
- {"Haiti", "Haïti", "HT", "HTI", "332"},
- {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"},
- {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"},
- {"Honduras", "Honduras (le)", "HN", "HND", "340"},
- {"Hong Kong", "Hong Kong", "HK", "HKG", "344"},
- {"Hungary", "Hongrie (la)", "HU", "HUN", "348"},
- {"Iceland", "Islande (l')", "IS", "ISL", "352"},
- {"India", "Inde (l')", "IN", "IND", "356"},
- {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"},
- {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"},
- {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"},
- {"Ireland", "Irlande (l')", "IE", "IRL", "372"},
- {"Israel", "Israël", "IL", "ISR", "376"},
- {"Italy", "Italie (l')", "IT", "ITA", "380"},
- {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"},
- {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"},
- {"Japan", "Japon (le)", "JP", "JPN", "392"},
- {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"},
- {"Jordan", "Jordanie (la)", "JO", "JOR", "400"},
- {"Kenya", "Kenya (le)", "KE", "KEN", "404"},
- {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"},
- {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"},
- {"Kuwait", "Koweït (le)", "KW", "KWT", "414"},
- {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"},
- {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"},
- {"Lebanon", "Liban (le)", "LB", "LBN", "422"},
- {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"},
- {"Latvia", "Lettonie (la)", "LV", "LVA", "428"},
- {"Liberia", "Libéria (le)", "LR", "LBR", "430"},
- {"Libya", "Libye (la)", "LY", "LBY", "434"},
- {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"},
- {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"},
- {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"},
- {"Macao", "Macao", "MO", "MAC", "446"},
- {"Madagascar", "Madagascar", "MG", "MDG", "450"},
- {"Malawi", "Malawi (le)", "MW", "MWI", "454"},
- {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"},
- {"Maldives", "Maldives (les)", "MV", "MDV", "462"},
- {"Mali", "Mali (le)", "ML", "MLI", "466"},
- {"Malta", "Malte", "MT", "MLT", "470"},
- {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"},
- {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"},
- {"Mauritius", "Maurice", "MU", "MUS", "480"},
- {"Mexico", "Mexique (le)", "MX", "MEX", "484"},
- {"Monaco", "Monaco", "MC", "MCO", "492"},
- {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"},
- {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"},
- {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"},
- {"Montserrat", "Montserrat", "MS", "MSR", "500"},
- {"Morocco", "Maroc (le)", "MA", "MAR", "504"},
- {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"},
- {"Oman", "Oman", "OM", "OMN", "512"},
- {"Namibia", "Namibie (la)", "NA", "NAM", "516"},
- {"Nauru", "Nauru", "NR", "NRU", "520"},
- {"Nepal", "Népal (le)", "NP", "NPL", "524"},
- {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"},
- {"Curaçao", "Curaçao", "CW", "CUW", "531"},
- {"Aruba", "Aruba", "AW", "ABW", "533"},
- {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"},
- {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"},
- {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"},
- {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"},
- {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"},
- {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"},
- {"Niger (the)", "Niger (le)", "NE", "NER", "562"},
- {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"},
- {"Niue", "Niue", "NU", "NIU", "570"},
- {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"},
- {"Norway", "Norvège (la)", "NO", "NOR", "578"},
- {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"},
- {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"},
- {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"},
- {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"},
- {"Palau", "Palaos (les)", "PW", "PLW", "585"},
- {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"},
- {"Panama", "Panama (le)", "PA", "PAN", "591"},
- {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"},
- {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"},
- {"Peru", "Pérou (le)", "PE", "PER", "604"},
- {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"},
- {"Pitcairn", "Pitcairn", "PN", "PCN", "612"},
- {"Poland", "Pologne (la)", "PL", "POL", "616"},
- {"Portugal", "Portugal (le)", "PT", "PRT", "620"},
- {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"},
- {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"},
- {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"},
- {"Qatar", "Qatar (le)", "QA", "QAT", "634"},
- {"Réunion", "Réunion (La)", "RE", "REU", "638"},
- {"Romania", "Roumanie (la)", "RO", "ROU", "642"},
- {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"},
- {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"},
- {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"},
- {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"},
- {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"},
- {"Anguilla", "Anguilla", "AI", "AIA", "660"},
- {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"},
- {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"},
- {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"},
- {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"},
- {"San Marino", "Saint-Marin", "SM", "SMR", "674"},
- {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"},
- {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"},
- {"Senegal", "Sénégal (le)", "SN", "SEN", "686"},
- {"Serbia", "Serbie (la)", "RS", "SRB", "688"},
- {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"},
- {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"},
- {"Singapore", "Singapour", "SG", "SGP", "702"},
- {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"},
- {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"},
- {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"},
- {"Somalia", "Somalie (la)", "SO", "SOM", "706"},
- {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"},
- {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"},
- {"Spain", "Espagne (l')", "ES", "ESP", "724"},
- {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"},
- {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"},
- {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"},
- {"Suriname", "Suriname (le)", "SR", "SUR", "740"},
- {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"},
- {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"},
- {"Sweden", "Suède (la)", "SE", "SWE", "752"},
- {"Switzerland", "Suisse (la)", "CH", "CHE", "756"},
- {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"},
- {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"},
- {"Thailand", "Thaïlande (la)", "TH", "THA", "764"},
- {"Togo", "Togo (le)", "TG", "TGO", "768"},
- {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"},
- {"Tonga", "Tonga (les)", "TO", "TON", "776"},
- {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"},
- {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"},
- {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"},
- {"Turkey", "Turquie (la)", "TR", "TUR", "792"},
- {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"},
- {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"},
- {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"},
- {"Uganda", "Ouganda (l')", "UG", "UGA", "800"},
- {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"},
- {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"},
- {"Egypt", "Égypte (l')", "EG", "EGY", "818"},
- {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"},
- {"Guernsey", "Guernesey", "GG", "GGY", "831"},
- {"Jersey", "Jersey", "JE", "JEY", "832"},
- {"Isle of Man", "Île de Man", "IM", "IMN", "833"},
- {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"},
- {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"},
- {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"},
- {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"},
- {"Uruguay", "Uruguay (l')", "UY", "URY", "858"},
- {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"},
- {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"},
- {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"},
- {"Samoa", "Samoa (le)", "WS", "WSM", "882"},
- {"Yemen", "Yémen (le)", "YE", "YEM", "887"},
- {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"},
-}
-
-// ISO4217List is the list of ISO currency codes
-var ISO4217List = []string{
- "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN",
- "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD",
- "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK",
- "DJF", "DKK", "DOP", "DZD",
- "EGP", "ERN", "ETB", "EUR",
- "FJD", "FKP",
- "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD",
- "HKD", "HNL", "HRK", "HTG", "HUF",
- "IDR", "ILS", "INR", "IQD", "IRR", "ISK",
- "JMD", "JOD", "JPY",
- "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT",
- "LAK", "LBP", "LKR", "LRD", "LSL", "LYD",
- "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN",
- "NAD", "NGN", "NIO", "NOK", "NPR", "NZD",
- "OMR",
- "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG",
- "QAR",
- "RON", "RSD", "RUB", "RWF",
- "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL",
- "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS",
- "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS",
- "VEF", "VES", "VND", "VUV",
- "WST",
- "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX",
- "YER",
- "ZAR", "ZMW", "ZWL",
-}
-
-// ISO693Entry stores ISO language codes
-type ISO693Entry struct {
- Alpha3bCode string
- Alpha2Code string
- English string
-}
-
-//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json
-var ISO693List = []ISO693Entry{
- {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"},
- {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"},
- {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"},
- {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"},
- {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"},
- {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"},
- {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"},
- {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"},
- {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"},
- {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"},
- {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"},
- {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"},
- {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"},
- {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"},
- {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"},
- {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"},
- {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"},
- {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"},
- {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"},
- {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"},
- {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"},
- {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"},
- {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"},
- {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"},
- {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"},
- {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"},
- {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"},
- {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"},
- {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"},
- {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"},
- {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"},
- {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"},
- {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"},
- {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"},
- {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"},
- {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"},
- {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"},
- {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"},
- {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"},
- {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"},
- {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"},
- {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"},
- {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"},
- {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"},
- {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"},
- {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"},
- {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"},
- {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"},
- {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"},
- {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"},
- {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"},
- {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"},
- {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"},
- {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"},
- {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"},
- {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"},
- {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"},
- {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"},
- {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"},
- {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"},
- {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"},
- {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"},
- {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"},
- {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"},
- {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"},
- {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"},
- {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"},
- {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"},
- {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"},
- {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"},
- {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"},
- {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"},
- {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"},
- {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"},
- {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"},
- {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"},
- {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"},
- {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"},
- {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"},
- {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"},
- {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"},
- {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"},
- {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"},
- {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"},
- {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"},
- {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"},
- {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"},
- {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"},
- {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"},
- {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"},
- {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"},
- {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"},
- {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"},
- {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"},
- {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"},
- {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"},
- {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"},
- {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"},
- {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"},
- {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"},
- {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"},
- {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"},
- {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"},
- {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"},
- {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"},
- {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"},
- {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"},
- {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"},
- {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"},
- {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"},
- {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"},
- {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"},
- {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"},
- {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"},
- {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"},
- {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"},
- {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"},
- {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"},
- {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"},
- {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"},
- {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"},
- {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"},
- {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"},
- {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"},
- {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"},
- {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"},
- {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"},
- {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"},
- {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"},
- {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"},
- {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"},
- {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"},
- {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"},
- {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"},
- {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"},
- {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"},
- {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"},
- {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"},
- {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"},
- {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"},
- {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"},
- {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"},
- {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"},
- {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"},
- {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"},
- {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"},
- {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"},
- {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"},
- {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"},
- {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"},
- {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"},
- {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"},
- {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"},
- {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"},
- {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"},
- {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"},
- {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"},
- {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"},
- {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"},
- {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"},
- {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"},
- {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"},
- {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"},
- {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"},
- {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"},
- {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"},
- {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"},
- {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"},
- {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"},
- {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"},
- {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"},
- {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"},
- {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"},
- {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"},
- {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"},
- {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"},
- {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"},
- {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"},
- {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"},
- {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"},
- {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"},
- {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"},
- {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"},
- {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"},
-}
diff --git a/vendor/github.com/asaskevich/govalidator/utils.go b/vendor/github.com/asaskevich/govalidator/utils.go
deleted file mode 100644
index f4c30f824..000000000
--- a/vendor/github.com/asaskevich/govalidator/utils.go
+++ /dev/null
@@ -1,270 +0,0 @@
-package govalidator
-
-import (
- "errors"
- "fmt"
- "html"
- "math"
- "path"
- "regexp"
- "strings"
- "unicode"
- "unicode/utf8"
-)
-
-// Contains checks if the string contains the substring.
-func Contains(str, substring string) bool {
- return strings.Contains(str, substring)
-}
-
-// Matches checks if string matches the pattern (pattern is regular expression)
-// In case of error return false
-func Matches(str, pattern string) bool {
- match, _ := regexp.MatchString(pattern, str)
- return match
-}
-
-// LeftTrim trims characters from the left side of the input.
-// If second argument is empty, it will remove leading spaces.
-func LeftTrim(str, chars string) string {
- if chars == "" {
- return strings.TrimLeftFunc(str, unicode.IsSpace)
- }
- r, _ := regexp.Compile("^[" + chars + "]+")
- return r.ReplaceAllString(str, "")
-}
-
-// RightTrim trims characters from the right side of the input.
-// If second argument is empty, it will remove trailing spaces.
-func RightTrim(str, chars string) string {
- if chars == "" {
- return strings.TrimRightFunc(str, unicode.IsSpace)
- }
- r, _ := regexp.Compile("[" + chars + "]+$")
- return r.ReplaceAllString(str, "")
-}
-
-// Trim trims characters from both sides of the input.
-// If second argument is empty, it will remove spaces.
-func Trim(str, chars string) string {
- return LeftTrim(RightTrim(str, chars), chars)
-}
-
-// WhiteList removes characters that do not appear in the whitelist.
-func WhiteList(str, chars string) string {
- pattern := "[^" + chars + "]+"
- r, _ := regexp.Compile(pattern)
- return r.ReplaceAllString(str, "")
-}
-
-// BlackList removes characters that appear in the blacklist.
-func BlackList(str, chars string) string {
- pattern := "[" + chars + "]+"
- r, _ := regexp.Compile(pattern)
- return r.ReplaceAllString(str, "")
-}
-
-// StripLow removes characters with a numerical value < 32 and 127, mostly control characters.
-// If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD).
-func StripLow(str string, keepNewLines bool) string {
- chars := ""
- if keepNewLines {
- chars = "\x00-\x09\x0B\x0C\x0E-\x1F\x7F"
- } else {
- chars = "\x00-\x1F\x7F"
- }
- return BlackList(str, chars)
-}
-
-// ReplacePattern replaces regular expression pattern in string
-func ReplacePattern(str, pattern, replace string) string {
- r, _ := regexp.Compile(pattern)
- return r.ReplaceAllString(str, replace)
-}
-
-// Escape replaces <, >, & and " with HTML entities.
-var Escape = html.EscapeString
-
-func addSegment(inrune, segment []rune) []rune {
- if len(segment) == 0 {
- return inrune
- }
- if len(inrune) != 0 {
- inrune = append(inrune, '_')
- }
- inrune = append(inrune, segment...)
- return inrune
-}
-
-// UnderscoreToCamelCase converts from underscore separated form to camel case form.
-// Ex.: my_func => MyFunc
-func UnderscoreToCamelCase(s string) string {
- return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1)
-}
-
-// CamelCaseToUnderscore converts from camel case form to underscore separated form.
-// Ex.: MyFunc => my_func
-func CamelCaseToUnderscore(str string) string {
- var output []rune
- var segment []rune
- for _, r := range str {
-
- // not treat number as separate segment
- if !unicode.IsLower(r) && string(r) != "_" && !unicode.IsNumber(r) {
- output = addSegment(output, segment)
- segment = nil
- }
- segment = append(segment, unicode.ToLower(r))
- }
- output = addSegment(output, segment)
- return string(output)
-}
-
-// Reverse returns reversed string
-func Reverse(s string) string {
- r := []rune(s)
- for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {
- r[i], r[j] = r[j], r[i]
- }
- return string(r)
-}
-
-// GetLines splits string by "\n" and return array of lines
-func GetLines(s string) []string {
- return strings.Split(s, "\n")
-}
-
-// GetLine returns specified line of multiline string
-func GetLine(s string, index int) (string, error) {
- lines := GetLines(s)
- if index < 0 || index >= len(lines) {
- return "", errors.New("line index out of bounds")
- }
- return lines[index], nil
-}
-
-// RemoveTags removes all tags from HTML string
-func RemoveTags(s string) string {
- return ReplacePattern(s, "<[^>]*>", "")
-}
-
-// SafeFileName returns safe string that can be used in file names
-func SafeFileName(str string) string {
- name := strings.ToLower(str)
- name = path.Clean(path.Base(name))
- name = strings.Trim(name, " ")
- separators, err := regexp.Compile(`[ &_=+:]`)
- if err == nil {
- name = separators.ReplaceAllString(name, "-")
- }
- legal, err := regexp.Compile(`[^[:alnum:]-.]`)
- if err == nil {
- name = legal.ReplaceAllString(name, "")
- }
- for strings.Contains(name, "--") {
- name = strings.Replace(name, "--", "-", -1)
- }
- return name
-}
-
-// NormalizeEmail canonicalize an email address.
-// The local part of the email address is lowercased for all domains; the hostname is always lowercased and
-// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail).
-// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and
-// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are
-// normalized to @gmail.com.
-func NormalizeEmail(str string) (string, error) {
- if !IsEmail(str) {
- return "", fmt.Errorf("%s is not an email", str)
- }
- parts := strings.Split(str, "@")
- parts[0] = strings.ToLower(parts[0])
- parts[1] = strings.ToLower(parts[1])
- if parts[1] == "gmail.com" || parts[1] == "googlemail.com" {
- parts[1] = "gmail.com"
- parts[0] = strings.Split(ReplacePattern(parts[0], `\.`, ""), "+")[0]
- }
- return strings.Join(parts, "@"), nil
-}
-
-// Truncate a string to the closest length without breaking words.
-func Truncate(str string, length int, ending string) string {
- var aftstr, befstr string
- if len(str) > length {
- words := strings.Fields(str)
- before, present := 0, 0
- for i := range words {
- befstr = aftstr
- before = present
- aftstr = aftstr + words[i] + " "
- present = len(aftstr)
- if present > length && i != 0 {
- if (length - before) < (present - length) {
- return Trim(befstr, " /\\.,\"'#!?&@+-") + ending
- }
- return Trim(aftstr, " /\\.,\"'#!?&@+-") + ending
- }
- }
- }
-
- return str
-}
-
-// PadLeft pads left side of a string if size of string is less then indicated pad length
-func PadLeft(str string, padStr string, padLen int) string {
- return buildPadStr(str, padStr, padLen, true, false)
-}
-
-// PadRight pads right side of a string if size of string is less then indicated pad length
-func PadRight(str string, padStr string, padLen int) string {
- return buildPadStr(str, padStr, padLen, false, true)
-}
-
-// PadBoth pads both sides of a string if size of string is less then indicated pad length
-func PadBoth(str string, padStr string, padLen int) string {
- return buildPadStr(str, padStr, padLen, true, true)
-}
-
-// PadString either left, right or both sides.
-// Note that padding string can be unicode and more then one character
-func buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string {
-
- // When padded length is less then the current string size
- if padLen < utf8.RuneCountInString(str) {
- return str
- }
-
- padLen -= utf8.RuneCountInString(str)
-
- targetLen := padLen
-
- targetLenLeft := targetLen
- targetLenRight := targetLen
- if padLeft && padRight {
- targetLenLeft = padLen / 2
- targetLenRight = padLen - targetLenLeft
- }
-
- strToRepeatLen := utf8.RuneCountInString(padStr)
-
- repeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen)))
- repeatedString := strings.Repeat(padStr, repeatTimes)
-
- leftSide := ""
- if padLeft {
- leftSide = repeatedString[0:targetLenLeft]
- }
-
- rightSide := ""
- if padRight {
- rightSide = repeatedString[0:targetLenRight]
- }
-
- return leftSide + str + rightSide
-}
-
-// TruncatingErrorf removes extra args from fmt.Errorf if not formatted in the str object
-func TruncatingErrorf(str string, args ...interface{}) error {
- n := strings.Count(str, "%s")
- return fmt.Errorf(str, args[:n]...)
-}
diff --git a/vendor/github.com/asaskevich/govalidator/validator.go b/vendor/github.com/asaskevich/govalidator/validator.go
deleted file mode 100644
index c9c4fac06..000000000
--- a/vendor/github.com/asaskevich/govalidator/validator.go
+++ /dev/null
@@ -1,1768 +0,0 @@
-// Package govalidator is package of validators and sanitizers for strings, structs and collections.
-package govalidator
-
-import (
- "bytes"
- "crypto/rsa"
- "crypto/x509"
- "encoding/base64"
- "encoding/json"
- "encoding/pem"
- "fmt"
- "io/ioutil"
- "net"
- "net/url"
- "reflect"
- "regexp"
- "sort"
- "strconv"
- "strings"
- "time"
- "unicode"
- "unicode/utf8"
-)
-
-var (
- fieldsRequiredByDefault bool
- nilPtrAllowedByRequired = false
- notNumberRegexp = regexp.MustCompile("[^0-9]+")
- whiteSpacesAndMinus = regexp.MustCompile(`[\s-]+`)
- paramsRegexp = regexp.MustCompile(`\(.*\)$`)
-)
-
-const maxURLRuneCount = 2083
-const minURLRuneCount = 3
-const rfc3339WithoutZone = "2006-01-02T15:04:05"
-
-// SetFieldsRequiredByDefault causes validation to fail when struct fields
-// do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`).
-// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter):
-// type exampleStruct struct {
-// Name string ``
-// Email string `valid:"email"`
-// This, however, will only fail when Email is empty or an invalid email address:
-// type exampleStruct2 struct {
-// Name string `valid:"-"`
-// Email string `valid:"email"`
-// Lastly, this will only fail when Email is an invalid email address but not when it's empty:
-// type exampleStruct2 struct {
-// Name string `valid:"-"`
-// Email string `valid:"email,optional"`
-func SetFieldsRequiredByDefault(value bool) {
- fieldsRequiredByDefault = value
-}
-
-// SetNilPtrAllowedByRequired causes validation to pass for nil ptrs when a field is set to required.
-// The validation will still reject ptr fields in their zero value state. Example with this enabled:
-// type exampleStruct struct {
-// Name *string `valid:"required"`
-// With `Name` set to "", this will be considered invalid input and will cause a validation error.
-// With `Name` set to nil, this will be considered valid by validation.
-// By default this is disabled.
-func SetNilPtrAllowedByRequired(value bool) {
- nilPtrAllowedByRequired = value
-}
-
-// IsEmail checks if the string is an email.
-func IsEmail(str string) bool {
- // TODO uppercase letters are not supported
- return rxEmail.MatchString(str)
-}
-
-// IsExistingEmail checks if the string is an email of existing domain
-func IsExistingEmail(email string) bool {
-
- if len(email) < 6 || len(email) > 254 {
- return false
- }
- at := strings.LastIndex(email, "@")
- if at <= 0 || at > len(email)-3 {
- return false
- }
- user := email[:at]
- host := email[at+1:]
- if len(user) > 64 {
- return false
- }
- switch host {
- case "localhost", "example.com":
- return true
- }
- if userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) {
- return false
- }
- if _, err := net.LookupMX(host); err != nil {
- if _, err := net.LookupIP(host); err != nil {
- return false
- }
- }
-
- return true
-}
-
-// IsURL checks if the string is an URL.
-func IsURL(str string) bool {
- if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") {
- return false
- }
- strTemp := str
- if strings.Contains(str, ":") && !strings.Contains(str, "://") {
- // support no indicated urlscheme but with colon for port number
- // http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString
- strTemp = "http://" + str
- }
- u, err := url.Parse(strTemp)
- if err != nil {
- return false
- }
- if strings.HasPrefix(u.Host, ".") {
- return false
- }
- if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) {
- return false
- }
- return rxURL.MatchString(str)
-}
-
-// IsRequestURL checks if the string rawurl, assuming
-// it was received in an HTTP request, is a valid
-// URL confirm to RFC 3986
-func IsRequestURL(rawurl string) bool {
- url, err := url.ParseRequestURI(rawurl)
- if err != nil {
- return false //Couldn't even parse the rawurl
- }
- if len(url.Scheme) == 0 {
- return false //No Scheme found
- }
- return true
-}
-
-// IsRequestURI checks if the string rawurl, assuming
-// it was received in an HTTP request, is an
-// absolute URI or an absolute path.
-func IsRequestURI(rawurl string) bool {
- _, err := url.ParseRequestURI(rawurl)
- return err == nil
-}
-
-// IsAlpha checks if the string contains only letters (a-zA-Z). Empty string is valid.
-func IsAlpha(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxAlpha.MatchString(str)
-}
-
-//IsUTFLetter checks if the string contains only unicode letter characters.
-//Similar to IsAlpha but for all languages. Empty string is valid.
-func IsUTFLetter(str string) bool {
- if IsNull(str) {
- return true
- }
-
- for _, c := range str {
- if !unicode.IsLetter(c) {
- return false
- }
- }
- return true
-
-}
-
-// IsAlphanumeric checks if the string contains only letters and numbers. Empty string is valid.
-func IsAlphanumeric(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxAlphanumeric.MatchString(str)
-}
-
-// IsUTFLetterNumeric checks if the string contains only unicode letters and numbers. Empty string is valid.
-func IsUTFLetterNumeric(str string) bool {
- if IsNull(str) {
- return true
- }
- for _, c := range str {
- if !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok
- return false
- }
- }
- return true
-
-}
-
-// IsNumeric checks if the string contains only numbers. Empty string is valid.
-func IsNumeric(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxNumeric.MatchString(str)
-}
-
-// IsUTFNumeric checks if the string contains only unicode numbers of any kind.
-// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid.
-func IsUTFNumeric(str string) bool {
- if IsNull(str) {
- return true
- }
- if strings.IndexAny(str, "+-") > 0 {
- return false
- }
- if len(str) > 1 {
- str = strings.TrimPrefix(str, "-")
- str = strings.TrimPrefix(str, "+")
- }
- for _, c := range str {
- if !unicode.IsNumber(c) { //numbers && minus sign are ok
- return false
- }
- }
- return true
-
-}
-
-// IsUTFDigit checks if the string contains only unicode radix-10 decimal digits. Empty string is valid.
-func IsUTFDigit(str string) bool {
- if IsNull(str) {
- return true
- }
- if strings.IndexAny(str, "+-") > 0 {
- return false
- }
- if len(str) > 1 {
- str = strings.TrimPrefix(str, "-")
- str = strings.TrimPrefix(str, "+")
- }
- for _, c := range str {
- if !unicode.IsDigit(c) { //digits && minus sign are ok
- return false
- }
- }
- return true
-
-}
-
-// IsHexadecimal checks if the string is a hexadecimal number.
-func IsHexadecimal(str string) bool {
- return rxHexadecimal.MatchString(str)
-}
-
-// IsHexcolor checks if the string is a hexadecimal color.
-func IsHexcolor(str string) bool {
- return rxHexcolor.MatchString(str)
-}
-
-// IsRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB).
-func IsRGBcolor(str string) bool {
- return rxRGBcolor.MatchString(str)
-}
-
-// IsLowerCase checks if the string is lowercase. Empty string is valid.
-func IsLowerCase(str string) bool {
- if IsNull(str) {
- return true
- }
- return str == strings.ToLower(str)
-}
-
-// IsUpperCase checks if the string is uppercase. Empty string is valid.
-func IsUpperCase(str string) bool {
- if IsNull(str) {
- return true
- }
- return str == strings.ToUpper(str)
-}
-
-// HasLowerCase checks if the string contains at least 1 lowercase. Empty string is valid.
-func HasLowerCase(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxHasLowerCase.MatchString(str)
-}
-
-// HasUpperCase checks if the string contains as least 1 uppercase. Empty string is valid.
-func HasUpperCase(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxHasUpperCase.MatchString(str)
-}
-
-// IsInt checks if the string is an integer. Empty string is valid.
-func IsInt(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxInt.MatchString(str)
-}
-
-// IsFloat checks if the string is a float.
-func IsFloat(str string) bool {
- return str != "" && rxFloat.MatchString(str)
-}
-
-// IsDivisibleBy checks if the string is a number that's divisible by another.
-// If second argument is not valid integer or zero, it's return false.
-// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero).
-func IsDivisibleBy(str, num string) bool {
- f, _ := ToFloat(str)
- p := int64(f)
- q, _ := ToInt(num)
- if q == 0 {
- return false
- }
- return (p == 0) || (p%q == 0)
-}
-
-// IsNull checks if the string is null.
-func IsNull(str string) bool {
- return len(str) == 0
-}
-
-// IsNotNull checks if the string is not null.
-func IsNotNull(str string) bool {
- return !IsNull(str)
-}
-
-// HasWhitespaceOnly checks the string only contains whitespace
-func HasWhitespaceOnly(str string) bool {
- return len(str) > 0 && rxHasWhitespaceOnly.MatchString(str)
-}
-
-// HasWhitespace checks if the string contains any whitespace
-func HasWhitespace(str string) bool {
- return len(str) > 0 && rxHasWhitespace.MatchString(str)
-}
-
-// IsByteLength checks if the string's length (in bytes) falls in a range.
-func IsByteLength(str string, min, max int) bool {
- return len(str) >= min && len(str) <= max
-}
-
-// IsUUIDv3 checks if the string is a UUID version 3.
-func IsUUIDv3(str string) bool {
- return rxUUID3.MatchString(str)
-}
-
-// IsUUIDv4 checks if the string is a UUID version 4.
-func IsUUIDv4(str string) bool {
- return rxUUID4.MatchString(str)
-}
-
-// IsUUIDv5 checks if the string is a UUID version 5.
-func IsUUIDv5(str string) bool {
- return rxUUID5.MatchString(str)
-}
-
-// IsUUID checks if the string is a UUID (version 3, 4 or 5).
-func IsUUID(str string) bool {
- return rxUUID.MatchString(str)
-}
-
-// Byte to index table for O(1) lookups when unmarshaling.
-// We use 0xFF as sentinel value for invalid indexes.
-var ulidDec = [...]byte{
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01,
- 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
- 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFF,
- 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, 0x1D, 0x1E,
- 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C,
- 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14,
- 0x15, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C,
- 0x1D, 0x1E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-}
-
-// EncodedSize is the length of a text encoded ULID.
-const ulidEncodedSize = 26
-
-// IsULID checks if the string is a ULID.
-//
-// Implementation got from:
-// https://github.com/oklog/ulid (Apache-2.0 License)
-//
-func IsULID(str string) bool {
- // Check if a base32 encoded ULID is the right length.
- if len(str) != ulidEncodedSize {
- return false
- }
-
- // Check if all the characters in a base32 encoded ULID are part of the
- // expected base32 character set.
- if ulidDec[str[0]] == 0xFF ||
- ulidDec[str[1]] == 0xFF ||
- ulidDec[str[2]] == 0xFF ||
- ulidDec[str[3]] == 0xFF ||
- ulidDec[str[4]] == 0xFF ||
- ulidDec[str[5]] == 0xFF ||
- ulidDec[str[6]] == 0xFF ||
- ulidDec[str[7]] == 0xFF ||
- ulidDec[str[8]] == 0xFF ||
- ulidDec[str[9]] == 0xFF ||
- ulidDec[str[10]] == 0xFF ||
- ulidDec[str[11]] == 0xFF ||
- ulidDec[str[12]] == 0xFF ||
- ulidDec[str[13]] == 0xFF ||
- ulidDec[str[14]] == 0xFF ||
- ulidDec[str[15]] == 0xFF ||
- ulidDec[str[16]] == 0xFF ||
- ulidDec[str[17]] == 0xFF ||
- ulidDec[str[18]] == 0xFF ||
- ulidDec[str[19]] == 0xFF ||
- ulidDec[str[20]] == 0xFF ||
- ulidDec[str[21]] == 0xFF ||
- ulidDec[str[22]] == 0xFF ||
- ulidDec[str[23]] == 0xFF ||
- ulidDec[str[24]] == 0xFF ||
- ulidDec[str[25]] == 0xFF {
- return false
- }
-
- // Check if the first character in a base32 encoded ULID will overflow. This
- // happens because the base32 representation encodes 130 bits, while the
- // ULID is only 128 bits.
- //
- // See https://github.com/oklog/ulid/issues/9 for details.
- if str[0] > '7' {
- return false
- }
- return true
-}
-
-// IsCreditCard checks if the string is a credit card.
-func IsCreditCard(str string) bool {
- sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "")
- if !rxCreditCard.MatchString(sanitized) {
- return false
- }
-
- number, _ := ToInt(sanitized)
- number, lastDigit := number / 10, number % 10
-
- var sum int64
- for i:=0; number > 0; i++ {
- digit := number % 10
-
- if i % 2 == 0 {
- digit *= 2
- if digit > 9 {
- digit -= 9
- }
- }
-
- sum += digit
- number = number / 10
- }
-
- return (sum + lastDigit) % 10 == 0
-}
-
-// IsISBN10 checks if the string is an ISBN version 10.
-func IsISBN10(str string) bool {
- return IsISBN(str, 10)
-}
-
-// IsISBN13 checks if the string is an ISBN version 13.
-func IsISBN13(str string) bool {
- return IsISBN(str, 13)
-}
-
-// IsISBN checks if the string is an ISBN (version 10 or 13).
-// If version value is not equal to 10 or 13, it will be checks both variants.
-func IsISBN(str string, version int) bool {
- sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "")
- var checksum int32
- var i int32
- if version == 10 {
- if !rxISBN10.MatchString(sanitized) {
- return false
- }
- for i = 0; i < 9; i++ {
- checksum += (i + 1) * int32(sanitized[i]-'0')
- }
- if sanitized[9] == 'X' {
- checksum += 10 * 10
- } else {
- checksum += 10 * int32(sanitized[9]-'0')
- }
- if checksum%11 == 0 {
- return true
- }
- return false
- } else if version == 13 {
- if !rxISBN13.MatchString(sanitized) {
- return false
- }
- factor := []int32{1, 3}
- for i = 0; i < 12; i++ {
- checksum += factor[i%2] * int32(sanitized[i]-'0')
- }
- return (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0
- }
- return IsISBN(str, 10) || IsISBN(str, 13)
-}
-
-// IsJSON checks if the string is valid JSON (note: uses json.Unmarshal).
-func IsJSON(str string) bool {
- var js json.RawMessage
- return json.Unmarshal([]byte(str), &js) == nil
-}
-
-// IsMultibyte checks if the string contains one or more multibyte chars. Empty string is valid.
-func IsMultibyte(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxMultibyte.MatchString(str)
-}
-
-// IsASCII checks if the string contains ASCII chars only. Empty string is valid.
-func IsASCII(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxASCII.MatchString(str)
-}
-
-// IsPrintableASCII checks if the string contains printable ASCII chars only. Empty string is valid.
-func IsPrintableASCII(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxPrintableASCII.MatchString(str)
-}
-
-// IsFullWidth checks if the string contains any full-width chars. Empty string is valid.
-func IsFullWidth(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxFullWidth.MatchString(str)
-}
-
-// IsHalfWidth checks if the string contains any half-width chars. Empty string is valid.
-func IsHalfWidth(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxHalfWidth.MatchString(str)
-}
-
-// IsVariableWidth checks if the string contains a mixture of full and half-width chars. Empty string is valid.
-func IsVariableWidth(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str)
-}
-
-// IsBase64 checks if a string is base64 encoded.
-func IsBase64(str string) bool {
- return rxBase64.MatchString(str)
-}
-
-// IsFilePath checks is a string is Win or Unix file path and returns it's type.
-func IsFilePath(str string) (bool, int) {
- if rxWinPath.MatchString(str) {
- //check windows path limit see:
- // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath
- if len(str[3:]) > 32767 {
- return false, Win
- }
- return true, Win
- } else if rxUnixPath.MatchString(str) {
- return true, Unix
- }
- return false, Unknown
-}
-
-//IsWinFilePath checks both relative & absolute paths in Windows
-func IsWinFilePath(str string) bool {
- if rxARWinPath.MatchString(str) {
- //check windows path limit see:
- // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath
- if len(str[3:]) > 32767 {
- return false
- }
- return true
- }
- return false
-}
-
-//IsUnixFilePath checks both relative & absolute paths in Unix
-func IsUnixFilePath(str string) bool {
- if rxARUnixPath.MatchString(str) {
- return true
- }
- return false
-}
-
-// IsDataURI checks if a string is base64 encoded data URI such as an image
-func IsDataURI(str string) bool {
- dataURI := strings.Split(str, ",")
- if !rxDataURI.MatchString(dataURI[0]) {
- return false
- }
- return IsBase64(dataURI[1])
-}
-
-// IsMagnetURI checks if a string is valid magnet URI
-func IsMagnetURI(str string) bool {
- return rxMagnetURI.MatchString(str)
-}
-
-// IsISO3166Alpha2 checks if a string is valid two-letter country code
-func IsISO3166Alpha2(str string) bool {
- for _, entry := range ISO3166List {
- if str == entry.Alpha2Code {
- return true
- }
- }
- return false
-}
-
-// IsISO3166Alpha3 checks if a string is valid three-letter country code
-func IsISO3166Alpha3(str string) bool {
- for _, entry := range ISO3166List {
- if str == entry.Alpha3Code {
- return true
- }
- }
- return false
-}
-
-// IsISO693Alpha2 checks if a string is valid two-letter language code
-func IsISO693Alpha2(str string) bool {
- for _, entry := range ISO693List {
- if str == entry.Alpha2Code {
- return true
- }
- }
- return false
-}
-
-// IsISO693Alpha3b checks if a string is valid three-letter language code
-func IsISO693Alpha3b(str string) bool {
- for _, entry := range ISO693List {
- if str == entry.Alpha3bCode {
- return true
- }
- }
- return false
-}
-
-// IsDNSName will validate the given string as a DNS name
-func IsDNSName(str string) bool {
- if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 {
- // constraints already violated
- return false
- }
- return !IsIP(str) && rxDNSName.MatchString(str)
-}
-
-// IsHash checks if a string is a hash of type algorithm.
-// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b']
-func IsHash(str string, algorithm string) bool {
- var len string
- algo := strings.ToLower(algorithm)
-
- if algo == "crc32" || algo == "crc32b" {
- len = "8"
- } else if algo == "md5" || algo == "md4" || algo == "ripemd128" || algo == "tiger128" {
- len = "32"
- } else if algo == "sha1" || algo == "ripemd160" || algo == "tiger160" {
- len = "40"
- } else if algo == "tiger192" {
- len = "48"
- } else if algo == "sha3-224" {
- len = "56"
- } else if algo == "sha256" || algo == "sha3-256" {
- len = "64"
- } else if algo == "sha384" || algo == "sha3-384" {
- len = "96"
- } else if algo == "sha512" || algo == "sha3-512" {
- len = "128"
- } else {
- return false
- }
-
- return Matches(str, "^[a-f0-9]{"+len+"}$")
-}
-
-// IsSHA3224 checks is a string is a SHA3-224 hash. Alias for `IsHash(str, "sha3-224")`
-func IsSHA3224(str string) bool {
- return IsHash(str, "sha3-224")
-}
-
-// IsSHA3256 checks is a string is a SHA3-256 hash. Alias for `IsHash(str, "sha3-256")`
-func IsSHA3256(str string) bool {
- return IsHash(str, "sha3-256")
-}
-
-// IsSHA3384 checks is a string is a SHA3-384 hash. Alias for `IsHash(str, "sha3-384")`
-func IsSHA3384(str string) bool {
- return IsHash(str, "sha3-384")
-}
-
-// IsSHA3512 checks is a string is a SHA3-512 hash. Alias for `IsHash(str, "sha3-512")`
-func IsSHA3512(str string) bool {
- return IsHash(str, "sha3-512")
-}
-
-// IsSHA512 checks is a string is a SHA512 hash. Alias for `IsHash(str, "sha512")`
-func IsSHA512(str string) bool {
- return IsHash(str, "sha512")
-}
-
-// IsSHA384 checks is a string is a SHA384 hash. Alias for `IsHash(str, "sha384")`
-func IsSHA384(str string) bool {
- return IsHash(str, "sha384")
-}
-
-// IsSHA256 checks is a string is a SHA256 hash. Alias for `IsHash(str, "sha256")`
-func IsSHA256(str string) bool {
- return IsHash(str, "sha256")
-}
-
-// IsTiger192 checks is a string is a Tiger192 hash. Alias for `IsHash(str, "tiger192")`
-func IsTiger192(str string) bool {
- return IsHash(str, "tiger192")
-}
-
-// IsTiger160 checks is a string is a Tiger160 hash. Alias for `IsHash(str, "tiger160")`
-func IsTiger160(str string) bool {
- return IsHash(str, "tiger160")
-}
-
-// IsRipeMD160 checks is a string is a RipeMD160 hash. Alias for `IsHash(str, "ripemd160")`
-func IsRipeMD160(str string) bool {
- return IsHash(str, "ripemd160")
-}
-
-// IsSHA1 checks is a string is a SHA-1 hash. Alias for `IsHash(str, "sha1")`
-func IsSHA1(str string) bool {
- return IsHash(str, "sha1")
-}
-
-// IsTiger128 checks is a string is a Tiger128 hash. Alias for `IsHash(str, "tiger128")`
-func IsTiger128(str string) bool {
- return IsHash(str, "tiger128")
-}
-
-// IsRipeMD128 checks is a string is a RipeMD128 hash. Alias for `IsHash(str, "ripemd128")`
-func IsRipeMD128(str string) bool {
- return IsHash(str, "ripemd128")
-}
-
-// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, "crc32")`
-func IsCRC32(str string) bool {
- return IsHash(str, "crc32")
-}
-
-// IsCRC32b checks is a string is a CRC32b hash. Alias for `IsHash(str, "crc32b")`
-func IsCRC32b(str string) bool {
- return IsHash(str, "crc32b")
-}
-
-// IsMD5 checks is a string is a MD5 hash. Alias for `IsHash(str, "md5")`
-func IsMD5(str string) bool {
- return IsHash(str, "md5")
-}
-
-// IsMD4 checks is a string is a MD4 hash. Alias for `IsHash(str, "md4")`
-func IsMD4(str string) bool {
- return IsHash(str, "md4")
-}
-
-// IsDialString validates the given string for usage with the various Dial() functions
-func IsDialString(str string) bool {
- if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) {
- return true
- }
-
- return false
-}
-
-// IsIP checks if a string is either IP version 4 or 6. Alias for `net.ParseIP`
-func IsIP(str string) bool {
- return net.ParseIP(str) != nil
-}
-
-// IsPort checks if a string represents a valid port
-func IsPort(str string) bool {
- if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 {
- return true
- }
- return false
-}
-
-// IsIPv4 checks if the string is an IP version 4.
-func IsIPv4(str string) bool {
- ip := net.ParseIP(str)
- return ip != nil && strings.Contains(str, ".")
-}
-
-// IsIPv6 checks if the string is an IP version 6.
-func IsIPv6(str string) bool {
- ip := net.ParseIP(str)
- return ip != nil && strings.Contains(str, ":")
-}
-
-// IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6)
-func IsCIDR(str string) bool {
- _, _, err := net.ParseCIDR(str)
- return err == nil
-}
-
-// IsMAC checks if a string is valid MAC address.
-// Possible MAC formats:
-// 01:23:45:67:89:ab
-// 01:23:45:67:89:ab:cd:ef
-// 01-23-45-67-89-ab
-// 01-23-45-67-89-ab-cd-ef
-// 0123.4567.89ab
-// 0123.4567.89ab.cdef
-func IsMAC(str string) bool {
- _, err := net.ParseMAC(str)
- return err == nil
-}
-
-// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name
-func IsHost(str string) bool {
- return IsIP(str) || IsDNSName(str)
-}
-
-// IsMongoID checks if the string is a valid hex-encoded representation of a MongoDB ObjectId.
-func IsMongoID(str string) bool {
- return rxHexadecimal.MatchString(str) && (len(str) == 24)
-}
-
-// IsLatitude checks if a string is valid latitude.
-func IsLatitude(str string) bool {
- return rxLatitude.MatchString(str)
-}
-
-// IsLongitude checks if a string is valid longitude.
-func IsLongitude(str string) bool {
- return rxLongitude.MatchString(str)
-}
-
-// IsIMEI checks if a string is valid IMEI
-func IsIMEI(str string) bool {
- return rxIMEI.MatchString(str)
-}
-
-// IsIMSI checks if a string is valid IMSI
-func IsIMSI(str string) bool {
- if !rxIMSI.MatchString(str) {
- return false
- }
-
- mcc, err := strconv.ParseInt(str[0:3], 10, 32)
- if err != nil {
- return false
- }
-
- switch mcc {
- case 202, 204, 206, 208, 212, 213, 214, 216, 218, 219:
- case 220, 221, 222, 226, 228, 230, 231, 232, 234, 235:
- case 238, 240, 242, 244, 246, 247, 248, 250, 255, 257:
- case 259, 260, 262, 266, 268, 270, 272, 274, 276, 278:
- case 280, 282, 283, 284, 286, 288, 289, 290, 292, 293:
- case 294, 295, 297, 302, 308, 310, 311, 312, 313, 314:
- case 315, 316, 330, 332, 334, 338, 340, 342, 344, 346:
- case 348, 350, 352, 354, 356, 358, 360, 362, 363, 364:
- case 365, 366, 368, 370, 372, 374, 376, 400, 401, 402:
- case 404, 405, 406, 410, 412, 413, 414, 415, 416, 417:
- case 418, 419, 420, 421, 422, 424, 425, 426, 427, 428:
- case 429, 430, 431, 432, 434, 436, 437, 438, 440, 441:
- case 450, 452, 454, 455, 456, 457, 460, 461, 466, 467:
- case 470, 472, 502, 505, 510, 514, 515, 520, 525, 528:
- case 530, 536, 537, 539, 540, 541, 542, 543, 544, 545:
- case 546, 547, 548, 549, 550, 551, 552, 553, 554, 555:
- case 602, 603, 604, 605, 606, 607, 608, 609, 610, 611:
- case 612, 613, 614, 615, 616, 617, 618, 619, 620, 621:
- case 622, 623, 624, 625, 626, 627, 628, 629, 630, 631:
- case 632, 633, 634, 635, 636, 637, 638, 639, 640, 641:
- case 642, 643, 645, 646, 647, 648, 649, 650, 651, 652:
- case 653, 654, 655, 657, 658, 659, 702, 704, 706, 708:
- case 710, 712, 714, 716, 722, 724, 730, 732, 734, 736:
- case 738, 740, 742, 744, 746, 748, 750, 995:
- return true
- default:
- return false
- }
- return true
-}
-
-// IsRsaPublicKey checks if a string is valid public key with provided length
-func IsRsaPublicKey(str string, keylen int) bool {
- bb := bytes.NewBufferString(str)
- pemBytes, err := ioutil.ReadAll(bb)
- if err != nil {
- return false
- }
- block, _ := pem.Decode(pemBytes)
- if block != nil && block.Type != "PUBLIC KEY" {
- return false
- }
- var der []byte
-
- if block != nil {
- der = block.Bytes
- } else {
- der, err = base64.StdEncoding.DecodeString(str)
- if err != nil {
- return false
- }
- }
-
- key, err := x509.ParsePKIXPublicKey(der)
- if err != nil {
- return false
- }
- pubkey, ok := key.(*rsa.PublicKey)
- if !ok {
- return false
- }
- bitlen := len(pubkey.N.Bytes()) * 8
- return bitlen == int(keylen)
-}
-
-// IsRegex checks if a give string is a valid regex with RE2 syntax or not
-func IsRegex(str string) bool {
- if _, err := regexp.Compile(str); err == nil {
- return true
- }
- return false
-}
-
-func toJSONName(tag string) string {
- if tag == "" {
- return ""
- }
-
- // JSON name always comes first. If there's no options then split[0] is
- // JSON name, if JSON name is not set, then split[0] is an empty string.
- split := strings.SplitN(tag, ",", 2)
-
- name := split[0]
-
- // However it is possible that the field is skipped when
- // (de-)serializing from/to JSON, in which case assume that there is no
- // tag name to use
- if name == "-" {
- return ""
- }
- return name
-}
-
-func prependPathToErrors(err error, path string) error {
- switch err2 := err.(type) {
- case Error:
- err2.Path = append([]string{path}, err2.Path...)
- return err2
- case Errors:
- errors := err2.Errors()
- for i, err3 := range errors {
- errors[i] = prependPathToErrors(err3, path)
- }
- return err2
- }
- return err
-}
-
-// ValidateArray performs validation according to condition iterator that validates every element of the array
-func ValidateArray(array []interface{}, iterator ConditionIterator) bool {
- return Every(array, iterator)
-}
-
-// ValidateMap use validation map for fields.
-// result will be equal to `false` if there are any errors.
-// s is the map containing the data to be validated.
-// m is the validation map in the form:
-// map[string]interface{}{"name":"required,alpha","address":map[string]interface{}{"line1":"required,alphanum"}}
-func ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error) {
- if s == nil {
- return true, nil
- }
- result := true
- var err error
- var errs Errors
- var index int
- val := reflect.ValueOf(s)
- for key, value := range s {
- presentResult := true
- validator, ok := m[key]
- if !ok {
- presentResult = false
- var err error
- err = fmt.Errorf("all map keys has to be present in the validation map; got %s", key)
- err = prependPathToErrors(err, key)
- errs = append(errs, err)
- }
- valueField := reflect.ValueOf(value)
- mapResult := true
- typeResult := true
- structResult := true
- resultField := true
- switch subValidator := validator.(type) {
- case map[string]interface{}:
- var err error
- if v, ok := value.(map[string]interface{}); !ok {
- mapResult = false
- err = fmt.Errorf("map validator has to be for the map type only; got %s", valueField.Type().String())
- err = prependPathToErrors(err, key)
- errs = append(errs, err)
- } else {
- mapResult, err = ValidateMap(v, subValidator)
- if err != nil {
- mapResult = false
- err = prependPathToErrors(err, key)
- errs = append(errs, err)
- }
- }
- case string:
- if (valueField.Kind() == reflect.Struct ||
- (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) &&
- subValidator != "-" {
- var err error
- structResult, err = ValidateStruct(valueField.Interface())
- if err != nil {
- err = prependPathToErrors(err, key)
- errs = append(errs, err)
- }
- }
- resultField, err = typeCheck(valueField, reflect.StructField{
- Name: key,
- PkgPath: "",
- Type: val.Type(),
- Tag: reflect.StructTag(fmt.Sprintf("%s:%q", tagName, subValidator)),
- Offset: 0,
- Index: []int{index},
- Anonymous: false,
- }, val, nil)
- if err != nil {
- errs = append(errs, err)
- }
- case nil:
- // already handlerd when checked before
- default:
- typeResult = false
- err = fmt.Errorf("map validator has to be either map[string]interface{} or string; got %s", valueField.Type().String())
- err = prependPathToErrors(err, key)
- errs = append(errs, err)
- }
- result = result && presentResult && typeResult && resultField && structResult && mapResult
- index++
- }
- // checks required keys
- requiredResult := true
- for key, value := range m {
- if schema, ok := value.(string); ok {
- tags := parseTagIntoMap(schema)
- if required, ok := tags["required"]; ok {
- if _, ok := s[key]; !ok {
- requiredResult = false
- if required.customErrorMessage != "" {
- err = Error{key, fmt.Errorf(required.customErrorMessage), true, "required", []string{}}
- } else {
- err = Error{key, fmt.Errorf("required field missing"), false, "required", []string{}}
- }
- errs = append(errs, err)
- }
- }
- }
- }
-
- if len(errs) > 0 {
- err = errs
- }
- return result && requiredResult, err
-}
-
-// ValidateStruct use tags for fields.
-// result will be equal to `false` if there are any errors.
-// todo currently there is no guarantee that errors will be returned in predictable order (tests may to fail)
-func ValidateStruct(s interface{}) (bool, error) {
- if s == nil {
- return true, nil
- }
- result := true
- var err error
- val := reflect.ValueOf(s)
- if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr {
- val = val.Elem()
- }
- // we only accept structs
- if val.Kind() != reflect.Struct {
- return false, fmt.Errorf("function only accepts structs; got %s", val.Kind())
- }
- var errs Errors
- for i := 0; i < val.NumField(); i++ {
- valueField := val.Field(i)
- typeField := val.Type().Field(i)
- if typeField.PkgPath != "" {
- continue // Private field
- }
- structResult := true
- if valueField.Kind() == reflect.Interface {
- valueField = valueField.Elem()
- }
- if (valueField.Kind() == reflect.Struct ||
- (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) &&
- typeField.Tag.Get(tagName) != "-" {
- var err error
- structResult, err = ValidateStruct(valueField.Interface())
- if err != nil {
- err = prependPathToErrors(err, typeField.Name)
- errs = append(errs, err)
- }
- }
- resultField, err2 := typeCheck(valueField, typeField, val, nil)
- if err2 != nil {
-
- // Replace structure name with JSON name if there is a tag on the variable
- jsonTag := toJSONName(typeField.Tag.Get("json"))
- if jsonTag != "" {
- switch jsonError := err2.(type) {
- case Error:
- jsonError.Name = jsonTag
- err2 = jsonError
- case Errors:
- for i2, err3 := range jsonError {
- switch customErr := err3.(type) {
- case Error:
- customErr.Name = jsonTag
- jsonError[i2] = customErr
- }
- }
-
- err2 = jsonError
- }
- }
-
- errs = append(errs, err2)
- }
- result = result && resultField && structResult
- }
- if len(errs) > 0 {
- err = errs
- }
- return result, err
-}
-
-// ValidateStructAsync performs async validation of the struct and returns results through the channels
-func ValidateStructAsync(s interface{}) (<-chan bool, <-chan error) {
- res := make(chan bool)
- errors := make(chan error)
-
- go func() {
- defer close(res)
- defer close(errors)
-
- isValid, isFailed := ValidateStruct(s)
-
- res <- isValid
- errors <- isFailed
- }()
-
- return res, errors
-}
-
-// ValidateMapAsync performs async validation of the map and returns results through the channels
-func ValidateMapAsync(s map[string]interface{}, m map[string]interface{}) (<-chan bool, <-chan error) {
- res := make(chan bool)
- errors := make(chan error)
-
- go func() {
- defer close(res)
- defer close(errors)
-
- isValid, isFailed := ValidateMap(s, m)
-
- res <- isValid
- errors <- isFailed
- }()
-
- return res, errors
-}
-
-// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{"required": "Some error message", "length(2|3)": ""}
-func parseTagIntoMap(tag string) tagOptionsMap {
- optionsMap := make(tagOptionsMap)
- options := strings.Split(tag, ",")
-
- for i, option := range options {
- option = strings.TrimSpace(option)
-
- validationOptions := strings.Split(option, "~")
- if !isValidTag(validationOptions[0]) {
- continue
- }
- if len(validationOptions) == 2 {
- optionsMap[validationOptions[0]] = tagOption{validationOptions[0], validationOptions[1], i}
- } else {
- optionsMap[validationOptions[0]] = tagOption{validationOptions[0], "", i}
- }
- }
- return optionsMap
-}
-
-func isValidTag(s string) bool {
- if s == "" {
- return false
- }
- for _, c := range s {
- switch {
- case strings.ContainsRune("\\'\"!#$%&()*+-./:<=>?@[]^_{|}~ ", c):
- // Backslash and quote chars are reserved, but
- // otherwise any punctuation chars are allowed
- // in a tag name.
- default:
- if !unicode.IsLetter(c) && !unicode.IsDigit(c) {
- return false
- }
- }
- }
- return true
-}
-
-// IsSSN will validate the given string as a U.S. Social Security Number
-func IsSSN(str string) bool {
- if str == "" || len(str) != 11 {
- return false
- }
- return rxSSN.MatchString(str)
-}
-
-// IsSemver checks if string is valid semantic version
-func IsSemver(str string) bool {
- return rxSemver.MatchString(str)
-}
-
-// IsType checks if interface is of some type
-func IsType(v interface{}, params ...string) bool {
- if len(params) == 1 {
- typ := params[0]
- return strings.Replace(reflect.TypeOf(v).String(), " ", "", -1) == strings.Replace(typ, " ", "", -1)
- }
- return false
-}
-
-// IsTime checks if string is valid according to given format
-func IsTime(str string, format string) bool {
- _, err := time.Parse(format, str)
- return err == nil
-}
-
-// IsUnixTime checks if string is valid unix timestamp value
-func IsUnixTime(str string) bool {
- if _, err := strconv.Atoi(str); err == nil {
- return true
- }
- return false
-}
-
-// IsRFC3339 checks if string is valid timestamp value according to RFC3339
-func IsRFC3339(str string) bool {
- return IsTime(str, time.RFC3339)
-}
-
-// IsRFC3339WithoutZone checks if string is valid timestamp value according to RFC3339 which excludes the timezone.
-func IsRFC3339WithoutZone(str string) bool {
- return IsTime(str, rfc3339WithoutZone)
-}
-
-// IsISO4217 checks if string is valid ISO currency code
-func IsISO4217(str string) bool {
- for _, currency := range ISO4217List {
- if str == currency {
- return true
- }
- }
-
- return false
-}
-
-// ByteLength checks string's length
-func ByteLength(str string, params ...string) bool {
- if len(params) == 2 {
- min, _ := ToInt(params[0])
- max, _ := ToInt(params[1])
- return len(str) >= int(min) && len(str) <= int(max)
- }
-
- return false
-}
-
-// RuneLength checks string's length
-// Alias for StringLength
-func RuneLength(str string, params ...string) bool {
- return StringLength(str, params...)
-}
-
-// IsRsaPub checks whether string is valid RSA key
-// Alias for IsRsaPublicKey
-func IsRsaPub(str string, params ...string) bool {
- if len(params) == 1 {
- len, _ := ToInt(params[0])
- return IsRsaPublicKey(str, int(len))
- }
-
- return false
-}
-
-// StringMatches checks if a string matches a given pattern.
-func StringMatches(s string, params ...string) bool {
- if len(params) == 1 {
- pattern := params[0]
- return Matches(s, pattern)
- }
- return false
-}
-
-// StringLength checks string's length (including multi byte strings)
-func StringLength(str string, params ...string) bool {
-
- if len(params) == 2 {
- strLength := utf8.RuneCountInString(str)
- min, _ := ToInt(params[0])
- max, _ := ToInt(params[1])
- return strLength >= int(min) && strLength <= int(max)
- }
-
- return false
-}
-
-// MinStringLength checks string's minimum length (including multi byte strings)
-func MinStringLength(str string, params ...string) bool {
-
- if len(params) == 1 {
- strLength := utf8.RuneCountInString(str)
- min, _ := ToInt(params[0])
- return strLength >= int(min)
- }
-
- return false
-}
-
-// MaxStringLength checks string's maximum length (including multi byte strings)
-func MaxStringLength(str string, params ...string) bool {
-
- if len(params) == 1 {
- strLength := utf8.RuneCountInString(str)
- max, _ := ToInt(params[0])
- return strLength <= int(max)
- }
-
- return false
-}
-
-// Range checks string's length
-func Range(str string, params ...string) bool {
- if len(params) == 2 {
- value, _ := ToFloat(str)
- min, _ := ToFloat(params[0])
- max, _ := ToFloat(params[1])
- return InRange(value, min, max)
- }
-
- return false
-}
-
-// IsInRaw checks if string is in list of allowed values
-func IsInRaw(str string, params ...string) bool {
- if len(params) == 1 {
- rawParams := params[0]
-
- parsedParams := strings.Split(rawParams, "|")
-
- return IsIn(str, parsedParams...)
- }
-
- return false
-}
-
-// IsIn checks if string str is a member of the set of strings params
-func IsIn(str string, params ...string) bool {
- for _, param := range params {
- if str == param {
- return true
- }
- }
-
- return false
-}
-
-func checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) {
- if nilPtrAllowedByRequired {
- k := v.Kind()
- if (k == reflect.Ptr || k == reflect.Interface) && v.IsNil() {
- return true, nil
- }
- }
-
- if requiredOption, isRequired := options["required"]; isRequired {
- if len(requiredOption.customErrorMessage) > 0 {
- return false, Error{t.Name, fmt.Errorf(requiredOption.customErrorMessage), true, "required", []string{}}
- }
- return false, Error{t.Name, fmt.Errorf("non zero value required"), false, "required", []string{}}
- } else if _, isOptional := options["optional"]; fieldsRequiredByDefault && !isOptional {
- return false, Error{t.Name, fmt.Errorf("Missing required field"), false, "required", []string{}}
- }
- // not required and empty is valid
- return true, nil
-}
-
-func typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) {
- if !v.IsValid() {
- return false, nil
- }
-
- tag := t.Tag.Get(tagName)
-
- // checks if the field should be ignored
- switch tag {
- case "":
- if v.Kind() != reflect.Slice && v.Kind() != reflect.Map {
- if !fieldsRequiredByDefault {
- return true, nil
- }
- return false, Error{t.Name, fmt.Errorf("All fields are required to at least have one validation defined"), false, "required", []string{}}
- }
- case "-":
- return true, nil
- }
-
- isRootType := false
- if options == nil {
- isRootType = true
- options = parseTagIntoMap(tag)
- }
-
- if isEmptyValue(v) {
- // an empty value is not validated, checks only required
- isValid, resultErr = checkRequired(v, t, options)
- for key := range options {
- delete(options, key)
- }
- return isValid, resultErr
- }
-
- var customTypeErrors Errors
- optionsOrder := options.orderedKeys()
- for _, validatorName := range optionsOrder {
- validatorStruct := options[validatorName]
- if validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok {
- delete(options, validatorName)
-
- if result := validatefunc(v.Interface(), o.Interface()); !result {
- if len(validatorStruct.customErrorMessage) > 0 {
- customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: TruncatingErrorf(validatorStruct.customErrorMessage, fmt.Sprint(v), validatorName), CustomErrorMessageExists: true, Validator: stripParams(validatorName)})
- continue
- }
- customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf("%s does not validate as %s", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)})
- }
- }
- }
-
- if len(customTypeErrors.Errors()) > 0 {
- return false, customTypeErrors
- }
-
- if isRootType {
- // Ensure that we've checked the value by all specified validators before report that the value is valid
- defer func() {
- delete(options, "optional")
- delete(options, "required")
-
- if isValid && resultErr == nil && len(options) != 0 {
- optionsOrder := options.orderedKeys()
- for _, validator := range optionsOrder {
- isValid = false
- resultErr = Error{t.Name, fmt.Errorf(
- "The following validator is invalid or can't be applied to the field: %q", validator), false, stripParams(validator), []string{}}
- return
- }
- }
- }()
- }
-
- for _, validatorSpec := range optionsOrder {
- validatorStruct := options[validatorSpec]
- var negate bool
- validator := validatorSpec
- customMsgExists := len(validatorStruct.customErrorMessage) > 0
-
- // checks whether the tag looks like '!something' or 'something'
- if validator[0] == '!' {
- validator = validator[1:]
- negate = true
- }
-
- // checks for interface param validators
- for key, value := range InterfaceParamTagRegexMap {
- ps := value.FindStringSubmatch(validator)
- if len(ps) == 0 {
- continue
- }
-
- validatefunc, ok := InterfaceParamTagMap[key]
- if !ok {
- continue
- }
-
- delete(options, validatorSpec)
-
- field := fmt.Sprint(v)
- if result := validatefunc(v.Interface(), ps[1:]...); (!result && !negate) || (result && negate) {
- if customMsgExists {
- return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- if negate {
- return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- }
- }
-
- switch v.Kind() {
- case reflect.Bool,
- reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
- reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr,
- reflect.Float32, reflect.Float64,
- reflect.String:
- // for each tag option checks the map of validator functions
- for _, validatorSpec := range optionsOrder {
- validatorStruct := options[validatorSpec]
- var negate bool
- validator := validatorSpec
- customMsgExists := len(validatorStruct.customErrorMessage) > 0
-
- // checks whether the tag looks like '!something' or 'something'
- if validator[0] == '!' {
- validator = validator[1:]
- negate = true
- }
-
- // checks for param validators
- for key, value := range ParamTagRegexMap {
- ps := value.FindStringSubmatch(validator)
- if len(ps) == 0 {
- continue
- }
-
- validatefunc, ok := ParamTagMap[key]
- if !ok {
- continue
- }
-
- delete(options, validatorSpec)
-
- switch v.Kind() {
- case reflect.String,
- reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
- reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
- reflect.Float32, reflect.Float64:
-
- field := fmt.Sprint(v) // make value into string, then validate with regex
- if result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) {
- if customMsgExists {
- return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- if negate {
- return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- default:
- // type not yet supported, fail
- return false, Error{t.Name, fmt.Errorf("Validator %s doesn't support kind %s", validator, v.Kind()), false, stripParams(validatorSpec), []string{}}
- }
- }
-
- if validatefunc, ok := TagMap[validator]; ok {
- delete(options, validatorSpec)
-
- switch v.Kind() {
- case reflect.String,
- reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
- reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
- reflect.Float32, reflect.Float64:
- field := fmt.Sprint(v) // make value into string, then validate with regex
- if result := validatefunc(field); !result && !negate || result && negate {
- if customMsgExists {
- return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- if negate {
- return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- default:
- //Not Yet Supported Types (Fail here!)
- err := fmt.Errorf("Validator %s doesn't support kind %s for value %v", validator, v.Kind(), v)
- return false, Error{t.Name, err, false, stripParams(validatorSpec), []string{}}
- }
- }
- }
- return true, nil
- case reflect.Map:
- if v.Type().Key().Kind() != reflect.String {
- return false, &UnsupportedTypeError{v.Type()}
- }
- var sv stringValues
- sv = v.MapKeys()
- sort.Sort(sv)
- result := true
- for i, k := range sv {
- var resultItem bool
- var err error
- if v.MapIndex(k).Kind() != reflect.Struct {
- resultItem, err = typeCheck(v.MapIndex(k), t, o, options)
- if err != nil {
- return false, err
- }
- } else {
- resultItem, err = ValidateStruct(v.MapIndex(k).Interface())
- if err != nil {
- err = prependPathToErrors(err, t.Name+"."+sv[i].Interface().(string))
- return false, err
- }
- }
- result = result && resultItem
- }
- return result, nil
- case reflect.Slice, reflect.Array:
- result := true
- for i := 0; i < v.Len(); i++ {
- var resultItem bool
- var err error
- if v.Index(i).Kind() != reflect.Struct {
- resultItem, err = typeCheck(v.Index(i), t, o, options)
- if err != nil {
- return false, err
- }
- } else {
- resultItem, err = ValidateStruct(v.Index(i).Interface())
- if err != nil {
- err = prependPathToErrors(err, t.Name+"."+strconv.Itoa(i))
- return false, err
- }
- }
- result = result && resultItem
- }
- return result, nil
- case reflect.Interface:
- // If the value is an interface then encode its element
- if v.IsNil() {
- return true, nil
- }
- return ValidateStruct(v.Interface())
- case reflect.Ptr:
- // If the value is a pointer then checks its element
- if v.IsNil() {
- return true, nil
- }
- return typeCheck(v.Elem(), t, o, options)
- case reflect.Struct:
- return true, nil
- default:
- return false, &UnsupportedTypeError{v.Type()}
- }
-}
-
-func stripParams(validatorString string) string {
- return paramsRegexp.ReplaceAllString(validatorString, "")
-}
-
-// isEmptyValue checks whether value empty or not
-func isEmptyValue(v reflect.Value) bool {
- switch v.Kind() {
- case reflect.String, reflect.Array:
- return v.Len() == 0
- case reflect.Map, reflect.Slice:
- return v.Len() == 0 || v.IsNil()
- case reflect.Bool:
- return !v.Bool()
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return v.Int() == 0
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- return v.Uint() == 0
- case reflect.Float32, reflect.Float64:
- return v.Float() == 0
- case reflect.Interface, reflect.Ptr:
- return v.IsNil()
- }
-
- return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface())
-}
-
-// ErrorByField returns error for specified field of the struct
-// validated by ValidateStruct or empty string if there are no errors
-// or this field doesn't exists or doesn't have any errors.
-func ErrorByField(e error, field string) string {
- if e == nil {
- return ""
- }
- return ErrorsByField(e)[field]
-}
-
-// ErrorsByField returns map of errors of the struct validated
-// by ValidateStruct or empty map if there are no errors.
-func ErrorsByField(e error) map[string]string {
- m := make(map[string]string)
- if e == nil {
- return m
- }
- // prototype for ValidateStruct
-
- switch e := e.(type) {
- case Error:
- m[e.Name] = e.Err.Error()
- case Errors:
- for _, item := range e.Errors() {
- n := ErrorsByField(item)
- for k, v := range n {
- m[k] = v
- }
- }
- }
-
- return m
-}
-
-// Error returns string equivalent for reflect.Type
-func (e *UnsupportedTypeError) Error() string {
- return "validator: unsupported type: " + e.Type.String()
-}
-
-func (sv stringValues) Len() int { return len(sv) }
-func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] }
-func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) }
-func (sv stringValues) get(i int) string { return sv[i].String() }
-
-func IsE164(str string) bool {
- return rxE164.MatchString(str)
-}
diff --git a/vendor/github.com/asaskevich/govalidator/wercker.yml b/vendor/github.com/asaskevich/govalidator/wercker.yml
deleted file mode 100644
index bc5f7b086..000000000
--- a/vendor/github.com/asaskevich/govalidator/wercker.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-box: golang
-build:
- steps:
- - setup-go-workspace
-
- - script:
- name: go get
- code: |
- go version
- go get -t ./...
-
- - script:
- name: go test
- code: |
- go test -race -v ./...
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/auth/bearer/token.go b/vendor/github.com/aws/aws-sdk-go/aws/auth/bearer/token.go
index dd950a286..b20f75e16 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/auth/bearer/token.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/auth/bearer/token.go
@@ -1,8 +1,11 @@
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package bearer
import (
- "github.com/aws/aws-sdk-go/aws"
"time"
+
+ "github.com/aws/aws-sdk-go/aws"
)
// Token provides a type wrapping a bearer token and expiration metadata.
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go
index 99849c0e1..8a31d481f 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go
@@ -1,4 +1,7 @@
// Package awserr represents API error interface accessors for the SDK.
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package awserr
// An Error wraps lower level errors with code, message and an original error.
@@ -10,24 +13,23 @@ package awserr
//
// Example:
//
-// output, err := s3manage.Upload(svc, input, opts)
-// if err != nil {
-// if awsErr, ok := err.(awserr.Error); ok {
-// // Get error details
-// log.Println("Error:", awsErr.Code(), awsErr.Message())
-//
-// // Prints out full error message, including original error if there was one.
-// log.Println("Error:", awsErr.Error())
-//
-// // Get original error
-// if origErr := awsErr.OrigErr(); origErr != nil {
-// // operate on original error.
-// }
-// } else {
-// fmt.Println(err.Error())
-// }
-// }
-//
+// output, err := s3manage.Upload(svc, input, opts)
+// if err != nil {
+// if awsErr, ok := err.(awserr.Error); ok {
+// // Get error details
+// log.Println("Error:", awsErr.Code(), awsErr.Message())
+//
+// // Prints out full error message, including original error if there was one.
+// log.Println("Error:", awsErr.Error())
+//
+// // Get original error
+// if origErr := awsErr.OrigErr(); origErr != nil {
+// // operate on original error.
+// }
+// } else {
+// fmt.Println(err.Error())
+// }
+// }
type Error interface {
// Satisfy the generic error interface.
error
@@ -100,32 +102,31 @@ func NewBatchError(code, message string, errs []error) BatchedErrors {
//
// Example:
//
-// output, err := s3manage.Upload(svc, input, opts)
-// if err != nil {
-// if reqerr, ok := err.(RequestFailure); ok {
-// log.Println("Request failed", reqerr.Code(), reqerr.Message(), reqerr.RequestID())
-// } else {
-// log.Println("Error:", err.Error())
-// }
-// }
+// output, err := s3manage.Upload(svc, input, opts)
+// if err != nil {
+// if reqerr, ok := err.(RequestFailure); ok {
+// log.Println("Request failed", reqerr.Code(), reqerr.Message(), reqerr.RequestID())
+// } else {
+// log.Println("Error:", err.Error())
+// }
+// }
//
// Combined with awserr.Error:
//
-// output, err := s3manage.Upload(svc, input, opts)
-// if err != nil {
-// if awsErr, ok := err.(awserr.Error); ok {
-// // Generic AWS Error with Code, Message, and original error (if any)
-// fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
-//
-// if reqErr, ok := err.(awserr.RequestFailure); ok {
-// // A service error occurred
-// fmt.Println(reqErr.StatusCode(), reqErr.RequestID())
-// }
-// } else {
-// fmt.Println(err.Error())
-// }
-// }
-//
+// output, err := s3manage.Upload(svc, input, opts)
+// if err != nil {
+// if awsErr, ok := err.(awserr.Error); ok {
+// // Generic AWS Error with Code, Message, and original error (if any)
+// fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
+//
+// if reqErr, ok := err.(awserr.RequestFailure); ok {
+// // A service error occurred
+// fmt.Println(reqErr.StatusCode(), reqErr.RequestID())
+// }
+// } else {
+// fmt.Println(err.Error())
+// }
+// }
type RequestFailure interface {
Error
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/doc.go
new file mode 100644
index 000000000..5ebbfcaeb
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/doc.go
@@ -0,0 +1,3 @@
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
+package awsutil
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go
index b147f103c..12b3f7ead 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go
@@ -1,3 +1,5 @@
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package client
import (
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go
index a7530ebb3..972103edd 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go
@@ -1,3 +1,5 @@
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package metadata
// ClientInfo wraps immutable data from the client.Client structure.
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
index 36a915efe..fba8d74c7 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
@@ -1,3 +1,5 @@
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package corehandlers
import (
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
index a880a3de8..c561f4a6f 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
@@ -14,38 +14,39 @@
//
// Example of using the environment variable credentials.
//
-// creds := credentials.NewEnvCredentials()
+// creds := credentials.NewEnvCredentials()
//
-// // Retrieve the credentials value
-// credValue, err := creds.Get()
-// if err != nil {
-// // handle error
-// }
+// // Retrieve the credentials value
+// credValue, err := creds.Get()
+// if err != nil {
+// // handle error
+// }
//
// Example of forcing credentials to expire and be refreshed on the next Get().
// This may be helpful to proactively expire credentials and refresh them sooner
// than they would naturally expire on their own.
//
-// creds := credentials.NewCredentials(&ec2rolecreds.EC2RoleProvider{})
-// creds.Expire()
-// credsValue, err := creds.Get()
-// // New credentials will be retrieved instead of from cache.
+// creds := credentials.NewCredentials(&ec2rolecreds.EC2RoleProvider{})
+// creds.Expire()
+// credsValue, err := creds.Get()
+// // New credentials will be retrieved instead of from cache.
//
-//
-// Custom Provider
+// # Custom Provider
//
// Each Provider built into this package also provides a helper method to generate
// a Credentials pointer setup with the provider. To use a custom Provider just
// create a type which satisfies the Provider interface and pass it to the
// NewCredentials method.
//
-// type MyProvider struct{}
-// func (m *MyProvider) Retrieve() (Value, error) {...}
-// func (m *MyProvider) IsExpired() bool {...}
+// type MyProvider struct{}
+// func (m *MyProvider) Retrieve() (Value, error) {...}
+// func (m *MyProvider) IsExpired() bool {...}
//
-// creds := credentials.NewCredentials(&MyProvider{})
-// credValue, err := creds.Get()
+// creds := credentials.NewCredentials(&MyProvider{})
+// credValue, err := creds.Get()
//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package credentials
import (
@@ -64,10 +65,10 @@ import (
// when making service API calls. For example, when accessing public
// s3 buckets.
//
-// svc := s3.New(session.Must(session.NewSession(&aws.Config{
-// Credentials: credentials.AnonymousCredentials,
-// })))
-// // Access public S3 buckets.
+// svc := s3.New(session.Must(session.NewSession(&aws.Config{
+// Credentials: credentials.AnonymousCredentials,
+// })))
+// // Access public S3 buckets.
var AnonymousCredentials = NewStaticCredentials("", "", "")
// A Value is the AWS credentials value for individual credential fields.
@@ -150,10 +151,11 @@ func (p ErrorProvider) IsExpired() bool {
// provider's struct.
//
// Example:
-// type EC2RoleProvider struct {
-// Expiry
-// ...
-// }
+//
+// type EC2RoleProvider struct {
+// Expiry
+// ...
+// }
type Expiry struct {
// The date/time when to expire on
expiration time.Time
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go
index 25a66d1dd..7636aa6aa 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go
@@ -3,7 +3,7 @@
// control options, and configuration for the CSM client. The client can be
// controlled manually, or automatically via the SDK's Session configuration.
//
-// Enabling CSM client via SDK's Session configuration
+// # Enabling CSM client via SDK's Session configuration
//
// The CSM client can be enabled automatically via SDK's Session configuration.
// The SDK's session configuration enables the CSM client if the AWS_CSM_PORT
@@ -12,39 +12,39 @@
// The configuration options for the CSM client via the SDK's session
// configuration are:
//
-// * AWS_CSM_PORT=
-// The port number the CSM agent will receive metrics on.
+// - AWS_CSM_PORT=
+// The port number the CSM agent will receive metrics on.
//
-// * AWS_CSM_HOST=
-// The hostname, or IP address the CSM agent will receive metrics on.
-// Without port number.
+// - AWS_CSM_HOST=
+// The hostname, or IP address the CSM agent will receive metrics on.
+// Without port number.
//
-// Manually enabling the CSM client
+// # Manually enabling the CSM client
//
// The CSM client can be started, paused, and resumed manually. The Start
// function will enable the CSM client to publish metrics to the CSM agent. It
// is safe to call Start concurrently, but if Start is called additional times
// with different ClientID or address it will panic.
//
-// r, err := csm.Start("clientID", ":31000")
-// if err != nil {
-// panic(fmt.Errorf("failed starting CSM: %v", err))
-// }
+// r, err := csm.Start("clientID", ":31000")
+// if err != nil {
+// panic(fmt.Errorf("failed starting CSM: %v", err))
+// }
//
// When controlling the CSM client manually, you must also inject its request
// handlers into the SDK's Session configuration for the SDK's API clients to
// publish metrics.
//
-// sess, err := session.NewSession(&aws.Config{})
-// if err != nil {
-// panic(fmt.Errorf("failed loading session: %v", err))
-// }
+// sess, err := session.NewSession(&aws.Config{})
+// if err != nil {
+// panic(fmt.Errorf("failed loading session: %v", err))
+// }
//
-// // Add CSM client's metric publishing request handlers to the SDK's
-// // Session Configuration.
-// r.InjectHandlers(&sess.Handlers)
+// // Add CSM client's metric publishing request handlers to the SDK's
+// // Session Configuration.
+// r.InjectHandlers(&sess.Handlers)
//
-// Controlling CSM client
+// # Controlling CSM client
//
// Once the CSM client has been enabled the Get function will return a Reporter
// value that you can use to pause and resume the metrics published to the CSM
@@ -54,16 +54,19 @@
// The Pause method can be called to stop the CSM client publishing metrics to
// the CSM agent. The Continue method will resume metric publishing.
//
-// // Get the CSM client Reporter.
-// r := csm.Get()
+// // Get the CSM client Reporter.
+// r := csm.Get()
//
-// // Will pause monitoring
-// r.Pause()
-// resp, err = client.GetObject(&s3.GetObjectInput{
-// Bucket: aws.String("bucket"),
-// Key: aws.String("key"),
-// })
+// // Will pause monitoring
+// r.Pause()
+// resp, err = client.GetObject(&s3.GetObjectInput{
+// Bucket: aws.String("bucket"),
+// Key: aws.String("key"),
+// })
//
-// // Resume monitoring
-// r.Continue()
+// // Resume monitoring
+// r.Continue()
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package csm
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
index 1ba80b576..3675504c6 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
@@ -5,6 +5,9 @@
// instead. This package is useful when you need to reset the defaults
// of a session or service client to the SDK defaults before setting
// additional parameters.
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package defaults
import (
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/doc.go
index 4fcb61618..bf20b773b 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/doc.go
@@ -1,7 +1,7 @@
// Package aws provides the core SDK's utilities and shared types. Use this package's
// utilities to simplify setting and reading API operations parameters.
//
-// Value and Pointer Conversion Utilities
+// # Value and Pointer Conversion Utilities
//
// This package includes a helper conversion utility for each scalar type the SDK's
// API use. These utilities make getting a pointer of the scalar, and dereferencing
@@ -16,33 +16,33 @@
// to get pointer of a literal string value, because getting the address of a
// literal requires assigning the value to a variable first.
//
-// var strPtr *string
+// var strPtr *string
//
-// // Without the SDK's conversion functions
-// str := "my string"
-// strPtr = &str
+// // Without the SDK's conversion functions
+// str := "my string"
+// strPtr = &str
//
-// // With the SDK's conversion functions
-// strPtr = aws.String("my string")
+// // With the SDK's conversion functions
+// strPtr = aws.String("my string")
//
-// // Convert *string to string value
-// str = aws.StringValue(strPtr)
+// // Convert *string to string value
+// str = aws.StringValue(strPtr)
//
// In addition to scalars the aws package also includes conversion utilities for
// map and slice for commonly types used in API parameters. The map and slice
// conversion functions use similar naming pattern as the scalar conversion
// functions.
//
-// var strPtrs []*string
-// var strs []string = []string{"Go", "Gophers", "Go"}
+// var strPtrs []*string
+// var strs []string = []string{"Go", "Gophers", "Go"}
//
-// // Convert []string to []*string
-// strPtrs = aws.StringSlice(strs)
+// // Convert []string to []*string
+// strPtrs = aws.StringSlice(strs)
//
-// // Convert []*string to []string
-// strs = aws.StringValueSlice(strPtrs)
+// // Convert []*string to []string
+// strs = aws.StringValueSlice(strPtrs)
//
-// SDK Default HTTP Client
+// # SDK Default HTTP Client
//
// The SDK will use the http.DefaultClient if a HTTP client is not provided to
// the SDK's Session, or service client constructor. This means that if the
@@ -53,4 +53,7 @@
// a custom HTTP Client to share explicitly through your application. You can
// configure the SDK to use the custom HTTP Client by setting the HTTPClient
// value of the SDK's Config type when creating a Session or service client.
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package aws
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
index f4cc8751d..5fcc35a1f 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
@@ -9,6 +9,9 @@
// The endpoint of the EC2 IMDS client can be configured via the environment
// variable, AWS_EC2_METADATA_SERVICE_ENDPOINT when creating the client with a
// Session. See aws/session#Options.EC2IMDSEndpoint for more details.
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package ec2metadata
import (
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go
index 66dec6beb..7ba7aee50 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go
@@ -62,4 +62,7 @@
// Region: aws.String("us-west-2"),
// EndpointResolver: endpoints.ResolverFunc(myCustomResolver),
// }))
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package endpoints
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/request/doc.go
new file mode 100644
index 000000000..bd3c3441f
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/doc.go
@@ -0,0 +1,3 @@
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
+package request
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go
index ff3cc012a..f91389034 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go
@@ -1,367 +1,366 @@
-/*
-Package session provides configuration for the SDK's service clients. Sessions
-can be shared across service clients that share the same base configuration.
-
-Sessions are safe to use concurrently as long as the Session is not being
-modified. Sessions should be cached when possible, because creating a new
-Session will load all configuration values from the environment, and config
-files each time the Session is created. Sharing the Session value across all of
-your service clients will ensure the configuration is loaded the fewest number
-of times possible.
-
-Sessions options from Shared Config
-
-By default NewSession will only load credentials from the shared credentials
-file (~/.aws/credentials). If the AWS_SDK_LOAD_CONFIG environment variable is
-set to a truthy value the Session will be created from the configuration
-values from the shared config (~/.aws/config) and shared credentials
-(~/.aws/credentials) files. Using the NewSessionWithOptions with
-SharedConfigState set to SharedConfigEnable will create the session as if the
-AWS_SDK_LOAD_CONFIG environment variable was set.
-
-Credential and config loading order
-
-The Session will attempt to load configuration and credentials from the
-environment, configuration files, and other credential sources. The order
-configuration is loaded in is:
-
- * Environment Variables
- * Shared Credentials file
- * Shared Configuration file (if SharedConfig is enabled)
- * EC2 Instance Metadata (credentials only)
-
-The Environment variables for credentials will have precedence over shared
-config even if SharedConfig is enabled. To override this behavior, and use
-shared config credentials instead specify the session.Options.Profile, (e.g.
-when using credential_source=Environment to assume a role).
-
- sess, err := session.NewSessionWithOptions(session.Options{
- Profile: "myProfile",
- })
-
-Creating Sessions
-
-Creating a Session without additional options will load credentials region, and
-profile loaded from the environment and shared config automatically. See,
-"Environment Variables" section for information on environment variables used
-by Session.
-
- // Create Session
- sess, err := session.NewSession()
-
-
-When creating Sessions optional aws.Config values can be passed in that will
-override the default, or loaded, config values the Session is being created
-with. This allows you to provide additional, or case based, configuration
-as needed.
-
- // Create a Session with a custom region
- sess, err := session.NewSession(&aws.Config{
- Region: aws.String("us-west-2"),
- })
-
-Use NewSessionWithOptions to provide additional configuration driving how the
-Session's configuration will be loaded. Such as, specifying shared config
-profile, or override the shared config state, (AWS_SDK_LOAD_CONFIG).
-
- // Equivalent to session.NewSession()
- sess, err := session.NewSessionWithOptions(session.Options{
- // Options
- })
-
- sess, err := session.NewSessionWithOptions(session.Options{
- // Specify profile to load for the session's config
- Profile: "profile_name",
-
- // Provide SDK Config options, such as Region.
- Config: aws.Config{
- Region: aws.String("us-west-2"),
- },
-
- // Force enable Shared Config support
- SharedConfigState: session.SharedConfigEnable,
- })
-
-Adding Handlers
-
-You can add handlers to a session to decorate API operation, (e.g. adding HTTP
-headers). All clients that use the Session receive a copy of the Session's
-handlers. For example, the following request handler added to the Session logs
-every requests made.
-
- // Create a session, and add additional handlers for all service
- // clients created with the Session to inherit. Adds logging handler.
- sess := session.Must(session.NewSession())
-
- sess.Handlers.Send.PushFront(func(r *request.Request) {
- // Log every request made and its payload
- logger.Printf("Request: %s/%s, Params: %s",
- r.ClientInfo.ServiceName, r.Operation, r.Params)
- })
-
-Shared Config Fields
-
-By default the SDK will only load the shared credentials file's
-(~/.aws/credentials) credentials values, and all other config is provided by
-the environment variables, SDK defaults, and user provided aws.Config values.
-
-If the AWS_SDK_LOAD_CONFIG environment variable is set, or SharedConfigEnable
-option is used to create the Session the full shared config values will be
-loaded. This includes credentials, region, and support for assume role. In
-addition the Session will load its configuration from both the shared config
-file (~/.aws/config) and shared credentials file (~/.aws/credentials). Both
-files have the same format.
-
-If both config files are present the configuration from both files will be
-read. The Session will be created from configuration values from the shared
-credentials file (~/.aws/credentials) over those in the shared config file
-(~/.aws/config).
-
-Credentials are the values the SDK uses to authenticating requests with AWS
-Services. When specified in a file, both aws_access_key_id and
-aws_secret_access_key must be provided together in the same file to be
-considered valid. They will be ignored if both are not present.
-aws_session_token is an optional field that can be provided in addition to the
-other two fields.
-
- aws_access_key_id = AKID
- aws_secret_access_key = SECRET
- aws_session_token = TOKEN
-
- ; region only supported if SharedConfigEnabled.
- region = us-east-1
-
-Assume Role configuration
-
-The role_arn field allows you to configure the SDK to assume an IAM role using
-a set of credentials from another source. Such as when paired with static
-credentials, "profile_source", "credential_process", or "credential_source"
-fields. If "role_arn" is provided, a source of credentials must also be
-specified, such as "source_profile", "credential_source", or
-"credential_process".
-
- role_arn = arn:aws:iam:::role/
- source_profile = profile_with_creds
- external_id = 1234
- mfa_serial =
- role_session_name = session_name
-
-
-The SDK supports assuming a role with MFA token. If "mfa_serial" is set, you
-must also set the Session Option.AssumeRoleTokenProvider. The Session will fail
-to load if the AssumeRoleTokenProvider is not specified.
-
- sess := session.Must(session.NewSessionWithOptions(session.Options{
- AssumeRoleTokenProvider: stscreds.StdinTokenProvider,
- }))
-
-To setup Assume Role outside of a session see the stscreds.AssumeRoleProvider
-documentation.
-
-Environment Variables
-
-When a Session is created several environment variables can be set to adjust
-how the SDK functions, and what configuration data it loads when creating
-Sessions. All environment values are optional, but some values like credentials
-require multiple of the values to set or the partial values will be ignored.
-All environment variable values are strings unless otherwise noted.
-
-Environment configuration values. If set both Access Key ID and Secret Access
-Key must be provided. Session Token and optionally also be provided, but is
-not required.
-
- # Access Key ID
- AWS_ACCESS_KEY_ID=AKID
- AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set.
-
- # Secret Access Key
- AWS_SECRET_ACCESS_KEY=SECRET
- AWS_SECRET_KEY=SECRET=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set.
-
- # Session Token
- AWS_SESSION_TOKEN=TOKEN
-
-Region value will instruct the SDK where to make service API requests to. If is
-not provided in the environment the region must be provided before a service
-client request is made.
-
- AWS_REGION=us-east-1
-
- # AWS_DEFAULT_REGION is only read if AWS_SDK_LOAD_CONFIG is also set,
- # and AWS_REGION is not also set.
- AWS_DEFAULT_REGION=us-east-1
-
-Profile name the SDK should load use when loading shared config from the
-configuration files. If not provided "default" will be used as the profile name.
-
- AWS_PROFILE=my_profile
-
- # AWS_DEFAULT_PROFILE is only read if AWS_SDK_LOAD_CONFIG is also set,
- # and AWS_PROFILE is not also set.
- AWS_DEFAULT_PROFILE=my_profile
-
-SDK load config instructs the SDK to load the shared config in addition to
-shared credentials. This also expands the configuration loaded so the shared
-credentials will have parity with the shared config file. This also enables
-Region and Profile support for the AWS_DEFAULT_REGION and AWS_DEFAULT_PROFILE
-env values as well.
-
- AWS_SDK_LOAD_CONFIG=1
-
-Custom Shared Config and Credential Files
-
-Shared credentials file path can be set to instruct the SDK to use an alternative
-file for the shared credentials. If not set the file will be loaded from
-$HOME/.aws/credentials on Linux/Unix based systems, and
-%USERPROFILE%\.aws\credentials on Windows.
-
- AWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials
-
-Shared config file path can be set to instruct the SDK to use an alternative
-file for the shared config. If not set the file will be loaded from
-$HOME/.aws/config on Linux/Unix based systems, and
-%USERPROFILE%\.aws\config on Windows.
-
- AWS_CONFIG_FILE=$HOME/my_shared_config
-
-Custom CA Bundle
-
-Path to a custom Credentials Authority (CA) bundle PEM file that the SDK
-will use instead of the default system's root CA bundle. Use this only
-if you want to replace the CA bundle the SDK uses for TLS requests.
-
- AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle
-
-Enabling this option will attempt to merge the Transport into the SDK's HTTP
-client. If the client's Transport is not a http.Transport an error will be
-returned. If the Transport's TLS config is set this option will cause the SDK
-to overwrite the Transport's TLS config's RootCAs value. If the CA bundle file
-contains multiple certificates all of them will be loaded.
-
-The Session option CustomCABundle is also available when creating sessions
-to also enable this feature. CustomCABundle session option field has priority
-over the AWS_CA_BUNDLE environment variable, and will be used if both are set.
-
-Setting a custom HTTPClient in the aws.Config options will override this setting.
-To use this option and custom HTTP client, the HTTP client needs to be provided
-when creating the session. Not the service client.
-
-Custom Client TLS Certificate
-
-The SDK supports the environment and session option being configured with
-Client TLS certificates that are sent as a part of the client's TLS handshake
-for client authentication. If used, both Cert and Key values are required. If
-one is missing, or either fail to load the contents of the file an error will
-be returned.
-
-HTTP Client's Transport concrete implementation must be a http.Transport
-or creating the session will fail.
-
- AWS_SDK_GO_CLIENT_TLS_KEY=$HOME/my_client_key
- AWS_SDK_GO_CLIENT_TLS_CERT=$HOME/my_client_cert
-
-This can also be configured via the session.Options ClientTLSCert and ClientTLSKey.
-
- sess, err := session.NewSessionWithOptions(session.Options{
- ClientTLSCert: myCertFile,
- ClientTLSKey: myKeyFile,
- })
-
-Custom EC2 IMDS Endpoint
-
-The endpoint of the EC2 IMDS client can be configured via the environment
-variable, AWS_EC2_METADATA_SERVICE_ENDPOINT when creating the client with a
-Session. See Options.EC2IMDSEndpoint for more details.
-
- AWS_EC2_METADATA_SERVICE_ENDPOINT=http://169.254.169.254
-
-If using an URL with an IPv6 address literal, the IPv6 address
-component must be enclosed in square brackets.
-
- AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1]
-
-The custom EC2 IMDS endpoint can also be specified via the Session options.
-
- sess, err := session.NewSessionWithOptions(session.Options{
- EC2MetadataEndpoint: "http://[::1]",
- })
-
-FIPS and DualStack Endpoints
-
-The SDK can be configured to resolve an endpoint with certain capabilities such as FIPS and DualStack.
-
-You can configure a FIPS endpoint using an environment variable, shared config ($HOME/.aws/config),
-or programmatically.
-
-To configure a FIPS endpoint set the environment variable set the AWS_USE_FIPS_ENDPOINT to true or false to enable
-or disable FIPS endpoint resolution.
-
- AWS_USE_FIPS_ENDPOINT=true
-
-To configure a FIPS endpoint using shared config, set use_fips_endpoint to true or false to enable
-or disable FIPS endpoint resolution.
-
- [profile myprofile]
- region=us-west-2
- use_fips_endpoint=true
-
-To configure a FIPS endpoint programmatically
-
- // Option 1: Configure it on a session for all clients
- sess, err := session.NewSessionWithOptions(session.Options{
- UseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled,
- })
- if err != nil {
- // handle error
- }
-
- client := s3.New(sess)
-
- // Option 2: Configure it per client
- sess, err := session.NewSession()
- if err != nil {
- // handle error
- }
-
- client := s3.New(sess, &aws.Config{
- UseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled,
- })
-
-You can configure a DualStack endpoint using an environment variable, shared config ($HOME/.aws/config),
-or programmatically.
-
-To configure a DualStack endpoint set the environment variable set the AWS_USE_DUALSTACK_ENDPOINT to true or false to
-enable or disable DualStack endpoint resolution.
-
- AWS_USE_DUALSTACK_ENDPOINT=true
-
-To configure a DualStack endpoint using shared config, set use_dualstack_endpoint to true or false to enable
-or disable DualStack endpoint resolution.
-
- [profile myprofile]
- region=us-west-2
- use_dualstack_endpoint=true
-
-To configure a DualStack endpoint programmatically
-
- // Option 1: Configure it on a session for all clients
- sess, err := session.NewSessionWithOptions(session.Options{
- UseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled,
- })
- if err != nil {
- // handle error
- }
-
- client := s3.New(sess)
-
- // Option 2: Configure it per client
- sess, err := session.NewSession()
- if err != nil {
- // handle error
- }
-
- client := s3.New(sess, &aws.Config{
- UseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled,
- })
-*/
+// Package session provides configuration for the SDK's service clients. Sessions
+// can be shared across service clients that share the same base configuration.
+//
+// Sessions are safe to use concurrently as long as the Session is not being
+// modified. Sessions should be cached when possible, because creating a new
+// Session will load all configuration values from the environment, and config
+// files each time the Session is created. Sharing the Session value across all of
+// your service clients will ensure the configuration is loaded the fewest number
+// of times possible.
+//
+// # Sessions options from Shared Config
+//
+// By default NewSession will only load credentials from the shared credentials
+// file (~/.aws/credentials). If the AWS_SDK_LOAD_CONFIG environment variable is
+// set to a truthy value the Session will be created from the configuration
+// values from the shared config (~/.aws/config) and shared credentials
+// (~/.aws/credentials) files. Using the NewSessionWithOptions with
+// SharedConfigState set to SharedConfigEnable will create the session as if the
+// AWS_SDK_LOAD_CONFIG environment variable was set.
+//
+// # Credential and config loading order
+//
+// The Session will attempt to load configuration and credentials from the
+// environment, configuration files, and other credential sources. The order
+// configuration is loaded in is:
+//
+// - Environment Variables
+// - Shared Credentials file
+// - Shared Configuration file (if SharedConfig is enabled)
+// - EC2 Instance Metadata (credentials only)
+//
+// The Environment variables for credentials will have precedence over shared
+// config even if SharedConfig is enabled. To override this behavior, and use
+// shared config credentials instead specify the session.Options.Profile, (e.g.
+// when using credential_source=Environment to assume a role).
+//
+// sess, err := session.NewSessionWithOptions(session.Options{
+// Profile: "myProfile",
+// })
+//
+// # Creating Sessions
+//
+// Creating a Session without additional options will load credentials region, and
+// profile loaded from the environment and shared config automatically. See,
+// "Environment Variables" section for information on environment variables used
+// by Session.
+//
+// // Create Session
+// sess, err := session.NewSession()
+//
+// When creating Sessions optional aws.Config values can be passed in that will
+// override the default, or loaded, config values the Session is being created
+// with. This allows you to provide additional, or case based, configuration
+// as needed.
+//
+// // Create a Session with a custom region
+// sess, err := session.NewSession(&aws.Config{
+// Region: aws.String("us-west-2"),
+// })
+//
+// Use NewSessionWithOptions to provide additional configuration driving how the
+// Session's configuration will be loaded. Such as, specifying shared config
+// profile, or override the shared config state, (AWS_SDK_LOAD_CONFIG).
+//
+// // Equivalent to session.NewSession()
+// sess, err := session.NewSessionWithOptions(session.Options{
+// // Options
+// })
+//
+// sess, err := session.NewSessionWithOptions(session.Options{
+// // Specify profile to load for the session's config
+// Profile: "profile_name",
+//
+// // Provide SDK Config options, such as Region.
+// Config: aws.Config{
+// Region: aws.String("us-west-2"),
+// },
+//
+// // Force enable Shared Config support
+// SharedConfigState: session.SharedConfigEnable,
+// })
+//
+// # Adding Handlers
+//
+// You can add handlers to a session to decorate API operation, (e.g. adding HTTP
+// headers). All clients that use the Session receive a copy of the Session's
+// handlers. For example, the following request handler added to the Session logs
+// every requests made.
+//
+// // Create a session, and add additional handlers for all service
+// // clients created with the Session to inherit. Adds logging handler.
+// sess := session.Must(session.NewSession())
+//
+// sess.Handlers.Send.PushFront(func(r *request.Request) {
+// // Log every request made and its payload
+// logger.Printf("Request: %s/%s, Params: %s",
+// r.ClientInfo.ServiceName, r.Operation, r.Params)
+// })
+//
+// # Shared Config Fields
+//
+// By default the SDK will only load the shared credentials file's
+// (~/.aws/credentials) credentials values, and all other config is provided by
+// the environment variables, SDK defaults, and user provided aws.Config values.
+//
+// If the AWS_SDK_LOAD_CONFIG environment variable is set, or SharedConfigEnable
+// option is used to create the Session the full shared config values will be
+// loaded. This includes credentials, region, and support for assume role. In
+// addition the Session will load its configuration from both the shared config
+// file (~/.aws/config) and shared credentials file (~/.aws/credentials). Both
+// files have the same format.
+//
+// If both config files are present the configuration from both files will be
+// read. The Session will be created from configuration values from the shared
+// credentials file (~/.aws/credentials) over those in the shared config file
+// (~/.aws/config).
+//
+// Credentials are the values the SDK uses to authenticating requests with AWS
+// Services. When specified in a file, both aws_access_key_id and
+// aws_secret_access_key must be provided together in the same file to be
+// considered valid. They will be ignored if both are not present.
+// aws_session_token is an optional field that can be provided in addition to the
+// other two fields.
+//
+// aws_access_key_id = AKID
+// aws_secret_access_key = SECRET
+// aws_session_token = TOKEN
+//
+// ; region only supported if SharedConfigEnabled.
+// region = us-east-1
+//
+// # Assume Role configuration
+//
+// The role_arn field allows you to configure the SDK to assume an IAM role using
+// a set of credentials from another source. Such as when paired with static
+// credentials, "profile_source", "credential_process", or "credential_source"
+// fields. If "role_arn" is provided, a source of credentials must also be
+// specified, such as "source_profile", "credential_source", or
+// "credential_process".
+//
+// role_arn = arn:aws:iam:::role/
+// source_profile = profile_with_creds
+// external_id = 1234
+// mfa_serial =
+// role_session_name = session_name
+//
+// The SDK supports assuming a role with MFA token. If "mfa_serial" is set, you
+// must also set the Session Option.AssumeRoleTokenProvider. The Session will fail
+// to load if the AssumeRoleTokenProvider is not specified.
+//
+// sess := session.Must(session.NewSessionWithOptions(session.Options{
+// AssumeRoleTokenProvider: stscreds.StdinTokenProvider,
+// }))
+//
+// To setup Assume Role outside of a session see the stscreds.AssumeRoleProvider
+// documentation.
+//
+// # Environment Variables
+//
+// When a Session is created several environment variables can be set to adjust
+// how the SDK functions, and what configuration data it loads when creating
+// Sessions. All environment values are optional, but some values like credentials
+// require multiple of the values to set or the partial values will be ignored.
+// All environment variable values are strings unless otherwise noted.
+//
+// Environment configuration values. If set both Access Key ID and Secret Access
+// Key must be provided. Session Token and optionally also be provided, but is
+// not required.
+//
+// # Access Key ID
+// AWS_ACCESS_KEY_ID=AKID
+// AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set.
+//
+// # Secret Access Key
+// AWS_SECRET_ACCESS_KEY=SECRET
+// AWS_SECRET_KEY=SECRET=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set.
+//
+// # Session Token
+// AWS_SESSION_TOKEN=TOKEN
+//
+// Region value will instruct the SDK where to make service API requests to. If is
+// not provided in the environment the region must be provided before a service
+// client request is made.
+//
+// AWS_REGION=us-east-1
+//
+// # AWS_DEFAULT_REGION is only read if AWS_SDK_LOAD_CONFIG is also set,
+// # and AWS_REGION is not also set.
+// AWS_DEFAULT_REGION=us-east-1
+//
+// Profile name the SDK should load use when loading shared config from the
+// configuration files. If not provided "default" will be used as the profile name.
+//
+// AWS_PROFILE=my_profile
+//
+// # AWS_DEFAULT_PROFILE is only read if AWS_SDK_LOAD_CONFIG is also set,
+// # and AWS_PROFILE is not also set.
+// AWS_DEFAULT_PROFILE=my_profile
+//
+// SDK load config instructs the SDK to load the shared config in addition to
+// shared credentials. This also expands the configuration loaded so the shared
+// credentials will have parity with the shared config file. This also enables
+// Region and Profile support for the AWS_DEFAULT_REGION and AWS_DEFAULT_PROFILE
+// env values as well.
+//
+// AWS_SDK_LOAD_CONFIG=1
+//
+// # Custom Shared Config and Credential Files
+//
+// Shared credentials file path can be set to instruct the SDK to use an alternative
+// file for the shared credentials. If not set the file will be loaded from
+// $HOME/.aws/credentials on Linux/Unix based systems, and
+// %USERPROFILE%\.aws\credentials on Windows.
+//
+// AWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials
+//
+// Shared config file path can be set to instruct the SDK to use an alternative
+// file for the shared config. If not set the file will be loaded from
+// $HOME/.aws/config on Linux/Unix based systems, and
+// %USERPROFILE%\.aws\config on Windows.
+//
+// AWS_CONFIG_FILE=$HOME/my_shared_config
+//
+// # Custom CA Bundle
+//
+// Path to a custom Credentials Authority (CA) bundle PEM file that the SDK
+// will use instead of the default system's root CA bundle. Use this only
+// if you want to replace the CA bundle the SDK uses for TLS requests.
+//
+// AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle
+//
+// Enabling this option will attempt to merge the Transport into the SDK's HTTP
+// client. If the client's Transport is not a http.Transport an error will be
+// returned. If the Transport's TLS config is set this option will cause the SDK
+// to overwrite the Transport's TLS config's RootCAs value. If the CA bundle file
+// contains multiple certificates all of them will be loaded.
+//
+// The Session option CustomCABundle is also available when creating sessions
+// to also enable this feature. CustomCABundle session option field has priority
+// over the AWS_CA_BUNDLE environment variable, and will be used if both are set.
+//
+// Setting a custom HTTPClient in the aws.Config options will override this setting.
+// To use this option and custom HTTP client, the HTTP client needs to be provided
+// when creating the session. Not the service client.
+//
+// # Custom Client TLS Certificate
+//
+// The SDK supports the environment and session option being configured with
+// Client TLS certificates that are sent as a part of the client's TLS handshake
+// for client authentication. If used, both Cert and Key values are required. If
+// one is missing, or either fail to load the contents of the file an error will
+// be returned.
+//
+// HTTP Client's Transport concrete implementation must be a http.Transport
+// or creating the session will fail.
+//
+// AWS_SDK_GO_CLIENT_TLS_KEY=$HOME/my_client_key
+// AWS_SDK_GO_CLIENT_TLS_CERT=$HOME/my_client_cert
+//
+// This can also be configured via the session.Options ClientTLSCert and ClientTLSKey.
+//
+// sess, err := session.NewSessionWithOptions(session.Options{
+// ClientTLSCert: myCertFile,
+// ClientTLSKey: myKeyFile,
+// })
+//
+// # Custom EC2 IMDS Endpoint
+//
+// The endpoint of the EC2 IMDS client can be configured via the environment
+// variable, AWS_EC2_METADATA_SERVICE_ENDPOINT when creating the client with a
+// Session. See Options.EC2IMDSEndpoint for more details.
+//
+// AWS_EC2_METADATA_SERVICE_ENDPOINT=http://169.254.169.254
+//
+// If using an URL with an IPv6 address literal, the IPv6 address
+// component must be enclosed in square brackets.
+//
+// AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1]
+//
+// The custom EC2 IMDS endpoint can also be specified via the Session options.
+//
+// sess, err := session.NewSessionWithOptions(session.Options{
+// EC2MetadataEndpoint: "http://[::1]",
+// })
+//
+// # FIPS and DualStack Endpoints
+//
+// The SDK can be configured to resolve an endpoint with certain capabilities such as FIPS and DualStack.
+//
+// You can configure a FIPS endpoint using an environment variable, shared config ($HOME/.aws/config),
+// or programmatically.
+//
+// To configure a FIPS endpoint set the environment variable set the AWS_USE_FIPS_ENDPOINT to true or false to enable
+// or disable FIPS endpoint resolution.
+//
+// AWS_USE_FIPS_ENDPOINT=true
+//
+// To configure a FIPS endpoint using shared config, set use_fips_endpoint to true or false to enable
+// or disable FIPS endpoint resolution.
+//
+// [profile myprofile]
+// region=us-west-2
+// use_fips_endpoint=true
+//
+// To configure a FIPS endpoint programmatically
+//
+// // Option 1: Configure it on a session for all clients
+// sess, err := session.NewSessionWithOptions(session.Options{
+// UseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled,
+// })
+// if err != nil {
+// // handle error
+// }
+//
+// client := s3.New(sess)
+//
+// // Option 2: Configure it per client
+// sess, err := session.NewSession()
+// if err != nil {
+// // handle error
+// }
+//
+// client := s3.New(sess, &aws.Config{
+// UseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled,
+// })
+//
+// You can configure a DualStack endpoint using an environment variable, shared config ($HOME/.aws/config),
+// or programmatically.
+//
+// To configure a DualStack endpoint set the environment variable set the AWS_USE_DUALSTACK_ENDPOINT to true or false to
+// enable or disable DualStack endpoint resolution.
+//
+// AWS_USE_DUALSTACK_ENDPOINT=true
+//
+// To configure a DualStack endpoint using shared config, set use_dualstack_endpoint to true or false to enable
+// or disable DualStack endpoint resolution.
+//
+// [profile myprofile]
+// region=us-west-2
+// use_dualstack_endpoint=true
+//
+// To configure a DualStack endpoint programmatically
+//
+// // Option 1: Configure it on a session for all clients
+// sess, err := session.NewSessionWithOptions(session.Options{
+// UseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled,
+// })
+// if err != nil {
+// // handle error
+// }
+//
+// client := s3.New(sess)
+//
+// // Option 2: Configure it per client
+// sess, err := session.NewSession()
+// if err != nil {
+// // handle error
+// }
+//
+// client := s3.New(sess, &aws.Config{
+// UseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled,
+// })
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package session
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go
index b542df931..3370f03e8 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go
@@ -52,6 +52,9 @@
//
// Test `TestStandaloneSign` provides a complete example of using the signer
// outside of the SDK and pre-escaping the URI path.
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package v4
import (
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go
index e72db4de1..4116bc3f1 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/version.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go
@@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
-const SDKVersion = "1.55.7"
+const SDKVersion = "1.55.8"
diff --git a/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/doc.go b/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/doc.go
index 402a2dd6e..d0399ff5e 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/doc.go
@@ -60,4 +60,7 @@
// See the AWS Secrets Manager client SecretsManager for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/secretsmanager/#New
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package secretsmanager
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go b/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go
index 15e61a322..91049220b 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/sso/doc.go
@@ -42,4 +42,7 @@
// See the AWS Single Sign-On client SSO for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/sso/#New
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package sso
diff --git a/vendor/github.com/aws/aws-sdk-go/service/ssooidc/doc.go b/vendor/github.com/aws/aws-sdk-go/service/ssooidc/doc.go
index 083568c61..1285e91e8 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/ssooidc/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/ssooidc/doc.go
@@ -64,4 +64,7 @@
// See the AWS SSO OIDC client SSOOIDC for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/ssooidc/#New
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package ssooidc
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go b/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go
index ea1d9eb0c..d1a66b560 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go
@@ -28,4 +28,7 @@
// See the AWS Security Token Service client STS for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/sts/#New
+//
+// Deprecated: aws-sdk-go is deprecated. Use aws-sdk-go-v2.
+// See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/.
package sts
diff --git a/vendor/github.com/catenacyber/perfsprint/analyzer/analyzer.go b/vendor/github.com/catenacyber/perfsprint/analyzer/analyzer.go
index 42eb0259a..c44104f5f 100644
--- a/vendor/github.com/catenacyber/perfsprint/analyzer/analyzer.go
+++ b/vendor/github.com/catenacyber/perfsprint/analyzer/analyzer.go
@@ -1,3 +1,4 @@
+// Package analyzer provides a static analysis tool that checks that fmt.Sprintf can be replaced with a faster alternative.
package analyzer
import (
@@ -118,7 +119,8 @@ func isConcatable(verb string) bool {
if strings.Count(verb, "%[1]s") > 1 {
return false
}
- return (hasPrefix || hasSuffix) && !(hasPrefix && hasSuffix)
+ // TODO handle case hasPrefix and hasSuffix
+ return (hasPrefix || hasSuffix) && !(hasPrefix && hasSuffix) //nolint:staticcheck
}
func isStringAdd(st *ast.AssignStmt, idname string) ast.Expr {
@@ -171,6 +173,9 @@ func (n *perfSprint) reportConcatLoop(pass *analysis.Pass, neededPackages map[st
if ok {
_, ok = adds[id.Name]
if ok {
+ if x.Tok == token.ASSIGN && isStringAdd(x, id.Name) == nil {
+ addTODO = id.Name
+ }
return false
}
}
@@ -198,11 +203,15 @@ func (n *perfSprint) reportConcatLoop(pass *analysis.Pass, neededPackages map[st
// before the loop: declare the strings Builders
// during the loop: replace concatenation with Builder.WriteString
// after the loop: use the Builder.String to append to the pre-existing string
+ var prefixSb203 strings.Builder
+ var suffixSb203 strings.Builder
for _, k := range keys {
// lol
- prefix += fmt.Sprintf("var %sSb%d strings.Builder\n", k, loopStartLine)
- suffix += fmt.Sprintf("\n%s += %sSb%d.String()", k, k, loopStartLine)
+ prefixSb203.WriteString(fmt.Sprintf("var %sSb%d strings.Builder\n", k, loopStartLine))
+ suffixSb203.WriteString(fmt.Sprintf("\n%s += %sSb%d.String()", k, k, loopStartLine))
}
+ prefix += prefixSb203.String()
+ suffix += suffixSb203.String()
te := []analysis.TextEdit{
{
Pos: node.Pos(),
diff --git a/vendor/github.com/coreos/go-semver/NOTICE b/vendor/github.com/coreos/go-semver/NOTICE
deleted file mode 100644
index 23a0ada2f..000000000
--- a/vendor/github.com/coreos/go-semver/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-CoreOS Project
-Copyright 2018 CoreOS, Inc
-
-This product includes software developed at CoreOS, Inc.
-(http://www.coreos.com/).
diff --git a/vendor/github.com/coreos/go-semver/semver/semver.go b/vendor/github.com/coreos/go-semver/semver/semver.go
deleted file mode 100644
index eb9fb7ff2..000000000
--- a/vendor/github.com/coreos/go-semver/semver/semver.go
+++ /dev/null
@@ -1,296 +0,0 @@
-// Copyright 2013-2015 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Semantic Versions http://semver.org
-package semver
-
-import (
- "bytes"
- "errors"
- "fmt"
- "regexp"
- "strconv"
- "strings"
-)
-
-type Version struct {
- Major int64
- Minor int64
- Patch int64
- PreRelease PreRelease
- Metadata string
-}
-
-type PreRelease string
-
-func splitOff(input *string, delim string) (val string) {
- parts := strings.SplitN(*input, delim, 2)
-
- if len(parts) == 2 {
- *input = parts[0]
- val = parts[1]
- }
-
- return val
-}
-
-func New(version string) *Version {
- return Must(NewVersion(version))
-}
-
-func NewVersion(version string) (*Version, error) {
- v := Version{}
-
- if err := v.Set(version); err != nil {
- return nil, err
- }
-
- return &v, nil
-}
-
-// Must is a helper for wrapping NewVersion and will panic if err is not nil.
-func Must(v *Version, err error) *Version {
- if err != nil {
- panic(err)
- }
- return v
-}
-
-// Set parses and updates v from the given version string. Implements flag.Value
-func (v *Version) Set(version string) error {
- metadata := splitOff(&version, "+")
- preRelease := PreRelease(splitOff(&version, "-"))
- dotParts := strings.SplitN(version, ".", 3)
-
- if len(dotParts) != 3 {
- return fmt.Errorf("%s is not in dotted-tri format", version)
- }
-
- if err := validateIdentifier(string(preRelease)); err != nil {
- return fmt.Errorf("failed to validate pre-release: %v", err)
- }
-
- if err := validateIdentifier(metadata); err != nil {
- return fmt.Errorf("failed to validate metadata: %v", err)
- }
-
- parsed := make([]int64, 3)
-
- for i, v := range dotParts[:3] {
- val, err := strconv.ParseInt(v, 10, 64)
- parsed[i] = val
- if err != nil {
- return err
- }
- }
-
- v.Metadata = metadata
- v.PreRelease = preRelease
- v.Major = parsed[0]
- v.Minor = parsed[1]
- v.Patch = parsed[2]
- return nil
-}
-
-func (v Version) String() string {
- var buffer bytes.Buffer
-
- fmt.Fprintf(&buffer, "%d.%d.%d", v.Major, v.Minor, v.Patch)
-
- if v.PreRelease != "" {
- fmt.Fprintf(&buffer, "-%s", v.PreRelease)
- }
-
- if v.Metadata != "" {
- fmt.Fprintf(&buffer, "+%s", v.Metadata)
- }
-
- return buffer.String()
-}
-
-func (v *Version) UnmarshalYAML(unmarshal func(interface{}) error) error {
- var data string
- if err := unmarshal(&data); err != nil {
- return err
- }
- return v.Set(data)
-}
-
-func (v Version) MarshalJSON() ([]byte, error) {
- return []byte(`"` + v.String() + `"`), nil
-}
-
-func (v *Version) UnmarshalJSON(data []byte) error {
- l := len(data)
- if l == 0 || string(data) == `""` {
- return nil
- }
- if l < 2 || data[0] != '"' || data[l-1] != '"' {
- return errors.New("invalid semver string")
- }
- return v.Set(string(data[1 : l-1]))
-}
-
-// Compare tests if v is less than, equal to, or greater than versionB,
-// returning -1, 0, or +1 respectively.
-func (v Version) Compare(versionB Version) int {
- if cmp := recursiveCompare(v.Slice(), versionB.Slice()); cmp != 0 {
- return cmp
- }
- return preReleaseCompare(v, versionB)
-}
-
-// Equal tests if v is equal to versionB.
-func (v Version) Equal(versionB Version) bool {
- return v.Compare(versionB) == 0
-}
-
-// LessThan tests if v is less than versionB.
-func (v Version) LessThan(versionB Version) bool {
- return v.Compare(versionB) < 0
-}
-
-// Slice converts the comparable parts of the semver into a slice of integers.
-func (v Version) Slice() []int64 {
- return []int64{v.Major, v.Minor, v.Patch}
-}
-
-func (p PreRelease) Slice() []string {
- preRelease := string(p)
- return strings.Split(preRelease, ".")
-}
-
-func preReleaseCompare(versionA Version, versionB Version) int {
- a := versionA.PreRelease
- b := versionB.PreRelease
-
- /* Handle the case where if two versions are otherwise equal it is the
- * one without a PreRelease that is greater */
- if len(a) == 0 && (len(b) > 0) {
- return 1
- } else if len(b) == 0 && (len(a) > 0) {
- return -1
- }
-
- // If there is a prerelease, check and compare each part.
- return recursivePreReleaseCompare(a.Slice(), b.Slice())
-}
-
-func recursiveCompare(versionA []int64, versionB []int64) int {
- if len(versionA) == 0 {
- return 0
- }
-
- a := versionA[0]
- b := versionB[0]
-
- if a > b {
- return 1
- } else if a < b {
- return -1
- }
-
- return recursiveCompare(versionA[1:], versionB[1:])
-}
-
-func recursivePreReleaseCompare(versionA []string, versionB []string) int {
- // A larger set of pre-release fields has a higher precedence than a smaller set,
- // if all of the preceding identifiers are equal.
- if len(versionA) == 0 {
- if len(versionB) > 0 {
- return -1
- }
- return 0
- } else if len(versionB) == 0 {
- // We're longer than versionB so return 1.
- return 1
- }
-
- a := versionA[0]
- b := versionB[0]
-
- aInt := false
- bInt := false
-
- aI, err := strconv.Atoi(versionA[0])
- if err == nil {
- aInt = true
- }
-
- bI, err := strconv.Atoi(versionB[0])
- if err == nil {
- bInt = true
- }
-
- // Numeric identifiers always have lower precedence than non-numeric identifiers.
- if aInt && !bInt {
- return -1
- } else if !aInt && bInt {
- return 1
- }
-
- // Handle Integer Comparison
- if aInt && bInt {
- if aI > bI {
- return 1
- } else if aI < bI {
- return -1
- }
- }
-
- // Handle String Comparison
- if a > b {
- return 1
- } else if a < b {
- return -1
- }
-
- return recursivePreReleaseCompare(versionA[1:], versionB[1:])
-}
-
-// BumpMajor increments the Major field by 1 and resets all other fields to their default values
-func (v *Version) BumpMajor() {
- v.Major += 1
- v.Minor = 0
- v.Patch = 0
- v.PreRelease = PreRelease("")
- v.Metadata = ""
-}
-
-// BumpMinor increments the Minor field by 1 and resets all other fields to their default values
-func (v *Version) BumpMinor() {
- v.Minor += 1
- v.Patch = 0
- v.PreRelease = PreRelease("")
- v.Metadata = ""
-}
-
-// BumpPatch increments the Patch field by 1 and resets all other fields to their default values
-func (v *Version) BumpPatch() {
- v.Patch += 1
- v.PreRelease = PreRelease("")
- v.Metadata = ""
-}
-
-// validateIdentifier makes sure the provided identifier satisfies semver spec
-func validateIdentifier(id string) error {
- if id != "" && !reIdentifier.MatchString(id) {
- return fmt.Errorf("%s is not a valid semver identifier", id)
- }
- return nil
-}
-
-// reIdentifier is a regular expression used to check that pre-release and metadata
-// identifiers satisfy the spec requirements
-var reIdentifier = regexp.MustCompile(`^[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*$`)
diff --git a/vendor/github.com/coreos/go-semver/semver/sort.go b/vendor/github.com/coreos/go-semver/semver/sort.go
deleted file mode 100644
index e256b41a5..000000000
--- a/vendor/github.com/coreos/go-semver/semver/sort.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2013-2015 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package semver
-
-import (
- "sort"
-)
-
-type Versions []*Version
-
-func (s Versions) Len() int {
- return len(s)
-}
-
-func (s Versions) Swap(i, j int) {
- s[i], s[j] = s[j], s[i]
-}
-
-func (s Versions) Less(i, j int) bool {
- return s[i].LessThan(*s[j])
-}
-
-// Sort sorts the given slice of Version
-func Sort(versions []*Version) {
- sort.Sort(Versions(versions))
-}
diff --git a/vendor/github.com/coreos/go-systemd/v22/LICENSE b/vendor/github.com/coreos/go-systemd/v22/LICENSE
deleted file mode 100644
index 37ec93a14..000000000
--- a/vendor/github.com/coreos/go-systemd/v22/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and
-distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright
-owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities
-that control, are controlled by, or are under common control with that entity.
-For the purposes of this definition, "control" means (i) the power, direct or
-indirect, to cause the direction or management of such entity, whether by
-contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
-outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising
-permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including
-but not limited to software source code, documentation source, and configuration
-files.
-
-"Object" form shall mean any form resulting from mechanical transformation or
-translation of a Source form, including but not limited to compiled object code,
-generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made
-available under the License, as indicated by a copyright notice that is included
-in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that
-is based on (or derived from) the Work and for which the editorial revisions,
-annotations, elaborations, or other modifications represent, as a whole, an
-original work of authorship. For the purposes of this License, Derivative Works
-shall not include works that remain separable from, or merely link (or bind by
-name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version
-of the Work and any modifications or additions to that Work or Derivative Works
-thereof, that is intentionally submitted to Licensor for inclusion in the Work
-by the copyright owner or by an individual or Legal Entity authorized to submit
-on behalf of the copyright owner. For the purposes of this definition,
-"submitted" means any form of electronic, verbal, or written communication sent
-to the Licensor or its representatives, including but not limited to
-communication on electronic mailing lists, source code control systems, and
-issue tracking systems that are managed by, or on behalf of, the Licensor for
-the purpose of discussing and improving the Work, but excluding communication
-that is conspicuously marked or otherwise designated in writing by the copyright
-owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
-of whom a Contribution has been received by Licensor and subsequently
-incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the Work and such
-Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable (except as stated in this section) patent license to make, have
-made, use, offer to sell, sell, import, and otherwise transfer the Work, where
-such license applies only to those patent claims licensable by such Contributor
-that are necessarily infringed by their Contribution(s) alone or by combination
-of their Contribution(s) with the Work to which such Contribution(s) was
-submitted. If You institute patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Work or a
-Contribution incorporated within the Work constitutes direct or contributory
-patent infringement, then any patent licenses granted to You under this License
-for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof
-in any medium, with or without modifications, and in Source or Object form,
-provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of
-this License; and
-You must cause any modified files to carry prominent notices stating that You
-changed the files; and
-You must retain, in the Source form of any Derivative Works that You distribute,
-all copyright, patent, trademark, and attribution notices from the Source form
-of the Work, excluding those notices that do not pertain to any part of the
-Derivative Works; and
-If the Work includes a "NOTICE" text file as part of its distribution, then any
-Derivative Works that You distribute must include a readable copy of the
-attribution notices contained within such NOTICE file, excluding those notices
-that do not pertain to any part of the Derivative Works, in at least one of the
-following places: within a NOTICE text file distributed as part of the
-Derivative Works; within the Source form or documentation, if provided along
-with the Derivative Works; or, within a display generated by the Derivative
-Works, if and wherever such third-party notices normally appear. The contents of
-the NOTICE file are for informational purposes only and do not modify the
-License. You may add Your own attribution notices within Derivative Works that
-You distribute, alongside or as an addendum to the NOTICE text from the Work,
-provided that such additional attribution notices cannot be construed as
-modifying the License.
-You may add Your own copyright statement to Your modifications and may provide
-additional or different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works as a whole,
-provided Your use, reproduction, and distribution of the Work otherwise complies
-with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted
-for inclusion in the Work by You to the Licensor shall be under the terms and
-conditions of this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify the terms of
-any separate license agreement you may have executed with Licensor regarding
-such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks,
-service marks, or product names of the Licensor, except as required for
-reasonable and customary use in describing the origin of the Work and
-reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the
-Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
-including, without limitation, any warranties or conditions of TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
-solely responsible for determining the appropriateness of using or
-redistributing the Work and assume any risks associated with Your exercise of
-permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence),
-contract, or otherwise, unless required by applicable law (such as deliberate
-and grossly negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special, incidental,
-or consequential damages of any character arising as a result of this License or
-out of the use or inability to use the Work (including but not limited to
-damages for loss of goodwill, work stoppage, computer failure or malfunction, or
-any and all other commercial damages or losses), even if such Contributor has
-been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to
-offer, and charge a fee for, acceptance of support, warranty, indemnity, or
-other liability obligations and/or rights consistent with this License. However,
-in accepting such obligations, You may act only on Your own behalf and on Your
-sole responsibility, not on behalf of any other Contributor, and only if You
-agree to indemnify, defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason of your
-accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work
-
-To apply the Apache License to your work, attach the following boilerplate
-notice, with the fields enclosed by brackets "[]" replaced with your own
-identifying information. (Don't include the brackets!) The text should be
-enclosed in the appropriate comment syntax for the file format. We also
-recommend that a file or class name and description of purpose be included on
-the same "printed page" as the copyright notice for easier identification within
-third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/vendor/github.com/coreos/go-systemd/v22/NOTICE b/vendor/github.com/coreos/go-systemd/v22/NOTICE
deleted file mode 100644
index 23a0ada2f..000000000
--- a/vendor/github.com/coreos/go-systemd/v22/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-CoreOS Project
-Copyright 2018 CoreOS, Inc
-
-This product includes software developed at CoreOS, Inc.
-(http://www.coreos.com/).
diff --git a/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify.go b/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify.go
deleted file mode 100644
index ba4ae31f1..000000000
--- a/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify.go
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2014 Docker, Inc.
-// Copyright 2015-2018 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-// Package daemon provides a Go implementation of the sd_notify protocol.
-// It can be used to inform systemd of service start-up completion, watchdog
-// events, and other status changes.
-//
-// https://www.freedesktop.org/software/systemd/man/sd_notify.html#Description
-package daemon
-
-import (
- "net"
- "os"
-)
-
-const (
- // SdNotifyReady tells the service manager that service startup is finished
- // or the service finished loading its configuration.
- SdNotifyReady = "READY=1"
-
- // SdNotifyStopping tells the service manager that the service is beginning
- // its shutdown.
- SdNotifyStopping = "STOPPING=1"
-
- // SdNotifyReloading tells the service manager that this service is
- // reloading its configuration. Note that you must call SdNotifyReady when
- // it completed reloading.
- SdNotifyReloading = "RELOADING=1"
-
- // SdNotifyWatchdog tells the service manager to update the watchdog
- // timestamp for the service.
- SdNotifyWatchdog = "WATCHDOG=1"
-)
-
-// SdNotify sends a message to the init daemon. It is common to ignore the error.
-// If `unsetEnvironment` is true, the environment variable `NOTIFY_SOCKET`
-// will be unconditionally unset.
-//
-// It returns one of the following:
-// (false, nil) - notification not supported (i.e. NOTIFY_SOCKET is unset)
-// (false, err) - notification supported, but failure happened (e.g. error connecting to NOTIFY_SOCKET or while sending data)
-// (true, nil) - notification supported, data has been sent
-func SdNotify(unsetEnvironment bool, state string) (bool, error) {
- socketAddr := &net.UnixAddr{
- Name: os.Getenv("NOTIFY_SOCKET"),
- Net: "unixgram",
- }
-
- // NOTIFY_SOCKET not set
- if socketAddr.Name == "" {
- return false, nil
- }
-
- if unsetEnvironment {
- if err := os.Unsetenv("NOTIFY_SOCKET"); err != nil {
- return false, err
- }
- }
-
- conn, err := net.DialUnix(socketAddr.Net, nil, socketAddr)
- // Error connecting to NOTIFY_SOCKET
- if err != nil {
- return false, err
- }
- defer conn.Close()
-
- if _, err = conn.Write([]byte(state)); err != nil {
- return false, err
- }
- return true, nil
-}
diff --git a/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go b/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go
deleted file mode 100644
index 25d9c1aa9..000000000
--- a/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2016 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package daemon
-
-import (
- "fmt"
- "os"
- "strconv"
- "time"
-)
-
-// SdWatchdogEnabled returns watchdog information for a service.
-// Processes should call daemon.SdNotify(false, daemon.SdNotifyWatchdog) every
-// time / 2.
-// If `unsetEnvironment` is true, the environment variables `WATCHDOG_USEC` and
-// `WATCHDOG_PID` will be unconditionally unset.
-//
-// It returns one of the following:
-// (0, nil) - watchdog isn't enabled or we aren't the watched PID.
-// (0, err) - an error happened (e.g. error converting time).
-// (time, nil) - watchdog is enabled and we can send ping. time is delay
-// before inactive service will be killed.
-func SdWatchdogEnabled(unsetEnvironment bool) (time.Duration, error) {
- wusec := os.Getenv("WATCHDOG_USEC")
- wpid := os.Getenv("WATCHDOG_PID")
- if unsetEnvironment {
- wusecErr := os.Unsetenv("WATCHDOG_USEC")
- wpidErr := os.Unsetenv("WATCHDOG_PID")
- if wusecErr != nil {
- return 0, wusecErr
- }
- if wpidErr != nil {
- return 0, wpidErr
- }
- }
-
- if wusec == "" {
- return 0, nil
- }
- s, err := strconv.Atoi(wusec)
- if err != nil {
- return 0, fmt.Errorf("error converting WATCHDOG_USEC: %s", err)
- }
- if s <= 0 {
- return 0, fmt.Errorf("error WATCHDOG_USEC must be a positive number")
- }
- interval := time.Duration(s) * time.Microsecond
-
- if wpid == "" {
- return interval, nil
- }
- p, err := strconv.Atoi(wpid)
- if err != nil {
- return 0, fmt.Errorf("error converting WATCHDOG_PID: %s", err)
- }
- if os.Getpid() != p {
- return 0, nil
- }
-
- return interval, nil
-}
diff --git a/vendor/github.com/coreos/go-systemd/v22/journal/journal.go b/vendor/github.com/coreos/go-systemd/v22/journal/journal.go
deleted file mode 100644
index ac24c7767..000000000
--- a/vendor/github.com/coreos/go-systemd/v22/journal/journal.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package journal provides write bindings to the local systemd journal.
-// It is implemented in pure Go and connects to the journal directly over its
-// unix socket.
-//
-// To read from the journal, see the "sdjournal" package, which wraps the
-// sd-journal a C API.
-//
-// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
-package journal
-
-import (
- "fmt"
-)
-
-// Priority of a journal message
-type Priority int
-
-const (
- PriEmerg Priority = iota
- PriAlert
- PriCrit
- PriErr
- PriWarning
- PriNotice
- PriInfo
- PriDebug
-)
-
-// Print prints a message to the local systemd journal using Send().
-func Print(priority Priority, format string, a ...interface{}) error {
- return Send(fmt.Sprintf(format, a...), priority, nil)
-}
diff --git a/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go b/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go
deleted file mode 100644
index c5b23a819..000000000
--- a/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go
+++ /dev/null
@@ -1,267 +0,0 @@
-// Copyright 2015 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//go:build !windows
-// +build !windows
-
-// Package journal provides write bindings to the local systemd journal.
-// It is implemented in pure Go and connects to the journal directly over its
-// unix socket.
-//
-// To read from the journal, see the "sdjournal" package, which wraps the
-// sd-journal a C API.
-//
-// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
-package journal
-
-import (
- "bytes"
- "encoding/binary"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "net"
- "os"
- "strconv"
- "strings"
- "sync"
- "sync/atomic"
- "syscall"
- "unsafe"
-)
-
-var (
- // This can be overridden at build-time:
- // https://github.com/golang/go/wiki/GcToolchainTricks#including-build-information-in-the-executable
- journalSocket = "/run/systemd/journal/socket"
-
- // unixConnPtr atomically holds the local unconnected Unix-domain socket.
- // Concrete safe pointer type: *net.UnixConn
- unixConnPtr unsafe.Pointer
- // onceConn ensures that unixConnPtr is initialized exactly once.
- onceConn sync.Once
-)
-
-// Enabled checks whether the local systemd journal is available for logging.
-func Enabled() bool {
- if c := getOrInitConn(); c == nil {
- return false
- }
-
- conn, err := net.Dial("unixgram", journalSocket)
- if err != nil {
- return false
- }
- defer conn.Close()
-
- return true
-}
-
-// StderrIsJournalStream returns whether the process stderr is connected
-// to the Journal's stream transport.
-//
-// This can be used for automatic protocol upgrading described in [Journal Native Protocol].
-//
-// Returns true if JOURNAL_STREAM environment variable is present,
-// and stderr's device and inode numbers match it.
-//
-// Error is returned if unexpected error occurs: e.g. if JOURNAL_STREAM environment variable
-// is present, but malformed, fstat syscall fails, etc.
-//
-// [Journal Native Protocol]: https://systemd.io/JOURNAL_NATIVE_PROTOCOL/#automatic-protocol-upgrading
-func StderrIsJournalStream() (bool, error) {
- return fdIsJournalStream(syscall.Stderr)
-}
-
-// StdoutIsJournalStream returns whether the process stdout is connected
-// to the Journal's stream transport.
-//
-// Returns true if JOURNAL_STREAM environment variable is present,
-// and stdout's device and inode numbers match it.
-//
-// Error is returned if unexpected error occurs: e.g. if JOURNAL_STREAM environment variable
-// is present, but malformed, fstat syscall fails, etc.
-//
-// Most users should probably use [StderrIsJournalStream].
-func StdoutIsJournalStream() (bool, error) {
- return fdIsJournalStream(syscall.Stdout)
-}
-
-func fdIsJournalStream(fd int) (bool, error) {
- journalStream := os.Getenv("JOURNAL_STREAM")
- if journalStream == "" {
- return false, nil
- }
-
- var expectedStat syscall.Stat_t
- _, err := fmt.Sscanf(journalStream, "%d:%d", &expectedStat.Dev, &expectedStat.Ino)
- if err != nil {
- return false, fmt.Errorf("failed to parse JOURNAL_STREAM=%q: %v", journalStream, err)
- }
-
- var stat syscall.Stat_t
- err = syscall.Fstat(fd, &stat)
- if err != nil {
- return false, err
- }
-
- match := stat.Dev == expectedStat.Dev && stat.Ino == expectedStat.Ino
- return match, nil
-}
-
-// Send a message to the local systemd journal. vars is a map of journald
-// fields to values. Fields must be composed of uppercase letters, numbers,
-// and underscores, but must not start with an underscore. Within these
-// restrictions, any arbitrary field name may be used. Some names have special
-// significance: see the journalctl documentation
-// (http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html)
-// for more details. vars may be nil.
-func Send(message string, priority Priority, vars map[string]string) error {
- conn := getOrInitConn()
- if conn == nil {
- return errors.New("could not initialize socket to journald")
- }
-
- socketAddr := &net.UnixAddr{
- Name: journalSocket,
- Net: "unixgram",
- }
-
- data := new(bytes.Buffer)
- appendVariable(data, "PRIORITY", strconv.Itoa(int(priority)))
- appendVariable(data, "MESSAGE", message)
- for k, v := range vars {
- appendVariable(data, k, v)
- }
-
- _, _, err := conn.WriteMsgUnix(data.Bytes(), nil, socketAddr)
- if err == nil {
- return nil
- }
- if !isSocketSpaceError(err) {
- return err
- }
-
- // Large log entry, send it via tempfile and ancillary-fd.
- file, err := tempFd()
- if err != nil {
- return err
- }
- defer file.Close()
- _, err = io.Copy(file, data)
- if err != nil {
- return err
- }
- rights := syscall.UnixRights(int(file.Fd()))
- _, _, err = conn.WriteMsgUnix([]byte{}, rights, socketAddr)
- if err != nil {
- return err
- }
-
- return nil
-}
-
-// getOrInitConn attempts to get the global `unixConnPtr` socket, initializing if necessary
-func getOrInitConn() *net.UnixConn {
- conn := (*net.UnixConn)(atomic.LoadPointer(&unixConnPtr))
- if conn != nil {
- return conn
- }
- onceConn.Do(initConn)
- return (*net.UnixConn)(atomic.LoadPointer(&unixConnPtr))
-}
-
-func appendVariable(w io.Writer, name, value string) {
- if err := validVarName(name); err != nil {
- fmt.Fprintf(os.Stderr, "variable name %s contains invalid character, ignoring\n", name)
- }
- if strings.ContainsRune(value, '\n') {
- /* When the value contains a newline, we write:
- * - the variable name, followed by a newline
- * - the size (in 64bit little endian format)
- * - the data, followed by a newline
- */
- fmt.Fprintln(w, name)
- binary.Write(w, binary.LittleEndian, uint64(len(value)))
- fmt.Fprintln(w, value)
- } else {
- /* just write the variable and value all on one line */
- fmt.Fprintf(w, "%s=%s\n", name, value)
- }
-}
-
-// validVarName validates a variable name to make sure journald will accept it.
-// The variable name must be in uppercase and consist only of characters,
-// numbers and underscores, and may not begin with an underscore:
-// https://www.freedesktop.org/software/systemd/man/sd_journal_print.html
-func validVarName(name string) error {
- if name == "" {
- return errors.New("Empty variable name")
- } else if name[0] == '_' {
- return errors.New("Variable name begins with an underscore")
- }
-
- for _, c := range name {
- if !(('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || c == '_') {
- return errors.New("Variable name contains invalid characters")
- }
- }
- return nil
-}
-
-// isSocketSpaceError checks whether the error is signaling
-// an "overlarge message" condition.
-func isSocketSpaceError(err error) bool {
- opErr, ok := err.(*net.OpError)
- if !ok || opErr == nil {
- return false
- }
-
- sysErr, ok := opErr.Err.(*os.SyscallError)
- if !ok || sysErr == nil {
- return false
- }
-
- return sysErr.Err == syscall.EMSGSIZE || sysErr.Err == syscall.ENOBUFS
-}
-
-// tempFd creates a temporary, unlinked file under `/dev/shm`.
-func tempFd() (*os.File, error) {
- file, err := ioutil.TempFile("/dev/shm/", "journal.XXXXX")
- if err != nil {
- return nil, err
- }
- err = syscall.Unlink(file.Name())
- if err != nil {
- return nil, err
- }
- return file, nil
-}
-
-// initConn initializes the global `unixConnPtr` socket.
-// It is automatically called when needed.
-func initConn() {
- autobind, err := net.ResolveUnixAddr("unixgram", "")
- if err != nil {
- return
- }
-
- sock, err := net.ListenUnixgram("unixgram", autobind)
- if err != nil {
- return
- }
-
- atomic.StorePointer(&unixConnPtr, unsafe.Pointer(sock))
-}
diff --git a/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go b/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go
deleted file mode 100644
index 322e41e74..000000000
--- a/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package journal provides write bindings to the local systemd journal.
-// It is implemented in pure Go and connects to the journal directly over its
-// unix socket.
-//
-// To read from the journal, see the "sdjournal" package, which wraps the
-// sd-journal a C API.
-//
-// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
-package journal
-
-import (
- "errors"
-)
-
-func Enabled() bool {
- return false
-}
-
-func Send(message string, priority Priority, vars map[string]string) error {
- return errors.New("could not initialize socket to journald")
-}
-
-func StderrIsJournalStream() (bool, error) {
- return false, nil
-}
-
-func StdoutIsJournalStream() (bool, error) {
- return false, nil
-}
diff --git a/vendor/github.com/emicklei/go-restful/v3/.travis.yml b/vendor/github.com/emicklei/go-restful/v3/.travis.yml
deleted file mode 100644
index 3a0bf5ff1..000000000
--- a/vendor/github.com/emicklei/go-restful/v3/.travis.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-language: go
-
-go:
- - 1.x
-
-before_install:
- - go test -v
-
-script:
- - go test -race -coverprofile=coverage.txt -covermode=atomic
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
\ No newline at end of file
diff --git a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md
index 6f24dfff5..4fcd920ab 100644
--- a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md
+++ b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md
@@ -1,5 +1,9 @@
# Change history of go-restful
+## [v3.13.0] - 2025-08-14
+
+- optimize performance of path matching in CurlyRouter ( thanks @wenhuang, Wen Huang)
+
## [v3.12.2] - 2025-02-21
- allow empty payloads in post,put,patch, issue #580 ( thanks @liggitt, Jordan Liggitt)
diff --git a/vendor/github.com/emicklei/go-restful/v3/README.md b/vendor/github.com/emicklei/go-restful/v3/README.md
index 3fb40d198..50a79ab69 100644
--- a/vendor/github.com/emicklei/go-restful/v3/README.md
+++ b/vendor/github.com/emicklei/go-restful/v3/README.md
@@ -84,6 +84,7 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo
- Configurable (trace) logging
- Customizable gzip/deflate readers and writers using CompressorProvider registration
- Inject your own http.Handler using the `HttpMiddlewareHandlerToFilter` function
+- Added `SetPathTokenCacheEnabled` and `SetCustomVerbCacheEnabled` to disable regexp caching (default=true)
## How to customize
There are several hooks to customize the behavior of the go-restful package.
diff --git a/vendor/github.com/emicklei/go-restful/v3/curly.go b/vendor/github.com/emicklei/go-restful/v3/curly.go
index 6fd2bcd5a..eec43bfd0 100644
--- a/vendor/github.com/emicklei/go-restful/v3/curly.go
+++ b/vendor/github.com/emicklei/go-restful/v3/curly.go
@@ -9,11 +9,35 @@ import (
"regexp"
"sort"
"strings"
+ "sync"
)
// CurlyRouter expects Routes with paths that contain zero or more parameters in curly brackets.
type CurlyRouter struct{}
+var (
+ regexCache sync.Map // Cache for compiled regex patterns
+ pathTokenCacheEnabled = true // Enable/disable path token regex caching
+)
+
+// SetPathTokenCacheEnabled enables or disables path token regex caching for CurlyRouter.
+// When disabled, regex patterns will be compiled on every request.
+// When enabled (default), compiled regex patterns are cached for better performance.
+func SetPathTokenCacheEnabled(enabled bool) {
+ pathTokenCacheEnabled = enabled
+}
+
+// getCachedRegexp retrieves a compiled regex from the cache if found and valid.
+// Returns the regex and true if found and valid, nil and false otherwise.
+func getCachedRegexp(cache *sync.Map, pattern string) (*regexp.Regexp, bool) {
+ if cached, found := cache.Load(pattern); found {
+ if regex, ok := cached.(*regexp.Regexp); ok {
+ return regex, true
+ }
+ }
+ return nil, false
+}
+
// SelectRoute is part of the Router interface and returns the best match
// for the WebService and its Route for the given Request.
func (c CurlyRouter) SelectRoute(
@@ -113,8 +137,28 @@ func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, reque
}
return true, true
}
- matched, err := regexp.MatchString(regPart, requestToken)
- return (matched && err == nil), false
+
+ // Check cache first (if enabled)
+ if pathTokenCacheEnabled {
+ if regex, found := getCachedRegexp(®exCache, regPart); found {
+ matched := regex.MatchString(requestToken)
+ return matched, false
+ }
+ }
+
+ // Compile the regex
+ regex, err := regexp.Compile(regPart)
+ if err != nil {
+ return false, false
+ }
+
+ // Cache the regex (if enabled)
+ if pathTokenCacheEnabled {
+ regexCache.Store(regPart, regex)
+ }
+
+ matched := regex.MatchString(requestToken)
+ return matched, false
}
var jsr311Router = RouterJSR311{}
@@ -168,7 +212,7 @@ func (c CurlyRouter) computeWebserviceScore(requestTokens []string, routeTokens
if matchesToken {
score++ // extra score for regex match
}
- }
+ }
} else {
// not a parameter
if eachRequestToken != eachRouteToken {
diff --git a/vendor/github.com/emicklei/go-restful/v3/custom_verb.go b/vendor/github.com/emicklei/go-restful/v3/custom_verb.go
index bfc17efde..0b98eeb09 100644
--- a/vendor/github.com/emicklei/go-restful/v3/custom_verb.go
+++ b/vendor/github.com/emicklei/go-restful/v3/custom_verb.go
@@ -1,14 +1,28 @@
package restful
+// Copyright 2025 Ernest Micklei. All rights reserved.
+// Use of this source code is governed by a license
+// that can be found in the LICENSE file.
+
import (
"fmt"
"regexp"
+ "sync"
)
var (
- customVerbReg = regexp.MustCompile(":([A-Za-z]+)$")
+ customVerbReg = regexp.MustCompile(":([A-Za-z]+)$")
+ customVerbCache sync.Map // Cache for compiled custom verb regexes
+ customVerbCacheEnabled = true // Enable/disable custom verb regex caching
)
+// SetCustomVerbCacheEnabled enables or disables custom verb regex caching.
+// When disabled, custom verb regex patterns will be compiled on every request.
+// When enabled (default), compiled custom verb regex patterns are cached for better performance.
+func SetCustomVerbCacheEnabled(enabled bool) {
+ customVerbCacheEnabled = enabled
+}
+
func hasCustomVerb(routeToken string) bool {
return customVerbReg.MatchString(routeToken)
}
@@ -20,7 +34,23 @@ func isMatchCustomVerb(routeToken string, pathToken string) bool {
}
customVerb := rs[1]
- specificVerbReg := regexp.MustCompile(fmt.Sprintf(":%s$", customVerb))
+ regexPattern := fmt.Sprintf(":%s$", customVerb)
+
+ // Check cache first (if enabled)
+ if customVerbCacheEnabled {
+ if specificVerbReg, found := getCachedRegexp(&customVerbCache, regexPattern); found {
+ return specificVerbReg.MatchString(pathToken)
+ }
+ }
+
+ // Compile the regex
+ specificVerbReg := regexp.MustCompile(regexPattern)
+
+ // Cache the regex (if enabled)
+ if customVerbCacheEnabled {
+ customVerbCache.Store(regexPattern, specificVerbReg)
+ }
+
return specificVerbReg.MatchString(pathToken)
}
diff --git a/vendor/github.com/emicklei/go-restful/v3/doc.go b/vendor/github.com/emicklei/go-restful/v3/doc.go
index 69b13057d..80809225b 100644
--- a/vendor/github.com/emicklei/go-restful/v3/doc.go
+++ b/vendor/github.com/emicklei/go-restful/v3/doc.go
@@ -1,7 +1,7 @@
/*
Package restful , a lean package for creating REST-style WebServices without magic.
-WebServices and Routes
+### WebServices and Routes
A WebService has a collection of Route objects that dispatch incoming Http Requests to a function calls.
Typically, a WebService has a root path (e.g. /users) and defines common MIME types for its routes.
@@ -30,14 +30,14 @@ The (*Request, *Response) arguments provide functions for reading information fr
See the example https://github.com/emicklei/go-restful/blob/v3/examples/user-resource/restful-user-resource.go with a full implementation.
-Regular expression matching Routes
+### Regular expression matching Routes
A Route parameter can be specified using the format "uri/{var[:regexp]}" or the special version "uri/{var:*}" for matching the tail of the path.
For example, /persons/{name:[A-Z][A-Z]} can be used to restrict values for the parameter "name" to only contain capital alphabetic characters.
Regular expressions must use the standard Go syntax as described in the regexp package. (https://code.google.com/p/re2/wiki/Syntax)
This feature requires the use of a CurlyRouter.
-Containers
+### Containers
A Container holds a collection of WebServices, Filters and a http.ServeMux for multiplexing http requests.
Using the statements "restful.Add(...) and restful.Filter(...)" will register WebServices and Filters to the Default Container.
@@ -47,7 +47,7 @@ You can create your own Container and create a new http.Server for that particul
container := restful.NewContainer()
server := &http.Server{Addr: ":8081", Handler: container}
-Filters
+### Filters
A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses.
You can use filters to perform generic logging, measurement, authentication, redirect, set response headers etc.
@@ -60,22 +60,21 @@ Use the following statement to pass the request,response pair to the next filter
chain.ProcessFilter(req, resp)
-Container Filters
+### Container Filters
These are processed before any registered WebService.
// install a (global) filter for the default container (processed before any webservice)
restful.Filter(globalLogging)
-WebService Filters
+### WebService Filters
These are processed before any Route of a WebService.
// install a webservice filter (processed before any route)
ws.Filter(webserviceLogging).Filter(measureTime)
-
-Route Filters
+### Route Filters
These are processed before calling the function associated with the Route.
@@ -84,7 +83,7 @@ These are processed before calling the function associated with the Route.
See the example https://github.com/emicklei/go-restful/blob/v3/examples/filters/restful-filters.go with full implementations.
-Response Encoding
+### Response Encoding
Two encodings are supported: gzip and deflate. To enable this for all responses:
@@ -95,20 +94,20 @@ Alternatively, you can create a Filter that performs the encoding and install it
See the example https://github.com/emicklei/go-restful/blob/v3/examples/encoding/restful-encoding-filter.go
-OPTIONS support
+### OPTIONS support
By installing a pre-defined container filter, your Webservice(s) can respond to the OPTIONS Http request.
Filter(OPTIONSFilter())
-CORS
+### CORS
By installing the filter of a CrossOriginResourceSharing (CORS), your WebService(s) can handle CORS requests.
cors := CrossOriginResourceSharing{ExposeHeaders: []string{"X-My-Header"}, CookiesAllowed: false, Container: DefaultContainer}
Filter(cors.Filter)
-Error Handling
+### Error Handling
Unexpected things happen. If a request cannot be processed because of a failure, your service needs to tell via the response what happened and why.
For this reason HTTP status codes exist and it is important to use the correct code in every exceptional situation.
@@ -137,11 +136,11 @@ The request does not have or has an unknown Accept Header set for this operation
The request does not have or has an unknown Content-Type Header set for this operation.
-ServiceError
+### ServiceError
In addition to setting the correct (error) Http status code, you can choose to write a ServiceError message on the response.
-Performance options
+### Performance options
This package has several options that affect the performance of your service. It is important to understand them and how you can change it.
@@ -156,30 +155,27 @@ Default value is true
If content encoding is enabled then the default strategy for getting new gzip/zlib writers and readers is to use a sync.Pool.
Because writers are expensive structures, performance is even more improved when using a preloaded cache. You can also inject your own implementation.
-Trouble shooting
+### Trouble shooting
This package has the means to produce detail logging of the complete Http request matching process and filter invocation.
Enabling this feature requires you to set an implementation of restful.StdLogger (e.g. log.Logger) instance such as:
restful.TraceLogger(log.New(os.Stdout, "[restful] ", log.LstdFlags|log.Lshortfile))
-Logging
+### Logging
The restful.SetLogger() method allows you to override the logger used by the package. By default restful
uses the standard library `log` package and logs to stdout. Different logging packages are supported as
long as they conform to `StdLogger` interface defined in the `log` sub-package, writing an adapter for your
preferred package is simple.
-Resources
+### Resources
-[project]: https://github.com/emicklei/go-restful
+(c) 2012-2025, http://ernestmicklei.com. MIT License
+[project]: https://github.com/emicklei/go-restful
[examples]: https://github.com/emicklei/go-restful/blob/master/examples
-
-[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/
-
+[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/
[showcases]: https://github.com/emicklei/mora, https://github.com/emicklei/landskape
-
-(c) 2012-2015, http://ernestmicklei.com. MIT License
*/
package restful
diff --git a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
index d2fafb8a2..568ce16d7 100644
--- a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
+++ b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
@@ -1,56 +1,75 @@
-linters-settings:
- gocyclo:
- min-complexity: 45
- dupl:
- threshold: 200
- goconst:
- min-len: 2
- min-occurrences: 3
-
+version: "2"
linters:
- enable-all: true
+ default: all
disable:
- - recvcheck
- - unparam
- - lll
- - gochecknoinits
- - gochecknoglobals
+ - cyclop
+ - depguard
+ - errchkjson
+ - errorlint
+ - exhaustruct
+ - forcetypeassert
- funlen
- - godox
+ - gochecknoglobals
+ - gochecknoinits
- gocognit
- - whitespace
- - wsl
- - wrapcheck
- - testpackage
- - nlreturn
- - errorlint
- - nestif
- godot
- - gofumpt
+ - godox
+ - gosmopolitan
+ - inamedparam
+ - intrange # disabled while < go1.22
+ - ireturn
+ - lll
+ - musttag
+ - nestif
+ - nlreturn
+ - nonamedreturns
+ - noinlineerr
- paralleltest
- - tparallel
+ - recvcheck
+ - testpackage
- thelper
- - exhaustruct
+ - tparallel
+ - unparam
- varnamelen
- - gci
- - depguard
- - errchkjson
- - inamedparam
- - nonamedreturns
- - musttag
- - ireturn
- - forcetypeassert
- - cyclop
- # deprecated linters
- #- deadcode
- #- interfacer
- #- scopelint
- #- varcheck
- #- structcheck
- #- golint
- #- nosnakecase
- #- maligned
- #- goerr113
- #- ifshort
- #- gomnd
- #- exhaustivestruct
+ - whitespace
+ - wrapcheck
+ - wsl
+ - wsl_v5
+ settings:
+ dupl:
+ threshold: 200
+ goconst:
+ min-len: 2
+ min-occurrences: 3
+ gocyclo:
+ min-complexity: 45
+ exclusions:
+ generated: lax
+ presets:
+ - comments
+ - common-false-positives
+ - legacy
+ - std-error-handling
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
+formatters:
+ enable:
+ - gofmt
+ - goimports
+ exclusions:
+ generated: lax
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
+issues:
+ # Maximum issues count per one linter.
+ # Set to 0 to disable.
+ # Default: 50
+ max-issues-per-linter: 0
+ # Maximum count of issues with the same text.
+ # Set to 0 to disable.
+ # Default: 3
+ max-same-issues: 0
diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go
index a08cd68ac..afc8a7840 100644
--- a/vendor/github.com/go-openapi/jsonpointer/pointer.go
+++ b/vendor/github.com/go-openapi/jsonpointer/pointer.go
@@ -33,7 +33,7 @@ import (
"strconv"
"strings"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonname"
)
const (
@@ -56,181 +56,107 @@ type JSONSetable interface {
JSONSet(string, any) error
}
-// New creates a new json pointer for the given string
-func New(jsonPointerString string) (Pointer, error) {
-
- var p Pointer
- err := p.parse(jsonPointerString)
- return p, err
-
-}
-
// Pointer the json pointer reprsentation
type Pointer struct {
referenceTokens []string
}
-// "Constructor", parses the given string JSON pointer
-func (p *Pointer) parse(jsonPointerString string) error {
-
- var err error
+// New creates a new json pointer for the given string
+func New(jsonPointerString string) (Pointer, error) {
- if jsonPointerString != emptyPointer {
- if !strings.HasPrefix(jsonPointerString, pointerSeparator) {
- err = errors.Join(ErrInvalidStart, ErrPointer)
- } else {
- referenceTokens := strings.Split(jsonPointerString, pointerSeparator)
- p.referenceTokens = append(p.referenceTokens, referenceTokens[1:]...)
- }
- }
+ var p Pointer
+ err := p.parse(jsonPointerString)
+ return p, err
- return err
}
// Get uses the pointer to retrieve a value from a JSON document
func (p *Pointer) Get(document any) (any, reflect.Kind, error) {
- return p.get(document, swag.DefaultJSONNameProvider)
+ return p.get(document, jsonname.DefaultJSONNameProvider)
}
// Set uses the pointer to set a value from a JSON document
func (p *Pointer) Set(document any, value any) (any, error) {
- return document, p.set(document, value, swag.DefaultJSONNameProvider)
+ return document, p.set(document, value, jsonname.DefaultJSONNameProvider)
}
-// GetForToken gets a value for a json pointer token 1 level deep
-func GetForToken(document any, decodedToken string) (any, reflect.Kind, error) {
- return getSingleImpl(document, decodedToken, swag.DefaultJSONNameProvider)
-}
-
-// SetForToken gets a value for a json pointer token 1 level deep
-func SetForToken(document any, decodedToken string, value any) (any, error) {
- return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider)
-}
-
-func isNil(input any) bool {
- if input == nil {
- return true
+// DecodedTokens returns the decoded tokens
+func (p *Pointer) DecodedTokens() []string {
+ result := make([]string, 0, len(p.referenceTokens))
+ for _, t := range p.referenceTokens {
+ result = append(result, Unescape(t))
}
+ return result
+}
- kind := reflect.TypeOf(input).Kind()
- switch kind { //nolint:exhaustive
- case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan:
- return reflect.ValueOf(input).IsNil()
- default:
- return false
- }
+// IsEmpty returns true if this is an empty json pointer
+// this indicates that it points to the root document
+func (p *Pointer) IsEmpty() bool {
+ return len(p.referenceTokens) == 0
}
-func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvider) (any, reflect.Kind, error) {
- rValue := reflect.Indirect(reflect.ValueOf(node))
- kind := rValue.Kind()
- if isNil(node) {
- return nil, kind, fmt.Errorf("nil value has no field %q: %w", decodedToken, ErrPointer)
- }
+// Pointer to string representation function
+func (p *Pointer) String() string {
- switch typed := node.(type) {
- case JSONPointable:
- r, err := typed.JSONLookup(decodedToken)
- if err != nil {
- return nil, kind, err
- }
- return r, kind, nil
- case *any: // case of a pointer to interface, that is not resolved by reflect.Indirect
- return getSingleImpl(*typed, decodedToken, nameProvider)
+ if len(p.referenceTokens) == 0 {
+ return emptyPointer
}
- switch kind { //nolint:exhaustive
- case reflect.Struct:
- nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
- if !ok {
- return nil, kind, fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
- }
- fld := rValue.FieldByName(nm)
- return fld.Interface(), kind, nil
-
- case reflect.Map:
- kv := reflect.ValueOf(decodedToken)
- mv := rValue.MapIndex(kv)
+ pointerString := pointerSeparator + strings.Join(p.referenceTokens, pointerSeparator)
- if mv.IsValid() {
- return mv.Interface(), kind, nil
- }
- return nil, kind, fmt.Errorf("object has no key %q: %w", decodedToken, ErrPointer)
+ return pointerString
+}
- case reflect.Slice:
- tokenIndex, err := strconv.Atoi(decodedToken)
+func (p *Pointer) Offset(document string) (int64, error) {
+ dec := json.NewDecoder(strings.NewReader(document))
+ var offset int64
+ for _, ttk := range p.DecodedTokens() {
+ tk, err := dec.Token()
if err != nil {
- return nil, kind, err
+ return 0, err
}
- sLength := rValue.Len()
- if tokenIndex < 0 || tokenIndex >= sLength {
- return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength-1, tokenIndex, ErrPointer)
+ switch tk := tk.(type) {
+ case json.Delim:
+ switch tk {
+ case '{':
+ offset, err = offsetSingleObject(dec, ttk)
+ if err != nil {
+ return 0, err
+ }
+ case '[':
+ offset, err = offsetSingleArray(dec, ttk)
+ if err != nil {
+ return 0, err
+ }
+ default:
+ return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
+ }
+ default:
+ return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
}
-
- elem := rValue.Index(tokenIndex)
- return elem.Interface(), kind, nil
-
- default:
- return nil, kind, fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
-
+ return offset, nil
}
-func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameProvider) error {
- rValue := reflect.Indirect(reflect.ValueOf(node))
-
- if ns, ok := node.(JSONSetable); ok { // pointer impl
- return ns.JSONSet(decodedToken, data)
- }
-
- if rValue.Type().Implements(jsonSetableType) {
- return node.(JSONSetable).JSONSet(decodedToken, data)
- }
-
- switch rValue.Kind() { //nolint:exhaustive
- case reflect.Struct:
- nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
- if !ok {
- return fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
- }
- fld := rValue.FieldByName(nm)
- if fld.IsValid() {
- fld.Set(reflect.ValueOf(data))
- }
- return nil
-
- case reflect.Map:
- kv := reflect.ValueOf(decodedToken)
- rValue.SetMapIndex(kv, reflect.ValueOf(data))
- return nil
-
- case reflect.Slice:
- tokenIndex, err := strconv.Atoi(decodedToken)
- if err != nil {
- return err
- }
- sLength := rValue.Len()
- if tokenIndex < 0 || tokenIndex >= sLength {
- return fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength, tokenIndex, ErrPointer)
- }
+// "Constructor", parses the given string JSON pointer
+func (p *Pointer) parse(jsonPointerString string) error {
+ var err error
- elem := rValue.Index(tokenIndex)
- if !elem.CanSet() {
- return fmt.Errorf("can't set slice index %s to %v: %w", decodedToken, data, ErrPointer)
+ if jsonPointerString != emptyPointer {
+ if !strings.HasPrefix(jsonPointerString, pointerSeparator) {
+ err = errors.Join(ErrInvalidStart, ErrPointer)
+ } else {
+ referenceTokens := strings.Split(jsonPointerString, pointerSeparator)
+ p.referenceTokens = append(p.referenceTokens, referenceTokens[1:]...)
}
- elem.Set(reflect.ValueOf(data))
- return nil
-
- default:
- return fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
+ return err
}
-func (p *Pointer) get(node any, nameProvider *swag.NameProvider) (any, reflect.Kind, error) {
-
+func (p *Pointer) get(node any, nameProvider *jsonname.NameProvider) (any, reflect.Kind, error) {
if nameProvider == nil {
- nameProvider = swag.DefaultJSONNameProvider
+ nameProvider = jsonname.DefaultJSONNameProvider
}
kind := reflect.Invalid
@@ -256,7 +182,7 @@ func (p *Pointer) get(node any, nameProvider *swag.NameProvider) (any, reflect.K
return node, kind, nil
}
-func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
+func (p *Pointer) set(node, data any, nameProvider *jsonname.NameProvider) error {
knd := reflect.ValueOf(node).Kind()
if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array {
@@ -267,7 +193,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
}
if nameProvider == nil {
- nameProvider = swag.DefaultJSONNameProvider
+ nameProvider = jsonname.DefaultJSONNameProvider
}
// Full document when empty
@@ -285,6 +211,11 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
return setSingleImpl(node, data, decodedToken, nameProvider)
}
+ // Check for nil during traversal
+ if isNil(node) {
+ return fmt.Errorf("cannot traverse through nil value at %q: %w", decodedToken, ErrPointer)
+ }
+
rValue := reflect.Indirect(reflect.ValueOf(node))
kind := rValue.Kind()
@@ -348,68 +279,142 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
default:
return fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
-
}
return nil
}
-// DecodedTokens returns the decoded tokens
-func (p *Pointer) DecodedTokens() []string {
- result := make([]string, 0, len(p.referenceTokens))
- for _, t := range p.referenceTokens {
- result = append(result, Unescape(t))
+func isNil(input any) bool {
+ if input == nil {
+ return true
+ }
+
+ kind := reflect.TypeOf(input).Kind()
+ switch kind { //nolint:exhaustive
+ case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan:
+ return reflect.ValueOf(input).IsNil()
+ default:
+ return false
}
- return result
}
-// IsEmpty returns true if this is an empty json pointer
-// this indicates that it points to the root document
-func (p *Pointer) IsEmpty() bool {
- return len(p.referenceTokens) == 0
+// GetForToken gets a value for a json pointer token 1 level deep
+func GetForToken(document any, decodedToken string) (any, reflect.Kind, error) {
+ return getSingleImpl(document, decodedToken, jsonname.DefaultJSONNameProvider)
}
-// Pointer to string representation function
-func (p *Pointer) String() string {
+// SetForToken gets a value for a json pointer token 1 level deep
+func SetForToken(document any, decodedToken string, value any) (any, error) {
+ return document, setSingleImpl(document, value, decodedToken, jsonname.DefaultJSONNameProvider)
+}
- if len(p.referenceTokens) == 0 {
- return emptyPointer
+func getSingleImpl(node any, decodedToken string, nameProvider *jsonname.NameProvider) (any, reflect.Kind, error) {
+ rValue := reflect.Indirect(reflect.ValueOf(node))
+ kind := rValue.Kind()
+ if isNil(node) {
+ return nil, kind, fmt.Errorf("nil value has no field %q: %w", decodedToken, ErrPointer)
}
- pointerString := pointerSeparator + strings.Join(p.referenceTokens, pointerSeparator)
+ switch typed := node.(type) {
+ case JSONPointable:
+ r, err := typed.JSONLookup(decodedToken)
+ if err != nil {
+ return nil, kind, err
+ }
+ return r, kind, nil
+ case *any: // case of a pointer to interface, that is not resolved by reflect.Indirect
+ return getSingleImpl(*typed, decodedToken, nameProvider)
+ }
- return pointerString
+ switch kind { //nolint:exhaustive
+ case reflect.Struct:
+ nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
+ if !ok {
+ return nil, kind, fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
+ }
+ fld := rValue.FieldByName(nm)
+ return fld.Interface(), kind, nil
+
+ case reflect.Map:
+ kv := reflect.ValueOf(decodedToken)
+ mv := rValue.MapIndex(kv)
+
+ if mv.IsValid() {
+ return mv.Interface(), kind, nil
+ }
+ return nil, kind, fmt.Errorf("object has no key %q: %w", decodedToken, ErrPointer)
+
+ case reflect.Slice:
+ tokenIndex, err := strconv.Atoi(decodedToken)
+ if err != nil {
+ return nil, kind, err
+ }
+ sLength := rValue.Len()
+ if tokenIndex < 0 || tokenIndex >= sLength {
+ return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength-1, tokenIndex, ErrPointer)
+ }
+
+ elem := rValue.Index(tokenIndex)
+ return elem.Interface(), kind, nil
+
+ default:
+ return nil, kind, fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
+ }
}
-func (p *Pointer) Offset(document string) (int64, error) {
- dec := json.NewDecoder(strings.NewReader(document))
- var offset int64
- for _, ttk := range p.DecodedTokens() {
- tk, err := dec.Token()
+func setSingleImpl(node, data any, decodedToken string, nameProvider *jsonname.NameProvider) error {
+ rValue := reflect.Indirect(reflect.ValueOf(node))
+
+ // Check for nil to prevent panic when calling rValue.Type()
+ if isNil(node) {
+ return fmt.Errorf("cannot set field %q on nil value: %w", decodedToken, ErrPointer)
+ }
+
+ if ns, ok := node.(JSONSetable); ok { // pointer impl
+ return ns.JSONSet(decodedToken, data)
+ }
+
+ if rValue.Type().Implements(jsonSetableType) {
+ return node.(JSONSetable).JSONSet(decodedToken, data)
+ }
+
+ switch rValue.Kind() { //nolint:exhaustive
+ case reflect.Struct:
+ nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
+ if !ok {
+ return fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
+ }
+ fld := rValue.FieldByName(nm)
+ if fld.IsValid() {
+ fld.Set(reflect.ValueOf(data))
+ }
+ return nil
+
+ case reflect.Map:
+ kv := reflect.ValueOf(decodedToken)
+ rValue.SetMapIndex(kv, reflect.ValueOf(data))
+ return nil
+
+ case reflect.Slice:
+ tokenIndex, err := strconv.Atoi(decodedToken)
if err != nil {
- return 0, err
+ return err
}
- switch tk := tk.(type) {
- case json.Delim:
- switch tk {
- case '{':
- offset, err = offsetSingleObject(dec, ttk)
- if err != nil {
- return 0, err
- }
- case '[':
- offset, err = offsetSingleArray(dec, ttk)
- if err != nil {
- return 0, err
- }
- default:
- return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
- }
- default:
- return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
+ sLength := rValue.Len()
+ if tokenIndex < 0 || tokenIndex >= sLength {
+ return fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength, tokenIndex, ErrPointer)
}
+
+ elem := rValue.Index(tokenIndex)
+ if !elem.CanSet() {
+ return fmt.Errorf("can't set slice index %s to %v: %w", decodedToken, data, ErrPointer)
+ }
+ elem.Set(reflect.ValueOf(data))
+ return nil
+
+ default:
+ return fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
- return offset, nil
}
func offsetSingleObject(dec *json.Decoder, decodedToken string) (int64, error) {
diff --git a/vendor/github.com/go-openapi/jsonreference/.golangci.yml b/vendor/github.com/go-openapi/jsonreference/.golangci.yml
index 22f8d21cc..568ce16d7 100644
--- a/vendor/github.com/go-openapi/jsonreference/.golangci.yml
+++ b/vendor/github.com/go-openapi/jsonreference/.golangci.yml
@@ -1,61 +1,75 @@
-linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
- gocyclo:
- min-complexity: 45
- maligned:
- suggest-new: true
- dupl:
- threshold: 200
- goconst:
- min-len: 2
- min-occurrences: 3
-
+version: "2"
linters:
- enable-all: true
+ default: all
disable:
- - maligned
- - unparam
- - lll
- - gochecknoinits
- - gochecknoglobals
+ - cyclop
+ - depguard
+ - errchkjson
+ - errorlint
+ - exhaustruct
+ - forcetypeassert
- funlen
- - godox
+ - gochecknoglobals
+ - gochecknoinits
- gocognit
- - whitespace
- - wsl
- - wrapcheck
- - testpackage
- - nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- - errorlint
- - nestif
- godot
- - gofumpt
+ - godox
+ - gosmopolitan
+ - inamedparam
+ - intrange # disabled while < go1.22
+ - ireturn
+ - lll
+ - musttag
+ - nestif
+ - nlreturn
+ - nonamedreturns
+ - noinlineerr
- paralleltest
- - tparallel
+ - recvcheck
+ - testpackage
- thelper
- - ifshort
- - exhaustruct
+ - tparallel
+ - unparam
- varnamelen
- - gci
- - depguard
- - errchkjson
- - inamedparam
- - nonamedreturns
- - musttag
- - ireturn
- - forcetypeassert
- - cyclop
- # deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
+ - whitespace
+ - wrapcheck
+ - wsl
+ - wsl_v5
+ settings:
+ dupl:
+ threshold: 200
+ goconst:
+ min-len: 2
+ min-occurrences: 3
+ gocyclo:
+ min-complexity: 45
+ exclusions:
+ generated: lax
+ presets:
+ - comments
+ - common-false-positives
+ - legacy
+ - std-error-handling
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
+formatters:
+ enable:
+ - gofmt
+ - goimports
+ exclusions:
+ generated: lax
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
+issues:
+ # Maximum issues count per one linter.
+ # Set to 0 to disable.
+ # Default: 50
+ max-issues-per-linter: 0
+ # Maximum count of issues with the same text.
+ # Set to 0 to disable.
+ # Default: 3
+ max-same-issues: 0
diff --git a/vendor/github.com/go-openapi/jsonreference/reference.go b/vendor/github.com/go-openapi/jsonreference/reference.go
index cfdef03e5..6a1fed5df 100644
--- a/vendor/github.com/go-openapi/jsonreference/reference.go
+++ b/vendor/github.com/go-openapi/jsonreference/reference.go
@@ -38,13 +38,25 @@ const (
fragmentRune = `#`
)
+var ErrChildURL = errors.New("child url is nil")
+
+// Ref represents a json reference object
+type Ref struct {
+ referenceURL *url.URL
+ referencePointer jsonpointer.Pointer
+
+ HasFullURL bool
+ HasURLPathOnly bool
+ HasFragmentOnly bool
+ HasFileScheme bool
+ HasFullFilePath bool
+}
+
// New creates a new reference for the given string
func New(jsonReferenceString string) (Ref, error) {
-
var r Ref
err := r.parse(jsonReferenceString)
return r, err
-
}
// MustCreateRef parses the ref string and panics when it's invalid.
@@ -54,19 +66,8 @@ func MustCreateRef(ref string) Ref {
if err != nil {
panic(err)
}
- return r
-}
-// Ref represents a json reference object
-type Ref struct {
- referenceURL *url.URL
- referencePointer jsonpointer.Pointer
-
- HasFullURL bool
- HasURLPathOnly bool
- HasFragmentOnly bool
- HasFileScheme bool
- HasFullFilePath bool
+ return r
}
// GetURL gets the URL for this reference
@@ -81,7 +82,6 @@ func (r *Ref) GetPointer() *jsonpointer.Pointer {
// String returns the best version of the url for this reference
func (r *Ref) String() string {
-
if r.referenceURL != nil {
return r.referenceURL.String()
}
@@ -106,9 +106,27 @@ func (r *Ref) IsCanonical() bool {
return (r.HasFileScheme && r.HasFullFilePath) || (!r.HasFileScheme && r.HasFullURL)
}
+// Inherits creates a new reference from a parent and a child
+// If the child cannot inherit from the parent, an error is returned
+func (r *Ref) Inherits(child Ref) (*Ref, error) {
+ childURL := child.GetURL()
+ parentURL := r.GetURL()
+ if childURL == nil {
+ return nil, ErrChildURL
+ }
+ if parentURL == nil {
+ return &child, nil
+ }
+
+ ref, err := New(parentURL.ResolveReference(childURL).String())
+ if err != nil {
+ return nil, err
+ }
+ return &ref, nil
+}
+
// "Constructor", parses the given string JSON reference
func (r *Ref) parse(jsonReferenceString string) error {
-
parsed, err := url.Parse(jsonReferenceString)
if err != nil {
return err
@@ -137,22 +155,3 @@ func (r *Ref) parse(jsonReferenceString string) error {
return nil
}
-
-// Inherits creates a new reference from a parent and a child
-// If the child cannot inherit from the parent, an error is returned
-func (r *Ref) Inherits(child Ref) (*Ref, error) {
- childURL := child.GetURL()
- parentURL := r.GetURL()
- if childURL == nil {
- return nil, errors.New("child url is nil")
- }
- if parentURL == nil {
- return &child, nil
- }
-
- ref, err := New(parentURL.ResolveReference(childURL).String())
- if err != nil {
- return nil, err
- }
- return &ref, nil
-}
diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml
index d2fafb8a2..66eac0df8 100644
--- a/vendor/github.com/go-openapi/swag/.golangci.yml
+++ b/vendor/github.com/go-openapi/swag/.golangci.yml
@@ -1,56 +1,76 @@
-linters-settings:
- gocyclo:
- min-complexity: 45
- dupl:
- threshold: 200
- goconst:
- min-len: 2
- min-occurrences: 3
-
+version: "2"
linters:
- enable-all: true
+ default: all
disable:
- - recvcheck
- - unparam
- - lll
- - gochecknoinits
- - gochecknoglobals
+ - cyclop
+ - depguard
+ - errchkjson
+ - errorlint
+ - exhaustruct
+ - forcetypeassert
- funlen
- - godox
+ - gochecknoglobals
+ - gochecknoinits
- gocognit
- - whitespace
- - wsl
- - wrapcheck
- - testpackage
- - nlreturn
- - errorlint
- - nestif
- godot
- - gofumpt
+ - godox
+ - gomoddirectives
+ - gosmopolitan
+ - inamedparam
+ - intrange # disabled while < go1.22
+ - ireturn
+ - lll
+ - musttag
+ - nestif
+ - nlreturn
+ - nonamedreturns
+ - noinlineerr
- paralleltest
- - tparallel
+ - recvcheck
+ - testpackage
- thelper
- - exhaustruct
+ - tparallel
+ - unparam
- varnamelen
- - gci
- - depguard
- - errchkjson
- - inamedparam
- - nonamedreturns
- - musttag
- - ireturn
- - forcetypeassert
- - cyclop
- # deprecated linters
- #- deadcode
- #- interfacer
- #- scopelint
- #- varcheck
- #- structcheck
- #- golint
- #- nosnakecase
- #- maligned
- #- goerr113
- #- ifshort
- #- gomnd
- #- exhaustivestruct
+ - whitespace
+ - wrapcheck
+ - wsl
+ - wsl_v5
+ settings:
+ dupl:
+ threshold: 200
+ goconst:
+ min-len: 2
+ min-occurrences: 3
+ gocyclo:
+ min-complexity: 45
+ exclusions:
+ generated: lax
+ presets:
+ - comments
+ - common-false-positives
+ - legacy
+ - std-error-handling
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
+formatters:
+ enable:
+ - gofmt
+ - goimports
+ exclusions:
+ generated: lax
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
+issues:
+ # Maximum issues count per one linter.
+ # Set to 0 to disable.
+ # Default: 50
+ max-issues-per-linter: 0
+ # Maximum count of issues with the same text.
+ # Set to 0 to disable.
+ # Default: 3
+ max-same-issues: 0
diff --git a/vendor/github.com/go-openapi/swag/BENCHMARK.md b/vendor/github.com/go-openapi/swag/BENCHMARK.md
deleted file mode 100644
index e7f28ed6b..000000000
--- a/vendor/github.com/go-openapi/swag/BENCHMARK.md
+++ /dev/null
@@ -1,52 +0,0 @@
-# Benchmarks
-
-## Name mangling utilities
-
-```bash
-go test -bench XXX -run XXX -benchtime 30s
-```
-
-### Benchmarks at b3e7a5386f996177e4808f11acb2aa93a0f660df
-
-```
-goos: linux
-goarch: amd64
-pkg: github.com/go-openapi/swag
-cpu: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
-BenchmarkToXXXName/ToGoName-4 862623 44101 ns/op 10450 B/op 732 allocs/op
-BenchmarkToXXXName/ToVarName-4 853656 40728 ns/op 10468 B/op 734 allocs/op
-BenchmarkToXXXName/ToFileName-4 1268312 27813 ns/op 9785 B/op 617 allocs/op
-BenchmarkToXXXName/ToCommandName-4 1276322 27903 ns/op 9785 B/op 617 allocs/op
-BenchmarkToXXXName/ToHumanNameLower-4 895334 40354 ns/op 10472 B/op 731 allocs/op
-BenchmarkToXXXName/ToHumanNameTitle-4 882441 40678 ns/op 10566 B/op 749 allocs/op
-```
-
-### Benchmarks after PR #79
-
-~ x10 performance improvement and ~ /100 memory allocations.
-
-```
-goos: linux
-goarch: amd64
-pkg: github.com/go-openapi/swag
-cpu: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
-BenchmarkToXXXName/ToGoName-4 9595830 3991 ns/op 42 B/op 5 allocs/op
-BenchmarkToXXXName/ToVarName-4 9194276 3984 ns/op 62 B/op 7 allocs/op
-BenchmarkToXXXName/ToFileName-4 17002711 2123 ns/op 147 B/op 7 allocs/op
-BenchmarkToXXXName/ToCommandName-4 16772926 2111 ns/op 147 B/op 7 allocs/op
-BenchmarkToXXXName/ToHumanNameLower-4 9788331 3749 ns/op 92 B/op 6 allocs/op
-BenchmarkToXXXName/ToHumanNameTitle-4 9188260 3941 ns/op 104 B/op 6 allocs/op
-```
-
-```
-goos: linux
-goarch: amd64
-pkg: github.com/go-openapi/swag
-cpu: AMD Ryzen 7 5800X 8-Core Processor
-BenchmarkToXXXName/ToGoName-16 18527378 1972 ns/op 42 B/op 5 allocs/op
-BenchmarkToXXXName/ToVarName-16 15552692 2093 ns/op 62 B/op 7 allocs/op
-BenchmarkToXXXName/ToFileName-16 32161176 1117 ns/op 147 B/op 7 allocs/op
-BenchmarkToXXXName/ToCommandName-16 32256634 1137 ns/op 147 B/op 7 allocs/op
-BenchmarkToXXXName/ToHumanNameLower-16 18599661 1946 ns/op 92 B/op 6 allocs/op
-BenchmarkToXXXName/ToHumanNameTitle-16 17581353 2054 ns/op 105 B/op 6 allocs/op
-```
diff --git a/vendor/github.com/go-openapi/swag/README.md b/vendor/github.com/go-openapi/swag/README.md
index a72922299..1efb7a342 100644
--- a/vendor/github.com/go-openapi/swag/README.md
+++ b/vendor/github.com/go-openapi/swag/README.md
@@ -1,23 +1,171 @@
# Swag [](https://github.com/go-openapi/swag/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/swag)
[](https://slackin.goswagger.io)
-[](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE)
+[](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE)
[](https://pkg.go.dev/github.com/go-openapi/swag)
[](https://goreportcard.com/report/github.com/go-openapi/swag)
-Contains a bunch of helper functions for go-openapi and go-swagger projects.
+Package `swag` contains a bunch of helper functions for go-openapi and go-swagger projects.
You may also use it standalone for your projects.
-* convert between value and pointers for builtin types
-* convert from string to builtin types (wraps strconv)
-* fast json concatenation
-* search in path
-* load from file or http
-* name mangling
+> `swag` is one of the foundational building blocks of the go-openapi initiative.
+>
+> Most repositories in `github.com/go-openapi/...` depend on it in some way.
+> So does the CLI tool `github.com/go-swagger/go-swagger`,
+> and the code generated by this tool.
+## Contents
-This repo has only few dependencies outside of the standard library:
+`go-openapi/swag` now exposes a collection of relatively independent modules.
+
+Here is what is inside:
+
+* Module `cmdutils`
+
+ * [x] utilities to work with CLIs
+
+* Module `conv`
+
+ * [x] convert between values and pointers for any types
+ * [x] convert from string to builtin types (wraps `strconv`)
+ * [x] require `./typeutils` (test dependency)
+
+* Module `fileutils`
+
+ * [x] file upload type
+ * [x] search in path (deprecated)
+
+* Module `jsonname`
+
+ * [x] infer JSON names from go properties
+
+* Module `jsonutils`
+
+ * [x] fast json concatenation
+ * [x] read and write JSON from and to dynamic go data structures
+ * [x] require `github.com/mailru/easyjson`
+
+* Module `loading`
+
+ * [x] load from file or http
+ * [x] require `./yamlutils`
+
+* Module `mangling`
+
+ * [x] name mangling for go
+
+* Module `netutils`
+
+ * [x] host, port from address
+
+* Module `stringutils`
+
+ * [x] search in slice (with case-insensitive)
+ * [x] split/join query parameters as arrays
+
+* Module `typeutils`
+
+ * [x] check the zero value for any type
+
+* Module `yamlutils`
+
+ * [x] converting YAML to JSON
+ * [x] loading YAML into a dynamic YAML document
+ * [x] require `./jsonutils`
+ * [x] require `github.com/mailru/easyjson`
+ * [x] require `gopkg.in/yaml.v3`
+
+---
+
+The root module `github.com/go-openapi/swag` at the repo level maintains a few
+dependencies outside of the standard library:
* YAML utilities depend on `gopkg.in/yaml.v3`
-* `github.com/mailru/easyjson v0.7.7`
+* JSON utilities `github.com/mailru/easyjson`
+
+This is not necessarily the case for all sub-modules.
+
+## Release notes
+
+### v0.25.0 [draft, unreleased]
+
+* v0.25.0 will remove the dependency to `mailru/easyjson` by default.
+* users of JSON or YAML utility who want to use `easyjson` as their
+ prefered JSON marshaler will be able to do so by registering it
+ at runtime.
+
+### v0.24.0
+
+With this release, we have largely modernized the API of `swag`:
+
+* The traditional `swag` API is still supported: code that imports `swag` will still
+ compile and work the same.
+* A deprecation notice is published to encourage consumers of this library to adopt
+ the newer API
+* **Deprecation notice**
+ * configuration through global variables is now deprecated, in favor of options passed as parameters
+ * all helper functions are moved to more specialized packages, which are exposed as
+ go modules. Importing such a module would reduce the footprint of dependencies.
+ * _all_ functions, variables, constants exposed by the deprecated API have now moved, so
+ that consumers of the new API no longer need to import github.com/go-openapi/swag, but
+ should import the desired sub-module(s).
+
+**New with this release**:
+
+* [x] type converters and pointer to value helpers now support generic types
+* [x] name mangling now support pluralized initialisms (issue #46)
+ Strings like "contact IDs" are now recognized as such a plural form and mangled as a linter would expect.
+* [x] performance: small improvements to reduce the overhead of convert/format wrappers (see issues #110, or PR #108)
+* [x] performance: name mangling utilities run ~ 10% faster (PR #115)
+
+---
+
+Moving forward, no additional feature will be added to the `swag` API directly.
+
+However, child modules will continue to evolve or some new ones may be added in the future.
+
+
+#### Note to contributors
+
+The mono-repo structure comes with some unavoidable extra pains...
+
+* Testing
+
+> The usual `go test ./...` command, run from the root of this repo won't work any longer to test all submodules.
+>
+> Each module constitutes an independant unit of test. So you have to run `go test` inside each module.
+> Or you may take a look at how this is achieved by CI
+> [here] https://github.com/go-openapi/swag/blob/master/.github/workflows/go-test.yml).
+>
+> There are also some alternative tricks using `go work`, for local development, if you feel comfortable with
+> go workspaces. Perhaps some day, we'll have a `go work test` to run all tests without any hack.
+
+* Releasing
+
+> Each module follows its own independant module versioning.
+>
+> So you have tags like `mangling/v0.24.0`, `fileutils/v0.24.0` etc that are used by `go mod` and `go get`
+> to refer to the tagged version of each module specifically.
+>
+> This means we may release patches etc to each module independently.
+>
+> We'd like to adopt the rule that modules in this repo would only differ by a patch version
+> (e.g. `v0.24.5` vs `v0.24.3`), and we'll level all modules whenever a minor version is introduced.
+>
+> A script in `./hack` is provided to tag all modules in one go at the same level in one go.
+
+## Todos, suggestions and plans
+
+All kinds of contributions are welcome.
+
+A few ideas:
+
+* [ ] Complete the split of dependencies to isolate easyjson from the rest
+* [ ] Improve mangling utilities (improve readability, support for capitalized words,
+ better word substitution for non-letter symbols...)
+* [ ] Move back to this common shared pot a few of the technical features introduced by go-swagger independently
+ (e.g. mangle go package names, search package with go modules support, ...)
+* [ ] Apply a similar mono-repo approach to go-openapi/strfmt which suffer from similar woes: bloated API,
+ imposed dependency to some database driver.
+
diff --git a/vendor/github.com/coreos/go-semver/LICENSE b/vendor/github.com/go-openapi/swag/cmdutils/LICENSE
similarity index 100%
rename from vendor/github.com/coreos/go-semver/LICENSE
rename to vendor/github.com/go-openapi/swag/cmdutils/LICENSE
diff --git a/vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go b/vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go
new file mode 100644
index 000000000..bc01ec2bb
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go
@@ -0,0 +1,24 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cmdutils
+
+// CommandLineOptionsGroup represents a group of user-defined command line options.
+//
+// This is for instance used to configure command line arguments in API servers generated by go-swagger.
+type CommandLineOptionsGroup struct {
+ ShortDescription string
+ LongDescription string
+ Options interface{}
+}
diff --git a/vendor/github.com/go-openapi/swag/cmdutils/doc.go b/vendor/github.com/go-openapi/swag/cmdutils/doc.go
new file mode 100644
index 000000000..63ac1d17e
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/cmdutils/doc.go
@@ -0,0 +1,16 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package cmdutils brings helpers for CLIs produced by go-openapi
+package cmdutils
diff --git a/vendor/github.com/go-openapi/swag/cmdutils_iface.go b/vendor/github.com/go-openapi/swag/cmdutils_iface.go
new file mode 100644
index 000000000..1eaf36f15
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/cmdutils_iface.go
@@ -0,0 +1,22 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import "github.com/go-openapi/swag/cmdutils"
+
+// CommandLineOptionsGroup represents a group of user-defined command line options.
+//
+// Deprecated: use [cmdutils.CommandLineOptionsGroup] instead.
+type CommandLineOptionsGroup = cmdutils.CommandLineOptionsGroup
diff --git a/vendor/github.com/google/gofuzz/LICENSE b/vendor/github.com/go-openapi/swag/conv/LICENSE
similarity index 100%
rename from vendor/github.com/google/gofuzz/LICENSE
rename to vendor/github.com/go-openapi/swag/conv/LICENSE
diff --git a/vendor/github.com/go-openapi/swag/conv/convert.go b/vendor/github.com/go-openapi/swag/conv/convert.go
new file mode 100644
index 000000000..b9b869854
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/convert.go
@@ -0,0 +1,172 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package conv
+
+import (
+ "math"
+ "strconv"
+ "strings"
+)
+
+// same as ECMA Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER
+const (
+ maxJSONFloat = float64(1<<53 - 1) // 9007199254740991.0 2^53 - 1
+ minJSONFloat = -float64(1<<53 - 1) //-9007199254740991.0 -2^53 - 1
+ epsilon float64 = 1e-9
+)
+
+// IsFloat64AJSONInteger allows for integers [-2^53, 2^53-1] inclusive.
+func IsFloat64AJSONInteger(f float64) bool {
+ if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat {
+ return false
+ }
+ rounded := math.Round(f)
+ if f == rounded {
+ return true
+ }
+ if rounded == 0 { // f = 0.0 exited above
+ return false
+ }
+
+ diff := math.Abs(f - rounded)
+ if diff == 0 {
+ return true
+ }
+
+ // relative error Abs{f - Round(f)) / Round(f)} < ε ; Round(f)
+ return diff < epsilon*math.Abs(rounded)
+}
+
+// ConvertFloat turns a string into a float numerical value.
+func ConvertFloat[T Float](str string) (T, error) {
+ var v T
+ f, err := strconv.ParseFloat(str, bitsize(v))
+ if err != nil {
+ return 0, err
+ }
+
+ return T(f), nil
+}
+
+// ConvertInteger turns a string into a signed integer.
+func ConvertInteger[T Signed](str string) (T, error) {
+ var v T
+ f, err := strconv.ParseInt(str, 10, bitsize(v))
+ if err != nil {
+ return 0, err
+ }
+
+ return T(f), nil
+}
+
+// ConvertUinteger turns a string into an unsigned integer.
+func ConvertUinteger[T Unsigned](str string) (T, error) {
+ var v T
+ f, err := strconv.ParseUint(str, 10, bitsize(v))
+ if err != nil {
+ return 0, err
+ }
+
+ return T(f), nil
+}
+
+// ConvertBool turns a string into a boolean.
+//
+// It supports a few more "true" strings than [strconv.ParseBool]:
+//
+// - it is not case sensitive ("trUe" or "FalsE" work)
+// - "ok", "yes", "y", "on", "selected", "checked", "enabled" are all true
+// - everything that is not true is false: there is never an actual error returned
+func ConvertBool(str string) (bool, error) {
+ switch strings.ToLower(str) {
+ case "true",
+ "1",
+ "yes",
+ "ok",
+ "y",
+ "on",
+ "selected",
+ "checked",
+ "t",
+ "enabled":
+ return true, nil
+ default:
+ return false, nil
+ }
+}
+
+// ConvertFloat32 turns a string into a float32.
+func ConvertFloat32(str string) (float32, error) { return ConvertFloat[float32](str) }
+
+// ConvertFloat64 turns a string into a float64
+func ConvertFloat64(str string) (float64, error) { return ConvertFloat[float64](str) }
+
+// ConvertInt8 turns a string into an int8
+func ConvertInt8(str string) (int8, error) { return ConvertInteger[int8](str) }
+
+// ConvertInt16 turns a string into an int16
+func ConvertInt16(str string) (int16, error) {
+ i, err := strconv.ParseInt(str, 10, 16)
+ if err != nil {
+ return 0, err
+ }
+ return int16(i), nil
+}
+
+// ConvertInt32 turns a string into an int32
+func ConvertInt32(str string) (int32, error) {
+ i, err := strconv.ParseInt(str, 10, 32)
+ if err != nil {
+ return 0, err
+ }
+ return int32(i), nil
+}
+
+// ConvertInt64 turns a string into an int64
+func ConvertInt64(str string) (int64, error) {
+ return strconv.ParseInt(str, 10, 64)
+}
+
+// ConvertUint8 turns a string into an uint8
+func ConvertUint8(str string) (uint8, error) {
+ i, err := strconv.ParseUint(str, 10, 8)
+ if err != nil {
+ return 0, err
+ }
+ return uint8(i), nil
+}
+
+// ConvertUint16 turns a string into an uint16
+func ConvertUint16(str string) (uint16, error) {
+ i, err := strconv.ParseUint(str, 10, 16)
+ if err != nil {
+ return 0, err
+ }
+ return uint16(i), nil
+}
+
+// ConvertUint32 turns a string into an uint32
+func ConvertUint32(str string) (uint32, error) {
+ i, err := strconv.ParseUint(str, 10, 32)
+ if err != nil {
+ return 0, err
+ }
+ return uint32(i), nil
+}
+
+// ConvertUint64 turns a string into an uint64
+func ConvertUint64(str string) (uint64, error) {
+ return strconv.ParseUint(str, 10, 64)
+}
diff --git a/vendor/github.com/go-openapi/swag/conv/convert_types.go b/vendor/github.com/go-openapi/swag/conv/convert_types.go
new file mode 100644
index 000000000..423e8663f
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/convert_types.go
@@ -0,0 +1,79 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package conv
+
+// The original version of this file, eons ago, was taken from the aws go sdk
+
+// Pointer returns a pointer to the value passed in.
+func Pointer[T any](v T) *T {
+ return &v
+}
+
+// Value returns a shallow copy of the value of the pointer passed in.
+//
+// If the pointer is nil, the returned value is the zero value.
+func Value[T any](v *T) T {
+ if v != nil {
+ return *v
+ }
+
+ var zero T
+ return zero
+}
+
+// PointerSlice converts a slice of values into a slice of pointers.
+func PointerSlice[T any](src []T) []*T {
+ dst := make([]*T, len(src))
+ for i := 0; i < len(src); i++ {
+ dst[i] = &(src[i])
+ }
+ return dst
+}
+
+// ValueSlice converts a slice of pointers into a slice of values.
+//
+// nil elements are zero values.
+func ValueSlice[T any](src []*T) []T {
+ dst := make([]T, len(src))
+ for i := 0; i < len(src); i++ {
+ if src[i] != nil {
+ dst[i] = *(src[i])
+ }
+ }
+ return dst
+}
+
+// PointerMap converts a map of values into a map of pointers.
+func PointerMap[K comparable, T any](src map[K]T) map[K]*T {
+ dst := make(map[K]*T)
+ for k, val := range src {
+ v := val
+ dst[k] = &v
+ }
+ return dst
+}
+
+// ValueMap converts a map of pointers into a map of values.
+//
+// nil elements are skipped.
+func ValueMap[K comparable, T any](src map[K]*T) map[K]T {
+ dst := make(map[K]T)
+ for k, val := range src {
+ if val != nil {
+ dst[k] = *val
+ }
+ }
+ return dst
+}
diff --git a/vendor/github.com/go-openapi/swag/conv/doc.go b/vendor/github.com/go-openapi/swag/conv/doc.go
new file mode 100644
index 000000000..b02711f42
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/doc.go
@@ -0,0 +1,26 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package conv exposes utilities to convert types.
+//
+// The Convert and Format families of functions are essentially a shorthand to [strconv] functions,
+// using the decimal representation of numbers.
+//
+// Features:
+//
+// - from string representation to value ("Convert*") and reciprocally ("Format*")
+// - from pointer to value ([Value]) and reciprocally ([Pointer])
+// - from slice of values to slice of pointers ([PointerSlice]) and reciprocally ([ValueSlice])
+// - from map of values to map of pointers ([PointerMap]) and reciprocally ([ValueMap])
+package conv
diff --git a/vendor/github.com/go-openapi/swag/conv/format.go b/vendor/github.com/go-openapi/swag/conv/format.go
new file mode 100644
index 000000000..db7562a4a
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/format.go
@@ -0,0 +1,39 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package conv
+
+import (
+ "strconv"
+)
+
+// FormatInteger turns an integer type into a string.
+func FormatInteger[T Signed](value T) string {
+ return strconv.FormatInt(int64(value), 10)
+}
+
+// FormatUinteger turns an unsigned integer type into a string.
+func FormatUinteger[T Unsigned](value T) string {
+ return strconv.FormatUint(uint64(value), 10)
+}
+
+// FormatFloat turns a floating point numerical value into a string.
+func FormatFloat[T Float](value T) string {
+ return strconv.FormatFloat(float64(value), 'f', -1, bitsize(value))
+}
+
+// FormatBool turns a boolean into a string.
+func FormatBool(value bool) string {
+ return strconv.FormatBool(value)
+}
diff --git a/vendor/github.com/go-openapi/swag/conv/sizeof.go b/vendor/github.com/go-openapi/swag/conv/sizeof.go
new file mode 100644
index 000000000..646f8be9a
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/sizeof.go
@@ -0,0 +1,17 @@
+package conv
+
+import "unsafe"
+
+// bitsize returns the size in bits of a type.
+//
+// NOTE: [unsafe.SizeOf] simply returns the size in bytes of the value.
+// For primitive types T, the generic stencil is precompiled and this value
+// is resolved at compile time, resulting in an immediate call to [strconv.ParseFloat].
+//
+// We may leave up to the go compiler to simplify this function into a
+// constant value, which happens in practice at least for primitive types
+// (e.g. numerical types).
+func bitsize[T Numerical](value T) int {
+ const bitsPerByte = 8
+ return int(unsafe.Sizeof(value)) * bitsPerByte
+}
diff --git a/vendor/github.com/go-openapi/swag/conv/type_constraints.go b/vendor/github.com/go-openapi/swag/conv/type_constraints.go
new file mode 100644
index 000000000..3c6149836
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/type_constraints.go
@@ -0,0 +1,40 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package conv
+
+type (
+ // these type constraints are redefined after golang.org/x/exp/constraints,
+ // because importing that package causes an undesired go upgrade.
+
+ // Signed integer types, cf. [golang.org/x/exp/constraints.Signed]
+ Signed interface {
+ ~int | ~int8 | ~int16 | ~int32 | ~int64
+ }
+
+ // Unsigned integer types, cf. [golang.org/x/exp/constraints.Unsigned]
+ Unsigned interface {
+ ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
+ }
+
+ // Float numerical types, cf. [golang.org/x/exp/constraints.Float]
+ Float interface {
+ ~float32 | ~float64
+ }
+
+ // Numerical types
+ Numerical interface {
+ Signed | Unsigned | Float
+ }
+)
diff --git a/vendor/github.com/go-openapi/swag/conv_iface.go b/vendor/github.com/go-openapi/swag/conv_iface.go
new file mode 100644
index 000000000..9991acb65
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv_iface.go
@@ -0,0 +1,497 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import (
+ "time"
+
+ "github.com/go-openapi/swag/conv"
+)
+
+// IsFloat64AJSONInteger allows for integers [-2^53, 2^53-1] inclusive.
+//
+// Deprecated: use [conv.IsFloat64AJSONInteger] instead.
+func IsFloat64AJSONInteger(f float64) bool { return conv.IsFloat64AJSONInteger(f) }
+
+// ConvertBool turns a string into a boolean.
+//
+// Deprecated: use [conv.ConvertBool] instead.
+func ConvertBool(str string) (bool, error) { return conv.ConvertBool(str) }
+
+// ConvertFloat32 turns a string into a float32.
+//
+// Deprecated: use [conv.ConvertFloat32] instead. Alternatively, you may use the generic version [conv.ConvertFloat].
+func ConvertFloat32(str string) (float32, error) { return conv.ConvertFloat[float32](str) }
+
+// ConvertFloat64 turns a string into a float64.
+//
+// Deprecated: use [conv.ConvertFloat64] instead. Alternatively, you may use the generic version [conv.ConvertFloat].
+func ConvertFloat64(str string) (float64, error) { return conv.ConvertFloat[float64](str) }
+
+// ConvertInt8 turns a string into an int8.
+//
+// Deprecated: use [conv.ConvertInt8] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
+func ConvertInt8(str string) (int8, error) { return conv.ConvertInteger[int8](str) }
+
+// ConvertInt16 turns a string into an int16.
+//
+// Deprecated: use [conv.ConvertInt16] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
+func ConvertInt16(str string) (int16, error) { return conv.ConvertInteger[int16](str) }
+
+// ConvertInt32 turns a string into an int32.
+//
+// Deprecated: use [conv.ConvertInt32] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
+func ConvertInt32(str string) (int32, error) { return conv.ConvertInteger[int32](str) }
+
+// ConvertInt64 turns a string into an int64.
+//
+// Deprecated: use [conv.ConvertInt64] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
+func ConvertInt64(str string) (int64, error) { return conv.ConvertInteger[int64](str) }
+
+// ConvertUint8 turns a string into an uint8.
+//
+// Deprecated: use [conv.ConvertUint8] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
+func ConvertUint8(str string) (uint8, error) { return conv.ConvertUinteger[uint8](str) }
+
+// ConvertUint16 turns a string into an uint16.
+//
+// Deprecated: use [conv.ConvertUint16] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
+func ConvertUint16(str string) (uint16, error) { return conv.ConvertUinteger[uint16](str) }
+
+// ConvertUint32 turns a string into an uint32.
+//
+// Deprecated: use [conv.ConvertUint32] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
+func ConvertUint32(str string) (uint32, error) { return conv.ConvertUinteger[uint32](str) }
+
+// ConvertUint64 turns a string into an uint64.
+//
+// Deprecated: use [conv.ConvertUint64] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
+func ConvertUint64(str string) (uint64, error) { return conv.ConvertUinteger[uint64](str) }
+
+// FormatBool turns a boolean into a string.
+//
+// Deprecated: use [conv.FormatBool] instead.
+func FormatBool(value bool) string { return conv.FormatBool(value) }
+
+// FormatFloat32 turns a float32 into a string.
+//
+// Deprecated: use [conv.FormatFloat] instead.
+func FormatFloat32(value float32) string { return conv.FormatFloat(value) }
+
+// FormatFloat64 turns a float64 into a string.
+//
+// Deprecated: use [conv.FormatFloat] instead.
+func FormatFloat64(value float64) string { return conv.FormatFloat(value) }
+
+// FormatInt8 turns an int8 into a string.
+//
+// Deprecated: use [conv.FormatInteger] instead.
+func FormatInt8(value int8) string { return conv.FormatInteger(value) }
+
+// FormatInt16 turns an int16 into a string.
+//
+// Deprecated: use [conv.FormatInteger] instead.
+func FormatInt16(value int16) string { return conv.FormatInteger(value) }
+
+// FormatInt32 turns an int32 into a string
+//
+// Deprecated: use [conv.FormatInteger] instead.
+func FormatInt32(value int32) string { return conv.FormatInteger(value) }
+
+// FormatInt64 turns an int64 into a string.
+//
+// Deprecated: use [conv.FormatInteger] instead.
+func FormatInt64(value int64) string { return conv.FormatInteger(value) }
+
+// FormatUint8 turns an uint8 into a string.
+//
+// Deprecated: use [conv.FormatUinteger] instead.
+func FormatUint8(value uint8) string { return conv.FormatUinteger(value) }
+
+// FormatUint16 turns an uint16 into a string.
+//
+// Deprecated: use [conv.FormatUinteger] instead.
+func FormatUint16(value uint16) string { return conv.FormatUinteger(value) }
+
+// FormatUint32 turns an uint32 into a string.
+//
+// Deprecated: use [conv.FormatUinteger] instead.
+func FormatUint32(value uint32) string { return conv.FormatUinteger(value) }
+
+// FormatUint64 turns an uint64 into a string.
+//
+// Deprecated: use [conv.FormatUinteger] instead.
+func FormatUint64(value uint64) string { return conv.FormatUinteger(value) }
+
+// String turn a pointer to of the string value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func String(v string) *string { return conv.Pointer(v) }
+
+// StringValue turn the value of the string pointer passed in or
+// "" if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func StringValue(v *string) string { return conv.Value(v) }
+
+// StringSlice converts a slice of string values into a slice of string pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func StringSlice(src []string) []*string { return conv.PointerSlice(src) }
+
+// StringValueSlice converts a slice of string pointers into a slice of string values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func StringValueSlice(src []*string) []string { return conv.ValueSlice(src) }
+
+// StringMap converts a string map of string values into a string map of string pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func StringMap(src map[string]string) map[string]*string { return conv.PointerMap(src) }
+
+// StringValueMap converts a string map of string pointers into a string map of string values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func StringValueMap(src map[string]*string) map[string]string { return conv.ValueMap(src) }
+
+// Bool turn a pointer to of the bool value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Bool(v bool) *bool { return conv.Pointer(v) }
+
+// BoolValue turn the value of the bool pointer passed in or false if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func BoolValue(v *bool) bool { return conv.Value(v) }
+
+// BoolSlice converts a slice of bool values into a slice of bool pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func BoolSlice(src []bool) []*bool { return conv.PointerSlice(src) }
+
+// BoolValueSlice converts a slice of bool pointers into a slice of bool values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func BoolValueSlice(src []*bool) []bool { return conv.ValueSlice(src) }
+
+// BoolMap converts a string map of bool values into a string map of bool pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func BoolMap(src map[string]bool) map[string]*bool { return conv.PointerMap(src) }
+
+// BoolValueMap converts a string map of bool pointers into a string map of bool values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func BoolValueMap(src map[string]*bool) map[string]bool { return conv.ValueMap(src) }
+
+// Int turn a pointer to of the int value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Int(v int) *int { return conv.Pointer(v) }
+
+// IntValue turn the value of the int pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func IntValue(v *int) int { return conv.Value(v) }
+
+// IntSlice converts a slice of int values into a slice of int pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func IntSlice(src []int) []*int { return conv.PointerSlice(src) }
+
+// IntValueSlice converts a slice of int pointers into a slice of int values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func IntValueSlice(src []*int) []int { return conv.ValueSlice(src) }
+
+// IntMap converts a string map of int values into a string map of int pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func IntMap(src map[string]int) map[string]*int { return conv.PointerMap(src) }
+
+// IntValueMap converts a string map of int pointers into a string map of int values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func IntValueMap(src map[string]*int) map[string]int { return conv.ValueMap(src) }
+
+// Int32 turn a pointer to of the int32 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Int32(v int32) *int32 { return conv.Pointer(v) }
+
+// Int32Value turn the value of the int32 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Int32Value(v *int32) int32 { return conv.Value(v) }
+
+// Int32Slice converts a slice of int32 values into a slice of int32 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Int32Slice(src []int32) []*int32 { return conv.PointerSlice(src) }
+
+// Int32ValueSlice converts a slice of int32 pointers into a slice of int32 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Int32ValueSlice(src []*int32) []int32 { return conv.ValueSlice(src) }
+
+// Int32Map converts a string map of int32 values into a string map of int32 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Int32Map(src map[string]int32) map[string]*int32 { return conv.PointerMap(src) }
+
+// Int32ValueMap converts a string map of int32 pointers into a string map of int32 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Int32ValueMap(src map[string]*int32) map[string]int32 { return conv.ValueMap(src) }
+
+// Int64 turn a pointer to of the int64 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Int64(v int64) *int64 { return conv.Pointer(v) }
+
+// Int64Value turn the value of the int64 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Int64Value(v *int64) int64 { return conv.Value(v) }
+
+// Int64Slice converts a slice of int64 values into a slice of int64 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Int64Slice(src []int64) []*int64 { return conv.PointerSlice(src) }
+
+// Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Int64ValueSlice(src []*int64) []int64 { return conv.ValueSlice(src) }
+
+// Int64Map converts a string map of int64 values into a string map of int64 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Int64Map(src map[string]int64) map[string]*int64 { return conv.PointerMap(src) }
+
+// Int64ValueMap converts a string map of int64 pointers into a string map of int64 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Int64ValueMap(src map[string]*int64) map[string]int64 { return conv.ValueMap(src) }
+
+// Uint16 turn a pointer to of the uint16 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Uint16(v uint16) *uint16 { return conv.Pointer(v) }
+
+// Uint16Value turn the value of the uint16 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Uint16Value(v *uint16) uint16 { return conv.Value(v) }
+
+// Uint16Slice converts a slice of uint16 values into a slice of uint16 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Uint16Slice(src []uint16) []*uint16 { return conv.PointerSlice(src) }
+
+// Uint16ValueSlice converts a slice of uint16 pointers into a slice of uint16 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Uint16ValueSlice(src []*uint16) []uint16 { return conv.ValueSlice(src) }
+
+// Uint16Map converts a string map of uint16 values into a string map of uint16 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Uint16Map(src map[string]uint16) map[string]*uint16 { return conv.PointerMap(src) }
+
+// Uint16ValueMap converts a string map of uint16 pointers into a string map of uint16 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { return conv.ValueMap(src) }
+
+// Uint turn a pointer to of the uint value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Uint(v uint) *uint { return conv.Pointer(v) }
+
+// UintValue turn the value of the uint pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func UintValue(v *uint) uint { return conv.Value(v) }
+
+// UintSlice converts a slice of uint values into a slice of uint pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func UintSlice(src []uint) []*uint { return conv.PointerSlice(src) }
+
+// UintValueSlice converts a slice of uint pointers into a slice of uint values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func UintValueSlice(src []*uint) []uint { return conv.ValueSlice(src) }
+
+// UintMap converts a string map of uint values into a string map of uint pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func UintMap(src map[string]uint) map[string]*uint { return conv.PointerMap(src) }
+
+// UintValueMap converts a string map of uint pointers into a string map of uint values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func UintValueMap(src map[string]*uint) map[string]uint { return conv.ValueMap(src) }
+
+// Uint32 turn a pointer to of the uint32 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Uint32(v uint32) *uint32 { return conv.Pointer(v) }
+
+// Uint32Value turn the value of the uint32 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Uint32Value(v *uint32) uint32 { return conv.Value(v) }
+
+// Uint32Slice converts a slice of uint32 values into a slice of uint32 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Uint32Slice(src []uint32) []*uint32 { return conv.PointerSlice(src) }
+
+// Uint32ValueSlice converts a slice of uint32 pointers into a slice of uint32 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Uint32ValueSlice(src []*uint32) []uint32 { return conv.ValueSlice(src) }
+
+// Uint32Map converts a string map of uint32 values into a string map of uint32 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Uint32Map(src map[string]uint32) map[string]*uint32 { return conv.PointerMap(src) }
+
+// Uint32ValueMap converts a string map of uint32 pointers into a string map of uint32 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { return conv.ValueMap(src) }
+
+// Uint64 turn a pointer to of the uint64 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Uint64(v uint64) *uint64 { return conv.Pointer(v) }
+
+// Uint64Value turn the value of the uint64 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Uint64Value(v *uint64) uint64 { return conv.Value(v) }
+
+// Uint64Slice converts a slice of uint64 values into a slice of uint64 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Uint64Slice(src []uint64) []*uint64 { return conv.PointerSlice(src) }
+
+// Uint64ValueSlice converts a slice of uint64 pointers into a slice of uint64 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Uint64ValueSlice(src []*uint64) []uint64 { return conv.ValueSlice(src) }
+
+// Uint64Map converts a string map of uint64 values into a string map of uint64 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Uint64Map(src map[string]uint64) map[string]*uint64 { return conv.PointerMap(src) }
+
+// Uint64ValueMap converts a string map of uint64 pointers into a string map of uint64 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { return conv.ValueMap(src) }
+
+// Float32 turn a pointer to of the float32 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Float32(v float32) *float32 { return conv.Pointer(v) }
+
+// Float32Value turn the value of the float32 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Float32Value(v *float32) float32 { return conv.Value(v) }
+
+// Float32Slice converts a slice of float32 values into a slice of float32 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Float32Slice(src []float32) []*float32 { return conv.PointerSlice(src) }
+
+// Float32ValueSlice converts a slice of float32 pointers into a slice of float32 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Float32ValueSlice(src []*float32) []float32 { return conv.ValueSlice(src) }
+
+// Float32Map converts a string map of float32 values into a string map of float32 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Float32Map(src map[string]float32) map[string]*float32 { return conv.PointerMap(src) }
+
+// Float32ValueMap converts a string map of float32 pointers into a string map of float32 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Float32ValueMap(src map[string]*float32) map[string]float32 { return conv.ValueMap(src) }
+
+// Float64 turn a pointer to of the float64 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Float64(v float64) *float64 { return conv.Pointer(v) }
+
+// Float64Value turn the value of the float64 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Float64Value(v *float64) float64 { return conv.Value(v) }
+
+// Float64Slice converts a slice of float64 values into a slice of float64 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Float64Slice(src []float64) []*float64 { return conv.PointerSlice(src) }
+
+// Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Float64ValueSlice(src []*float64) []float64 { return conv.ValueSlice(src) }
+
+// Float64Map converts a string map of float64 values into a string map of float64 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Float64Map(src map[string]float64) map[string]*float64 { return conv.PointerMap(src) }
+
+// Float64ValueMap converts a string map of float64 pointers into a string map of float64 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Float64ValueMap(src map[string]*float64) map[string]float64 { return conv.ValueMap(src) }
+
+// Time turn a pointer to of the time.Time value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Time(v time.Time) *time.Time { return conv.Pointer(v) }
+
+// TimeValue turn the value of the time.Time pointer passed in or time.Time{} if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func TimeValue(v *time.Time) time.Time { return conv.Value(v) }
+
+// TimeSlice converts a slice of time.Time values into a slice of time.Time pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func TimeSlice(src []time.Time) []*time.Time { return conv.PointerSlice(src) }
+
+// TimeValueSlice converts a slice of time.Time pointers into a slice of time.Time values
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func TimeValueSlice(src []*time.Time) []time.Time { return conv.ValueSlice(src) }
+
+// TimeMap converts a string map of time.Time values into a string map of time.Time pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func TimeMap(src map[string]time.Time) map[string]*time.Time { return conv.PointerMap(src) }
+
+// TimeValueMap converts a string map of time.Time pointers into a string map of time.Time values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func TimeValueMap(src map[string]*time.Time) map[string]time.Time { return conv.ValueMap(src) }
diff --git a/vendor/github.com/go-openapi/swag/convert.go b/vendor/github.com/go-openapi/swag/convert.go
deleted file mode 100644
index fc085aeb8..000000000
--- a/vendor/github.com/go-openapi/swag/convert.go
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package swag
-
-import (
- "math"
- "strconv"
- "strings"
-)
-
-// same as ECMA Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER
-const (
- maxJSONFloat = float64(1<<53 - 1) // 9007199254740991.0 2^53 - 1
- minJSONFloat = -float64(1<<53 - 1) //-9007199254740991.0 -2^53 - 1
- epsilon float64 = 1e-9
-)
-
-// IsFloat64AJSONInteger allow for integers [-2^53, 2^53-1] inclusive
-func IsFloat64AJSONInteger(f float64) bool {
- if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat {
- return false
- }
- fa := math.Abs(f)
- g := float64(uint64(f))
- ga := math.Abs(g)
-
- diff := math.Abs(f - g)
-
- // more info: https://floating-point-gui.de/errors/comparison/#look-out-for-edge-cases
- switch {
- case f == g: // best case
- return true
- case f == float64(int64(f)) || f == float64(uint64(f)): // optimistic case
- return true
- case f == 0 || g == 0 || diff < math.SmallestNonzeroFloat64: // very close to 0 values
- return diff < (epsilon * math.SmallestNonzeroFloat64)
- }
- // check the relative error
- return diff/math.Min(fa+ga, math.MaxFloat64) < epsilon
-}
-
-var evaluatesAsTrue map[string]struct{}
-
-func init() {
- evaluatesAsTrue = map[string]struct{}{
- "true": {},
- "1": {},
- "yes": {},
- "ok": {},
- "y": {},
- "on": {},
- "selected": {},
- "checked": {},
- "t": {},
- "enabled": {},
- }
-}
-
-// ConvertBool turn a string into a boolean
-func ConvertBool(str string) (bool, error) {
- _, ok := evaluatesAsTrue[strings.ToLower(str)]
- return ok, nil
-}
-
-// ConvertFloat32 turn a string into a float32
-func ConvertFloat32(str string) (float32, error) {
- f, err := strconv.ParseFloat(str, 32)
- if err != nil {
- return 0, err
- }
- return float32(f), nil
-}
-
-// ConvertFloat64 turn a string into a float64
-func ConvertFloat64(str string) (float64, error) {
- return strconv.ParseFloat(str, 64)
-}
-
-// ConvertInt8 turn a string into an int8
-func ConvertInt8(str string) (int8, error) {
- i, err := strconv.ParseInt(str, 10, 8)
- if err != nil {
- return 0, err
- }
- return int8(i), nil
-}
-
-// ConvertInt16 turn a string into an int16
-func ConvertInt16(str string) (int16, error) {
- i, err := strconv.ParseInt(str, 10, 16)
- if err != nil {
- return 0, err
- }
- return int16(i), nil
-}
-
-// ConvertInt32 turn a string into an int32
-func ConvertInt32(str string) (int32, error) {
- i, err := strconv.ParseInt(str, 10, 32)
- if err != nil {
- return 0, err
- }
- return int32(i), nil
-}
-
-// ConvertInt64 turn a string into an int64
-func ConvertInt64(str string) (int64, error) {
- return strconv.ParseInt(str, 10, 64)
-}
-
-// ConvertUint8 turn a string into an uint8
-func ConvertUint8(str string) (uint8, error) {
- i, err := strconv.ParseUint(str, 10, 8)
- if err != nil {
- return 0, err
- }
- return uint8(i), nil
-}
-
-// ConvertUint16 turn a string into an uint16
-func ConvertUint16(str string) (uint16, error) {
- i, err := strconv.ParseUint(str, 10, 16)
- if err != nil {
- return 0, err
- }
- return uint16(i), nil
-}
-
-// ConvertUint32 turn a string into an uint32
-func ConvertUint32(str string) (uint32, error) {
- i, err := strconv.ParseUint(str, 10, 32)
- if err != nil {
- return 0, err
- }
- return uint32(i), nil
-}
-
-// ConvertUint64 turn a string into an uint64
-func ConvertUint64(str string) (uint64, error) {
- return strconv.ParseUint(str, 10, 64)
-}
-
-// FormatBool turns a boolean into a string
-func FormatBool(value bool) string {
- return strconv.FormatBool(value)
-}
-
-// FormatFloat32 turns a float32 into a string
-func FormatFloat32(value float32) string {
- return strconv.FormatFloat(float64(value), 'f', -1, 32)
-}
-
-// FormatFloat64 turns a float64 into a string
-func FormatFloat64(value float64) string {
- return strconv.FormatFloat(value, 'f', -1, 64)
-}
-
-// FormatInt8 turns an int8 into a string
-func FormatInt8(value int8) string {
- return strconv.FormatInt(int64(value), 10)
-}
-
-// FormatInt16 turns an int16 into a string
-func FormatInt16(value int16) string {
- return strconv.FormatInt(int64(value), 10)
-}
-
-// FormatInt32 turns an int32 into a string
-func FormatInt32(value int32) string {
- return strconv.Itoa(int(value))
-}
-
-// FormatInt64 turns an int64 into a string
-func FormatInt64(value int64) string {
- return strconv.FormatInt(value, 10)
-}
-
-// FormatUint8 turns an uint8 into a string
-func FormatUint8(value uint8) string {
- return strconv.FormatUint(uint64(value), 10)
-}
-
-// FormatUint16 turns an uint16 into a string
-func FormatUint16(value uint16) string {
- return strconv.FormatUint(uint64(value), 10)
-}
-
-// FormatUint32 turns an uint32 into a string
-func FormatUint32(value uint32) string {
- return strconv.FormatUint(uint64(value), 10)
-}
-
-// FormatUint64 turns an uint64 into a string
-func FormatUint64(value uint64) string {
- return strconv.FormatUint(value, 10)
-}
diff --git a/vendor/github.com/go-openapi/swag/convert_types.go b/vendor/github.com/go-openapi/swag/convert_types.go
deleted file mode 100644
index c49cc473a..000000000
--- a/vendor/github.com/go-openapi/swag/convert_types.go
+++ /dev/null
@@ -1,730 +0,0 @@
-package swag
-
-import "time"
-
-// This file was taken from the aws go sdk
-
-// String returns a pointer to of the string value passed in.
-func String(v string) *string {
- return &v
-}
-
-// StringValue returns the value of the string pointer passed in or
-// "" if the pointer is nil.
-func StringValue(v *string) string {
- if v != nil {
- return *v
- }
- return ""
-}
-
-// StringSlice converts a slice of string values into a slice of
-// string pointers
-func StringSlice(src []string) []*string {
- dst := make([]*string, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// StringValueSlice converts a slice of string pointers into a slice of
-// string values
-func StringValueSlice(src []*string) []string {
- dst := make([]string, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// StringMap converts a string map of string values into a string
-// map of string pointers
-func StringMap(src map[string]string) map[string]*string {
- dst := make(map[string]*string)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// StringValueMap converts a string map of string pointers into a string
-// map of string values
-func StringValueMap(src map[string]*string) map[string]string {
- dst := make(map[string]string)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Bool returns a pointer to of the bool value passed in.
-func Bool(v bool) *bool {
- return &v
-}
-
-// BoolValue returns the value of the bool pointer passed in or
-// false if the pointer is nil.
-func BoolValue(v *bool) bool {
- if v != nil {
- return *v
- }
- return false
-}
-
-// BoolSlice converts a slice of bool values into a slice of
-// bool pointers
-func BoolSlice(src []bool) []*bool {
- dst := make([]*bool, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// BoolValueSlice converts a slice of bool pointers into a slice of
-// bool values
-func BoolValueSlice(src []*bool) []bool {
- dst := make([]bool, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// BoolMap converts a string map of bool values into a string
-// map of bool pointers
-func BoolMap(src map[string]bool) map[string]*bool {
- dst := make(map[string]*bool)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// BoolValueMap converts a string map of bool pointers into a string
-// map of bool values
-func BoolValueMap(src map[string]*bool) map[string]bool {
- dst := make(map[string]bool)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Int returns a pointer to of the int value passed in.
-func Int(v int) *int {
- return &v
-}
-
-// IntValue returns the value of the int pointer passed in or
-// 0 if the pointer is nil.
-func IntValue(v *int) int {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// IntSlice converts a slice of int values into a slice of
-// int pointers
-func IntSlice(src []int) []*int {
- dst := make([]*int, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// IntValueSlice converts a slice of int pointers into a slice of
-// int values
-func IntValueSlice(src []*int) []int {
- dst := make([]int, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// IntMap converts a string map of int values into a string
-// map of int pointers
-func IntMap(src map[string]int) map[string]*int {
- dst := make(map[string]*int)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// IntValueMap converts a string map of int pointers into a string
-// map of int values
-func IntValueMap(src map[string]*int) map[string]int {
- dst := make(map[string]int)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Int32 returns a pointer to of the int32 value passed in.
-func Int32(v int32) *int32 {
- return &v
-}
-
-// Int32Value returns the value of the int32 pointer passed in or
-// 0 if the pointer is nil.
-func Int32Value(v *int32) int32 {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// Int32Slice converts a slice of int32 values into a slice of
-// int32 pointers
-func Int32Slice(src []int32) []*int32 {
- dst := make([]*int32, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// Int32ValueSlice converts a slice of int32 pointers into a slice of
-// int32 values
-func Int32ValueSlice(src []*int32) []int32 {
- dst := make([]int32, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// Int32Map converts a string map of int32 values into a string
-// map of int32 pointers
-func Int32Map(src map[string]int32) map[string]*int32 {
- dst := make(map[string]*int32)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// Int32ValueMap converts a string map of int32 pointers into a string
-// map of int32 values
-func Int32ValueMap(src map[string]*int32) map[string]int32 {
- dst := make(map[string]int32)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Int64 returns a pointer to of the int64 value passed in.
-func Int64(v int64) *int64 {
- return &v
-}
-
-// Int64Value returns the value of the int64 pointer passed in or
-// 0 if the pointer is nil.
-func Int64Value(v *int64) int64 {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// Int64Slice converts a slice of int64 values into a slice of
-// int64 pointers
-func Int64Slice(src []int64) []*int64 {
- dst := make([]*int64, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// Int64ValueSlice converts a slice of int64 pointers into a slice of
-// int64 values
-func Int64ValueSlice(src []*int64) []int64 {
- dst := make([]int64, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// Int64Map converts a string map of int64 values into a string
-// map of int64 pointers
-func Int64Map(src map[string]int64) map[string]*int64 {
- dst := make(map[string]*int64)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// Int64ValueMap converts a string map of int64 pointers into a string
-// map of int64 values
-func Int64ValueMap(src map[string]*int64) map[string]int64 {
- dst := make(map[string]int64)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Uint16 returns a pointer to of the uint16 value passed in.
-func Uint16(v uint16) *uint16 {
- return &v
-}
-
-// Uint16Value returns the value of the uint16 pointer passed in or
-// 0 if the pointer is nil.
-func Uint16Value(v *uint16) uint16 {
- if v != nil {
- return *v
- }
-
- return 0
-}
-
-// Uint16Slice converts a slice of uint16 values into a slice of
-// uint16 pointers
-func Uint16Slice(src []uint16) []*uint16 {
- dst := make([]*uint16, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
-
- return dst
-}
-
-// Uint16ValueSlice converts a slice of uint16 pointers into a slice of
-// uint16 values
-func Uint16ValueSlice(src []*uint16) []uint16 {
- dst := make([]uint16, len(src))
-
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
-
- return dst
-}
-
-// Uint16Map converts a string map of uint16 values into a string
-// map of uint16 pointers
-func Uint16Map(src map[string]uint16) map[string]*uint16 {
- dst := make(map[string]*uint16)
-
- for k, val := range src {
- v := val
- dst[k] = &v
- }
-
- return dst
-}
-
-// Uint16ValueMap converts a string map of uint16 pointers into a string
-// map of uint16 values
-func Uint16ValueMap(src map[string]*uint16) map[string]uint16 {
- dst := make(map[string]uint16)
-
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
-
- return dst
-}
-
-// Uint returns a pointer to of the uint value passed in.
-func Uint(v uint) *uint {
- return &v
-}
-
-// UintValue returns the value of the uint pointer passed in or
-// 0 if the pointer is nil.
-func UintValue(v *uint) uint {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// UintSlice converts a slice of uint values into a slice of
-// uint pointers
-func UintSlice(src []uint) []*uint {
- dst := make([]*uint, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// UintValueSlice converts a slice of uint pointers into a slice of
-// uint values
-func UintValueSlice(src []*uint) []uint {
- dst := make([]uint, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// UintMap converts a string map of uint values into a string
-// map of uint pointers
-func UintMap(src map[string]uint) map[string]*uint {
- dst := make(map[string]*uint)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// UintValueMap converts a string map of uint pointers into a string
-// map of uint values
-func UintValueMap(src map[string]*uint) map[string]uint {
- dst := make(map[string]uint)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Uint32 returns a pointer to of the uint32 value passed in.
-func Uint32(v uint32) *uint32 {
- return &v
-}
-
-// Uint32Value returns the value of the uint32 pointer passed in or
-// 0 if the pointer is nil.
-func Uint32Value(v *uint32) uint32 {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// Uint32Slice converts a slice of uint32 values into a slice of
-// uint32 pointers
-func Uint32Slice(src []uint32) []*uint32 {
- dst := make([]*uint32, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// Uint32ValueSlice converts a slice of uint32 pointers into a slice of
-// uint32 values
-func Uint32ValueSlice(src []*uint32) []uint32 {
- dst := make([]uint32, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// Uint32Map converts a string map of uint32 values into a string
-// map of uint32 pointers
-func Uint32Map(src map[string]uint32) map[string]*uint32 {
- dst := make(map[string]*uint32)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// Uint32ValueMap converts a string map of uint32 pointers into a string
-// map of uint32 values
-func Uint32ValueMap(src map[string]*uint32) map[string]uint32 {
- dst := make(map[string]uint32)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Uint64 returns a pointer to of the uint64 value passed in.
-func Uint64(v uint64) *uint64 {
- return &v
-}
-
-// Uint64Value returns the value of the uint64 pointer passed in or
-// 0 if the pointer is nil.
-func Uint64Value(v *uint64) uint64 {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// Uint64Slice converts a slice of uint64 values into a slice of
-// uint64 pointers
-func Uint64Slice(src []uint64) []*uint64 {
- dst := make([]*uint64, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// Uint64ValueSlice converts a slice of uint64 pointers into a slice of
-// uint64 values
-func Uint64ValueSlice(src []*uint64) []uint64 {
- dst := make([]uint64, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// Uint64Map converts a string map of uint64 values into a string
-// map of uint64 pointers
-func Uint64Map(src map[string]uint64) map[string]*uint64 {
- dst := make(map[string]*uint64)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// Uint64ValueMap converts a string map of uint64 pointers into a string
-// map of uint64 values
-func Uint64ValueMap(src map[string]*uint64) map[string]uint64 {
- dst := make(map[string]uint64)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Float32 returns a pointer to of the float32 value passed in.
-func Float32(v float32) *float32 {
- return &v
-}
-
-// Float32Value returns the value of the float32 pointer passed in or
-// 0 if the pointer is nil.
-func Float32Value(v *float32) float32 {
- if v != nil {
- return *v
- }
-
- return 0
-}
-
-// Float32Slice converts a slice of float32 values into a slice of
-// float32 pointers
-func Float32Slice(src []float32) []*float32 {
- dst := make([]*float32, len(src))
-
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
-
- return dst
-}
-
-// Float32ValueSlice converts a slice of float32 pointers into a slice of
-// float32 values
-func Float32ValueSlice(src []*float32) []float32 {
- dst := make([]float32, len(src))
-
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
-
- return dst
-}
-
-// Float32Map converts a string map of float32 values into a string
-// map of float32 pointers
-func Float32Map(src map[string]float32) map[string]*float32 {
- dst := make(map[string]*float32)
-
- for k, val := range src {
- v := val
- dst[k] = &v
- }
-
- return dst
-}
-
-// Float32ValueMap converts a string map of float32 pointers into a string
-// map of float32 values
-func Float32ValueMap(src map[string]*float32) map[string]float32 {
- dst := make(map[string]float32)
-
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
-
- return dst
-}
-
-// Float64 returns a pointer to of the float64 value passed in.
-func Float64(v float64) *float64 {
- return &v
-}
-
-// Float64Value returns the value of the float64 pointer passed in or
-// 0 if the pointer is nil.
-func Float64Value(v *float64) float64 {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// Float64Slice converts a slice of float64 values into a slice of
-// float64 pointers
-func Float64Slice(src []float64) []*float64 {
- dst := make([]*float64, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// Float64ValueSlice converts a slice of float64 pointers into a slice of
-// float64 values
-func Float64ValueSlice(src []*float64) []float64 {
- dst := make([]float64, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// Float64Map converts a string map of float64 values into a string
-// map of float64 pointers
-func Float64Map(src map[string]float64) map[string]*float64 {
- dst := make(map[string]*float64)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// Float64ValueMap converts a string map of float64 pointers into a string
-// map of float64 values
-func Float64ValueMap(src map[string]*float64) map[string]float64 {
- dst := make(map[string]float64)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Time returns a pointer to of the time.Time value passed in.
-func Time(v time.Time) *time.Time {
- return &v
-}
-
-// TimeValue returns the value of the time.Time pointer passed in or
-// time.Time{} if the pointer is nil.
-func TimeValue(v *time.Time) time.Time {
- if v != nil {
- return *v
- }
- return time.Time{}
-}
-
-// TimeSlice converts a slice of time.Time values into a slice of
-// time.Time pointers
-func TimeSlice(src []time.Time) []*time.Time {
- dst := make([]*time.Time, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// TimeValueSlice converts a slice of time.Time pointers into a slice of
-// time.Time values
-func TimeValueSlice(src []*time.Time) []time.Time {
- dst := make([]time.Time, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// TimeMap converts a string map of time.Time values into a string
-// map of time.Time pointers
-func TimeMap(src map[string]time.Time) map[string]*time.Time {
- dst := make(map[string]*time.Time)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// TimeValueMap converts a string map of time.Time pointers into a string
-// map of time.Time values
-func TimeValueMap(src map[string]*time.Time) map[string]time.Time {
- dst := make(map[string]time.Time)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
diff --git a/vendor/github.com/go-openapi/swag/doc.go b/vendor/github.com/go-openapi/swag/doc.go
index 55094cb74..b5af82982 100644
--- a/vendor/github.com/go-openapi/swag/doc.go
+++ b/vendor/github.com/go-openapi/swag/doc.go
@@ -12,20 +12,67 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-/*
-Package swag contains a bunch of helper functions for go-openapi and go-swagger projects.
-
-You may also use it standalone for your projects.
-
- - convert between value and pointers for builtin types
- - convert from string to builtin types (wraps strconv)
- - fast json concatenation
- - search in path
- - load from file or http
- - name mangling
-
-This repo has only few dependencies outside of the standard library:
-
- - YAML utilities depend on gopkg.in/yaml.v2
-*/
+// Package swag contains a bunch of helper functions for go-openapi and go-swagger projects.
+//
+// You may also use it standalone for your projects.
+//
+// NOTE: all features that were previously exposed as package-level members (constants, variables,
+// functions and types) are now deprecated and are superseded by equivalent features in
+// more specialized sub-packages.
+//
+// Here is what is inside:
+//
+// Module [cmdutils]:
+//
+// - utilities to work with CLIs
+//
+// Module [conv]:
+//
+// - convert between value and pointers for builtin types
+// - convert from string to builtin types (wraps strconv)
+//
+// Module [fileutils]:
+//
+// - file upload type
+// - search in path
+//
+// Module [jsonname]:
+//
+// - json names for go properties
+//
+// Module [jsonutils]:
+//
+// - fast json concatenation
+// - read and write JSON from and to dynamic go data structures
+//
+// Module [loading]:
+//
+// - load from file or http
+//
+// Module [mangling]:
+//
+// - name mangling to generate clean identifiers
+//
+// Module [netutils]:
+//
+// - host, port from address
+//
+// Module [stringutils]:
+//
+// - find string in list
+// - join/split arrays of query parameters
+//
+// Module [typeutils]:
+//
+// - check the zero value of any type
+//
+// Module [yamlutils]:
+//
+// - converting YAML to JSON
+// - loading YAML into a dynamic YAML document
+//
+// This repo has a few dependencies outside of the standard library:
+//
+// - YAML utilities depend on [gopkg.in/yaml.v3]
+// - JSON utilities depend on [github.com/mailru/easyjson]
package swag
diff --git a/vendor/github.com/go-openapi/swag/errors.go b/vendor/github.com/go-openapi/swag/errors.go
deleted file mode 100644
index 6c67fbf92..000000000
--- a/vendor/github.com/go-openapi/swag/errors.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package swag
-
-type swagError string
-
-const (
- // ErrYAML is an error raised by YAML utilities
- ErrYAML swagError = "yaml error"
-
- // ErrLoader is an error raised by the file loader utility
- ErrLoader swagError = "loader error"
-)
-
-func (e swagError) Error() string {
- return string(e)
-}
diff --git a/vendor/github.com/kylelemons/godebug/LICENSE b/vendor/github.com/go-openapi/swag/fileutils/LICENSE
similarity index 100%
rename from vendor/github.com/kylelemons/godebug/LICENSE
rename to vendor/github.com/go-openapi/swag/fileutils/LICENSE
diff --git a/vendor/github.com/go-openapi/swag/fileutils/doc.go b/vendor/github.com/go-openapi/swag/fileutils/doc.go
new file mode 100644
index 000000000..4b48e7196
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/fileutils/doc.go
@@ -0,0 +1,21 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package fileutils exposes utilities to deal with files and paths.
+//
+// Currently, there is:
+// - [File] to represent an abstraction of an uploaded file.
+// For instance, this is used by [github.com/go-openapi/runtime.File].
+// - path search utilities (e.g. finding packages in the GO search path)
+package fileutils
diff --git a/vendor/github.com/go-openapi/swag/file.go b/vendor/github.com/go-openapi/swag/fileutils/file.go
similarity index 98%
rename from vendor/github.com/go-openapi/swag/file.go
rename to vendor/github.com/go-openapi/swag/fileutils/file.go
index 16accc55f..b17eaba58 100644
--- a/vendor/github.com/go-openapi/swag/file.go
+++ b/vendor/github.com/go-openapi/swag/fileutils/file.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package swag
+package fileutils
import "mime/multipart"
diff --git a/vendor/github.com/go-openapi/swag/fileutils/path.go b/vendor/github.com/go-openapi/swag/fileutils/path.go
new file mode 100644
index 000000000..a70ccb418
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/fileutils/path.go
@@ -0,0 +1,57 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package fileutils
+
+import (
+ "os"
+ "path/filepath"
+ "runtime"
+ "strings"
+)
+
+// GOPATHKey represents the env key for gopath
+const GOPATHKey = "GOPATH"
+
+// FindInSearchPath finds a package in a provided lists of paths
+func FindInSearchPath(searchPath, pkg string) string {
+ pathsList := filepath.SplitList(searchPath)
+ for _, path := range pathsList {
+ if evaluatedPath, err := filepath.EvalSymlinks(filepath.Join(path, "src", pkg)); err == nil {
+ if _, err := os.Stat(evaluatedPath); err == nil {
+ return evaluatedPath
+ }
+ }
+ }
+ return ""
+}
+
+// FindInGoSearchPath finds a package in the $GOPATH:$GOROOT
+func FindInGoSearchPath(pkg string) string {
+ return FindInSearchPath(FullGoSearchPath(), pkg)
+}
+
+// FullGoSearchPath gets the search paths for finding packages
+func FullGoSearchPath() string {
+ allPaths := os.Getenv(GOPATHKey)
+ if allPaths == "" {
+ allPaths = filepath.Join(os.Getenv("HOME"), "go")
+ }
+ if allPaths != "" {
+ allPaths = strings.Join([]string{allPaths, runtime.GOROOT()}, ":")
+ } else {
+ allPaths = runtime.GOROOT()
+ }
+ return allPaths
+}
diff --git a/vendor/github.com/go-openapi/swag/fileutils_iface.go b/vendor/github.com/go-openapi/swag/fileutils_iface.go
new file mode 100644
index 000000000..0c639e8c1
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/fileutils_iface.go
@@ -0,0 +1,44 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import "github.com/go-openapi/swag/fileutils"
+
+// GOPATHKey represents the env key for gopath
+//
+// Deprecated: use [fileutils.GOPATHKey] instead.
+const GOPATHKey = fileutils.GOPATHKey
+
+// File represents an uploaded file.
+//
+// Deprecated: use [fileutils.File] instead.
+type File = fileutils.File
+
+// FindInSearchPath finds a package in a provided lists of paths.
+//
+// Deprecated: use [fileutils.FindInSearchPath] instead.
+func FindInSearchPath(searchPath, pkg string) string {
+ return fileutils.FindInSearchPath(searchPath, pkg)
+}
+
+// FindInGoSearchPath finds a package in the $GOPATH:$GOROOT
+//
+// Deprecated: use [fileutils.FindInGoSearchPath] instead.
+func FindInGoSearchPath(pkg string) string { return fileutils.FindInGoSearchPath(pkg) }
+
+// FullGoSearchPath gets the search paths for finding packages
+//
+// Deprecated: use [fileutils.FullGoSearchPath] instead.
+func FullGoSearchPath() string { return fileutils.FullGoSearchPath() }
diff --git a/vendor/github.com/go-openapi/swag/initialism_index.go b/vendor/github.com/go-openapi/swag/initialism_index.go
deleted file mode 100644
index 20a359bb6..000000000
--- a/vendor/github.com/go-openapi/swag/initialism_index.go
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package swag
-
-import (
- "sort"
- "strings"
- "sync"
-)
-
-var (
- // commonInitialisms are common acronyms that are kept as whole uppercased words.
- commonInitialisms *indexOfInitialisms
-
- // initialisms is a slice of sorted initialisms
- initialisms []string
-
- // a copy of initialisms pre-baked as []rune
- initialismsRunes [][]rune
- initialismsUpperCased [][]rune
-
- isInitialism func(string) bool
-
- maxAllocMatches int
-)
-
-func init() {
- // Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769
- configuredInitialisms := map[string]bool{
- "ACL": true,
- "API": true,
- "ASCII": true,
- "CPU": true,
- "CSS": true,
- "DNS": true,
- "EOF": true,
- "GUID": true,
- "HTML": true,
- "HTTPS": true,
- "HTTP": true,
- "ID": true,
- "IP": true,
- "IPv4": true,
- "IPv6": true,
- "JSON": true,
- "LHS": true,
- "OAI": true,
- "QPS": true,
- "RAM": true,
- "RHS": true,
- "RPC": true,
- "SLA": true,
- "SMTP": true,
- "SQL": true,
- "SSH": true,
- "TCP": true,
- "TLS": true,
- "TTL": true,
- "UDP": true,
- "UI": true,
- "UID": true,
- "UUID": true,
- "URI": true,
- "URL": true,
- "UTF8": true,
- "VM": true,
- "XML": true,
- "XMPP": true,
- "XSRF": true,
- "XSS": true,
- }
-
- // a thread-safe index of initialisms
- commonInitialisms = newIndexOfInitialisms().load(configuredInitialisms)
- initialisms = commonInitialisms.sorted()
- initialismsRunes = asRunes(initialisms)
- initialismsUpperCased = asUpperCased(initialisms)
- maxAllocMatches = maxAllocHeuristic(initialismsRunes)
-
- // a test function
- isInitialism = commonInitialisms.isInitialism
-}
-
-func asRunes(in []string) [][]rune {
- out := make([][]rune, len(in))
- for i, initialism := range in {
- out[i] = []rune(initialism)
- }
-
- return out
-}
-
-func asUpperCased(in []string) [][]rune {
- out := make([][]rune, len(in))
-
- for i, initialism := range in {
- out[i] = []rune(upper(trim(initialism)))
- }
-
- return out
-}
-
-func maxAllocHeuristic(in [][]rune) int {
- heuristic := make(map[rune]int)
- for _, initialism := range in {
- heuristic[initialism[0]]++
- }
-
- var maxAlloc int
- for _, val := range heuristic {
- if val > maxAlloc {
- maxAlloc = val
- }
- }
-
- return maxAlloc
-}
-
-// AddInitialisms add additional initialisms
-func AddInitialisms(words ...string) {
- for _, word := range words {
- // commonInitialisms[upper(word)] = true
- commonInitialisms.add(upper(word))
- }
- // sort again
- initialisms = commonInitialisms.sorted()
- initialismsRunes = asRunes(initialisms)
- initialismsUpperCased = asUpperCased(initialisms)
-}
-
-// indexOfInitialisms is a thread-safe implementation of the sorted index of initialisms.
-// Since go1.9, this may be implemented with sync.Map.
-type indexOfInitialisms struct {
- sortMutex *sync.Mutex
- index *sync.Map
-}
-
-func newIndexOfInitialisms() *indexOfInitialisms {
- return &indexOfInitialisms{
- sortMutex: new(sync.Mutex),
- index: new(sync.Map),
- }
-}
-
-func (m *indexOfInitialisms) load(initial map[string]bool) *indexOfInitialisms {
- m.sortMutex.Lock()
- defer m.sortMutex.Unlock()
- for k, v := range initial {
- m.index.Store(k, v)
- }
- return m
-}
-
-func (m *indexOfInitialisms) isInitialism(key string) bool {
- _, ok := m.index.Load(key)
- return ok
-}
-
-func (m *indexOfInitialisms) add(key string) *indexOfInitialisms {
- m.index.Store(key, true)
- return m
-}
-
-func (m *indexOfInitialisms) sorted() (result []string) {
- m.sortMutex.Lock()
- defer m.sortMutex.Unlock()
- m.index.Range(func(key, _ interface{}) bool {
- k := key.(string)
- result = append(result, k)
- return true
- })
- sort.Sort(sort.Reverse(byInitialism(result)))
- return
-}
-
-type byInitialism []string
-
-func (s byInitialism) Len() int {
- return len(s)
-}
-func (s byInitialism) Swap(i, j int) {
- s[i], s[j] = s[j], s[i]
-}
-func (s byInitialism) Less(i, j int) bool {
- if len(s[i]) != len(s[j]) {
- return len(s[i]) < len(s[j])
- }
-
- return strings.Compare(s[i], s[j]) > 0
-}
diff --git a/vendor/github.com/go-openapi/swag/json.go b/vendor/github.com/go-openapi/swag/json.go
deleted file mode 100644
index c7caa9908..000000000
--- a/vendor/github.com/go-openapi/swag/json.go
+++ /dev/null
@@ -1,313 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package swag
-
-import (
- "bytes"
- "encoding/json"
- "log"
- "reflect"
- "strings"
- "sync"
-
- "github.com/mailru/easyjson/jlexer"
- "github.com/mailru/easyjson/jwriter"
-)
-
-// nullJSON represents a JSON object with null type
-var nullJSON = []byte("null")
-
-// DefaultJSONNameProvider the default cache for types
-var DefaultJSONNameProvider = NewNameProvider()
-
-const comma = byte(',')
-
-var closers map[byte]byte
-
-func init() {
- closers = map[byte]byte{
- '{': '}',
- '[': ']',
- }
-}
-
-type ejMarshaler interface {
- MarshalEasyJSON(w *jwriter.Writer)
-}
-
-type ejUnmarshaler interface {
- UnmarshalEasyJSON(w *jlexer.Lexer)
-}
-
-// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaler
-// so it takes the fastest option available.
-func WriteJSON(data interface{}) ([]byte, error) {
- if d, ok := data.(ejMarshaler); ok {
- jw := new(jwriter.Writer)
- d.MarshalEasyJSON(jw)
- return jw.BuildBytes()
- }
- if d, ok := data.(json.Marshaler); ok {
- return d.MarshalJSON()
- }
- return json.Marshal(data)
-}
-
-// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaler
-// so it takes the fastest option available
-func ReadJSON(data []byte, value interface{}) error {
- trimmedData := bytes.Trim(data, "\x00")
- if d, ok := value.(ejUnmarshaler); ok {
- jl := &jlexer.Lexer{Data: trimmedData}
- d.UnmarshalEasyJSON(jl)
- return jl.Error()
- }
- if d, ok := value.(json.Unmarshaler); ok {
- return d.UnmarshalJSON(trimmedData)
- }
- return json.Unmarshal(trimmedData, value)
-}
-
-// DynamicJSONToStruct converts an untyped json structure into a struct
-func DynamicJSONToStruct(data interface{}, target interface{}) error {
- // TODO: convert straight to a json typed map (mergo + iterate?)
- b, err := WriteJSON(data)
- if err != nil {
- return err
- }
- return ReadJSON(b, target)
-}
-
-// ConcatJSON concatenates multiple json objects efficiently
-func ConcatJSON(blobs ...[]byte) []byte {
- if len(blobs) == 0 {
- return nil
- }
-
- last := len(blobs) - 1
- for blobs[last] == nil || bytes.Equal(blobs[last], nullJSON) {
- // strips trailing null objects
- last--
- if last < 0 {
- // there was nothing but "null"s or nil...
- return nil
- }
- }
- if last == 0 {
- return blobs[0]
- }
-
- var opening, closing byte
- var idx, a int
- buf := bytes.NewBuffer(nil)
-
- for i, b := range blobs[:last+1] {
- if b == nil || bytes.Equal(b, nullJSON) {
- // a null object is in the list: skip it
- continue
- }
- if len(b) > 0 && opening == 0 { // is this an array or an object?
- opening, closing = b[0], closers[b[0]]
- }
-
- if opening != '{' && opening != '[' {
- continue // don't know how to concatenate non container objects
- }
-
- const minLengthIfNotEmpty = 3
- if len(b) < minLengthIfNotEmpty { // yep empty but also the last one, so closing this thing
- if i == last && a > 0 {
- if err := buf.WriteByte(closing); err != nil {
- log.Println(err)
- }
- }
- continue
- }
-
- idx = 0
- if a > 0 { // we need to join with a comma for everything beyond the first non-empty item
- if err := buf.WriteByte(comma); err != nil {
- log.Println(err)
- }
- idx = 1 // this is not the first or the last so we want to drop the leading bracket
- }
-
- if i != last { // not the last one, strip brackets
- if _, err := buf.Write(b[idx : len(b)-1]); err != nil {
- log.Println(err)
- }
- } else { // last one, strip only the leading bracket
- if _, err := buf.Write(b[idx:]); err != nil {
- log.Println(err)
- }
- }
- a++
- }
- // somehow it ended up being empty, so provide a default value
- if buf.Len() == 0 {
- if err := buf.WriteByte(opening); err != nil {
- log.Println(err)
- }
- if err := buf.WriteByte(closing); err != nil {
- log.Println(err)
- }
- }
- return buf.Bytes()
-}
-
-// ToDynamicJSON turns an object into a properly JSON typed structure
-func ToDynamicJSON(data interface{}) interface{} {
- // TODO: convert straight to a json typed map (mergo + iterate?)
- b, err := json.Marshal(data)
- if err != nil {
- log.Println(err)
- }
- var res interface{}
- if err := json.Unmarshal(b, &res); err != nil {
- log.Println(err)
- }
- return res
-}
-
-// FromDynamicJSON turns an object into a properly JSON typed structure
-func FromDynamicJSON(data, target interface{}) error {
- b, err := json.Marshal(data)
- if err != nil {
- log.Println(err)
- }
- return json.Unmarshal(b, target)
-}
-
-// NameProvider represents an object capable of translating from go property names
-// to json property names
-// This type is thread-safe.
-type NameProvider struct {
- lock *sync.Mutex
- index map[reflect.Type]nameIndex
-}
-
-type nameIndex struct {
- jsonNames map[string]string
- goNames map[string]string
-}
-
-// NewNameProvider creates a new name provider
-func NewNameProvider() *NameProvider {
- return &NameProvider{
- lock: &sync.Mutex{},
- index: make(map[reflect.Type]nameIndex),
- }
-}
-
-func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) {
- for i := 0; i < tpe.NumField(); i++ {
- targetDes := tpe.Field(i)
-
- if targetDes.PkgPath != "" { // unexported
- continue
- }
-
- if targetDes.Anonymous { // walk embedded structures tree down first
- buildnameIndex(targetDes.Type, idx, reverseIdx)
- continue
- }
-
- if tag := targetDes.Tag.Get("json"); tag != "" {
-
- parts := strings.Split(tag, ",")
- if len(parts) == 0 {
- continue
- }
-
- nm := parts[0]
- if nm == "-" {
- continue
- }
- if nm == "" { // empty string means we want to use the Go name
- nm = targetDes.Name
- }
-
- idx[nm] = targetDes.Name
- reverseIdx[targetDes.Name] = nm
- }
- }
-}
-
-func newNameIndex(tpe reflect.Type) nameIndex {
- var idx = make(map[string]string, tpe.NumField())
- var reverseIdx = make(map[string]string, tpe.NumField())
-
- buildnameIndex(tpe, idx, reverseIdx)
- return nameIndex{jsonNames: idx, goNames: reverseIdx}
-}
-
-// GetJSONNames gets all the json property names for a type
-func (n *NameProvider) GetJSONNames(subject interface{}) []string {
- n.lock.Lock()
- defer n.lock.Unlock()
- tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
- names, ok := n.index[tpe]
- if !ok {
- names = n.makeNameIndex(tpe)
- }
-
- res := make([]string, 0, len(names.jsonNames))
- for k := range names.jsonNames {
- res = append(res, k)
- }
- return res
-}
-
-// GetJSONName gets the json name for a go property name
-func (n *NameProvider) GetJSONName(subject interface{}, name string) (string, bool) {
- tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
- return n.GetJSONNameForType(tpe, name)
-}
-
-// GetJSONNameForType gets the json name for a go property name on a given type
-func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) {
- n.lock.Lock()
- defer n.lock.Unlock()
- names, ok := n.index[tpe]
- if !ok {
- names = n.makeNameIndex(tpe)
- }
- nme, ok := names.goNames[name]
- return nme, ok
-}
-
-func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex {
- names := newNameIndex(tpe)
- n.index[tpe] = names
- return names
-}
-
-// GetGoName gets the go name for a json property name
-func (n *NameProvider) GetGoName(subject interface{}, name string) (string, bool) {
- tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
- return n.GetGoNameForType(tpe, name)
-}
-
-// GetGoNameForType gets the go name for a given type for a json property name
-func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) {
- n.lock.Lock()
- defer n.lock.Unlock()
- names, ok := n.index[tpe]
- if !ok {
- names = n.makeNameIndex(tpe)
- }
- nme, ok := names.jsonNames[name]
- return nme, ok
-}
diff --git a/vendor/go.etcd.io/etcd/api/v3/LICENSE b/vendor/github.com/go-openapi/swag/jsonname/LICENSE
similarity index 100%
rename from vendor/go.etcd.io/etcd/api/v3/LICENSE
rename to vendor/github.com/go-openapi/swag/jsonname/LICENSE
diff --git a/vendor/github.com/go-openapi/swag/jsonname/doc.go b/vendor/github.com/go-openapi/swag/jsonname/doc.go
new file mode 100644
index 000000000..b2e0c80fc
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonname/doc.go
@@ -0,0 +1,16 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package jsonname is a provider of json property names from go properties.
+package jsonname
diff --git a/vendor/github.com/go-openapi/swag/jsonname/name_provider.go b/vendor/github.com/go-openapi/swag/jsonname/name_provider.go
new file mode 100644
index 000000000..e87aac2f7
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonname/name_provider.go
@@ -0,0 +1,149 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jsonname
+
+import (
+ "reflect"
+ "strings"
+ "sync"
+)
+
+// DefaultJSONNameProvider is the default cache for types.
+var DefaultJSONNameProvider = NewNameProvider()
+
+// NameProvider represents an object capable of translating from go property names
+// to json property names.
+//
+// This type is thread-safe.
+//
+// See [github.com/go-openapi/jsonpointer.Pointer] for an example.
+type NameProvider struct {
+ lock *sync.Mutex
+ index map[reflect.Type]nameIndex
+}
+
+type nameIndex struct {
+ jsonNames map[string]string
+ goNames map[string]string
+}
+
+// NewNameProvider creates a new name provider
+func NewNameProvider() *NameProvider {
+ return &NameProvider{
+ lock: &sync.Mutex{},
+ index: make(map[reflect.Type]nameIndex),
+ }
+}
+
+func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) {
+ for i := 0; i < tpe.NumField(); i++ {
+ targetDes := tpe.Field(i)
+
+ if targetDes.PkgPath != "" { // unexported
+ continue
+ }
+
+ if targetDes.Anonymous { // walk embedded structures tree down first
+ buildnameIndex(targetDes.Type, idx, reverseIdx)
+ continue
+ }
+
+ if tag := targetDes.Tag.Get("json"); tag != "" {
+
+ parts := strings.Split(tag, ",")
+ if len(parts) == 0 {
+ continue
+ }
+
+ nm := parts[0]
+ if nm == "-" {
+ continue
+ }
+ if nm == "" { // empty string means we want to use the Go name
+ nm = targetDes.Name
+ }
+
+ idx[nm] = targetDes.Name
+ reverseIdx[targetDes.Name] = nm
+ }
+ }
+}
+
+func newNameIndex(tpe reflect.Type) nameIndex {
+ var idx = make(map[string]string, tpe.NumField())
+ var reverseIdx = make(map[string]string, tpe.NumField())
+
+ buildnameIndex(tpe, idx, reverseIdx)
+ return nameIndex{jsonNames: idx, goNames: reverseIdx}
+}
+
+// GetJSONNames gets all the json property names for a type
+func (n *NameProvider) GetJSONNames(subject interface{}) []string {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+ names, ok := n.index[tpe]
+ if !ok {
+ names = n.makeNameIndex(tpe)
+ }
+
+ res := make([]string, 0, len(names.jsonNames))
+ for k := range names.jsonNames {
+ res = append(res, k)
+ }
+ return res
+}
+
+// GetJSONName gets the json name for a go property name
+func (n *NameProvider) GetJSONName(subject interface{}, name string) (string, bool) {
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+ return n.GetJSONNameForType(tpe, name)
+}
+
+// GetJSONNameForType gets the json name for a go property name on a given type
+func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+ names, ok := n.index[tpe]
+ if !ok {
+ names = n.makeNameIndex(tpe)
+ }
+ nme, ok := names.goNames[name]
+ return nme, ok
+}
+
+// GetGoName gets the go name for a json property name
+func (n *NameProvider) GetGoName(subject interface{}, name string) (string, bool) {
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+ return n.GetGoNameForType(tpe, name)
+}
+
+// GetGoNameForType gets the go name for a given type for a json property name
+func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+ names, ok := n.index[tpe]
+ if !ok {
+ names = n.makeNameIndex(tpe)
+ }
+ nme, ok := names.jsonNames[name]
+ return nme, ok
+}
+
+func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex {
+ names := newNameIndex(tpe)
+ n.index[tpe] = names
+ return names
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonname_iface.go b/vendor/github.com/go-openapi/swag/jsonname_iface.go
new file mode 100644
index 000000000..555369d75
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonname_iface.go
@@ -0,0 +1,35 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import (
+ "github.com/go-openapi/swag/jsonname"
+)
+
+// DefaultJSONNameProvider is the default cache for types
+//
+// Deprecated: use [jsonname.DefaultJSONNameProvider] instead.
+var DefaultJSONNameProvider = jsonname.DefaultJSONNameProvider
+
+// NameProvider represents an object capable of translating from go property names
+// to json property names.
+//
+// Deprecated: use [jsonname.NameProvider] instead.
+type NameProvider = jsonname.NameProvider
+
+// NewNameProvider creates a new name provider
+//
+// Deprecated: use [jsonname.NewNameProvider] instead.
+func NewNameProvider() *NameProvider { return jsonname.NewNameProvider() }
diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE b/vendor/github.com/go-openapi/swag/jsonutils/LICENSE
similarity index 100%
rename from vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE
rename to vendor/github.com/go-openapi/swag/jsonutils/LICENSE
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/concat.go b/vendor/github.com/go-openapi/swag/jsonutils/concat.go
new file mode 100644
index 000000000..4c96ec75d
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/concat.go
@@ -0,0 +1,100 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jsonutils
+
+import (
+ "bytes"
+)
+
+// nullJSON represents a JSON object with null type
+var nullJSON = []byte("null")
+
+const comma = byte(',')
+
+var closers map[byte]byte
+
+func init() {
+ closers = map[byte]byte{
+ '{': '}',
+ '[': ']',
+ }
+}
+
+// ConcatJSON concatenates multiple json objects efficiently
+func ConcatJSON(blobs ...[]byte) []byte {
+ if len(blobs) == 0 {
+ return nil
+ }
+
+ last := len(blobs) - 1
+ for blobs[last] == nil || bytes.Equal(blobs[last], nullJSON) {
+ // strips trailing null objects
+ last--
+ if last < 0 {
+ // there was nothing but "null"s or nil...
+ return nil
+ }
+ }
+ if last == 0 {
+ return blobs[0]
+ }
+
+ var opening, closing byte
+ var idx, a int
+ buf := bytes.NewBuffer(nil)
+
+ for i, b := range blobs[:last+1] {
+ if b == nil || bytes.Equal(b, nullJSON) {
+ // a null object is in the list: skip it
+ continue
+ }
+ if len(b) > 0 && opening == 0 { // is this an array or an object?
+ opening, closing = b[0], closers[b[0]]
+ }
+
+ if opening != '{' && opening != '[' {
+ continue // don't know how to concatenate non container objects
+ }
+
+ const minLengthIfNotEmpty = 3
+ if len(b) < minLengthIfNotEmpty { // yep empty but also the last one, so closing this thing
+ if i == last && a > 0 {
+ _ = buf.WriteByte(closing) // never returns err != nil
+ }
+ continue
+ }
+
+ idx = 0
+ if a > 0 { // we need to join with a comma for everything beyond the first non-empty item
+ _ = buf.WriteByte(comma) // never returns err != nil
+ idx = 1 // this is not the first or the last so we want to drop the leading bracket
+ }
+
+ if i != last { // not the last one, strip brackets
+ _, _ = buf.Write(b[idx : len(b)-1]) // never returns err != nil
+ } else { // last one, strip only the leading bracket
+ _, _ = buf.Write(b[idx:])
+ }
+ a++
+ }
+
+ // somehow it ended up being empty, so provide a default value
+ if buf.Len() == 0 && (opening == '{' || opening == '[') {
+ _ = buf.WriteByte(opening) // never returns err != nil
+ _ = buf.WriteByte(closing)
+ }
+
+ return buf.Bytes()
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/doc.go
new file mode 100644
index 000000000..495ef8341
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/doc.go
@@ -0,0 +1,18 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package jsonutils provides helpers to work with JSON.
+//
+// These utilities work with dynamic go structures to and from JSON.
+package jsonutils
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/json.go b/vendor/github.com/go-openapi/swag/jsonutils/json.go
new file mode 100644
index 000000000..62a3684ed
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/json.go
@@ -0,0 +1,80 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jsonutils
+
+import (
+ "bytes"
+ "encoding/json"
+
+ "github.com/mailru/easyjson"
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+type ejMarshaler = easyjson.Marshaler
+type ejUnmarshaler = easyjson.Unmarshaler
+
+// WriteJSON marshals a data structure as JSON.
+//
+// The difference with [json.Marshal] is that it may check among several alternatives
+// to do so.
+//
+// Currently this allows types that are [easyjson.Marshaler]s to use that route to produce JSON.
+func WriteJSON(value interface{}) ([]byte, error) {
+ if d, ok := value.(ejMarshaler); ok {
+ jw := new(jwriter.Writer)
+ d.MarshalEasyJSON(jw)
+ return jw.BuildBytes()
+ }
+ if d, ok := value.(json.Marshaler); ok {
+ return d.MarshalJSON()
+ }
+ return json.Marshal(value)
+}
+
+// ReadJSON unmarshals JSON data into a data structure.
+//
+// The difference with [json.Unmarshal] is that it may check among several alternatives
+// to do so.
+//
+// Currently this allows types that are [easyjson.Unmarshaler]s to use that route to process JSON.
+func ReadJSON(data []byte, value interface{}) error {
+ trimmedData := bytes.Trim(data, "\x00")
+ if d, ok := value.(ejUnmarshaler); ok {
+ jl := &jlexer.Lexer{Data: trimmedData}
+ d.UnmarshalEasyJSON(jl)
+ return jl.Error()
+ }
+
+ if d, ok := value.(json.Unmarshaler); ok {
+ return d.UnmarshalJSON(trimmedData)
+ }
+
+ return json.Unmarshal(trimmedData, value)
+}
+
+// FromDynamicJSON turns a go value into a properly JSON typed structure.
+//
+// "Dynamic JSON" refers to what you get when unmarshaling JSON into an untyped interface{},
+// i.e. objects are represented by map[string]interface{}, arrays by []interface{}, and
+// all numbers are represented as float64.
+func FromDynamicJSON(source, target interface{}) error {
+ b, err := WriteJSON(source)
+ if err != nil {
+ return err
+ }
+
+ return ReadJSON(b, target)
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go b/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go
new file mode 100644
index 000000000..e11fd4bfb
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go
@@ -0,0 +1,199 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jsonutils
+
+import (
+ "strconv"
+ "strings"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// JSONMapSlice represents a JSON object, with the order of keys maintained.
+type JSONMapSlice []JSONMapItem
+
+// MarshalJSON renders a [JSONMapSlice] as JSON bytes, preserving the order of keys.
+func (s JSONMapSlice) MarshalJSON() ([]byte, error) {
+ w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty}
+ s.MarshalEasyJSON(w)
+
+ return w.BuildBytes()
+}
+
+// MarshalEasyJSON renders a [JSONMapSlice] as JSON bytes, using easyJSON
+func (s JSONMapSlice) MarshalEasyJSON(w *jwriter.Writer) {
+ if s == nil {
+ w.RawString("null")
+
+ return
+ }
+
+ w.RawByte('{')
+
+ if len(s) == 0 {
+ w.RawByte('}')
+
+ return
+ }
+
+ s[0].MarshalEasyJSON(w)
+
+ for i := 1; i < len(s); i++ {
+ w.RawByte(',')
+ s[i].MarshalEasyJSON(w)
+ }
+
+ w.RawByte('}')
+}
+
+// UnmarshalJSON builds a [JSONMapSlice] from JSON bytes, preserving the order of keys.
+//
+// Inner objects are unmarshaled as [JSONMapSlice] slices and not map[string]any.
+func (s *JSONMapSlice) UnmarshalJSON(data []byte) error {
+ l := jlexer.Lexer{Data: data}
+ s.UnmarshalEasyJSON(&l)
+
+ return l.Error()
+}
+
+// UnmarshalEasyJSON builds a [JSONMapSlice] from JSON bytes, using easyJSON
+func (s *JSONMapSlice) UnmarshalEasyJSON(in *jlexer.Lexer) {
+ if in.IsNull() {
+ in.Skip()
+
+ return
+ }
+
+ result := make(JSONMapSlice, 0)
+ in.Delim('{')
+ for !in.IsDelim('}') {
+ var mi JSONMapItem
+ mi.UnmarshalEasyJSON(in)
+ result = append(result, mi)
+ }
+ in.Delim('}')
+
+ *s = result
+}
+
+// JSONMapItem represents the value of a key in a JSON object held by [JSONMapSlice].
+//
+// Notice that JSONMapItem should not be marshaled to or unmarshaled from JSON directly,
+// use this type as part of a [JSONMapSlice] when dealing with JSON bytes.
+type JSONMapItem struct {
+ Key string
+ Value any
+}
+
+// MarshalEasyJSON renders a [JSONMapItem] as JSON bytes, using easyJSON
+func (s JSONMapItem) MarshalEasyJSON(w *jwriter.Writer) {
+ w.String(s.Key)
+ w.RawByte(':')
+ w.Raw(WriteJSON(s.Value))
+}
+
+// UnmarshalEasyJSON builds a [JSONMapItem] from JSON bytes, using easyJSON
+func (s *JSONMapItem) UnmarshalEasyJSON(in *jlexer.Lexer) {
+ key := in.UnsafeString()
+ in.WantColon()
+ value := s.asInterface(in)
+ in.WantComma()
+
+ s.Key = key
+ s.Value = value
+}
+
+// asInterface is very much like [jlexer.Lexer.Interface], but unmarshals an object
+// into a [JSONMapSlice], not a map[string]any.
+//
+// We have to force parsing errors somehow, since [jlexer.Lexer] doesn't let us
+// set a parsing error directly.
+func (s *JSONMapItem) asInterface(in *jlexer.Lexer) any {
+ tokenKind := in.CurrentToken()
+
+ if !in.Ok() {
+ return nil
+ }
+
+ switch tokenKind {
+ case jlexer.TokenString:
+ return in.String()
+
+ case jlexer.TokenNumber:
+ // determine if we may use an integer type
+ n := in.JsonNumber().String()
+ if strings.ContainsRune(n, '.') {
+ f, _ := strconv.ParseFloat(n, 64)
+ return f
+ }
+
+ i, _ := strconv.ParseInt(n, 10, 64)
+ return i
+
+ case jlexer.TokenBool:
+ return in.Bool()
+
+ case jlexer.TokenNull:
+ in.Null()
+ return nil
+
+ case jlexer.TokenDelim:
+ if in.IsDelim('{') {
+ ret := make(JSONMapSlice, 0)
+ ret.UnmarshalEasyJSON(in)
+
+ if in.Ok() {
+ return ret
+ }
+
+ // lexer is in an error state: will exhaust
+ return nil
+ }
+
+ if in.IsDelim('[') {
+ in.Delim('[') // consume
+
+ ret := []interface{}{}
+ for !in.IsDelim(']') {
+ ret = append(ret, s.asInterface(in))
+ in.WantComma()
+ }
+ in.Delim(']')
+
+ if in.Ok() {
+ return ret
+ }
+
+ // lexer is in an error state: will exhaust
+ return nil
+ }
+
+ if in.Ok() {
+ in.Delim('{') // force error
+ }
+
+ return nil
+
+ case jlexer.TokenUndef:
+ fallthrough
+ default:
+ if in.Ok() {
+ in.Delim('{') // force error
+ }
+
+ return nil
+ }
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils_iface.go b/vendor/github.com/go-openapi/swag/jsonutils_iface.go
new file mode 100644
index 000000000..63e23f0b6
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils_iface.go
@@ -0,0 +1,76 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import (
+ "log"
+
+ "github.com/go-openapi/swag/jsonutils"
+)
+
+// JSONMapSlice represents a JSON object, with the order of keys maintained
+//
+// Deprecated: use [jsonutils.JSONMapSlice] instead, or [yamlutils.YAMLMapSlice] if you marshal YAML.
+type JSONMapSlice = jsonutils.JSONMapSlice
+
+// JSONMapItem represents a JSON object, with the order of keys maintained
+//
+// Deprecated: use [jsonutils.JSONMapItem] instead.
+type JSONMapItem = jsonutils.JSONMapItem
+
+// WriteJSON writes json data.
+//
+// Deprecated: use [jsonutils.WriteJSON] instead.
+func WriteJSON(data interface{}) ([]byte, error) { return jsonutils.WriteJSON(data) }
+
+// ReadJSON reads json data.
+//
+// Deprecated: use [jsonutils.ReadJSON] instead.
+func ReadJSON(data []byte, value interface{}) error { return jsonutils.ReadJSON(data, value) }
+
+// DynamicJSONToStruct converts an untyped JSON structure into a target data type.
+//
+// Deprecated: use [jsonutils.FromDynamicJSON] instead.
+func DynamicJSONToStruct(data interface{}, target interface{}) error {
+ return jsonutils.FromDynamicJSON(data, target)
+}
+
+// ConcatJSON concatenates multiple JSON objects efficiently.
+//
+// Deprecated: use [jsonutils.ConcatJSON] instead.
+func ConcatJSON(blobs ...[]byte) []byte { return jsonutils.ConcatJSON(blobs...) }
+
+// ToDynamicJSON turns a go value into a properly JSON untyped structure.
+//
+// It is the same as [FromDynamicJSON], but doesn't check for errors.
+//
+// Deprecated: this function is a misnomer and is unsafe. Use [jsonutils.FromDynamicJSON] instead.
+func ToDynamicJSON(value interface{}) interface{} {
+ var res interface{}
+ if err := FromDynamicJSON(value, &res); err != nil {
+ log.Println(err)
+ }
+
+ return res
+}
+
+// FromDynamicJSON turns a go value into a properly JSON typed structure.
+//
+// "Dynamic JSON" refers to what you get when unmarshaling JSON into an untyped interface{},
+// i.e. objects are represented by map[string]interface{}, arrays by []interface{}, and all
+// scalar values are interface{}.
+//
+// Deprecated: use [jsonutils.FromDynamicJSON] instead.
+func FromDynamicJSON(data, target interface{}) error { return jsonutils.FromDynamicJSON(data, target) }
diff --git a/vendor/github.com/go-openapi/swag/loading.go b/vendor/github.com/go-openapi/swag/loading.go
deleted file mode 100644
index 658a24b78..000000000
--- a/vendor/github.com/go-openapi/swag/loading.go
+++ /dev/null
@@ -1,176 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package swag
-
-import (
- "fmt"
- "io"
- "log"
- "net/http"
- "net/url"
- "os"
- "path"
- "path/filepath"
- "runtime"
- "strings"
- "time"
-)
-
-// LoadHTTPTimeout the default timeout for load requests
-var LoadHTTPTimeout = 30 * time.Second
-
-// LoadHTTPBasicAuthUsername the username to use when load requests require basic auth
-var LoadHTTPBasicAuthUsername = ""
-
-// LoadHTTPBasicAuthPassword the password to use when load requests require basic auth
-var LoadHTTPBasicAuthPassword = ""
-
-// LoadHTTPCustomHeaders an optional collection of custom HTTP headers for load requests
-var LoadHTTPCustomHeaders = map[string]string{}
-
-// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in
-func LoadFromFileOrHTTP(pth string) ([]byte, error) {
- return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(pth)
-}
-
-// LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in
-// timeout arg allows for per request overriding of the request timeout
-func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration) ([]byte, error) {
- return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(timeout))(pth)
-}
-
-// LoadStrategy returns a loader function for a given path or URI.
-//
-// The load strategy returns the remote load for any path starting with `http`.
-// So this works for any URI with a scheme `http` or `https`.
-//
-// The fallback strategy is to call the local loader.
-//
-// The local loader takes a local file system path (absolute or relative) as argument,
-// or alternatively a `file://...` URI, **without host** (see also below for windows).
-//
-// There are a few liberalities, initially intended to be tolerant regarding the URI syntax,
-// especially on windows.
-//
-// Before the local loader is called, the given path is transformed:
-// - percent-encoded characters are unescaped
-// - simple paths (e.g. `./folder/file`) are passed as-is
-// - on windows, occurrences of `/` are replaced by `\`, so providing a relative path such a `folder/file` works too.
-//
-// For paths provided as URIs with the "file" scheme, please note that:
-// - `file://` is simply stripped.
-// This means that the host part of the URI is not parsed at all.
-// For example, `file:///folder/file" becomes "/folder/file`,
-// but `file://localhost/folder/file` becomes `localhost/folder/file` on unix systems.
-// Similarly, `file://./folder/file` yields `./folder/file`.
-// - on windows, `file://...` can take a host so as to specify an UNC share location.
-//
-// Reminder about windows-specifics:
-// - `file://host/folder/file` becomes an UNC path like `\\host\folder\file` (no port specification is supported)
-// - `file:///c:/folder/file` becomes `C:\folder\file`
-// - `file://c:/folder/file` is tolerated (without leading `/`) and becomes `c:\folder\file`
-func LoadStrategy(pth string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) {
- if strings.HasPrefix(pth, "http") {
- return remote
- }
-
- return func(p string) ([]byte, error) {
- upth, err := url.PathUnescape(p)
- if err != nil {
- return nil, err
- }
-
- if !strings.HasPrefix(p, `file://`) {
- // regular file path provided: just normalize slashes
- return local(filepath.FromSlash(upth))
- }
-
- if runtime.GOOS != "windows" {
- // crude processing: this leaves full URIs with a host with a (mostly) unexpected result
- upth = strings.TrimPrefix(upth, `file://`)
-
- return local(filepath.FromSlash(upth))
- }
-
- // windows-only pre-processing of file://... URIs
-
- // support for canonical file URIs on windows.
- u, err := url.Parse(filepath.ToSlash(upth))
- if err != nil {
- return nil, err
- }
-
- if u.Host != "" {
- // assume UNC name (volume share)
- // NOTE: UNC port not yet supported
-
- // when the "host" segment is a drive letter:
- // file://C:/folder/... => C:\folder
- upth = path.Clean(strings.Join([]string{u.Host, u.Path}, `/`))
- if !strings.HasSuffix(u.Host, ":") && u.Host[0] != '.' {
- // tolerance: if we have a leading dot, this can't be a host
- // file://host/share/folder\... ==> \\host\share\path\folder
- upth = "//" + upth
- }
- } else {
- // no host, let's figure out if this is a drive letter
- upth = strings.TrimPrefix(upth, `file://`)
- first, _, _ := strings.Cut(strings.TrimPrefix(u.Path, "/"), "/")
- if strings.HasSuffix(first, ":") {
- // drive letter in the first segment:
- // file:///c:/folder/... ==> strip the leading slash
- upth = strings.TrimPrefix(upth, `/`)
- }
- }
-
- return local(filepath.FromSlash(upth))
- }
-}
-
-func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) {
- return func(path string) ([]byte, error) {
- client := &http.Client{Timeout: timeout}
- req, err := http.NewRequest(http.MethodGet, path, nil) //nolint:noctx
- if err != nil {
- return nil, err
- }
-
- if LoadHTTPBasicAuthUsername != "" && LoadHTTPBasicAuthPassword != "" {
- req.SetBasicAuth(LoadHTTPBasicAuthUsername, LoadHTTPBasicAuthPassword)
- }
-
- for key, val := range LoadHTTPCustomHeaders {
- req.Header.Set(key, val)
- }
-
- resp, err := client.Do(req)
- defer func() {
- if resp != nil {
- if e := resp.Body.Close(); e != nil {
- log.Println(e)
- }
- }
- }()
- if err != nil {
- return nil, err
- }
-
- if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("could not access document at %q [%s]: %w", path, resp.Status, ErrLoader)
- }
-
- return io.ReadAll(resp.Body)
- }
-}
diff --git a/vendor/go.etcd.io/etcd/client/v3/LICENSE b/vendor/github.com/go-openapi/swag/loading/LICENSE
similarity index 100%
rename from vendor/go.etcd.io/etcd/client/v3/LICENSE
rename to vendor/github.com/go-openapi/swag/loading/LICENSE
diff --git a/vendor/github.com/go-openapi/swag/loading/doc.go b/vendor/github.com/go-openapi/swag/loading/doc.go
new file mode 100644
index 000000000..62585615e
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/doc.go
@@ -0,0 +1,16 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package loading provides tools to load a file from http or from a local file system.
+package loading
diff --git a/vendor/github.com/go-openapi/swag/loading/errors.go b/vendor/github.com/go-openapi/swag/loading/errors.go
new file mode 100644
index 000000000..ca45732a7
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/errors.go
@@ -0,0 +1,26 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package loading
+
+type loadingError string
+
+const (
+ // ErrLoader is an error raised by the file loader utility
+ ErrLoader loadingError = "loader error"
+)
+
+func (e loadingError) Error() string {
+ return string(e)
+}
diff --git a/vendor/github.com/go-openapi/swag/loading/json.go b/vendor/github.com/go-openapi/swag/loading/json.go
new file mode 100644
index 000000000..aadf99913
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/json.go
@@ -0,0 +1,22 @@
+package loading
+
+import (
+ "encoding/json"
+ "errors"
+ "path/filepath"
+)
+
+// JSONMatcher matches json for a file loader.
+func JSONMatcher(path string) bool {
+ ext := filepath.Ext(path)
+ return ext == ".json" || ext == ".jsn" || ext == ".jso"
+}
+
+// JSONDoc loads a json document from either a file or a remote url.
+func JSONDoc(path string, opts ...Option) (json.RawMessage, error) {
+ data, err := LoadFromFileOrHTTP(path, opts...)
+ if err != nil {
+ return nil, errors.Join(err, ErrLoader)
+ }
+ return json.RawMessage(data), nil
+}
diff --git a/vendor/github.com/go-openapi/swag/loading/loading.go b/vendor/github.com/go-openapi/swag/loading/loading.go
new file mode 100644
index 000000000..bd955535f
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/loading.go
@@ -0,0 +1,171 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package loading
+
+import (
+ "context"
+ "embed"
+ "fmt"
+ "io"
+ "log"
+ "net/http"
+ "net/url"
+ "path"
+ "path/filepath"
+ "runtime"
+ "strings"
+)
+
+// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in
+func LoadFromFileOrHTTP(pth string, opts ...Option) ([]byte, error) {
+ o := optionsWithDefaults(opts)
+ return LoadStrategy(pth, o.ReadFileFunc(), loadHTTPBytes(opts...), opts...)(pth)
+}
+
+// LoadStrategy returns a loader function for a given path or URI.
+//
+// The load strategy returns the remote load for any path starting with `http`.
+// So this works for any URI with a scheme `http` or `https`.
+//
+// The fallback strategy is to call the local loader.
+//
+// The local loader takes a local file system path (absolute or relative) as argument,
+// or alternatively a `file://...` URI, **without host** (see also below for windows).
+//
+// There are a few liberalities, initially intended to be tolerant regarding the URI syntax,
+// especially on windows.
+//
+// Before the local loader is called, the given path is transformed:
+// - percent-encoded characters are unescaped
+// - simple paths (e.g. `./folder/file`) are passed as-is
+// - on windows, occurrences of `/` are replaced by `\`, so providing a relative path such a `folder/file` works too.
+//
+// For paths provided as URIs with the "file" scheme, please note that:
+// - `file://` is simply stripped.
+// This means that the host part of the URI is not parsed at all.
+// For example, `file:///folder/file" becomes "/folder/file`,
+// but `file://localhost/folder/file` becomes `localhost/folder/file` on unix systems.
+// Similarly, `file://./folder/file` yields `./folder/file`.
+// - on windows, `file://...` can take a host so as to specify an UNC share location.
+//
+// Reminder about windows-specifics:
+// - `file://host/folder/file` becomes an UNC path like `\\host\folder\file` (no port specification is supported)
+// - `file:///c:/folder/file` becomes `C:\folder\file`
+// - `file://c:/folder/file` is tolerated (without leading `/`) and becomes `c:\folder\file`
+func LoadStrategy(pth string, local, remote func(string) ([]byte, error), opts ...Option) func(string) ([]byte, error) {
+ if strings.HasPrefix(pth, "http") {
+ return remote
+ }
+ o := optionsWithDefaults(opts)
+ _, isEmbedFS := o.fs.(embed.FS)
+
+ return func(p string) ([]byte, error) {
+ upth, err := url.PathUnescape(p)
+ if err != nil {
+ return nil, err
+ }
+
+ cpth, hasPrefix := strings.CutPrefix(upth, "file://")
+ if !hasPrefix || isEmbedFS || runtime.GOOS != "windows" {
+ // crude processing: trim the file:// prefix. This leaves full URIs with a host with a (mostly) unexpected result
+ // regular file path provided: just normalize slashes
+ if isEmbedFS {
+ // on windows, we need to slash the path if FS is an embed FS.
+ return local(strings.TrimLeft(filepath.ToSlash(cpth), "./")) // remove invalid leading characters for embed FS
+ }
+
+ return local(filepath.FromSlash(cpth))
+ }
+
+ // windows-only pre-processing of file://... URIs, excluding embed.FS
+
+ // support for canonical file URIs on windows.
+ u, err := url.Parse(filepath.ToSlash(upth))
+ if err != nil {
+ return nil, err
+ }
+
+ if u.Host != "" {
+ // assume UNC name (volume share)
+ // NOTE: UNC port not yet supported
+
+ // when the "host" segment is a drive letter:
+ // file://C:/folder/... => C:\folder
+ upth = path.Clean(strings.Join([]string{u.Host, u.Path}, `/`))
+ if !strings.HasSuffix(u.Host, ":") && u.Host[0] != '.' {
+ // tolerance: if we have a leading dot, this can't be a host
+ // file://host/share/folder\... ==> \\host\share\path\folder
+ upth = "//" + upth
+ }
+ } else {
+ // no host, let's figure out if this is a drive letter
+ upth = strings.TrimPrefix(upth, `file://`)
+ first, _, _ := strings.Cut(strings.TrimPrefix(u.Path, "/"), "/")
+ if strings.HasSuffix(first, ":") {
+ // drive letter in the first segment:
+ // file:///c:/folder/... ==> strip the leading slash
+ upth = strings.TrimPrefix(upth, `/`)
+ }
+ }
+
+ return local(filepath.FromSlash(upth))
+ }
+}
+
+func loadHTTPBytes(opts ...Option) func(path string) ([]byte, error) {
+ o := optionsWithDefaults(opts)
+
+ return func(path string) ([]byte, error) {
+ client := o.client
+ timeoutCtx := context.Background()
+ var cancel func()
+
+ if o.httpTimeout > 0 {
+ timeoutCtx, cancel = context.WithTimeout(timeoutCtx, o.httpTimeout)
+ defer cancel()
+ }
+
+ req, err := http.NewRequestWithContext(timeoutCtx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, err
+ }
+
+ if o.basicAuthUsername != "" && o.basicAuthPassword != "" {
+ req.SetBasicAuth(o.basicAuthUsername, o.basicAuthPassword)
+ }
+
+ for key, val := range o.customHeaders {
+ req.Header.Set(key, val)
+ }
+
+ resp, err := client.Do(req)
+ defer func() {
+ if resp != nil {
+ if e := resp.Body.Close(); e != nil {
+ log.Println(e)
+ }
+ }
+ }()
+ if err != nil {
+ return nil, err
+ }
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("could not access document at %q [%s]: %w", path, resp.Status, ErrLoader)
+ }
+
+ return io.ReadAll(resp.Body)
+ }
+}
diff --git a/vendor/github.com/go-openapi/swag/loading/options.go b/vendor/github.com/go-openapi/swag/loading/options.go
new file mode 100644
index 000000000..a51329e93
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/options.go
@@ -0,0 +1,136 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package loading
+
+import (
+ "io/fs"
+ "net/http"
+ "os"
+ "time"
+)
+
+type (
+ // Option provides options for loading a file over HTTP or from a file.
+ Option func(*options)
+
+ httpOptions struct {
+ httpTimeout time.Duration
+ basicAuthUsername string
+ basicAuthPassword string
+ customHeaders map[string]string
+ client *http.Client
+ }
+
+ fileOptions struct {
+ fs fs.ReadFileFS
+ }
+
+ options struct {
+ httpOptions
+ fileOptions
+ }
+)
+
+func (fo fileOptions) ReadFileFunc() func(string) ([]byte, error) {
+ if fo.fs == nil {
+ return os.ReadFile
+ }
+
+ return fo.fs.ReadFile
+}
+
+// WithTimeout sets a timeout for the remote file loader.
+//
+// The default timeout is 30s.
+func WithTimeout(timeout time.Duration) Option {
+ return func(o *options) {
+ o.httpTimeout = timeout
+ }
+}
+
+// WithBasicAuth sets a basic authentication scheme for the remote file loader.
+func WithBasicAuth(username, password string) Option {
+ return func(o *options) {
+ o.basicAuthUsername = username
+ o.basicAuthPassword = password
+ }
+}
+
+// WithCustomHeaders sets custom headers for the remote file loader.
+func WithCustomHeaders(headers map[string]string) Option {
+ return func(o *options) {
+ if o.customHeaders == nil {
+ o.customHeaders = make(map[string]string, len(headers))
+ }
+
+ for header, value := range headers {
+ o.customHeaders[header] = value
+ }
+ }
+}
+
+// WithHTTClient overrides the default HTTP client used to fetch a remote file.
+//
+// By default, [http.DefaultClient] is used.
+func WithHTTPClient(client *http.Client) Option {
+ return func(o *options) {
+ o.client = client
+ }
+}
+
+// WithFileFS sets a file system for the local file loader.
+//
+// If the provided file system is a [fs.ReadFileFS], the ReadFile function is used.
+// Otherwise, ReadFile is wrapped using [fs.ReadFile].
+//
+// By default, the file system is the one provided by the os package.
+//
+// For example, this may be set to consume from an embedded file system, or a rooted FS.
+func WithFS(filesystem fs.FS) Option {
+ return func(o *options) {
+ if rfs, ok := filesystem.(fs.ReadFileFS); ok {
+ o.fs = rfs
+
+ return
+ }
+ o.fs = readFileFS{FS: filesystem}
+ }
+}
+
+type readFileFS struct {
+ fs.FS
+}
+
+func (r readFileFS) ReadFile(name string) ([]byte, error) {
+ return fs.ReadFile(r.FS, name)
+}
+
+func optionsWithDefaults(opts []Option) options {
+ const defaultTimeout = 30 * time.Second
+
+ o := options{
+ // package level defaults
+ httpOptions: httpOptions{
+ httpTimeout: defaultTimeout,
+ client: http.DefaultClient,
+ },
+ }
+
+ for _, apply := range opts {
+ apply(&o)
+ }
+
+ return o
+}
diff --git a/vendor/github.com/go-openapi/swag/loading/yaml.go b/vendor/github.com/go-openapi/swag/loading/yaml.go
new file mode 100644
index 000000000..40bd2a769
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/yaml.go
@@ -0,0 +1,48 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package loading
+
+import (
+ "encoding/json"
+ "path/filepath"
+
+ "github.com/go-openapi/swag/yamlutils"
+)
+
+// YAMLMatcher matches yaml for a file loader.
+func YAMLMatcher(path string) bool {
+ ext := filepath.Ext(path)
+ return ext == ".yaml" || ext == ".yml"
+}
+
+// YAMLDoc loads a yaml document from either http or a file and converts it to json.
+func YAMLDoc(path string, opts ...Option) (json.RawMessage, error) {
+ yamlDoc, err := YAMLData(path, opts...)
+ if err != nil {
+ return nil, err
+ }
+
+ return yamlutils.YAMLToJSON(yamlDoc)
+}
+
+// YAMLData loads a yaml document from either http or a file.
+func YAMLData(path string, opts ...Option) (interface{}, error) {
+ data, err := LoadFromFileOrHTTP(path, opts...)
+ if err != nil {
+ return nil, err
+ }
+
+ return yamlutils.BytesToYAMLDoc(data)
+}
diff --git a/vendor/github.com/go-openapi/swag/loading_iface.go b/vendor/github.com/go-openapi/swag/loading_iface.go
new file mode 100644
index 000000000..38d825bc5
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading_iface.go
@@ -0,0 +1,102 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import (
+ "encoding/json"
+ "time"
+
+ "github.com/go-openapi/swag/loading"
+)
+
+var (
+ // Package-level defaults for the file loading utilities (deprecated).
+
+ // LoadHTTPTimeout the default timeout for load requests.
+ //
+ // Deprecated: use [loading.WithTimeout] instead.
+ LoadHTTPTimeout = 30 * time.Second
+
+ // LoadHTTPBasicAuthUsername the username to use when load requests require basic auth.
+ //
+ // Deprecated: use [loading.WithBasicAuth] instead.
+ LoadHTTPBasicAuthUsername = ""
+
+ // LoadHTTPBasicAuthPassword the password to use when load requests require basic auth.
+ //
+ // Deprecated: use [loading.WithBasicAuth] instead.
+ LoadHTTPBasicAuthPassword = ""
+
+ // LoadHTTPCustomHeaders an optional collection of custom HTTP headers for load requests.
+ //
+ // Deprecated: use [loading.WithCustomHeaders] instead.
+ LoadHTTPCustomHeaders = map[string]string{}
+)
+
+// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the provided path.
+//
+// Deprecated: use [loading.LoadFromFileOrHTTP] instead.
+func LoadFromFileOrHTTP(pth string, opts ...loading.Option) ([]byte, error) {
+ return loading.LoadFromFileOrHTTP(pth, loadingOptionsWithDefaults(opts)...)
+}
+
+// LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in
+// timeout arg allows for per request overriding of the request timeout.
+//
+// Deprecated: use [loading.LoadFileOrHTTP] with the [loading.WithTimeout] option instead.
+func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration, opts ...loading.Option) ([]byte, error) {
+ opts = append(opts, loading.WithTimeout(timeout))
+
+ return LoadFromFileOrHTTP(pth, opts...)
+}
+
+// LoadStrategy returns a loader function for a given path or URL.
+//
+// Deprecated: use [loading.LoadStrategy] instead.
+func LoadStrategy(pth string, local, remote func(string) ([]byte, error), opts ...loading.Option) func(string) ([]byte, error) {
+ return loading.LoadStrategy(pth, local, remote, loadingOptionsWithDefaults(opts)...)
+}
+
+// YAMLMatcher matches yaml for a file loader.
+//
+// Deprecated: use [loading.YAMLMatcher] instead.
+func YAMLMatcher(path string) bool { return loading.YAMLMatcher(path) }
+
+// YAMLDoc loads a yaml document from either http or a file and converts it to json.
+//
+// Deprecated: use [loading.YAMLDoc] instead.
+func YAMLDoc(path string) (json.RawMessage, error) {
+ return loading.YAMLDoc(path)
+}
+
+// YAMLData loads a yaml document from either http or a file.
+//
+// Deprecated: use [loading.YAMLData] instead.
+func YAMLData(path string) (interface{}, error) {
+ return loading.YAMLData(path)
+}
+
+// loadingOptionsWithDefaults bridges deprecated default settings that use package-level variables,
+// with the recommended use of loading.Option.
+func loadingOptionsWithDefaults(opts []loading.Option) []loading.Option {
+ o := []loading.Option{
+ loading.WithTimeout(LoadHTTPTimeout),
+ loading.WithBasicAuth(LoadHTTPBasicAuthUsername, LoadHTTPBasicAuthPassword),
+ loading.WithCustomHeaders(LoadHTTPCustomHeaders),
+ }
+ o = append(o, opts...)
+
+ return o
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md b/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md
new file mode 100644
index 000000000..6674c63b7
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md
@@ -0,0 +1,90 @@
+# Benchmarking name mangling utilities
+
+```bash
+go test -bench XXX -run XXX -benchtime 30s
+```
+
+## Benchmarks at b3e7a5386f996177e4808f11acb2aa93a0f660df
+
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/swag
+cpu: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
+BenchmarkToXXXName/ToGoName-4 862623 44101 ns/op 10450 B/op 732 allocs/op
+BenchmarkToXXXName/ToVarName-4 853656 40728 ns/op 10468 B/op 734 allocs/op
+BenchmarkToXXXName/ToFileName-4 1268312 27813 ns/op 9785 B/op 617 allocs/op
+BenchmarkToXXXName/ToCommandName-4 1276322 27903 ns/op 9785 B/op 617 allocs/op
+BenchmarkToXXXName/ToHumanNameLower-4 895334 40354 ns/op 10472 B/op 731 allocs/op
+BenchmarkToXXXName/ToHumanNameTitle-4 882441 40678 ns/op 10566 B/op 749 allocs/op
+```
+
+## Benchmarks after PR #79
+
+~ x10 performance improvement and ~ /100 memory allocations.
+
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/swag
+cpu: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
+BenchmarkToXXXName/ToGoName-4 9595830 3991 ns/op 42 B/op 5 allocs/op
+BenchmarkToXXXName/ToVarName-4 9194276 3984 ns/op 62 B/op 7 allocs/op
+BenchmarkToXXXName/ToFileName-4 17002711 2123 ns/op 147 B/op 7 allocs/op
+BenchmarkToXXXName/ToCommandName-4 16772926 2111 ns/op 147 B/op 7 allocs/op
+BenchmarkToXXXName/ToHumanNameLower-4 9788331 3749 ns/op 92 B/op 6 allocs/op
+BenchmarkToXXXName/ToHumanNameTitle-4 9188260 3941 ns/op 104 B/op 6 allocs/op
+```
+
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/swag
+cpu: AMD Ryzen 7 5800X 8-Core Processor
+BenchmarkToXXXName/ToGoName-16 18527378 1972 ns/op 42 B/op 5 allocs/op
+BenchmarkToXXXName/ToVarName-16 15552692 2093 ns/op 62 B/op 7 allocs/op
+BenchmarkToXXXName/ToFileName-16 32161176 1117 ns/op 147 B/op 7 allocs/op
+BenchmarkToXXXName/ToCommandName-16 32256634 1137 ns/op 147 B/op 7 allocs/op
+BenchmarkToXXXName/ToHumanNameLower-16 18599661 1946 ns/op 92 B/op 6 allocs/op
+BenchmarkToXXXName/ToHumanNameTitle-16 17581353 2054 ns/op 105 B/op 6 allocs/op
+```
+
+## Benchmarks at d7d2d1b895f5b6747afaff312dd2a402e69e818b
+
+go1.24
+
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/swag
+cpu: AMD Ryzen 7 5800X 8-Core Processor
+BenchmarkToXXXName/ToGoName-16 19757858 1881 ns/op 42 B/op 5 allocs/op
+BenchmarkToXXXName/ToVarName-16 17494111 2094 ns/op 74 B/op 7 allocs/op
+BenchmarkToXXXName/ToFileName-16 28161226 1492 ns/op 158 B/op 7 allocs/op
+BenchmarkToXXXName/ToCommandName-16 23787333 1489 ns/op 158 B/op 7 allocs/op
+BenchmarkToXXXName/ToHumanNameLower-16 17537257 2030 ns/op 103 B/op 6 allocs/op
+BenchmarkToXXXName/ToHumanNameTitle-16 16977453 2156 ns/op 105 B/op 6 allocs/op
+```
+
+## Benchmarks after PR #106
+
+Moving the scope of everything down to a struct allowed to reduce a bit garbage and pooling.
+
+On top of that, ToGoName (and thus ToVarName) have been subject to a minor optimization, removing a few allocations.
+
+Overall timings improve by ~ -10%.
+
+go1.24
+
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/swag/mangling
+cpu: AMD Ryzen 7 5800X 8-Core Processor
+BenchmarkToXXXName/ToGoName-16 22496130 1618 ns/op 31 B/op 3 allocs/op
+BenchmarkToXXXName/ToVarName-16 22538068 1618 ns/op 33 B/op 3 allocs/op
+BenchmarkToXXXName/ToFileName-16 27722977 1236 ns/op 105 B/op 6 allocs/op
+BenchmarkToXXXName/ToCommandName-16 27967395 1258 ns/op 105 B/op 6 allocs/op
+BenchmarkToXXXName/ToHumanNameLower-16 18587901 1917 ns/op 103 B/op 6 allocs/op
+BenchmarkToXXXName/ToHumanNameTitle-16 17193208 2019 ns/op 108 B/op 7 allocs/op
+```
diff --git a/vendor/github.com/google/shlex/COPYING b/vendor/github.com/go-openapi/swag/mangling/LICENSE
similarity index 100%
rename from vendor/github.com/google/shlex/COPYING
rename to vendor/github.com/go-openapi/swag/mangling/LICENSE
diff --git a/vendor/github.com/go-openapi/swag/mangling/doc.go b/vendor/github.com/go-openapi/swag/mangling/doc.go
new file mode 100644
index 000000000..dbe806828
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/doc.go
@@ -0,0 +1,36 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package mangling provides name mangling capabilities.
+//
+// Name mangling is an important stage when generating code:
+// it helps construct safe program identifiers that abide by the language rules
+// and play along with linters.
+//
+// Examples:
+//
+// Suppose we get an object name taken from an API spec: "json_object",
+//
+// We may generate a legit go type name using [NameMangler.ToGoName]: "JsonObject".
+//
+// We may then locate this type in a source file named using [NameMangler.ToFileName]: "json_object.go".
+//
+// The methods exposed by the NameMangler are used to generate code in many different contexts, such as:
+//
+// - generating exported or unexported go identifiers from a JSON schema or an API spec
+// - generating file names
+// - generating human-readable comments for types and variables
+// - generating JSON-like API identifiers from go code
+// - ...
+package mangling
diff --git a/vendor/github.com/go-openapi/swag/mangling/initialism_index.go b/vendor/github.com/go-openapi/swag/mangling/initialism_index.go
new file mode 100644
index 000000000..cf0786f81
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/initialism_index.go
@@ -0,0 +1,268 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package mangling
+
+import (
+ "sort"
+ "strings"
+ "unicode"
+ "unicode/utf8"
+)
+
+// DefaultInitialisms returns all the initialisms configured by default for this package.
+//
+// # Motivation
+//
+// Common initialisms are acronyms for which the ordinary camel-casing rules are altered and
+// for which we retain the original case.
+//
+// This is largely specific to the go naming conventions enforced by golint (now revive).
+//
+// # Example
+//
+// In go, "id" is a good-looking identifier, but "Id" is not and "ID" is preferred
+// (notice that this stems only from conventions: the go compiler accepts all of these).
+//
+// Similarly, we may use "http", but not "Http". In this case, "HTTP" is preferred.
+//
+// # Reference and customization
+//
+// The default list of these casing-style exceptions is taken from the [github.com/mgechev/revive] linter for go:
+// https://github.com/mgechev/revive/blob/master/lint/name.go#L93
+//
+// There are a few additions to the original list, such as IPv4, IPv6 and OAI ("OpenAPI").
+//
+// For these additions, "IPv4" would be preferred to "Ipv4" or "IPV4", and "OAI" to "Oai"
+//
+// You may redefine this list entirely using the mangler option [WithInitialisms], or simply add extra definitions
+// using [WithAdditionalInitialisms].
+//
+// # Mixed-case and plurals
+//
+// Notice that initialisms are not necessarily fully upper-cased: a mixed-case initialism indicates the preferred casing.
+//
+// Obviously, lower-case only initialisms do not make a lot of sense: if lower-case only initialisms are added,
+// they will be considered fully capitalized.
+//
+// Plural forms use mixed case like "IDs". And so do values like "IPv4" or "IPv6".
+//
+// The [NameMangler] automatically detects simple plurals for words such as "IDs" or "APIs",
+// so you don't need to configure these variants.
+//
+// At this moment, it doesn't support pluralization of terms that ends with an 's' (or 'S'), since there is
+// no clear consensus on whether a word like DNS should be pluralized as DNSes or remain invariant.
+// The [NameMangler] consider those invariant. Therefore DNSs or DNSes are not recognized as plurals for DNS.
+//
+// Besids, we don't want to support pluralization of terms which would otherwise conflict with another one,
+// like "HTTPs" vs "HTTPS". All these should be considered invariant. Hence: "Https" matches "HTTPS" and
+// "HTTPSS" is "HTTPS" followed by "S".
+func DefaultInitialisms() []string {
+ return []string{
+ "ACL",
+ "API",
+ "ASCII",
+ "CPU",
+ "CSS",
+ "DNS",
+ "EOF",
+ "GUID",
+ "HTML",
+ "HTTPS",
+ "HTTP",
+ "ID",
+ "IP",
+ "IPv4", // prefer the mixed case outcome IPv4 over the capitalized IPV4
+ "IPv6", // prefer the mixed case outcome IPv6 over the capitalized IPV6
+ "JSON",
+ "LHS",
+ "OAI",
+ "QPS",
+ "RAM",
+ "RHS",
+ "RPC",
+ "SLA",
+ "SMTP",
+ "SQL",
+ "SSH",
+ "TCP",
+ "TLS",
+ "TTL",
+ "UDP",
+ "UI",
+ "UID",
+ "UUID",
+ "URI",
+ "URL",
+ "UTF8",
+ "VM",
+ "XML",
+ "XMPP",
+ "XSRF",
+ "XSS",
+ }
+}
+
+type indexOfInitialisms struct {
+ initialismsCache
+
+ index map[string]struct{}
+}
+
+func newIndexOfInitialisms() *indexOfInitialisms {
+ return &indexOfInitialisms{
+ index: make(map[string]struct{}),
+ }
+}
+
+func (m *indexOfInitialisms) add(words ...string) *indexOfInitialisms {
+ for _, word := range words {
+ // sanitization of injected words: trimmed from blanks, and must start with a letter
+ trimmed := strings.TrimSpace(word)
+
+ firstRune, _ := utf8.DecodeRuneInString(trimmed)
+ if !unicode.IsLetter(firstRune) {
+ continue
+ }
+
+ // Initialisms are case-sensitive. This means that we support mixed-case words.
+ // However, if specified as a lower-case string, the initialism should be fully capitalized.
+ if trimmed == strings.ToLower(trimmed) {
+ m.index[strings.ToUpper(trimmed)] = struct{}{}
+
+ continue
+ }
+
+ m.index[trimmed] = struct{}{}
+ }
+ return m
+}
+
+func (m *indexOfInitialisms) sorted() []string {
+ result := make([]string, 0, len(m.index))
+ for k := range m.index {
+ result = append(result, k)
+ }
+ sort.Sort(sort.Reverse(byInitialism(result)))
+ return result
+}
+
+func (m *indexOfInitialisms) buildCache() {
+ m.build(m.sorted(), m.pluralForm)
+}
+
+// initialismsCache caches all needed pre-computed and converted initialism entries,
+// in the desired resolution order.
+type initialismsCache struct {
+ initialisms []string
+ initialismsRunes [][]rune
+ initialismsUpperCased [][]rune // initialisms cached in their trimmed, upper-cased version
+ initialismsPluralForm []pluralForm
+}
+
+func (c *initialismsCache) build(in []string, pluralfunc func(string) pluralForm) {
+ c.initialisms = in
+ c.initialismsRunes = asRunes(c.initialisms)
+ c.initialismsUpperCased = asUpperCased(c.initialisms)
+ c.initialismsPluralForm = asPluralForms(c.initialisms, pluralfunc)
+}
+
+// pluralForm denotes the kind of pluralization to be used for initialisms.
+//
+// At this moment, initialisms are either invariant or follow a simple plural form with an
+// extra (lower case) "s".
+type pluralForm uint8
+
+const (
+ notPlural pluralForm = iota
+ invariantPlural
+ simplePlural
+)
+
+// pluralForm indicates how we want to pluralize a given initialism.
+//
+// Besides configured invariant forms (like HTTP and HTTPS),
+// an initialism is normally pluralized by adding a single 's', like in IDs.
+//
+// Initialisms ending with an 'S' or an 's' are configured as invariant (we don't
+// support plural forms like CSSes or DNSes, however the mechanism could be extended to
+// do just that).
+func (m *indexOfInitialisms) pluralForm(key string) pluralForm {
+ if _, ok := m.index[key]; !ok {
+ return notPlural
+ }
+
+ if strings.HasSuffix(strings.ToUpper(key), "S") {
+ return invariantPlural
+ }
+
+ if _, ok := m.index[key+"s"]; ok {
+ return invariantPlural
+ }
+
+ if _, ok := m.index[key+"S"]; ok {
+ return invariantPlural
+ }
+
+ return simplePlural
+}
+
+type byInitialism []string
+
+func (s byInitialism) Len() int {
+ return len(s)
+}
+func (s byInitialism) Swap(i, j int) {
+ s[i], s[j] = s[j], s[i]
+}
+
+// Less specifies the order in which initialisms are prioritized:
+// 1. match longest first
+// 2. when equal length, match in reverse lexicographical order, lower case match comes first
+func (s byInitialism) Less(i, j int) bool {
+ if len(s[i]) != len(s[j]) {
+ return len(s[i]) < len(s[j])
+ }
+
+ return s[i] < s[j]
+}
+
+func asRunes(in []string) [][]rune {
+ out := make([][]rune, len(in))
+ for i, initialism := range in {
+ out[i] = []rune(initialism)
+ }
+
+ return out
+}
+
+func asUpperCased(in []string) [][]rune {
+ out := make([][]rune, len(in))
+
+ for i, initialism := range in {
+ out[i] = []rune(upper(trim(initialism)))
+ }
+
+ return out
+}
+
+// asPluralForms bakes an index of pluralization support.
+func asPluralForms(in []string, pluralFunc func(string) pluralForm) []pluralForm {
+ out := make([]pluralForm, len(in))
+ for i, initialism := range in {
+ out[i] = pluralFunc(initialism)
+ }
+
+ return out
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/name_lexem.go b/vendor/github.com/go-openapi/swag/mangling/name_lexem.go
new file mode 100644
index 000000000..02004b4f3
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/name_lexem.go
@@ -0,0 +1,197 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package mangling
+
+import (
+ "bytes"
+ "strings"
+ "unicode"
+ "unicode/utf8"
+)
+
+type (
+ lexemKind uint8
+
+ nameLexem struct {
+ original string
+ matchedInitialism string
+ kind lexemKind
+ }
+)
+
+const (
+ lexemKindCasualName lexemKind = iota
+ lexemKindInitialismName
+)
+
+func newInitialismNameLexem(original, matchedInitialism string) nameLexem {
+ return nameLexem{
+ kind: lexemKindInitialismName,
+ original: original,
+ matchedInitialism: matchedInitialism,
+ }
+}
+
+func newCasualNameLexem(original string) nameLexem {
+ return nameLexem{
+ kind: lexemKindCasualName,
+ original: trim(original), // TODO: save on calls to trim
+ }
+}
+
+// WriteTitleized writes the titleized lexeme to a bytes.Buffer.
+//
+// If the first letter cannot be capitalized, it doesn't write anything and return false,
+// so the caller may attempt some workaround strategy.
+func (l nameLexem) WriteTitleized(w *bytes.Buffer, alwaysUpper bool) bool {
+ if l.kind == lexemKindInitialismName {
+ w.WriteString(l.matchedInitialism)
+
+ return true
+ }
+
+ if len(l.original) == 0 {
+ return true
+ }
+
+ if len(l.original) == 1 {
+ // identifier is too short: casing will depend on the context
+ firstByte := l.original[0]
+ switch {
+ case 'A' <= firstByte && firstByte <= 'Z':
+ // safe
+ w.WriteByte(firstByte)
+
+ return true
+ case alwaysUpper && 'a' <= firstByte && firstByte <= 'z':
+ w.WriteByte(firstByte - 'a' + 'A')
+
+ return true
+ default:
+
+ // not a letter: skip and let the caller decide
+ return false
+ }
+ }
+
+ if firstByte := l.original[0]; firstByte < utf8.RuneSelf {
+ // ASCII
+ switch {
+ case 'A' <= firstByte && firstByte <= 'Z':
+ // already an upper case letter
+ w.WriteString(l.original)
+
+ return true
+ case 'a' <= firstByte && firstByte <= 'z':
+ w.WriteByte(firstByte - 'a' + 'A')
+ w.WriteString(l.original[1:])
+
+ return true
+ default:
+ // not a good candidate: doesn't start with a letter
+ return false
+ }
+ }
+
+ // unicode
+ firstRune, idx := utf8.DecodeRuneInString(l.original)
+ if !unicode.IsLetter(firstRune) || !unicode.IsUpper(unicode.ToUpper(firstRune)) {
+ // not a good candidate: doesn't start with a letter
+ // or a rune for which case doesn't make sense (e.g. East-Asian runes etc)
+ return false
+ }
+
+ rest := l.original[idx:]
+ w.WriteRune(unicode.ToUpper(firstRune))
+ w.WriteString(strings.ToLower(rest))
+
+ return true
+}
+
+// WriteLower is like write titleized but it writes a lower-case version of the lexeme.
+//
+// Similarly, there is no writing if the casing of the first rune doesn't make sense.
+func (l nameLexem) WriteLower(w *bytes.Buffer, alwaysLower bool) bool {
+ if l.kind == lexemKindInitialismName {
+ w.WriteString(lower(l.matchedInitialism))
+
+ return true
+ }
+
+ if len(l.original) == 0 {
+ return true
+ }
+
+ if len(l.original) == 1 {
+ // identifier is too short: casing will depend on the context
+ firstByte := l.original[0]
+ switch {
+ case 'a' <= firstByte && firstByte <= 'z':
+ // safe
+ w.WriteByte(firstByte)
+
+ return true
+ case alwaysLower && 'A' <= firstByte && firstByte <= 'Z':
+ w.WriteByte(firstByte - 'A' + 'a')
+
+ return true
+ default:
+
+ // not a letter: skip and let the caller decide
+ return false
+ }
+ }
+
+ if firstByte := l.original[0]; firstByte < utf8.RuneSelf {
+ // ASCII
+ switch {
+ case 'a' <= firstByte && firstByte <= 'z':
+ // already a lower case letter
+ w.WriteString(l.original)
+
+ return true
+ case 'A' <= firstByte && firstByte <= 'Z':
+ w.WriteByte(firstByte - 'A' + 'a')
+ w.WriteString(l.original[1:])
+
+ return true
+ default:
+ // not a good candidate: doesn't start with a letter
+ return false
+ }
+ }
+
+ // unicode
+ firstRune, idx := utf8.DecodeRuneInString(l.original)
+ if !unicode.IsLetter(firstRune) || !unicode.IsLower(unicode.ToLower(firstRune)) {
+ // not a good candidate: doesn't start with a letter
+ // or a rune for which case doesn't make sense (e.g. East-Asian runes etc)
+ return false
+ }
+
+ rest := l.original[idx:]
+ w.WriteRune(unicode.ToLower(firstRune))
+ w.WriteString(rest)
+
+ return true
+}
+
+func (l nameLexem) GetOriginal() string {
+ return l.original
+}
+
+func (l nameLexem) IsInitialism() bool {
+ return l.kind == lexemKindInitialismName
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/name_mangler.go b/vendor/github.com/go-openapi/swag/mangling/name_mangler.go
new file mode 100644
index 000000000..94ae555a7
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/name_mangler.go
@@ -0,0 +1,381 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package mangling
+
+import (
+ "strings"
+ "unicode"
+)
+
+// NameMangler knows how to transform sentences or words into
+// identifiers that are a better fit in contexts such as:
+//
+// - unexported or exported go variable identifiers
+// - file names
+// - camel cased identifiers
+// - ...
+//
+// The [NameMangler] is safe for concurrent use, save for its [NameMangler.AddInitialisms] method,
+// which is not.
+//
+// # Known limitations
+//
+// At this moment, the [NameMangler] doesn't play well with "all caps" text:
+//
+// unless every single upper-cased word is declared as an initialism, capitalized words would generally
+// not be transformed with the expected result, e.g.
+//
+// ToFileName("THIS_IS_ALL_CAPS")
+//
+// yields the weird outcome
+//
+// "t_h_i_s_i_s_a_l_l_c_a_p_s"
+type NameMangler struct {
+ options
+
+ index *indexOfInitialisms
+
+ splitter splitter
+ splitterWithPostSplit splitter
+
+ _ struct{}
+}
+
+// NewNameMangler builds a name mangler ready to convert strings.
+//
+// The default name mangler is configured with default common initialisms and all default options.
+func NewNameMangler(opts ...Option) NameMangler {
+ m := NameMangler{
+ options: optionsWithDefaults(opts),
+ index: newIndexOfInitialisms(),
+ }
+ m.addInitialisms(m.commonInitialisms...)
+
+ // a splitter that returns matches lexemes as ready-to-assemble strings:
+ // details of the lexemes are redeemed.
+ m.splitter = newSplitter(
+ withInitialismsCache(&m.index.initialismsCache),
+ withReplaceFunc(m.replaceFunc),
+ )
+
+ // a splitter that returns matches lexemes ready for post-processing
+ m.splitterWithPostSplit = newSplitter(
+ withInitialismsCache(&m.index.initialismsCache),
+ withReplaceFunc(m.replaceFunc),
+ withPostSplitInitialismCheck,
+ )
+
+ return m
+}
+
+// AddInitialisms declares extra initialisms to the mangler.
+//
+// It declares extra words as "initialisms" (i.e. words that won't be camel cased or titled cased),
+// on top of the existing list of common initialisms (such as ID, HTTP...).
+//
+// Added words must start with a (unicode) letter. If some don't, they are ignored.
+// Added words are either fully capitalized or mixed-cased. Lower-case only words are considered capitalized.
+//
+// It is typically used just after initializing the [NameMangler].
+//
+// When all initialisms are known at the time the mangler is initialized, it is preferable to
+// use [NewNameMangler] with the option [WithAdditionalInitialisms].
+//
+// Adding initialisms mutates the mangler and should not be carried out concurrently with other calls to the mangler.
+func (m *NameMangler) AddInitialisms(words ...string) {
+ m.addInitialisms(words...)
+}
+
+// Initialisms renders the list of initialisms supported by this mangler.
+func (m *NameMangler) Initialisms() []string {
+ return m.index.initialisms
+}
+
+// Camelize a single word.
+//
+// Example:
+//
+// - "HELLO" and "hello" become "Hello".
+func (m NameMangler) Camelize(word string) string {
+ ru := []rune(word)
+
+ switch len(ru) {
+ case 0:
+ return ""
+ case 1:
+ return string(unicode.ToUpper(ru[0]))
+ default:
+ camelized := poolOfBuffers.BorrowBuffer(len(word))
+ camelized.Grow(len(word))
+ defer func() {
+ poolOfBuffers.RedeemBuffer(camelized)
+ }()
+
+ camelized.WriteRune(unicode.ToUpper(ru[0]))
+ for _, ru := range ru[1:] {
+ camelized.WriteRune(unicode.ToLower(ru))
+ }
+
+ return camelized.String()
+ }
+}
+
+// ToFileName generates a suitable snake-case file name from a sentence.
+//
+// It lower-cases everything with underscore (_) as a word separator.
+//
+// Examples:
+//
+// - "Hello, Swagger" becomes "hello_swagger"
+// - "HelloSwagger" becomes "hello_swagger"
+func (m NameMangler) ToFileName(name string) string {
+ inptr := m.split(name)
+ in := *inptr
+ out := make([]string, 0, len(in))
+
+ for _, w := range in {
+ out = append(out, lower(w))
+ }
+ poolOfStrings.RedeemStrings(inptr)
+
+ return strings.Join(out, "_")
+}
+
+// ToCommandName generates a suitable CLI command name from a sentence.
+//
+// It lower-cases everything with dash (-) as a word separator.
+//
+// Examples:
+//
+// - "Hello, Swagger" becomes "hello-swagger"
+// - "HelloSwagger" becomes "hello-swagger"
+func (m NameMangler) ToCommandName(name string) string {
+ inptr := m.split(name)
+ in := *inptr
+ out := make([]string, 0, len(in))
+
+ for _, w := range in {
+ out = append(out, lower(w))
+ }
+ poolOfStrings.RedeemStrings(inptr)
+
+ return strings.Join(out, "-")
+}
+
+// ToHumanNameLower represents a code name as a human-readable series of words.
+//
+// It lower-cases everything with blank space as a word separator.
+//
+// NOTE: parts recognized as initialisms just keep their original casing.
+//
+// Examples:
+//
+// - "Hello, Swagger" becomes "hello swagger"
+// - "HelloSwagger" or "Hello-Swagger" become "hello swagger"
+func (m NameMangler) ToHumanNameLower(name string) string {
+ s := m.splitterWithPostSplit
+ in := s.split(name)
+ out := make([]string, 0, len(*in))
+
+ for _, w := range *in {
+ if !w.IsInitialism() {
+ out = append(out, lower(w.GetOriginal()))
+ } else {
+ out = append(out, trim(w.GetOriginal()))
+ }
+ }
+
+ poolOfLexems.RedeemLexems(in)
+
+ return strings.Join(out, " ")
+}
+
+// ToHumanNameTitle represents a code name as a human-readable series of titleized words.
+//
+// It titleizes every word with blank space as a word separator.
+//
+// Examples:
+//
+// - "hello, Swagger" becomes "Hello Swagger"
+// - "helloSwagger" becomes "Hello Swagger"
+func (m NameMangler) ToHumanNameTitle(name string) string {
+ s := m.splitterWithPostSplit
+ in := s.split(name)
+
+ out := make([]string, 0, len(*in))
+ for _, w := range *in {
+ original := trim(w.GetOriginal())
+ if !w.IsInitialism() {
+ out = append(out, m.Camelize(original))
+ } else {
+ out = append(out, original)
+ }
+ }
+ poolOfLexems.RedeemLexems(in)
+
+ return strings.Join(out, " ")
+}
+
+// ToJSONName generates a camelized single-word version of a sentence.
+//
+// The output assembles every camelized word, but for the first word, which
+// is lower-cased.
+//
+// Example:
+//
+// - "Hello_swagger" becomes "helloSwagger"
+func (m NameMangler) ToJSONName(name string) string {
+ inptr := m.split(name)
+ in := *inptr
+ out := make([]string, 0, len(in))
+
+ for i, w := range in {
+ if i == 0 {
+ out = append(out, lower(w))
+ continue
+ }
+ out = append(out, m.Camelize(trim(w)))
+ }
+
+ poolOfStrings.RedeemStrings(inptr)
+
+ return strings.Join(out, "")
+}
+
+// ToVarName generates a legit unexported go variable name from a sentence.
+//
+// The generated name plays well with linters (see also [NameMangler.ToGoName]).
+//
+// Examples:
+//
+// - "Hello_swagger" becomes "helloSwagger"
+// - "Http_server" becomes "httpServer"
+//
+// This name applies the same rules as [NameMangler.ToGoName] (legit exported variable), save the
+// capitalization of the initial rune.
+//
+// Special case: when the initial part is a recognized as an initialism (like in the example above),
+// the full part is lower-cased.
+func (m NameMangler) ToVarName(name string) string {
+ return m.goIdentifier(name, false)
+}
+
+// ToGoName generates a legit exported go variable name from a sentence.
+//
+// The generated name plays well with most linters.
+//
+// ToGoName abides by the go "exported" symbol rule starting with an upper-case letter.
+//
+// Examples:
+//
+// - "hello_swagger" becomes "HelloSwagger"
+// - "Http_server" becomes "HTTPServer"
+//
+// # Edge cases
+//
+// Whenever the first rune is not eligible to upper case, a special prefix is prepended to the resulting name.
+// By default this is simply "X" and you may customize this behavior using the [WithGoNamePrefixFunc] option.
+//
+// This happens when the first rune is not a letter, e.g. a digit, or a symbol that has no word transliteration
+// (see also [WithReplaceFunc] about symbol transliterations),
+// as well as for most East Asian or Devanagari runes, for which there is no such concept as upper-case.
+//
+// # Linting
+//
+// [revive], the successor of golint is the reference linter.
+//
+// This means that [NameMangler.ToGoName] supports the initialisms that revive checks (see also [DefaultInitialisms]).
+//
+// At this moment, there is no attempt to transliterate unicode into ascii, meaning that some linters
+// (e.g. asciicheck, gosmopolitan) may croak on go identifiers generated from unicode input.
+//
+// [revive]: https://github.com/mgechev/revive
+func (m NameMangler) ToGoName(name string) string {
+ return m.goIdentifier(name, true)
+}
+
+func (m NameMangler) goIdentifier(name string, exported bool) string {
+ s := m.splitterWithPostSplit
+ lexems := s.split(name)
+ defer func() {
+ poolOfLexems.RedeemLexems(lexems)
+ }()
+ lexemes := *lexems
+
+ if len(lexemes) == 0 {
+ return ""
+ }
+
+ result := poolOfBuffers.BorrowBuffer(len(name))
+ defer func() {
+ poolOfBuffers.RedeemBuffer(result)
+ }()
+
+ firstPart := lexemes[0]
+ if !exported {
+ if ok := firstPart.WriteLower(result, true); !ok {
+ // NOTE: an initialism as the first part is lower-cased: no longer generates stuff like hTTPxyz.
+ //
+ // same prefixing rule applied to unexported variable as to an exported one, so that we have consistent
+ // names, whether the generated identifier is exported or not.
+ result.WriteString(strings.ToLower(m.prefixFunc()(name)))
+ result.WriteString(lexemes[0].GetOriginal())
+ }
+ } else {
+ if ok := firstPart.WriteTitleized(result, true); !ok {
+ // "repairs" a lexeme that doesn't start with a letter to become
+ // the start a legit go name. The current strategy is very crude and simply adds a fixed prefix,
+ // e.g. "X".
+ // For instance "1_sesame_street" would be split into lexemes ["1", "sesame", "street"] and
+ // the first one ("1") would result in something like "X1" (with the default prefix function).
+ //
+ // NOTE: no longer forcing the first part to be fully upper-cased
+ result.WriteString(m.prefixFunc()(name))
+ result.WriteString(lexemes[0].GetOriginal())
+ }
+ }
+
+ for _, lexem := range lexemes[1:] {
+ // NOTE: no longer forcing initialism parts to be fully upper-cased:
+ // * pluralized initialism preserve their trailing "s"
+ // * mixed-cased initialisms, such as IPv4, are preserved
+ if ok := lexem.WriteTitleized(result, false); !ok {
+ // it's not titleized: perhaps it's too short, perhaps the first rune is not a letter.
+ // write anyway
+ result.WriteString(lexem.GetOriginal())
+ }
+ }
+
+ return result.String()
+}
+
+func (m *NameMangler) addInitialisms(words ...string) {
+ m.index.add(words...)
+ m.index.buildCache()
+}
+
+// split calls the inner splitter.
+func (m NameMangler) split(str string) *[]string {
+ s := m.splitter
+ lexems := s.split(str)
+ result := poolOfStrings.BorrowStrings()
+
+ for _, lexem := range *lexems {
+ *result = append(*result, lexem.GetOriginal())
+ }
+ poolOfLexems.RedeemLexems(lexems)
+
+ return result
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/options.go b/vendor/github.com/go-openapi/swag/mangling/options.go
new file mode 100644
index 000000000..66ad2e46c
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/options.go
@@ -0,0 +1,161 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package mangling
+
+type (
+ // PrefixFunc defines a safeguard rule (that may depend on the input string), to prefix
+ // a generated go name (in [NameMangler.ToGoName] and [NameMangler.ToVarName]).
+ //
+ // See [NameMangler.ToGoName] for more about which edge cases the prefix function covers.
+ PrefixFunc func(string) string
+
+ // ReplaceFunc is a transliteration function to replace special runes by a word.
+ ReplaceFunc func(r rune) (string, bool)
+
+ // Option to configure a [NameMangler].
+ Option func(*options)
+
+ options struct {
+ commonInitialisms []string
+
+ goNamePrefixFunc PrefixFunc
+ goNamePrefixFuncPtr *PrefixFunc
+ replaceFunc func(r rune) (string, bool)
+ }
+)
+
+func (o *options) prefixFunc() PrefixFunc {
+ if o.goNamePrefixFuncPtr != nil && *o.goNamePrefixFuncPtr != nil {
+ return *o.goNamePrefixFuncPtr
+ }
+
+ return o.goNamePrefixFunc
+}
+
+// WithGoNamePrefixFunc overrides the default prefix rule to safeguard generated go names.
+//
+// Example:
+//
+// This helps convert "123" into "{prefix}123" (a very crude strategy indeed, but it works).
+//
+// See [github.com/go-swagger/go-swagger/generator.DefaultFuncMap] for an example.
+//
+// The prefix function is assumed to return a string that starts with an upper case letter.
+//
+// The default is to prefix with "X".
+//
+// See [NameMangler.ToGoName] for more about which edge cases the prefix function covers.
+func WithGoNamePrefixFunc(fn PrefixFunc) Option {
+ return func(o *options) {
+ o.goNamePrefixFunc = fn
+ }
+}
+
+// WithGoNamePrefixFuncPtr is like [WithGoNamePrefixFunc] but it specifies a pointer to a function.
+//
+// [WithGoNamePrefixFunc] should be preferred in most situations. This option should only serve the
+// purpose of handling special situations where the prefix function is not an internal variable
+// (e.g. an exported package global).
+//
+// [WithGoNamePrefixFuncPtr] supersedes [WithGoNamePrefixFunc] if it also specified.
+//
+// If the provided pointer is nil or points to a nil value, this option has no effect.
+//
+// The caller should ensure that no undesirable concurrent changes are applied to the function pointed to.
+func WithGoNamePrefixFuncPtr(ptr *PrefixFunc) Option {
+ return func(o *options) {
+ o.goNamePrefixFuncPtr = ptr
+ }
+}
+
+// WithInitialisms declares the initialisms this mangler supports.
+//
+// This supersedes any pre-loaded defaults (see [DefaultInitialisms] for more about what initialisms are).
+//
+// It declares words to be recognized as "initialisms" (i.e. words that won't be camel cased or titled cased).
+//
+// Words must start with a (unicode) letter. If some don't, they are ignored.
+// Words are either fully capitalized or mixed-cased. Lower-case only words are considered capitalized.
+func WithInitialisms(words ...string) Option {
+ return func(o *options) {
+ o.commonInitialisms = words
+ }
+}
+
+// WithAdditionalInitialisms adds new initialisms to the currently supported list (see [DefaultInitialisms]).
+//
+// The same sanitization rules apply as those described for [WithInitialisms].
+func WithAdditionalInitialisms(words ...string) Option {
+ return func(o *options) {
+ o.commonInitialisms = append(o.commonInitialisms, words...)
+ }
+}
+
+// WithReplaceFunc specifies a custom transliteration function instead of the default.
+//
+// The default translates the following characters into words as follows:
+//
+// - '@' -> 'At'
+// - '&' -> 'And'
+// - '|' -> 'Pipe'
+// - '$' -> 'Dollar'
+// - '!' -> 'Bang'
+//
+// Notice that the outcome of a transliteration should always be titleized.
+func WithReplaceFunc(fn ReplaceFunc) Option {
+ return func(o *options) {
+ o.replaceFunc = fn
+ }
+}
+
+func defaultPrefixFunc(_ string) string {
+ return "X"
+}
+
+// defaultReplaceTable finds a word representation for special characters.
+func defaultReplaceTable(r rune) (string, bool) {
+ switch r {
+ case '@':
+ return "At ", true
+ case '&':
+ return "And ", true
+ case '|':
+ return "Pipe ", true
+ case '$':
+ return "Dollar ", true
+ case '!':
+ return "Bang ", true
+ case '-':
+ return "", true
+ case '_':
+ return "", true
+ default:
+ return "", false
+ }
+}
+
+func optionsWithDefaults(opts []Option) options {
+ o := options{
+ commonInitialisms: DefaultInitialisms(),
+ goNamePrefixFunc: defaultPrefixFunc,
+ replaceFunc: defaultReplaceTable,
+ }
+
+ for _, apply := range opts {
+ apply(&o)
+ }
+
+ return o
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/pools.go b/vendor/github.com/go-openapi/swag/mangling/pools.go
new file mode 100644
index 000000000..d85b40387
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/pools.go
@@ -0,0 +1,134 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package mangling
+
+import (
+ "bytes"
+ "sync"
+)
+
+const maxAllocMatches = 8
+
+type (
+ // memory pools of temporary objects.
+ //
+ // These are used to recycle temporarily allocated objects
+ // and relieve the GC from undue pressure.
+
+ matchesPool struct {
+ *sync.Pool
+ }
+
+ buffersPool struct {
+ *sync.Pool
+ }
+
+ lexemsPool struct {
+ *sync.Pool
+ }
+
+ stringsPool struct {
+ *sync.Pool
+ }
+)
+
+var (
+ // poolOfMatches holds temporary slices for recycling during the initialism match process
+ poolOfMatches = matchesPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := make(initialismMatches, 0, maxAllocMatches)
+
+ return &s
+ },
+ },
+ }
+
+ poolOfBuffers = buffersPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ return new(bytes.Buffer)
+ },
+ },
+ }
+
+ poolOfLexems = lexemsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := make([]nameLexem, 0, maxAllocMatches)
+
+ return &s
+ },
+ },
+ }
+
+ poolOfStrings = stringsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := make([]string, 0, maxAllocMatches)
+
+ return &s
+ },
+ },
+ }
+)
+
+func (p matchesPool) BorrowMatches() *initialismMatches {
+ s := p.Get().(*initialismMatches)
+ *s = (*s)[:0] // reset slice, keep allocated capacity
+
+ return s
+}
+
+func (p buffersPool) BorrowBuffer(size int) *bytes.Buffer {
+ s := p.Get().(*bytes.Buffer)
+ s.Reset()
+
+ if s.Cap() < size {
+ s.Grow(size)
+ }
+
+ return s
+}
+
+func (p lexemsPool) BorrowLexems() *[]nameLexem {
+ s := p.Get().(*[]nameLexem)
+ *s = (*s)[:0] // reset slice, keep allocated capacity
+
+ return s
+}
+
+func (p stringsPool) BorrowStrings() *[]string {
+ s := p.Get().(*[]string)
+ *s = (*s)[:0] // reset slice, keep allocated capacity
+
+ return s
+}
+
+func (p matchesPool) RedeemMatches(s *initialismMatches) {
+ p.Put(s)
+}
+
+func (p buffersPool) RedeemBuffer(s *bytes.Buffer) {
+ p.Put(s)
+}
+
+func (p lexemsPool) RedeemLexems(s *[]nameLexem) {
+ p.Put(s)
+}
+
+func (p stringsPool) RedeemStrings(s *[]string) {
+ p.Put(s)
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/split.go b/vendor/github.com/go-openapi/swag/mangling/split.go
new file mode 100644
index 000000000..40e4a2e0e
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/split.go
@@ -0,0 +1,312 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package mangling
+
+import (
+ "unicode"
+)
+
+type splitterOption func(*splitter)
+
+// withPostSplitInitialismCheck allows to catch initialisms after main split process
+func withPostSplitInitialismCheck(s *splitter) {
+ s.postSplitInitialismCheck = true
+}
+
+func withReplaceFunc(fn ReplaceFunc) func(*splitter) {
+ return func(s *splitter) {
+ s.replaceFunc = fn
+ }
+}
+
+func withInitialismsCache(c *initialismsCache) splitterOption {
+ return func(s *splitter) {
+ s.initialismsCache = c
+ }
+}
+
+type (
+ initialismMatch struct {
+ body []rune
+ start, end int
+ complete bool
+ hasPlural pluralForm
+ }
+ initialismMatches []initialismMatch
+)
+
+func (m initialismMatch) isZero() bool {
+ return m.start == 0 && m.end == 0
+}
+
+type splitter struct {
+ *initialismsCache
+
+ postSplitInitialismCheck bool
+ replaceFunc ReplaceFunc
+}
+
+func newSplitter(options ...splitterOption) splitter {
+ var s splitter
+
+ for _, option := range options {
+ option(&s)
+ }
+
+ if s.replaceFunc == nil {
+ s.replaceFunc = defaultReplaceTable
+ }
+
+ return s
+}
+
+func (s splitter) split(name string) *[]nameLexem {
+ nameRunes := []rune(name)
+ matches := s.gatherInitialismMatches(nameRunes)
+ if matches == nil {
+ return poolOfLexems.BorrowLexems()
+ }
+
+ return s.mapMatchesToNameLexems(nameRunes, matches)
+}
+
+func (s splitter) gatherInitialismMatches(nameRunes []rune) *initialismMatches {
+ var matches *initialismMatches
+
+ for currentRunePosition, currentRune := range nameRunes {
+ // recycle these allocations as we loop over runes
+ // with such recycling, only 2 slices should be allocated per call
+ // instead of o(n).
+ newMatches := poolOfMatches.BorrowMatches()
+
+ // check current initialism matches
+ if matches != nil { // skip first iteration
+ for _, match := range *matches {
+ if keepCompleteMatch := match.complete; keepCompleteMatch {
+ *newMatches = append(*newMatches, match)
+
+ // the match is complete: keep it then move on to next rune
+ continue
+ }
+
+ currentMatchRune := match.body[currentRunePosition-match.start]
+ if currentMatchRune != currentRune {
+ // failed match, move on to next rune
+ continue
+ }
+
+ // try to complete ongoing match
+ if currentRunePosition-match.start == len(match.body)-1 {
+ // we are close; the next step is to check the symbol ahead
+ // if it is a lowercase letter, then it is not the end of match
+ // but the beginning of the next word.
+ //
+ // NOTE(fredbi): this heuristic sometimes leads to counterintuitive splits and
+ // perhaps (not sure yet) we should check against case _alternance_.
+ //
+ // Example:
+ //
+ // In the current version, in the sentence "IDS initialism", "ID" is recognized as an initialism,
+ // leading to a split like "id_s_initialism" (or IDSInitialism),
+ // whereas in the sentence "IDx initialism", it is not and produces something like
+ // "i_d_x_initialism" (or IDxInitialism). The generated file name is not great.
+ //
+ // Both go identifiers are tolerated by linters.
+ //
+ // Notice that the slightly different input "IDs initialism" is correctly detected
+ // as a pluralized initialism and produces something like "ids_initialism" (or IDsInitialism).
+
+ if currentRunePosition < len(nameRunes)-1 {
+ nextRune := nameRunes[currentRunePosition+1]
+
+ // recognize a plural form for this initialism (only simple pluralization is supported)
+ if nextRune == 's' && match.hasPlural == simplePlural {
+ // detected a pluralized initialism
+ match.body = append(match.body, nextRune)
+ currentRunePosition++
+ if currentRunePosition < len(nameRunes)-1 {
+ nextRune = nameRunes[currentRunePosition+1]
+ if newWord := unicode.IsLower(nextRune); newWord {
+ // it is the start of a new word.
+ // Match is only partial and the initialism is not recognized : move on
+ continue
+ }
+ }
+
+ // this is a pluralized match: keep it
+ match.complete = true
+ match.hasPlural = simplePlural
+ match.end = currentRunePosition
+ *newMatches = append(*newMatches, match)
+
+ // match is complete: keep it then move on to next rune
+ continue
+ }
+
+ if newWord := unicode.IsLower(nextRune); newWord {
+ // it is the start of a new word
+ // Match is only partial and the initialism is not recognized : move on
+ continue
+ }
+ }
+
+ match.complete = true
+ match.end = currentRunePosition
+ }
+
+ // append the ongoing matching attempt (not necessarily complete)
+ *newMatches = append(*newMatches, match)
+ }
+ }
+
+ // check for new initialism matches
+ for i, r := range s.initialismsRunes {
+ if r[0] == currentRune {
+ *newMatches = append(*newMatches, initialismMatch{
+ start: currentRunePosition,
+ body: r,
+ complete: false,
+ hasPlural: s.initialismsPluralForm[i],
+ })
+ }
+ }
+
+ if matches != nil {
+ poolOfMatches.RedeemMatches(matches)
+ }
+ matches = newMatches
+ }
+
+ // up to the caller to redeem this last slice
+ return matches
+}
+
+func (s splitter) mapMatchesToNameLexems(nameRunes []rune, matches *initialismMatches) *[]nameLexem {
+ nameLexems := poolOfLexems.BorrowLexems()
+
+ var lastAcceptedMatch initialismMatch
+ for _, match := range *matches {
+ if !match.complete {
+ continue
+ }
+
+ if firstMatch := lastAcceptedMatch.isZero(); firstMatch {
+ s.appendBrokenDownCasualString(nameLexems, nameRunes[:match.start])
+ *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body)))
+
+ lastAcceptedMatch = match
+
+ continue
+ }
+
+ if overlappedMatch := match.start <= lastAcceptedMatch.end; overlappedMatch {
+ continue
+ }
+
+ middle := nameRunes[lastAcceptedMatch.end+1 : match.start]
+ s.appendBrokenDownCasualString(nameLexems, middle)
+ *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body)))
+
+ lastAcceptedMatch = match
+ }
+
+ // we have not found any accepted matches
+ if lastAcceptedMatch.isZero() {
+ *nameLexems = (*nameLexems)[:0]
+ s.appendBrokenDownCasualString(nameLexems, nameRunes)
+ } else if lastAcceptedMatch.end+1 != len(nameRunes) {
+ rest := nameRunes[lastAcceptedMatch.end+1:]
+ s.appendBrokenDownCasualString(nameLexems, rest)
+ }
+
+ poolOfMatches.RedeemMatches(matches)
+
+ return nameLexems
+}
+
+func (s splitter) breakInitialism(original string) nameLexem {
+ return newInitialismNameLexem(original, original)
+}
+
+func (s splitter) appendBrokenDownCasualString(segments *[]nameLexem, str []rune) {
+ currentSegment := poolOfBuffers.BorrowBuffer(len(str)) // unlike strings.Builder, bytes.Buffer initial storage can reused
+ defer func() {
+ poolOfBuffers.RedeemBuffer(currentSegment)
+ }()
+
+ addCasualNameLexem := func(original string) {
+ *segments = append(*segments, newCasualNameLexem(original))
+ }
+
+ addInitialismNameLexem := func(original, match string) {
+ *segments = append(*segments, newInitialismNameLexem(original, match))
+ }
+
+ var addNameLexem func(string)
+ if s.postSplitInitialismCheck {
+ addNameLexem = func(original string) {
+ for i := range s.initialisms {
+ if isEqualFoldIgnoreSpace(s.initialismsUpperCased[i], original) {
+ addInitialismNameLexem(original, s.initialisms[i])
+
+ return
+ }
+ }
+
+ addCasualNameLexem(original)
+ }
+ } else {
+ addNameLexem = addCasualNameLexem
+ }
+
+ // NOTE: (performance). The few remaining non-amortized allocations
+ // lay in the code below: using String() forces
+ for _, rn := range str {
+ if replace, found := s.replaceFunc(rn); found {
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
+ currentSegment.Reset()
+ }
+
+ if replace != "" {
+ addNameLexem(replace)
+ }
+
+ continue
+ }
+
+ if !unicode.In(rn, unicode.L, unicode.M, unicode.N, unicode.Pc) {
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
+ currentSegment.Reset()
+ }
+
+ continue
+ }
+
+ if unicode.IsUpper(rn) {
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
+ }
+ currentSegment.Reset()
+ }
+
+ currentSegment.WriteRune(rn)
+ }
+
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
+ }
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/string_bytes.go b/vendor/github.com/go-openapi/swag/mangling/string_bytes.go
new file mode 100644
index 000000000..06351434d
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/string_bytes.go
@@ -0,0 +1,22 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package mangling
+
+import "unsafe"
+
+// hackStringBytes returns the (unsafe) underlying bytes slice of a string.
+func hackStringBytes(str string) []byte {
+ return unsafe.Slice(unsafe.StringData(str), len(str))
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/util.go b/vendor/github.com/go-openapi/swag/mangling/util.go
new file mode 100644
index 000000000..c289dc6bd
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/util.go
@@ -0,0 +1,129 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package mangling
+
+import (
+ "strings"
+ "unicode"
+ "unicode/utf8"
+)
+
+// Removes leading whitespaces
+func trim(str string) string { return strings.TrimSpace(str) }
+
+// upper is strings.ToUpper() combined with trim
+func upper(str string) string {
+ return strings.ToUpper(trim(str))
+}
+
+// lower is strings.ToLower() combined with trim
+func lower(str string) string {
+ return strings.ToLower(trim(str))
+}
+
+// isEqualFoldIgnoreSpace is the same as strings.EqualFold, but
+// it ignores leading and trailing blank spaces in the compared
+// string.
+//
+// base is assumed to be composed of upper-cased runes, and be already
+// trimmed.
+//
+// This code is heavily inspired from strings.EqualFold.
+func isEqualFoldIgnoreSpace(base []rune, str string) bool {
+ var i, baseIndex int
+ // equivalent to b := []byte(str), but without data copy
+ b := hackStringBytes(str)
+
+ for i < len(b) {
+ if c := b[i]; c < utf8.RuneSelf {
+ // fast path for ASCII
+ if c != ' ' && c != '\t' {
+ break
+ }
+ i++
+
+ continue
+ }
+
+ // unicode case
+ r, size := utf8.DecodeRune(b[i:])
+ if !unicode.IsSpace(r) {
+ break
+ }
+ i += size
+ }
+
+ if i >= len(b) {
+ return len(base) == 0
+ }
+
+ for _, baseRune := range base {
+ if i >= len(b) {
+ break
+ }
+
+ if c := b[i]; c < utf8.RuneSelf {
+ // single byte rune case (ASCII)
+ if baseRune >= utf8.RuneSelf {
+ return false
+ }
+
+ baseChar := byte(baseRune)
+ if c != baseChar && ((c < 'a') || (c > 'z') || (c-'a'+'A' != baseChar)) {
+ return false
+ }
+
+ baseIndex++
+ i++
+
+ continue
+ }
+
+ // unicode case
+ r, size := utf8.DecodeRune(b[i:])
+ if unicode.ToUpper(r) != baseRune {
+ return false
+ }
+ baseIndex++
+ i += size
+ }
+
+ if baseIndex != len(base) {
+ return false
+ }
+
+ // all passed: now we should only have blanks
+ for i < len(b) {
+ if c := b[i]; c < utf8.RuneSelf {
+ // fast path for ASCII
+ if c != ' ' && c != '\t' {
+ return false
+ }
+ i++
+
+ continue
+ }
+
+ // unicode case
+ r, size := utf8.DecodeRune(b[i:])
+ if !unicode.IsSpace(r) {
+ return false
+ }
+
+ i += size
+ }
+
+ return true
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling_iface.go b/vendor/github.com/go-openapi/swag/mangling_iface.go
new file mode 100644
index 000000000..2d0d07ddb
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling_iface.go
@@ -0,0 +1,80 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import "github.com/go-openapi/swag/mangling"
+
+// GoNamePrefixFunc sets an optional rule to prefix go names
+// which do not start with a letter.
+//
+// GoNamePrefixFunc should not be written to while concurrently using the other mangling functions of this package.
+//
+// Deprecated: use [mangling.WithGoNamePrefixFunc] instead.
+var GoNamePrefixFunc mangling.PrefixFunc
+
+// swagNameMangler is a global instance of the name mangler specifically alloted
+// to support deprecated functions.
+var swagNameMangler = mangling.NewNameMangler(
+ mangling.WithGoNamePrefixFuncPtr(&GoNamePrefixFunc),
+)
+
+// AddInitialisms adds additional initialisms to the default list (see [mangling.DefaultInitialisms]).
+//
+// AddInitialisms is not safe to be called concurrently.
+//
+// Deprecated: use [mangling.WithAdditionalInitialisms] instead.
+func AddInitialisms(words ...string) {
+ swagNameMangler.AddInitialisms(words...)
+}
+
+// Camelize a single word.
+//
+// Deprecated: use [mangling.NameMangler.Camelize] instead.
+func Camelize(word string) string { return swagNameMangler.Camelize(word) }
+
+// ToFileName lowercases and underscores a go type name.
+//
+// Deprecated: use [mangling.NameMangler.ToFileName] instead.
+func ToFileName(name string) string { return swagNameMangler.ToFileName(name) }
+
+// ToCommandName lowercases and underscores a go type name.
+//
+// Deprecated: use [mangling.NameMangler.ToCommandName] instead.
+func ToCommandName(name string) string { return swagNameMangler.ToCommandName(name) }
+
+// ToHumanNameLower represents a code name as a human series of words.
+//
+// Deprecated: use [mangling.NameMangler.ToHumanNameLower] instead.
+func ToHumanNameLower(name string) string { return swagNameMangler.ToHumanNameLower(name) }
+
+// ToHumanNameTitle represents a code name as a human series of words with the first letters titleized.
+//
+// Deprecated: use [mangling.NameMangler.ToHumanNameTitle] instead.
+func ToHumanNameTitle(name string) string { return swagNameMangler.ToHumanNameTitle(name) }
+
+// ToJSONName camel-cases a name which can be underscored or pascal-cased.
+//
+// Deprecated: use [mangling.NameMangler.ToJSONName] instead.
+func ToJSONName(name string) string { return swagNameMangler.ToJSONName(name) }
+
+// ToVarName camel-cases a name which can be underscored or pascal-cased.
+//
+// Deprecated: use [mangling.NameMangler.ToVarName] instead.
+func ToVarName(name string) string { return swagNameMangler.ToVarName(name) }
+
+// ToGoName translates a swagger name which can be underscored or camel cased to a name that golint likes.
+//
+// Deprecated: use [mangling.NameMangler.ToGoName] instead.
+func ToGoName(name string) string { return swagNameMangler.ToGoName(name) }
diff --git a/vendor/github.com/go-openapi/swag/name_lexem.go b/vendor/github.com/go-openapi/swag/name_lexem.go
deleted file mode 100644
index 8bb64ac32..000000000
--- a/vendor/github.com/go-openapi/swag/name_lexem.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package swag
-
-import (
- "unicode"
- "unicode/utf8"
-)
-
-type (
- lexemKind uint8
-
- nameLexem struct {
- original string
- matchedInitialism string
- kind lexemKind
- }
-)
-
-const (
- lexemKindCasualName lexemKind = iota
- lexemKindInitialismName
-)
-
-func newInitialismNameLexem(original, matchedInitialism string) nameLexem {
- return nameLexem{
- kind: lexemKindInitialismName,
- original: original,
- matchedInitialism: matchedInitialism,
- }
-}
-
-func newCasualNameLexem(original string) nameLexem {
- return nameLexem{
- kind: lexemKindCasualName,
- original: original,
- }
-}
-
-func (l nameLexem) GetUnsafeGoName() string {
- if l.kind == lexemKindInitialismName {
- return l.matchedInitialism
- }
-
- var (
- first rune
- rest string
- )
-
- for i, orig := range l.original {
- if i == 0 {
- first = orig
- continue
- }
-
- if i > 0 {
- rest = l.original[i:]
- break
- }
- }
-
- if len(l.original) > 1 {
- b := poolOfBuffers.BorrowBuffer(utf8.UTFMax + len(rest))
- defer func() {
- poolOfBuffers.RedeemBuffer(b)
- }()
- b.WriteRune(unicode.ToUpper(first))
- b.WriteString(lower(rest))
- return b.String()
- }
-
- return l.original
-}
-
-func (l nameLexem) GetOriginal() string {
- return l.original
-}
-
-func (l nameLexem) IsInitialism() bool {
- return l.kind == lexemKindInitialismName
-}
diff --git a/vendor/github.com/go-openapi/swag/netutils/LICENSE b/vendor/github.com/go-openapi/swag/netutils/LICENSE
new file mode 100644
index 000000000..d64569567
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/netutils/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/netutils/doc.go b/vendor/github.com/go-openapi/swag/netutils/doc.go
new file mode 100644
index 000000000..ed6d8a022
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/netutils/doc.go
@@ -0,0 +1,16 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package netutils provides helpers for network-related tasks.
+package netutils
diff --git a/vendor/github.com/go-openapi/swag/net.go b/vendor/github.com/go-openapi/swag/netutils/net.go
similarity index 85%
rename from vendor/github.com/go-openapi/swag/net.go
rename to vendor/github.com/go-openapi/swag/netutils/net.go
index 821235f84..3d0182fc5 100644
--- a/vendor/github.com/go-openapi/swag/net.go
+++ b/vendor/github.com/go-openapi/swag/netutils/net.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package swag
+package netutils
import (
"net"
@@ -20,7 +20,10 @@ import (
)
// SplitHostPort splits a network address into a host and a port.
-// The port is -1 when there is no port to be found
+//
+// The difference with the standard net.SplitHostPort is that the port is converted to an int.
+//
+// The port is -1 when there is no port to be found.
func SplitHostPort(addr string) (host string, port int, err error) {
h, p, err := net.SplitHostPort(addr)
if err != nil {
@@ -34,5 +37,6 @@ func SplitHostPort(addr string) (host string, port int, err error) {
if err != nil {
return "", -1, err
}
+
return h, pi, nil
}
diff --git a/vendor/github.com/go-openapi/swag/netutils_iface.go b/vendor/github.com/go-openapi/swag/netutils_iface.go
new file mode 100644
index 000000000..537314e36
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/netutils_iface.go
@@ -0,0 +1,24 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import "github.com/go-openapi/swag/netutils"
+
+// SplitHostPort splits a network address into a host and a port.
+//
+// Deprecated: use [netutils.SplitHostPort] instead.
+func SplitHostPort(addr string) (host string, port int, err error) {
+ return netutils.SplitHostPort(addr)
+}
diff --git a/vendor/github.com/go-openapi/swag/path.go b/vendor/github.com/go-openapi/swag/path.go
deleted file mode 100644
index 941bd0176..000000000
--- a/vendor/github.com/go-openapi/swag/path.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package swag
-
-import (
- "os"
- "path/filepath"
- "runtime"
- "strings"
-)
-
-const (
- // GOPATHKey represents the env key for gopath
- GOPATHKey = "GOPATH"
-)
-
-// FindInSearchPath finds a package in a provided lists of paths
-func FindInSearchPath(searchPath, pkg string) string {
- pathsList := filepath.SplitList(searchPath)
- for _, path := range pathsList {
- if evaluatedPath, err := filepath.EvalSymlinks(filepath.Join(path, "src", pkg)); err == nil {
- if _, err := os.Stat(evaluatedPath); err == nil {
- return evaluatedPath
- }
- }
- }
- return ""
-}
-
-// FindInGoSearchPath finds a package in the $GOPATH:$GOROOT
-func FindInGoSearchPath(pkg string) string {
- return FindInSearchPath(FullGoSearchPath(), pkg)
-}
-
-// FullGoSearchPath gets the search paths for finding packages
-func FullGoSearchPath() string {
- allPaths := os.Getenv(GOPATHKey)
- if allPaths == "" {
- allPaths = filepath.Join(os.Getenv("HOME"), "go")
- }
- if allPaths != "" {
- allPaths = strings.Join([]string{allPaths, runtime.GOROOT()}, ":")
- } else {
- allPaths = runtime.GOROOT()
- }
- return allPaths
-}
diff --git a/vendor/github.com/go-openapi/swag/split.go b/vendor/github.com/go-openapi/swag/split.go
deleted file mode 100644
index 274727a86..000000000
--- a/vendor/github.com/go-openapi/swag/split.go
+++ /dev/null
@@ -1,508 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package swag
-
-import (
- "bytes"
- "sync"
- "unicode"
- "unicode/utf8"
-)
-
-type (
- splitter struct {
- initialisms []string
- initialismsRunes [][]rune
- initialismsUpperCased [][]rune // initialisms cached in their trimmed, upper-cased version
- postSplitInitialismCheck bool
- }
-
- splitterOption func(*splitter)
-
- initialismMatch struct {
- body []rune
- start, end int
- complete bool
- }
- initialismMatches []initialismMatch
-)
-
-type (
- // memory pools of temporary objects.
- //
- // These are used to recycle temporarily allocated objects
- // and relieve the GC from undue pressure.
-
- matchesPool struct {
- *sync.Pool
- }
-
- buffersPool struct {
- *sync.Pool
- }
-
- lexemsPool struct {
- *sync.Pool
- }
-
- splittersPool struct {
- *sync.Pool
- }
-)
-
-var (
- // poolOfMatches holds temporary slices for recycling during the initialism match process
- poolOfMatches = matchesPool{
- Pool: &sync.Pool{
- New: func() any {
- s := make(initialismMatches, 0, maxAllocMatches)
-
- return &s
- },
- },
- }
-
- poolOfBuffers = buffersPool{
- Pool: &sync.Pool{
- New: func() any {
- return new(bytes.Buffer)
- },
- },
- }
-
- poolOfLexems = lexemsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := make([]nameLexem, 0, maxAllocMatches)
-
- return &s
- },
- },
- }
-
- poolOfSplitters = splittersPool{
- Pool: &sync.Pool{
- New: func() any {
- s := newSplitter()
-
- return &s
- },
- },
- }
-)
-
-// nameReplaceTable finds a word representation for special characters.
-func nameReplaceTable(r rune) (string, bool) {
- switch r {
- case '@':
- return "At ", true
- case '&':
- return "And ", true
- case '|':
- return "Pipe ", true
- case '$':
- return "Dollar ", true
- case '!':
- return "Bang ", true
- case '-':
- return "", true
- case '_':
- return "", true
- default:
- return "", false
- }
-}
-
-// split calls the splitter.
-//
-// Use newSplitter for more control and options
-func split(str string) []string {
- s := poolOfSplitters.BorrowSplitter()
- lexems := s.split(str)
- result := make([]string, 0, len(*lexems))
-
- for _, lexem := range *lexems {
- result = append(result, lexem.GetOriginal())
- }
- poolOfLexems.RedeemLexems(lexems)
- poolOfSplitters.RedeemSplitter(s)
-
- return result
-
-}
-
-func newSplitter(options ...splitterOption) splitter {
- s := splitter{
- postSplitInitialismCheck: false,
- initialisms: initialisms,
- initialismsRunes: initialismsRunes,
- initialismsUpperCased: initialismsUpperCased,
- }
-
- for _, option := range options {
- option(&s)
- }
-
- return s
-}
-
-// withPostSplitInitialismCheck allows to catch initialisms after main split process
-func withPostSplitInitialismCheck(s *splitter) {
- s.postSplitInitialismCheck = true
-}
-
-func (p matchesPool) BorrowMatches() *initialismMatches {
- s := p.Get().(*initialismMatches)
- *s = (*s)[:0] // reset slice, keep allocated capacity
-
- return s
-}
-
-func (p buffersPool) BorrowBuffer(size int) *bytes.Buffer {
- s := p.Get().(*bytes.Buffer)
- s.Reset()
-
- if s.Cap() < size {
- s.Grow(size)
- }
-
- return s
-}
-
-func (p lexemsPool) BorrowLexems() *[]nameLexem {
- s := p.Get().(*[]nameLexem)
- *s = (*s)[:0] // reset slice, keep allocated capacity
-
- return s
-}
-
-func (p splittersPool) BorrowSplitter(options ...splitterOption) *splitter {
- s := p.Get().(*splitter)
- s.postSplitInitialismCheck = false // reset options
- for _, apply := range options {
- apply(s)
- }
-
- return s
-}
-
-func (p matchesPool) RedeemMatches(s *initialismMatches) {
- p.Put(s)
-}
-
-func (p buffersPool) RedeemBuffer(s *bytes.Buffer) {
- p.Put(s)
-}
-
-func (p lexemsPool) RedeemLexems(s *[]nameLexem) {
- p.Put(s)
-}
-
-func (p splittersPool) RedeemSplitter(s *splitter) {
- p.Put(s)
-}
-
-func (m initialismMatch) isZero() bool {
- return m.start == 0 && m.end == 0
-}
-
-func (s splitter) split(name string) *[]nameLexem {
- nameRunes := []rune(name)
- matches := s.gatherInitialismMatches(nameRunes)
- if matches == nil {
- return poolOfLexems.BorrowLexems()
- }
-
- return s.mapMatchesToNameLexems(nameRunes, matches)
-}
-
-func (s splitter) gatherInitialismMatches(nameRunes []rune) *initialismMatches {
- var matches *initialismMatches
-
- for currentRunePosition, currentRune := range nameRunes {
- // recycle these allocations as we loop over runes
- // with such recycling, only 2 slices should be allocated per call
- // instead of o(n).
- newMatches := poolOfMatches.BorrowMatches()
-
- // check current initialism matches
- if matches != nil { // skip first iteration
- for _, match := range *matches {
- if keepCompleteMatch := match.complete; keepCompleteMatch {
- *newMatches = append(*newMatches, match)
- continue
- }
-
- // drop failed match
- currentMatchRune := match.body[currentRunePosition-match.start]
- if currentMatchRune != currentRune {
- continue
- }
-
- // try to complete ongoing match
- if currentRunePosition-match.start == len(match.body)-1 {
- // we are close; the next step is to check the symbol ahead
- // if it is a small letter, then it is not the end of match
- // but beginning of the next word
-
- if currentRunePosition < len(nameRunes)-1 {
- nextRune := nameRunes[currentRunePosition+1]
- if newWord := unicode.IsLower(nextRune); newWord {
- // oh ok, it was the start of a new word
- continue
- }
- }
-
- match.complete = true
- match.end = currentRunePosition
- }
-
- *newMatches = append(*newMatches, match)
- }
- }
-
- // check for new initialism matches
- for i := range s.initialisms {
- initialismRunes := s.initialismsRunes[i]
- if initialismRunes[0] == currentRune {
- *newMatches = append(*newMatches, initialismMatch{
- start: currentRunePosition,
- body: initialismRunes,
- complete: false,
- })
- }
- }
-
- if matches != nil {
- poolOfMatches.RedeemMatches(matches)
- }
- matches = newMatches
- }
-
- // up to the caller to redeem this last slice
- return matches
-}
-
-func (s splitter) mapMatchesToNameLexems(nameRunes []rune, matches *initialismMatches) *[]nameLexem {
- nameLexems := poolOfLexems.BorrowLexems()
-
- var lastAcceptedMatch initialismMatch
- for _, match := range *matches {
- if !match.complete {
- continue
- }
-
- if firstMatch := lastAcceptedMatch.isZero(); firstMatch {
- s.appendBrokenDownCasualString(nameLexems, nameRunes[:match.start])
- *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body)))
-
- lastAcceptedMatch = match
-
- continue
- }
-
- if overlappedMatch := match.start <= lastAcceptedMatch.end; overlappedMatch {
- continue
- }
-
- middle := nameRunes[lastAcceptedMatch.end+1 : match.start]
- s.appendBrokenDownCasualString(nameLexems, middle)
- *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body)))
-
- lastAcceptedMatch = match
- }
-
- // we have not found any accepted matches
- if lastAcceptedMatch.isZero() {
- *nameLexems = (*nameLexems)[:0]
- s.appendBrokenDownCasualString(nameLexems, nameRunes)
- } else if lastAcceptedMatch.end+1 != len(nameRunes) {
- rest := nameRunes[lastAcceptedMatch.end+1:]
- s.appendBrokenDownCasualString(nameLexems, rest)
- }
-
- poolOfMatches.RedeemMatches(matches)
-
- return nameLexems
-}
-
-func (s splitter) breakInitialism(original string) nameLexem {
- return newInitialismNameLexem(original, original)
-}
-
-func (s splitter) appendBrokenDownCasualString(segments *[]nameLexem, str []rune) {
- currentSegment := poolOfBuffers.BorrowBuffer(len(str)) // unlike strings.Builder, bytes.Buffer initial storage can reused
- defer func() {
- poolOfBuffers.RedeemBuffer(currentSegment)
- }()
-
- addCasualNameLexem := func(original string) {
- *segments = append(*segments, newCasualNameLexem(original))
- }
-
- addInitialismNameLexem := func(original, match string) {
- *segments = append(*segments, newInitialismNameLexem(original, match))
- }
-
- var addNameLexem func(string)
- if s.postSplitInitialismCheck {
- addNameLexem = func(original string) {
- for i := range s.initialisms {
- if isEqualFoldIgnoreSpace(s.initialismsUpperCased[i], original) {
- addInitialismNameLexem(original, s.initialisms[i])
-
- return
- }
- }
-
- addCasualNameLexem(original)
- }
- } else {
- addNameLexem = addCasualNameLexem
- }
-
- for _, rn := range str {
- if replace, found := nameReplaceTable(rn); found {
- if currentSegment.Len() > 0 {
- addNameLexem(currentSegment.String())
- currentSegment.Reset()
- }
-
- if replace != "" {
- addNameLexem(replace)
- }
-
- continue
- }
-
- if !unicode.In(rn, unicode.L, unicode.M, unicode.N, unicode.Pc) {
- if currentSegment.Len() > 0 {
- addNameLexem(currentSegment.String())
- currentSegment.Reset()
- }
-
- continue
- }
-
- if unicode.IsUpper(rn) {
- if currentSegment.Len() > 0 {
- addNameLexem(currentSegment.String())
- }
- currentSegment.Reset()
- }
-
- currentSegment.WriteRune(rn)
- }
-
- if currentSegment.Len() > 0 {
- addNameLexem(currentSegment.String())
- }
-}
-
-// isEqualFoldIgnoreSpace is the same as strings.EqualFold, but
-// it ignores leading and trailing blank spaces in the compared
-// string.
-//
-// base is assumed to be composed of upper-cased runes, and be already
-// trimmed.
-//
-// This code is heavily inspired from strings.EqualFold.
-func isEqualFoldIgnoreSpace(base []rune, str string) bool {
- var i, baseIndex int
- // equivalent to b := []byte(str), but without data copy
- b := hackStringBytes(str)
-
- for i < len(b) {
- if c := b[i]; c < utf8.RuneSelf {
- // fast path for ASCII
- if c != ' ' && c != '\t' {
- break
- }
- i++
-
- continue
- }
-
- // unicode case
- r, size := utf8.DecodeRune(b[i:])
- if !unicode.IsSpace(r) {
- break
- }
- i += size
- }
-
- if i >= len(b) {
- return len(base) == 0
- }
-
- for _, baseRune := range base {
- if i >= len(b) {
- break
- }
-
- if c := b[i]; c < utf8.RuneSelf {
- // single byte rune case (ASCII)
- if baseRune >= utf8.RuneSelf {
- return false
- }
-
- baseChar := byte(baseRune)
- if c != baseChar &&
- !('a' <= c && c <= 'z' && c-'a'+'A' == baseChar) {
- return false
- }
-
- baseIndex++
- i++
-
- continue
- }
-
- // unicode case
- r, size := utf8.DecodeRune(b[i:])
- if unicode.ToUpper(r) != baseRune {
- return false
- }
- baseIndex++
- i += size
- }
-
- if baseIndex != len(base) {
- return false
- }
-
- // all passed: now we should only have blanks
- for i < len(b) {
- if c := b[i]; c < utf8.RuneSelf {
- // fast path for ASCII
- if c != ' ' && c != '\t' {
- return false
- }
- i++
-
- continue
- }
-
- // unicode case
- r, size := utf8.DecodeRune(b[i:])
- if !unicode.IsSpace(r) {
- return false
- }
-
- i += size
- }
-
- return true
-}
diff --git a/vendor/github.com/go-openapi/swag/string_bytes.go b/vendor/github.com/go-openapi/swag/string_bytes.go
deleted file mode 100644
index 90745d5ca..000000000
--- a/vendor/github.com/go-openapi/swag/string_bytes.go
+++ /dev/null
@@ -1,8 +0,0 @@
-package swag
-
-import "unsafe"
-
-// hackStringBytes returns the (unsafe) underlying bytes slice of a string.
-func hackStringBytes(str string) []byte {
- return unsafe.Slice(unsafe.StringData(str), len(str))
-}
diff --git a/vendor/github.com/go-openapi/swag/stringutils/LICENSE b/vendor/github.com/go-openapi/swag/stringutils/LICENSE
new file mode 100644
index 000000000..d64569567
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/stringutils/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/stringutils/collection_formats.go b/vendor/github.com/go-openapi/swag/stringutils/collection_formats.go
new file mode 100644
index 000000000..1ff96dcbd
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/stringutils/collection_formats.go
@@ -0,0 +1,85 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package stringutils
+
+import "strings"
+
+const (
+ // collectionFormatComma = "csv"
+ collectionFormatSpace = "ssv"
+ collectionFormatTab = "tsv"
+ collectionFormatPipe = "pipes"
+ collectionFormatMulti = "multi"
+
+ collectionFormatDefaultSep = ","
+)
+
+// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute):
+//
+// ssv: space separated value
+// tsv: tab separated value
+// pipes: pipe (|) separated value
+// csv: comma separated value (default)
+func JoinByFormat(data []string, format string) []string {
+ if len(data) == 0 {
+ return data
+ }
+ var sep string
+ switch format {
+ case collectionFormatSpace:
+ sep = " "
+ case collectionFormatTab:
+ sep = "\t"
+ case collectionFormatPipe:
+ sep = "|"
+ case collectionFormatMulti:
+ return data
+ default:
+ sep = collectionFormatDefaultSep
+ }
+ return []string{strings.Join(data, sep)}
+}
+
+// SplitByFormat splits a string by a known format:
+//
+// ssv: space separated value
+// tsv: tab separated value
+// pipes: pipe (|) separated value
+// csv: comma separated value (default)
+func SplitByFormat(data, format string) []string {
+ if data == "" {
+ return nil
+ }
+ var sep string
+ switch format {
+ case collectionFormatSpace:
+ sep = " "
+ case collectionFormatTab:
+ sep = "\t"
+ case collectionFormatPipe:
+ sep = "|"
+ case collectionFormatMulti:
+ return nil
+ default:
+ sep = collectionFormatDefaultSep
+ }
+ var result []string
+ for _, s := range strings.Split(data, sep) {
+ if ts := strings.TrimSpace(s); ts != "" {
+ result = append(result, ts)
+ }
+ }
+ return result
+}
diff --git a/vendor/github.com/go-openapi/swag/stringutils/doc.go b/vendor/github.com/go-openapi/swag/stringutils/doc.go
new file mode 100644
index 000000000..b5d18e517
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/stringutils/doc.go
@@ -0,0 +1,16 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package stringutils exposes helpers to search and process strings.
+package stringutils
diff --git a/vendor/github.com/go-openapi/swag/stringutils/strings.go b/vendor/github.com/go-openapi/swag/stringutils/strings.go
new file mode 100644
index 000000000..086592317
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/stringutils/strings.go
@@ -0,0 +1,34 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package stringutils
+
+import (
+ "slices"
+ "strings"
+)
+
+// ContainsStrings searches a slice of strings for a case-sensitive match
+//
+// Now equivalent to the standard library [slice.Contains].
+func ContainsStrings(coll []string, item string) bool {
+ return slices.Contains(coll, item)
+}
+
+// ContainsStringsCI searches a slice of strings for a case-insensitive match
+func ContainsStringsCI(coll []string, item string) bool {
+ return slices.ContainsFunc(coll, func(e string) bool {
+ return strings.EqualFold(e, item)
+ })
+}
diff --git a/vendor/github.com/go-openapi/swag/stringutils_iface.go b/vendor/github.com/go-openapi/swag/stringutils_iface.go
new file mode 100644
index 000000000..00d7e0212
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/stringutils_iface.go
@@ -0,0 +1,45 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import "github.com/go-openapi/swag/stringutils"
+
+// ContainsStrings searches a slice of strings for a case-sensitive match.
+//
+// Deprecated: use [slices.Contains] or [stringutils.ContainsStrings] instead.
+func ContainsStrings(coll []string, item string) bool {
+ return stringutils.ContainsStrings(coll, item)
+}
+
+// ContainsStringsCI searches a slice of strings for a case-insensitive match.
+//
+// Deprecated: use [stringutils.ContainsStringsCI] instead.
+func ContainsStringsCI(coll []string, item string) bool {
+ return stringutils.ContainsStringsCI(coll, item)
+}
+
+// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute).
+//
+// Deprecated: use [stringutils.JoinByFormat] instead.
+func JoinByFormat(data []string, format string) []string {
+ return stringutils.JoinByFormat(data, format)
+}
+
+// SplitByFormat splits a string by a known format.
+//
+// Deprecated: use [stringutils.SplitByFormat] instead.
+func SplitByFormat(data, format string) []string {
+ return stringutils.SplitByFormat(data, format)
+}
diff --git a/vendor/github.com/go-openapi/swag/typeutils/LICENSE b/vendor/github.com/go-openapi/swag/typeutils/LICENSE
new file mode 100644
index 000000000..d64569567
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/typeutils/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/typeutils/doc.go b/vendor/github.com/go-openapi/swag/typeutils/doc.go
new file mode 100644
index 000000000..67e49d12e
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/typeutils/doc.go
@@ -0,0 +1,16 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package typeutils exposes utilities to inspect generic types.
+package typeutils
diff --git a/vendor/github.com/go-openapi/swag/typeutils/types.go b/vendor/github.com/go-openapi/swag/typeutils/types.go
new file mode 100644
index 000000000..8a29aa9c2
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/typeutils/types.go
@@ -0,0 +1,59 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package typeutils
+
+import "reflect"
+
+type zeroable interface {
+ IsZero() bool
+}
+
+// IsZero returns true when the value passed into the function is a zero value.
+// This allows for safer checking of interface values.
+func IsZero(data interface{}) bool {
+ v := reflect.ValueOf(data)
+ // check for nil data
+ switch v.Kind() { //nolint:exhaustive
+ case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
+ if v.IsNil() {
+ return true
+ }
+ }
+
+ // check for things that have an IsZero method instead
+ if vv, ok := data.(zeroable); ok {
+ return vv.IsZero()
+ }
+
+ // continue with slightly more complex reflection
+ switch v.Kind() { //nolint:exhaustive
+ case reflect.String:
+ return v.Len() == 0
+ case reflect.Bool:
+ return !v.Bool()
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return v.Int() == 0
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+ return v.Uint() == 0
+ case reflect.Float32, reflect.Float64:
+ return v.Float() == 0
+ case reflect.Struct, reflect.Array:
+ return reflect.DeepEqual(data, reflect.Zero(v.Type()).Interface())
+ case reflect.Invalid:
+ return true
+ default:
+ return false
+ }
+}
diff --git a/vendor/github.com/go-openapi/swag/typeutils_iface.go b/vendor/github.com/go-openapi/swag/typeutils_iface.go
new file mode 100644
index 000000000..b104a8040
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/typeutils_iface.go
@@ -0,0 +1,23 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import "github.com/go-openapi/swag/typeutils"
+
+// IsZero returns true when the value passed into the function is a zero value.
+// This allows for safer checking of interface values.
+//
+// Deprecated: use [typeutils.IsZero] instead.
+func IsZero(data interface{}) bool { return typeutils.IsZero(data) }
diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go
deleted file mode 100644
index 5051401c4..000000000
--- a/vendor/github.com/go-openapi/swag/util.go
+++ /dev/null
@@ -1,364 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package swag
-
-import (
- "reflect"
- "strings"
- "unicode"
- "unicode/utf8"
-)
-
-// GoNamePrefixFunc sets an optional rule to prefix go names
-// which do not start with a letter.
-//
-// The prefix function is assumed to return a string that starts with an upper case letter.
-//
-// e.g. to help convert "123" into "{prefix}123"
-//
-// The default is to prefix with "X"
-var GoNamePrefixFunc func(string) string
-
-func prefixFunc(name, in string) string {
- if GoNamePrefixFunc == nil {
- return "X" + in
- }
-
- return GoNamePrefixFunc(name) + in
-}
-
-const (
- // collectionFormatComma = "csv"
- collectionFormatSpace = "ssv"
- collectionFormatTab = "tsv"
- collectionFormatPipe = "pipes"
- collectionFormatMulti = "multi"
-)
-
-// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute):
-//
-// ssv: space separated value
-// tsv: tab separated value
-// pipes: pipe (|) separated value
-// csv: comma separated value (default)
-func JoinByFormat(data []string, format string) []string {
- if len(data) == 0 {
- return data
- }
- var sep string
- switch format {
- case collectionFormatSpace:
- sep = " "
- case collectionFormatTab:
- sep = "\t"
- case collectionFormatPipe:
- sep = "|"
- case collectionFormatMulti:
- return data
- default:
- sep = ","
- }
- return []string{strings.Join(data, sep)}
-}
-
-// SplitByFormat splits a string by a known format:
-//
-// ssv: space separated value
-// tsv: tab separated value
-// pipes: pipe (|) separated value
-// csv: comma separated value (default)
-func SplitByFormat(data, format string) []string {
- if data == "" {
- return nil
- }
- var sep string
- switch format {
- case collectionFormatSpace:
- sep = " "
- case collectionFormatTab:
- sep = "\t"
- case collectionFormatPipe:
- sep = "|"
- case collectionFormatMulti:
- return nil
- default:
- sep = ","
- }
- var result []string
- for _, s := range strings.Split(data, sep) {
- if ts := strings.TrimSpace(s); ts != "" {
- result = append(result, ts)
- }
- }
- return result
-}
-
-// Removes leading whitespaces
-func trim(str string) string {
- return strings.TrimSpace(str)
-}
-
-// Shortcut to strings.ToUpper()
-func upper(str string) string {
- return strings.ToUpper(trim(str))
-}
-
-// Shortcut to strings.ToLower()
-func lower(str string) string {
- return strings.ToLower(trim(str))
-}
-
-// Camelize an uppercased word
-func Camelize(word string) string {
- camelized := poolOfBuffers.BorrowBuffer(len(word))
- defer func() {
- poolOfBuffers.RedeemBuffer(camelized)
- }()
-
- for pos, ru := range []rune(word) {
- if pos > 0 {
- camelized.WriteRune(unicode.ToLower(ru))
- } else {
- camelized.WriteRune(unicode.ToUpper(ru))
- }
- }
- return camelized.String()
-}
-
-// ToFileName lowercases and underscores a go type name
-func ToFileName(name string) string {
- in := split(name)
- out := make([]string, 0, len(in))
-
- for _, w := range in {
- out = append(out, lower(w))
- }
-
- return strings.Join(out, "_")
-}
-
-// ToCommandName lowercases and underscores a go type name
-func ToCommandName(name string) string {
- in := split(name)
- out := make([]string, 0, len(in))
-
- for _, w := range in {
- out = append(out, lower(w))
- }
- return strings.Join(out, "-")
-}
-
-// ToHumanNameLower represents a code name as a human series of words
-func ToHumanNameLower(name string) string {
- s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck)
- in := s.split(name)
- poolOfSplitters.RedeemSplitter(s)
- out := make([]string, 0, len(*in))
-
- for _, w := range *in {
- if !w.IsInitialism() {
- out = append(out, lower(w.GetOriginal()))
- } else {
- out = append(out, trim(w.GetOriginal()))
- }
- }
- poolOfLexems.RedeemLexems(in)
-
- return strings.Join(out, " ")
-}
-
-// ToHumanNameTitle represents a code name as a human series of words with the first letters titleized
-func ToHumanNameTitle(name string) string {
- s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck)
- in := s.split(name)
- poolOfSplitters.RedeemSplitter(s)
-
- out := make([]string, 0, len(*in))
- for _, w := range *in {
- original := trim(w.GetOriginal())
- if !w.IsInitialism() {
- out = append(out, Camelize(original))
- } else {
- out = append(out, original)
- }
- }
- poolOfLexems.RedeemLexems(in)
-
- return strings.Join(out, " ")
-}
-
-// ToJSONName camelcases a name which can be underscored or pascal cased
-func ToJSONName(name string) string {
- in := split(name)
- out := make([]string, 0, len(in))
-
- for i, w := range in {
- if i == 0 {
- out = append(out, lower(w))
- continue
- }
- out = append(out, Camelize(trim(w)))
- }
- return strings.Join(out, "")
-}
-
-// ToVarName camelcases a name which can be underscored or pascal cased
-func ToVarName(name string) string {
- res := ToGoName(name)
- if isInitialism(res) {
- return lower(res)
- }
- if len(res) <= 1 {
- return lower(res)
- }
- return lower(res[:1]) + res[1:]
-}
-
-// ToGoName translates a swagger name which can be underscored or camel cased to a name that golint likes
-func ToGoName(name string) string {
- s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck)
- lexems := s.split(name)
- poolOfSplitters.RedeemSplitter(s)
- defer func() {
- poolOfLexems.RedeemLexems(lexems)
- }()
- lexemes := *lexems
-
- if len(lexemes) == 0 {
- return ""
- }
-
- result := poolOfBuffers.BorrowBuffer(len(name))
- defer func() {
- poolOfBuffers.RedeemBuffer(result)
- }()
-
- // check if not starting with a letter, upper case
- firstPart := lexemes[0].GetUnsafeGoName()
- if lexemes[0].IsInitialism() {
- firstPart = upper(firstPart)
- }
-
- if c := firstPart[0]; c < utf8.RuneSelf {
- // ASCII
- switch {
- case 'A' <= c && c <= 'Z':
- result.WriteString(firstPart)
- case 'a' <= c && c <= 'z':
- result.WriteByte(c - 'a' + 'A')
- result.WriteString(firstPart[1:])
- default:
- result.WriteString(prefixFunc(name, firstPart))
- // NOTE: no longer check if prefixFunc returns a string that starts with uppercase:
- // assume this is always the case
- }
- } else {
- // unicode
- firstRune, _ := utf8.DecodeRuneInString(firstPart)
- switch {
- case !unicode.IsLetter(firstRune):
- result.WriteString(prefixFunc(name, firstPart))
- case !unicode.IsUpper(firstRune):
- result.WriteString(prefixFunc(name, firstPart))
- /*
- result.WriteRune(unicode.ToUpper(firstRune))
- result.WriteString(firstPart[offset:])
- */
- default:
- result.WriteString(firstPart)
- }
- }
-
- for _, lexem := range lexemes[1:] {
- goName := lexem.GetUnsafeGoName()
-
- // to support old behavior
- if lexem.IsInitialism() {
- goName = upper(goName)
- }
- result.WriteString(goName)
- }
-
- return result.String()
-}
-
-// ContainsStrings searches a slice of strings for a case-sensitive match
-func ContainsStrings(coll []string, item string) bool {
- for _, a := range coll {
- if a == item {
- return true
- }
- }
- return false
-}
-
-// ContainsStringsCI searches a slice of strings for a case-insensitive match
-func ContainsStringsCI(coll []string, item string) bool {
- for _, a := range coll {
- if strings.EqualFold(a, item) {
- return true
- }
- }
- return false
-}
-
-type zeroable interface {
- IsZero() bool
-}
-
-// IsZero returns true when the value passed into the function is a zero value.
-// This allows for safer checking of interface values.
-func IsZero(data interface{}) bool {
- v := reflect.ValueOf(data)
- // check for nil data
- switch v.Kind() { //nolint:exhaustive
- case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
- if v.IsNil() {
- return true
- }
- }
-
- // check for things that have an IsZero method instead
- if vv, ok := data.(zeroable); ok {
- return vv.IsZero()
- }
-
- // continue with slightly more complex reflection
- switch v.Kind() { //nolint:exhaustive
- case reflect.String:
- return v.Len() == 0
- case reflect.Bool:
- return !v.Bool()
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return v.Int() == 0
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- return v.Uint() == 0
- case reflect.Float32, reflect.Float64:
- return v.Float() == 0
- case reflect.Struct, reflect.Array:
- return reflect.DeepEqual(data, reflect.Zero(v.Type()).Interface())
- case reflect.Invalid:
- return true
- default:
- return false
- }
-}
-
-// CommandLineOptionsGroup represents a group of user-defined command line options
-type CommandLineOptionsGroup struct {
- ShortDescription string
- LongDescription string
- Options interface{}
-}
diff --git a/vendor/github.com/go-openapi/swag/yaml.go b/vendor/github.com/go-openapi/swag/yaml.go
deleted file mode 100644
index 575346539..000000000
--- a/vendor/github.com/go-openapi/swag/yaml.go
+++ /dev/null
@@ -1,481 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package swag
-
-import (
- "encoding/json"
- "fmt"
- "path/filepath"
- "reflect"
- "sort"
- "strconv"
-
- "github.com/mailru/easyjson/jlexer"
- "github.com/mailru/easyjson/jwriter"
- yaml "gopkg.in/yaml.v3"
-)
-
-// YAMLMatcher matches yaml
-func YAMLMatcher(path string) bool {
- ext := filepath.Ext(path)
- return ext == ".yaml" || ext == ".yml"
-}
-
-// YAMLToJSON converts YAML unmarshaled data into json compatible data
-func YAMLToJSON(data interface{}) (json.RawMessage, error) {
- jm, err := transformData(data)
- if err != nil {
- return nil, err
- }
- b, err := WriteJSON(jm)
- return json.RawMessage(b), err
-}
-
-// BytesToYAMLDoc converts a byte slice into a YAML document
-func BytesToYAMLDoc(data []byte) (interface{}, error) {
- var document yaml.Node // preserve order that is present in the document
- if err := yaml.Unmarshal(data, &document); err != nil {
- return nil, err
- }
- if document.Kind != yaml.DocumentNode || len(document.Content) != 1 || document.Content[0].Kind != yaml.MappingNode {
- return nil, fmt.Errorf("only YAML documents that are objects are supported: %w", ErrYAML)
- }
- return &document, nil
-}
-
-func yamlNode(root *yaml.Node) (interface{}, error) {
- switch root.Kind {
- case yaml.DocumentNode:
- return yamlDocument(root)
- case yaml.SequenceNode:
- return yamlSequence(root)
- case yaml.MappingNode:
- return yamlMapping(root)
- case yaml.ScalarNode:
- return yamlScalar(root)
- case yaml.AliasNode:
- return yamlNode(root.Alias)
- default:
- return nil, fmt.Errorf("unsupported YAML node type: %v: %w", root.Kind, ErrYAML)
- }
-}
-
-func yamlDocument(node *yaml.Node) (interface{}, error) {
- if len(node.Content) != 1 {
- return nil, fmt.Errorf("unexpected YAML Document node content length: %d: %w", len(node.Content), ErrYAML)
- }
- return yamlNode(node.Content[0])
-}
-
-func yamlMapping(node *yaml.Node) (interface{}, error) {
- const sensibleAllocDivider = 2
- m := make(JSONMapSlice, len(node.Content)/sensibleAllocDivider)
-
- var j int
- for i := 0; i < len(node.Content); i += 2 {
- var nmi JSONMapItem
- k, err := yamlStringScalarC(node.Content[i])
- if err != nil {
- return nil, fmt.Errorf("unable to decode YAML map key: %w: %w", err, ErrYAML)
- }
- nmi.Key = k
- v, err := yamlNode(node.Content[i+1])
- if err != nil {
- return nil, fmt.Errorf("unable to process YAML map value for key %q: %w: %w", k, err, ErrYAML)
- }
- nmi.Value = v
- m[j] = nmi
- j++
- }
- return m, nil
-}
-
-func yamlSequence(node *yaml.Node) (interface{}, error) {
- s := make([]interface{}, 0)
-
- for i := 0; i < len(node.Content); i++ {
-
- v, err := yamlNode(node.Content[i])
- if err != nil {
- return nil, fmt.Errorf("unable to decode YAML sequence value: %w: %w", err, ErrYAML)
- }
- s = append(s, v)
- }
- return s, nil
-}
-
-const ( // See https://yaml.org/type/
- yamlStringScalar = "tag:yaml.org,2002:str"
- yamlIntScalar = "tag:yaml.org,2002:int"
- yamlBoolScalar = "tag:yaml.org,2002:bool"
- yamlFloatScalar = "tag:yaml.org,2002:float"
- yamlTimestamp = "tag:yaml.org,2002:timestamp"
- yamlNull = "tag:yaml.org,2002:null"
-)
-
-func yamlScalar(node *yaml.Node) (interface{}, error) {
- switch node.LongTag() {
- case yamlStringScalar:
- return node.Value, nil
- case yamlBoolScalar:
- b, err := strconv.ParseBool(node.Value)
- if err != nil {
- return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting bool content: %w: %w", node.Value, err, ErrYAML)
- }
- return b, nil
- case yamlIntScalar:
- i, err := strconv.ParseInt(node.Value, 10, 64)
- if err != nil {
- return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting integer content: %w: %w", node.Value, err, ErrYAML)
- }
- return i, nil
- case yamlFloatScalar:
- f, err := strconv.ParseFloat(node.Value, 64)
- if err != nil {
- return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting float content: %w: %w", node.Value, err, ErrYAML)
- }
- return f, nil
- case yamlTimestamp:
- return node.Value, nil
- case yamlNull:
- return nil, nil //nolint:nilnil
- default:
- return nil, fmt.Errorf("YAML tag %q is not supported: %w", node.LongTag(), ErrYAML)
- }
-}
-
-func yamlStringScalarC(node *yaml.Node) (string, error) {
- if node.Kind != yaml.ScalarNode {
- return "", fmt.Errorf("expecting a string scalar but got %q: %w", node.Kind, ErrYAML)
- }
- switch node.LongTag() {
- case yamlStringScalar, yamlIntScalar, yamlFloatScalar:
- return node.Value, nil
- default:
- return "", fmt.Errorf("YAML tag %q is not supported as map key: %w", node.LongTag(), ErrYAML)
- }
-}
-
-// JSONMapSlice represent a JSON object, with the order of keys maintained
-type JSONMapSlice []JSONMapItem
-
-// MarshalJSON renders a JSONMapSlice as JSON
-func (s JSONMapSlice) MarshalJSON() ([]byte, error) {
- w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty}
- s.MarshalEasyJSON(w)
- return w.BuildBytes()
-}
-
-// MarshalEasyJSON renders a JSONMapSlice as JSON, using easyJSON
-func (s JSONMapSlice) MarshalEasyJSON(w *jwriter.Writer) {
- w.RawByte('{')
-
- ln := len(s)
- last := ln - 1
- for i := 0; i < ln; i++ {
- s[i].MarshalEasyJSON(w)
- if i != last { // last item
- w.RawByte(',')
- }
- }
-
- w.RawByte('}')
-}
-
-// UnmarshalJSON makes a JSONMapSlice from JSON
-func (s *JSONMapSlice) UnmarshalJSON(data []byte) error {
- l := jlexer.Lexer{Data: data}
- s.UnmarshalEasyJSON(&l)
- return l.Error()
-}
-
-// UnmarshalEasyJSON makes a JSONMapSlice from JSON, using easyJSON
-func (s *JSONMapSlice) UnmarshalEasyJSON(in *jlexer.Lexer) {
- if in.IsNull() {
- in.Skip()
- return
- }
-
- var result JSONMapSlice
- in.Delim('{')
- for !in.IsDelim('}') {
- var mi JSONMapItem
- mi.UnmarshalEasyJSON(in)
- result = append(result, mi)
- }
- *s = result
-}
-
-func (s JSONMapSlice) MarshalYAML() (interface{}, error) {
- var n yaml.Node
- n.Kind = yaml.DocumentNode
- var nodes []*yaml.Node
- for _, item := range s {
- nn, err := json2yaml(item.Value)
- if err != nil {
- return nil, err
- }
- ns := []*yaml.Node{
- {
- Kind: yaml.ScalarNode,
- Tag: yamlStringScalar,
- Value: item.Key,
- },
- nn,
- }
- nodes = append(nodes, ns...)
- }
-
- n.Content = []*yaml.Node{
- {
- Kind: yaml.MappingNode,
- Content: nodes,
- },
- }
-
- return yaml.Marshal(&n)
-}
-
-func isNil(input interface{}) bool {
- if input == nil {
- return true
- }
- kind := reflect.TypeOf(input).Kind()
- switch kind { //nolint:exhaustive
- case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan:
- return reflect.ValueOf(input).IsNil()
- default:
- return false
- }
-}
-
-func json2yaml(item interface{}) (*yaml.Node, error) {
- if isNil(item) {
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Value: "null",
- }, nil
- }
-
- switch val := item.(type) {
- case JSONMapSlice:
- var n yaml.Node
- n.Kind = yaml.MappingNode
- for i := range val {
- childNode, err := json2yaml(&val[i].Value)
- if err != nil {
- return nil, err
- }
- n.Content = append(n.Content, &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlStringScalar,
- Value: val[i].Key,
- }, childNode)
- }
- return &n, nil
- case map[string]interface{}:
- var n yaml.Node
- n.Kind = yaml.MappingNode
- keys := make([]string, 0, len(val))
- for k := range val {
- keys = append(keys, k)
- }
- sort.Strings(keys)
-
- for _, k := range keys {
- v := val[k]
- childNode, err := json2yaml(v)
- if err != nil {
- return nil, err
- }
- n.Content = append(n.Content, &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlStringScalar,
- Value: k,
- }, childNode)
- }
- return &n, nil
- case []interface{}:
- var n yaml.Node
- n.Kind = yaml.SequenceNode
- for i := range val {
- childNode, err := json2yaml(val[i])
- if err != nil {
- return nil, err
- }
- n.Content = append(n.Content, childNode)
- }
- return &n, nil
- case string:
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlStringScalar,
- Value: val,
- }, nil
- case float64:
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlFloatScalar,
- Value: strconv.FormatFloat(val, 'f', -1, 64),
- }, nil
- case int64:
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlIntScalar,
- Value: strconv.FormatInt(val, 10),
- }, nil
- case uint64:
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlIntScalar,
- Value: strconv.FormatUint(val, 10),
- }, nil
- case bool:
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlBoolScalar,
- Value: strconv.FormatBool(val),
- }, nil
- default:
- return nil, fmt.Errorf("unhandled type: %T: %w", val, ErrYAML)
- }
-}
-
-// JSONMapItem represents the value of a key in a JSON object held by JSONMapSlice
-type JSONMapItem struct {
- Key string
- Value interface{}
-}
-
-// MarshalJSON renders a JSONMapItem as JSON
-func (s JSONMapItem) MarshalJSON() ([]byte, error) {
- w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty}
- s.MarshalEasyJSON(w)
- return w.BuildBytes()
-}
-
-// MarshalEasyJSON renders a JSONMapItem as JSON, using easyJSON
-func (s JSONMapItem) MarshalEasyJSON(w *jwriter.Writer) {
- w.String(s.Key)
- w.RawByte(':')
- w.Raw(WriteJSON(s.Value))
-}
-
-// UnmarshalJSON makes a JSONMapItem from JSON
-func (s *JSONMapItem) UnmarshalJSON(data []byte) error {
- l := jlexer.Lexer{Data: data}
- s.UnmarshalEasyJSON(&l)
- return l.Error()
-}
-
-// UnmarshalEasyJSON makes a JSONMapItem from JSON, using easyJSON
-func (s *JSONMapItem) UnmarshalEasyJSON(in *jlexer.Lexer) {
- key := in.UnsafeString()
- in.WantColon()
- value := in.Interface()
- in.WantComma()
- s.Key = key
- s.Value = value
-}
-
-func transformData(input interface{}) (out interface{}, err error) {
- format := func(t interface{}) (string, error) {
- switch k := t.(type) {
- case string:
- return k, nil
- case uint:
- return strconv.FormatUint(uint64(k), 10), nil
- case uint8:
- return strconv.FormatUint(uint64(k), 10), nil
- case uint16:
- return strconv.FormatUint(uint64(k), 10), nil
- case uint32:
- return strconv.FormatUint(uint64(k), 10), nil
- case uint64:
- return strconv.FormatUint(k, 10), nil
- case int:
- return strconv.Itoa(k), nil
- case int8:
- return strconv.FormatInt(int64(k), 10), nil
- case int16:
- return strconv.FormatInt(int64(k), 10), nil
- case int32:
- return strconv.FormatInt(int64(k), 10), nil
- case int64:
- return strconv.FormatInt(k, 10), nil
- default:
- return "", fmt.Errorf("unexpected map key type, got: %T: %w", k, ErrYAML)
- }
- }
-
- switch in := input.(type) {
- case yaml.Node:
- return yamlNode(&in)
- case *yaml.Node:
- return yamlNode(in)
- case map[interface{}]interface{}:
- o := make(JSONMapSlice, 0, len(in))
- for ke, va := range in {
- var nmi JSONMapItem
- if nmi.Key, err = format(ke); err != nil {
- return nil, err
- }
-
- v, ert := transformData(va)
- if ert != nil {
- return nil, ert
- }
- nmi.Value = v
- o = append(o, nmi)
- }
- return o, nil
- case []interface{}:
- len1 := len(in)
- o := make([]interface{}, len1)
- for i := 0; i < len1; i++ {
- o[i], err = transformData(in[i])
- if err != nil {
- return nil, err
- }
- }
- return o, nil
- }
- return input, nil
-}
-
-// YAMLDoc loads a yaml document from either http or a file and converts it to json
-func YAMLDoc(path string) (json.RawMessage, error) {
- yamlDoc, err := YAMLData(path)
- if err != nil {
- return nil, err
- }
-
- data, err := YAMLToJSON(yamlDoc)
- if err != nil {
- return nil, err
- }
-
- return data, nil
-}
-
-// YAMLData loads a yaml document from either http or a file
-func YAMLData(path string) (interface{}, error) {
- data, err := LoadFromFileOrHTTP(path)
- if err != nil {
- return nil, err
- }
-
- return BytesToYAMLDoc(data)
-}
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/LICENSE b/vendor/github.com/go-openapi/swag/yamlutils/LICENSE
new file mode 100644
index 000000000..d64569567
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/doc.go b/vendor/github.com/go-openapi/swag/yamlutils/doc.go
new file mode 100644
index 000000000..c8454c95f
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils/doc.go
@@ -0,0 +1,16 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package yamlutils provides utilities to work with YAML documents.
+package yamlutils
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/errors.go b/vendor/github.com/go-openapi/swag/yamlutils/errors.go
new file mode 100644
index 000000000..014f227d9
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils/errors.go
@@ -0,0 +1,26 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package yamlutils
+
+type yamlError string
+
+const (
+ // ErrYAML is an error raised by YAML utilities
+ ErrYAML yamlError = "yaml error"
+)
+
+func (e yamlError) Error() string {
+ return string(e)
+}
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go b/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go
new file mode 100644
index 000000000..c12bcc19b
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go
@@ -0,0 +1,210 @@
+package yamlutils
+
+import (
+ "fmt"
+ "reflect"
+ "sort"
+ "strconv"
+
+ "github.com/go-openapi/swag/jsonutils"
+ yaml "gopkg.in/yaml.v3"
+)
+
+var (
+ _ yaml.Marshaler = YAMLMapSlice{}
+ // _ yaml.Unmarshaler = &YAMLMapSlice{} // TODO: implement yaml.Unmarshaler
+)
+
+// YAMLMapSlice represents a YAML object, with the order of keys maintained.
+//
+// It is similar to [jsonutils.JSONMapSlice] and also knows how to marshal and unmarshal YAML.
+type YAMLMapSlice []YAMLMapItem
+
+// YAMLMapItem represents the value of a key in a YAML object held by [YAMLMapSlice].
+//
+// It is entirely equivalent to [jsonutils.JSONMapItem], with the same limitation that
+// you should not Marshal or Unmarshal directly this type, outside of a [YAMLMapSlice].
+type YAMLMapItem = jsonutils.JSONMapItem
+
+// MarshalJSON renders this YAML object as JSON bytes.
+func (s YAMLMapSlice) MarshalJSON() ([]byte, error) {
+ return jsonutils.JSONMapSlice(s).MarshalJSON()
+}
+
+// UnmarshalJSON builds this YAML object from JSON bytes.
+func (s *YAMLMapSlice) UnmarshalJSON(data []byte) error {
+ js := jsonutils.JSONMapSlice(*s)
+
+ if err := js.UnmarshalJSON(data); err != nil {
+ return err
+ }
+
+ *s = YAMLMapSlice(js)
+
+ return nil
+}
+
+// MarshalYAML produces a YAML document as bytes
+func (s YAMLMapSlice) MarshalYAML() (interface{}, error) {
+ var n yaml.Node
+ n.Kind = yaml.DocumentNode
+ var nodes []*yaml.Node
+
+ for _, item := range s {
+ nn, err := json2yaml(item.Value)
+ if err != nil {
+ return nil, err
+ }
+
+ ns := []*yaml.Node{
+ {
+ Kind: yaml.ScalarNode,
+ Tag: yamlStringScalar,
+ Value: item.Key,
+ },
+ nn,
+ }
+ nodes = append(nodes, ns...)
+ }
+
+ n.Content = []*yaml.Node{
+ {
+ Kind: yaml.MappingNode,
+ Content: nodes,
+ },
+ }
+
+ return yaml.Marshal(&n)
+}
+
+/*
+// UnmarshalYAML builds a YAMLMapSlice object from a YAML document [yaml.Node].
+func (s *YAMLMapSlice) UnmarshalYAML(value *yaml.Node) error {
+ panic("not implemented")
+
+ return nil
+}
+*/
+
+func isNil(input interface{}) bool {
+ if input == nil {
+ return true
+ }
+ kind := reflect.TypeOf(input).Kind()
+ switch kind { //nolint:exhaustive
+ case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan:
+ return reflect.ValueOf(input).IsNil()
+ default:
+ return false
+ }
+}
+
+func json2yaml(item interface{}) (*yaml.Node, error) {
+ if isNil(item) {
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Value: "null",
+ }, nil
+ }
+
+ switch val := item.(type) {
+ case YAMLMapSlice:
+ var n yaml.Node
+ n.Kind = yaml.MappingNode
+ for i := range val {
+ childNode, err := json2yaml(val[i].Value)
+ if err != nil {
+ return nil, err
+ }
+ n.Content = append(n.Content, &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlStringScalar,
+ Value: val[i].Key,
+ }, childNode)
+ }
+ return &n, nil
+
+ case jsonutils.JSONMapSlice:
+ var n yaml.Node
+ n.Kind = yaml.MappingNode
+ for i := range val {
+ childNode, err := json2yaml(val[i].Value)
+ if err != nil {
+ return nil, err
+ }
+ n.Content = append(n.Content, &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlStringScalar,
+ Value: val[i].Key,
+ }, childNode)
+ }
+ return &n, nil
+
+ case map[string]interface{}:
+ var n yaml.Node
+ n.Kind = yaml.MappingNode
+ keys := make([]string, 0, len(val))
+ for k := range val {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+
+ for _, k := range keys {
+ v := val[k]
+ childNode, err := json2yaml(v)
+ if err != nil {
+ return nil, err
+ }
+ n.Content = append(n.Content, &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlStringScalar,
+ Value: k,
+ }, childNode)
+ }
+ return &n, nil
+
+ case []interface{}:
+ var n yaml.Node
+ n.Kind = yaml.SequenceNode
+ for i := range val {
+ childNode, err := json2yaml(val[i])
+ if err != nil {
+ return nil, err
+ }
+ n.Content = append(n.Content, childNode)
+ }
+ return &n, nil
+ case string:
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlStringScalar,
+ Value: val,
+ }, nil
+ case float64:
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlFloatScalar,
+ Value: strconv.FormatFloat(val, 'f', -1, 64),
+ }, nil
+ case int64:
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlIntScalar,
+ Value: strconv.FormatInt(val, 10),
+ }, nil
+ case uint64:
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlIntScalar,
+ Value: strconv.FormatUint(val, 10),
+ }, nil
+ case bool:
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlBoolScalar,
+ Value: strconv.FormatBool(val),
+ }, nil
+ default:
+ return nil, fmt.Errorf("unhandled type: %T: %w", val, ErrYAML)
+ }
+}
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/yaml.go b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go
new file mode 100644
index 000000000..c7e88255f
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go
@@ -0,0 +1,233 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package yamlutils
+
+import (
+ json "encoding/json"
+ "fmt"
+ "strconv"
+
+ "github.com/go-openapi/swag/jsonutils"
+ yaml "gopkg.in/yaml.v3"
+)
+
+// YAMLToJSON converts a YAML document into JSON bytes.
+//
+// Note: a YAML document is the output from a [yaml.Marshaler], e.g a pointer to a [yaml.Node].
+func YAMLToJSON(value interface{}) (json.RawMessage, error) {
+ jm, err := transformData(value)
+ if err != nil {
+ return nil, err
+ }
+
+ b, err := jsonutils.WriteJSON(jm)
+
+ return json.RawMessage(b), err
+}
+
+// BytesToYAMLDoc converts a byte slice into a YAML document.
+//
+// This function only supports root documents that are objects.
+//
+// A YAML document is a pointer to a [yaml.Node].
+func BytesToYAMLDoc(data []byte) (interface{}, error) {
+ var document yaml.Node // preserve order that is present in the document
+ if err := yaml.Unmarshal(data, &document); err != nil {
+ return nil, err
+ }
+ if document.Kind != yaml.DocumentNode || len(document.Content) != 1 || document.Content[0].Kind != yaml.MappingNode {
+ return nil, fmt.Errorf("only YAML documents that are objects are supported: %w", ErrYAML)
+ }
+ return &document, nil
+}
+
+func yamlNode(root *yaml.Node) (interface{}, error) {
+ switch root.Kind {
+ case yaml.DocumentNode:
+ return yamlDocument(root)
+ case yaml.SequenceNode:
+ return yamlSequence(root)
+ case yaml.MappingNode:
+ return yamlMapping(root)
+ case yaml.ScalarNode:
+ return yamlScalar(root)
+ case yaml.AliasNode:
+ return yamlNode(root.Alias)
+ default:
+ return nil, fmt.Errorf("unsupported YAML node type: %v: %w", root.Kind, ErrYAML)
+ }
+}
+
+func yamlDocument(node *yaml.Node) (interface{}, error) {
+ if len(node.Content) != 1 {
+ return nil, fmt.Errorf("unexpected YAML Document node content length: %d: %w", len(node.Content), ErrYAML)
+ }
+ return yamlNode(node.Content[0])
+}
+
+func yamlMapping(node *yaml.Node) (interface{}, error) {
+ const sensibleAllocDivider = 2
+ m := make(YAMLMapSlice, len(node.Content)/sensibleAllocDivider)
+
+ var j int
+ for i := 0; i < len(node.Content); i += 2 {
+ var nmi YAMLMapItem
+ k, err := yamlStringScalarC(node.Content[i])
+ if err != nil {
+ return nil, fmt.Errorf("unable to decode YAML map key: %w: %w", err, ErrYAML)
+ }
+ nmi.Key = k
+ v, err := yamlNode(node.Content[i+1])
+ if err != nil {
+ return nil, fmt.Errorf("unable to process YAML map value for key %q: %w: %w", k, err, ErrYAML)
+ }
+ nmi.Value = v
+ m[j] = nmi
+ j++
+ }
+ return m, nil
+}
+
+func yamlSequence(node *yaml.Node) (interface{}, error) {
+ s := make([]interface{}, 0)
+
+ for i := 0; i < len(node.Content); i++ {
+
+ v, err := yamlNode(node.Content[i])
+ if err != nil {
+ return nil, fmt.Errorf("unable to decode YAML sequence value: %w: %w", err, ErrYAML)
+ }
+ s = append(s, v)
+ }
+ return s, nil
+}
+
+const ( // See https://yaml.org/type/
+ yamlStringScalar = "tag:yaml.org,2002:str"
+ yamlIntScalar = "tag:yaml.org,2002:int"
+ yamlBoolScalar = "tag:yaml.org,2002:bool"
+ yamlFloatScalar = "tag:yaml.org,2002:float"
+ yamlTimestamp = "tag:yaml.org,2002:timestamp"
+ yamlNull = "tag:yaml.org,2002:null"
+)
+
+func yamlScalar(node *yaml.Node) (interface{}, error) {
+ switch node.LongTag() {
+ case yamlStringScalar:
+ return node.Value, nil
+ case yamlBoolScalar:
+ b, err := strconv.ParseBool(node.Value)
+ if err != nil {
+ return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting bool content: %w: %w", node.Value, err, ErrYAML)
+ }
+ return b, nil
+ case yamlIntScalar:
+ i, err := strconv.ParseInt(node.Value, 10, 64)
+ if err != nil {
+ return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting integer content: %w: %w", node.Value, err, ErrYAML)
+ }
+ return i, nil
+ case yamlFloatScalar:
+ f, err := strconv.ParseFloat(node.Value, 64)
+ if err != nil {
+ return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting float content: %w: %w", node.Value, err, ErrYAML)
+ }
+ return f, nil
+ case yamlTimestamp:
+ // YAML timestamp is marshaled as string, not time
+ return node.Value, nil
+ case yamlNull:
+ return nil, nil //nolint:nilnil
+ default:
+ return nil, fmt.Errorf("YAML tag %q is not supported: %w", node.LongTag(), ErrYAML)
+ }
+}
+
+func yamlStringScalarC(node *yaml.Node) (string, error) {
+ if node.Kind != yaml.ScalarNode {
+ return "", fmt.Errorf("expecting a string scalar but got %q: %w", node.Kind, ErrYAML)
+ }
+ switch node.LongTag() {
+ case yamlStringScalar, yamlIntScalar, yamlFloatScalar:
+ return node.Value, nil
+ default:
+ return "", fmt.Errorf("YAML tag %q is not supported as map key: %w", node.LongTag(), ErrYAML)
+ }
+}
+
+func transformData(input interface{}) (out interface{}, err error) {
+ format := func(t interface{}) (string, error) {
+ switch k := t.(type) {
+ case string:
+ return k, nil
+ case uint:
+ return strconv.FormatUint(uint64(k), 10), nil
+ case uint8:
+ return strconv.FormatUint(uint64(k), 10), nil
+ case uint16:
+ return strconv.FormatUint(uint64(k), 10), nil
+ case uint32:
+ return strconv.FormatUint(uint64(k), 10), nil
+ case uint64:
+ return strconv.FormatUint(k, 10), nil
+ case int:
+ return strconv.Itoa(k), nil
+ case int8:
+ return strconv.FormatInt(int64(k), 10), nil
+ case int16:
+ return strconv.FormatInt(int64(k), 10), nil
+ case int32:
+ return strconv.FormatInt(int64(k), 10), nil
+ case int64:
+ return strconv.FormatInt(k, 10), nil
+ default:
+ return "", fmt.Errorf("unexpected map key type, got: %T: %w", k, ErrYAML)
+ }
+ }
+
+ switch in := input.(type) {
+ case yaml.Node:
+ return yamlNode(&in)
+ case *yaml.Node:
+ return yamlNode(in)
+ case map[interface{}]interface{}:
+ o := make(YAMLMapSlice, 0, len(in))
+ for ke, va := range in {
+ var nmi YAMLMapItem
+ if nmi.Key, err = format(ke); err != nil {
+ return nil, err
+ }
+
+ v, ert := transformData(va)
+ if ert != nil {
+ return nil, ert
+ }
+ nmi.Value = v
+ o = append(o, nmi)
+ }
+ return o, nil
+ case []interface{}:
+ len1 := len(in)
+ o := make([]interface{}, len1)
+ for i := 0; i < len1; i++ {
+ o[i], err = transformData(in[i])
+ if err != nil {
+ return nil, err
+ }
+ }
+ return o, nil
+ }
+ return input, nil
+}
diff --git a/vendor/github.com/go-openapi/swag/yamlutils_iface.go b/vendor/github.com/go-openapi/swag/yamlutils_iface.go
new file mode 100644
index 000000000..49e646486
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils_iface.go
@@ -0,0 +1,31 @@
+// Copyright 2015 go-swagger maintainers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package swag
+
+import (
+ "encoding/json"
+
+ "github.com/go-openapi/swag/yamlutils"
+)
+
+// YAMLToJSON converts YAML unmarshaled data into json compatible data
+//
+// Deprecated: use [yamlutils.YAMLToJSON] instead.
+func YAMLToJSON(data interface{}) (json.RawMessage, error) { return yamlutils.YAMLToJSON(data) }
+
+// BytesToYAMLDoc converts a byte slice into a YAML document
+//
+// Deprecated: use [yamlutils.BytesToYAMLDoc] instead.
+func BytesToYAMLDoc(data []byte) (interface{}, error) { return yamlutils.BytesToYAMLDoc(data) }
diff --git a/vendor/github.com/godoc-lint/godoc-lint/pkg/check/require_doc/require_doc.go b/vendor/github.com/godoc-lint/godoc-lint/pkg/check/require_doc/require_doc.go
index 9b0ba1aff..afa16bd78 100644
--- a/vendor/github.com/godoc-lint/godoc-lint/pkg/check/require_doc/require_doc.go
+++ b/vendor/github.com/godoc-lint/godoc-lint/pkg/check/require_doc/require_doc.go
@@ -44,6 +44,13 @@ func (r *RequireDocChecker) Apply(actx *model.AnalysisContext) error {
continue
}
+ if decl.Name == "_" {
+ // Blank identifiers should be ignored; e.g.:
+ //
+ // var _ = 0
+ continue
+ }
+
if decl.Doc != nil && (decl.Doc.DisabledRules.All || decl.Doc.DisabledRules.Rules.Has(requireDocRule)) {
continue
}
diff --git a/vendor/github.com/godoc-lint/godoc-lint/pkg/check/start_with_name/start_with_name.go b/vendor/github.com/godoc-lint/godoc-lint/pkg/check/start_with_name/start_with_name.go
index af83b99a0..f8c905aab 100644
--- a/vendor/github.com/godoc-lint/godoc-lint/pkg/check/start_with_name/start_with_name.go
+++ b/vendor/github.com/godoc-lint/godoc-lint/pkg/check/start_with_name/start_with_name.go
@@ -45,6 +45,13 @@ func (r *StartWithNameChecker) Apply(actx *model.AnalysisContext) error {
continue
}
+ if decl.Name == "_" {
+ // Blank identifiers should be ignored; e.g.:
+ //
+ // var _ = 0
+ continue
+ }
+
if decl.Kind == model.SymbolDeclKindBad {
continue
}
diff --git a/vendor/github.com/godoc-lint/godoc-lint/pkg/config/plain.go b/vendor/github.com/godoc-lint/godoc-lint/pkg/config/plain.go
index 4cb75d8d0..d19323f3f 100644
--- a/vendor/github.com/godoc-lint/godoc-lint/pkg/config/plain.go
+++ b/vendor/github.com/godoc-lint/godoc-lint/pkg/config/plain.go
@@ -43,7 +43,7 @@ func transferOptions(target *model.RuleOptions, source *PlainRuleOptions) {
resVT := resV.Type()
resOptionMap := make(map[string]string, resVT.NumField())
- for i := 0; i < resVT.NumField(); i++ {
+ for i := range resVT.NumField() {
ft := resVT.Field(i)
key, ok := ft.Tag.Lookup("option")
if !ok {
@@ -54,7 +54,7 @@ func transferOptions(target *model.RuleOptions, source *PlainRuleOptions) {
v := reflect.ValueOf(source).Elem()
vt := v.Type()
- for i := 0; i < vt.NumField(); i++ {
+ for i := range vt.NumField() {
ft := vt.Field(i)
key, ok := ft.Tag.Lookup("option")
if !ok {
diff --git a/vendor/github.com/godoc-lint/godoc-lint/pkg/inspect/inspector.go b/vendor/github.com/godoc-lint/godoc-lint/pkg/inspect/inspector.go
index 7ea535ee8..0040be0e0 100644
--- a/vendor/github.com/godoc-lint/godoc-lint/pkg/inspect/inspector.go
+++ b/vendor/github.com/godoc-lint/godoc-lint/pkg/inspect/inspector.go
@@ -296,14 +296,13 @@ func (i *Inspector) extractCommentGroup(cg *ast.CommentGroup) *model.CommentGrou
func extractDisableDirectivesInComment(s string) model.InspectorResultDisableRules {
result := model.InspectorResultDisableRules{}
for _, directive := range disableDirectivePattern.FindAllStringSubmatch(s, -1) {
- args := string(directive[1])
+ args := directive[1]
if args == "" {
result.All = true
continue
}
- names := strings.Split(strings.TrimSpace(args), " ")
- for _, name := range names {
+ for name := range strings.SplitSeq(strings.TrimSpace(args), " ") {
if model.AllRules.Has(model.Rule(name)) {
result.Rules = result.Rules.Add(model.Rule(name))
}
diff --git a/vendor/github.com/gogo/protobuf/gogoproto/Makefile b/vendor/github.com/gogo/protobuf/gogoproto/Makefile
deleted file mode 100644
index 0b4659b73..000000000
--- a/vendor/github.com/gogo/protobuf/gogoproto/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-# Protocol Buffers for Go with Gadgets
-#
-# Copyright (c) 2013, The GoGo Authors. All rights reserved.
-# http://github.com/gogo/protobuf
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-regenerate:
- go install github.com/gogo/protobuf/protoc-gen-gogo
- protoc --gogo_out=Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:../../../../ --proto_path=../../../../:../protobuf/:. *.proto
-
-restore:
- cp gogo.pb.golden gogo.pb.go
-
-preserve:
- cp gogo.pb.go gogo.pb.golden
diff --git a/vendor/github.com/gogo/protobuf/gogoproto/doc.go b/vendor/github.com/gogo/protobuf/gogoproto/doc.go
deleted file mode 100644
index 081c86fa8..000000000
--- a/vendor/github.com/gogo/protobuf/gogoproto/doc.go
+++ /dev/null
@@ -1,169 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-/*
-Package gogoproto provides extensions for protocol buffers to achieve:
-
- - fast marshalling and unmarshalling.
- - peace of mind by optionally generating test and benchmark code.
- - more canonical Go structures.
- - less typing by optionally generating extra helper code.
- - goprotobuf compatibility
-
-More Canonical Go Structures
-
-A lot of time working with a goprotobuf struct will lead you to a place where you create another struct that is easier to work with and then have a function to copy the values between the two structs.
-You might also find that basic structs that started their life as part of an API need to be sent over the wire. With gob, you could just send it. With goprotobuf, you need to make a parallel struct.
-Gogoprotobuf tries to fix these problems with the nullable, embed, customtype and customname field extensions.
-
- - nullable, if false, a field is generated without a pointer (see warning below).
- - embed, if true, the field is generated as an embedded field.
- - customtype, It works with the Marshal and Unmarshal methods, to allow you to have your own types in your struct, but marshal to bytes. For example, custom.Uuid or custom.Fixed128
- - customname (beta), Changes the generated fieldname. This is especially useful when generated methods conflict with fieldnames.
- - casttype (beta), Changes the generated fieldtype. All generated code assumes that this type is castable to the protocol buffer field type. It does not work for structs or enums.
- - castkey (beta), Changes the generated fieldtype for a map key. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps.
- - castvalue (beta), Changes the generated fieldtype for a map value. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps.
-
-Warning about nullable: According to the Protocol Buffer specification, you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set. It can be seen as a layer on top of Protocol Buffers, where before and after marshalling all non-nullable fields are set and they cannot be unset.
-
-Let us look at:
-
- github.com/gogo/protobuf/test/example/example.proto
-
-for a quicker overview.
-
-The following message:
-
- package test;
-
- import "github.com/gogo/protobuf/gogoproto/gogo.proto";
-
- message A {
- optional string Description = 1 [(gogoproto.nullable) = false];
- optional int64 Number = 2 [(gogoproto.nullable) = false];
- optional bytes Id = 3 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uuid", (gogoproto.nullable) = false];
- }
-
-Will generate a go struct which looks a lot like this:
-
- type A struct {
- Description string
- Number int64
- Id github_com_gogo_protobuf_test_custom.Uuid
- }
-
-You will see there are no pointers, since all fields are non-nullable.
-You will also see a custom type which marshals to a string.
-Be warned it is your responsibility to test your custom types thoroughly.
-You should think of every possible empty and nil case for your marshaling, unmarshaling and size methods.
-
-Next we will embed the message A in message B.
-
- message B {
- optional A A = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true];
- repeated bytes G = 2 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uint128", (gogoproto.nullable) = false];
- }
-
-See below that A is embedded in B.
-
- type B struct {
- A
- G []github_com_gogo_protobuf_test_custom.Uint128
- }
-
-Also see the repeated custom type.
-
- type Uint128 [2]uint64
-
-Next we will create a custom name for one of our fields.
-
- message C {
- optional int64 size = 1 [(gogoproto.customname) = "MySize"];
- }
-
-See below that the field's name is MySize and not Size.
-
- type C struct {
- MySize *int64
- }
-
-The is useful when having a protocol buffer message with a field name which conflicts with a generated method.
-As an example, having a field name size and using the sizer plugin to generate a Size method will cause a go compiler error.
-Using customname you can fix this error without changing the field name.
-This is typically useful when working with a protocol buffer that was designed before these methods and/or the go language were avialable.
-
-Gogoprotobuf also has some more subtle changes, these could be changed back:
-
- - the generated package name for imports do not have the extra /filename.pb,
- but are actually the imports specified in the .proto file.
-
-Gogoprotobuf also has lost some features which should be brought back with time:
-
- - Marshalling and unmarshalling with reflect and without the unsafe package,
- this requires work in pointer_reflect.go
-
-Why does nullable break protocol buffer specifications:
-
-The protocol buffer specification states, somewhere, that you should be able to tell whether a
-field is set or unset. With the option nullable=false this feature is lost,
-since your non-nullable fields will always be set. It can be seen as a layer on top of
-protocol buffers, where before and after marshalling all non-nullable fields are set
-and they cannot be unset.
-
-Goprotobuf Compatibility:
-
-Gogoprotobuf is compatible with Goprotobuf, because it is compatible with protocol buffers.
-Gogoprotobuf generates the same code as goprotobuf if no extensions are used.
-The enumprefix, getters and stringer extensions can be used to remove some of the unnecessary code generated by goprotobuf:
-
- - gogoproto_import, if false, the generated code imports github.com/golang/protobuf/proto instead of github.com/gogo/protobuf/proto.
- - goproto_enum_prefix, if false, generates the enum constant names without the messagetype prefix
- - goproto_enum_stringer (experimental), if false, the enum is generated without the default string method, this is useful for rather using enum_stringer, or allowing you to write your own string method.
- - goproto_getters, if false, the message is generated without get methods, this is useful when you would rather want to use face
- - goproto_stringer, if false, the message is generated without the default string method, this is useful for rather using stringer, or allowing you to write your own string method.
- - goproto_extensions_map (beta), if false, the extensions field is generated as type []byte instead of type map[int32]proto.Extension
- - goproto_unrecognized (beta), if false, XXX_unrecognized field is not generated. This is useful in conjunction with gogoproto.nullable=false, to generate structures completely devoid of pointers and reduce GC pressure at the cost of losing information about unrecognized fields.
- - goproto_registration (beta), if true, the generated files will register all messages and types against both gogo/protobuf and golang/protobuf. This is necessary when using third-party packages which read registrations from golang/protobuf (such as the grpc-gateway).
-
-Less Typing and Peace of Mind is explained in their specific plugin folders godoc:
-
- - github.com/gogo/protobuf/plugin/
-
-If you do not use any of these extension the code that is generated
-will be the same as if goprotobuf has generated it.
-
-The most complete way to see examples is to look at
-
- github.com/gogo/protobuf/test/thetest.proto
-
-Gogoprototest is a seperate project,
-because we want to keep gogoprotobuf independent of goprotobuf,
-but we still want to test it thoroughly.
-
-*/
-package gogoproto
diff --git a/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go b/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go
deleted file mode 100644
index 1e91766ae..000000000
--- a/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go
+++ /dev/null
@@ -1,874 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: gogo.proto
-
-package gogoproto
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
- math "math"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-var E_GoprotoEnumPrefix = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.EnumOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 62001,
- Name: "gogoproto.goproto_enum_prefix",
- Tag: "varint,62001,opt,name=goproto_enum_prefix",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoEnumStringer = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.EnumOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 62021,
- Name: "gogoproto.goproto_enum_stringer",
- Tag: "varint,62021,opt,name=goproto_enum_stringer",
- Filename: "gogo.proto",
-}
-
-var E_EnumStringer = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.EnumOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 62022,
- Name: "gogoproto.enum_stringer",
- Tag: "varint,62022,opt,name=enum_stringer",
- Filename: "gogo.proto",
-}
-
-var E_EnumCustomname = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.EnumOptions)(nil),
- ExtensionType: (*string)(nil),
- Field: 62023,
- Name: "gogoproto.enum_customname",
- Tag: "bytes,62023,opt,name=enum_customname",
- Filename: "gogo.proto",
-}
-
-var E_Enumdecl = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.EnumOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 62024,
- Name: "gogoproto.enumdecl",
- Tag: "varint,62024,opt,name=enumdecl",
- Filename: "gogo.proto",
-}
-
-var E_EnumvalueCustomname = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.EnumValueOptions)(nil),
- ExtensionType: (*string)(nil),
- Field: 66001,
- Name: "gogoproto.enumvalue_customname",
- Tag: "bytes,66001,opt,name=enumvalue_customname",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoGettersAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63001,
- Name: "gogoproto.goproto_getters_all",
- Tag: "varint,63001,opt,name=goproto_getters_all",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoEnumPrefixAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63002,
- Name: "gogoproto.goproto_enum_prefix_all",
- Tag: "varint,63002,opt,name=goproto_enum_prefix_all",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoStringerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63003,
- Name: "gogoproto.goproto_stringer_all",
- Tag: "varint,63003,opt,name=goproto_stringer_all",
- Filename: "gogo.proto",
-}
-
-var E_VerboseEqualAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63004,
- Name: "gogoproto.verbose_equal_all",
- Tag: "varint,63004,opt,name=verbose_equal_all",
- Filename: "gogo.proto",
-}
-
-var E_FaceAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63005,
- Name: "gogoproto.face_all",
- Tag: "varint,63005,opt,name=face_all",
- Filename: "gogo.proto",
-}
-
-var E_GostringAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63006,
- Name: "gogoproto.gostring_all",
- Tag: "varint,63006,opt,name=gostring_all",
- Filename: "gogo.proto",
-}
-
-var E_PopulateAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63007,
- Name: "gogoproto.populate_all",
- Tag: "varint,63007,opt,name=populate_all",
- Filename: "gogo.proto",
-}
-
-var E_StringerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63008,
- Name: "gogoproto.stringer_all",
- Tag: "varint,63008,opt,name=stringer_all",
- Filename: "gogo.proto",
-}
-
-var E_OnlyoneAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63009,
- Name: "gogoproto.onlyone_all",
- Tag: "varint,63009,opt,name=onlyone_all",
- Filename: "gogo.proto",
-}
-
-var E_EqualAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63013,
- Name: "gogoproto.equal_all",
- Tag: "varint,63013,opt,name=equal_all",
- Filename: "gogo.proto",
-}
-
-var E_DescriptionAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63014,
- Name: "gogoproto.description_all",
- Tag: "varint,63014,opt,name=description_all",
- Filename: "gogo.proto",
-}
-
-var E_TestgenAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63015,
- Name: "gogoproto.testgen_all",
- Tag: "varint,63015,opt,name=testgen_all",
- Filename: "gogo.proto",
-}
-
-var E_BenchgenAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63016,
- Name: "gogoproto.benchgen_all",
- Tag: "varint,63016,opt,name=benchgen_all",
- Filename: "gogo.proto",
-}
-
-var E_MarshalerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63017,
- Name: "gogoproto.marshaler_all",
- Tag: "varint,63017,opt,name=marshaler_all",
- Filename: "gogo.proto",
-}
-
-var E_UnmarshalerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63018,
- Name: "gogoproto.unmarshaler_all",
- Tag: "varint,63018,opt,name=unmarshaler_all",
- Filename: "gogo.proto",
-}
-
-var E_StableMarshalerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63019,
- Name: "gogoproto.stable_marshaler_all",
- Tag: "varint,63019,opt,name=stable_marshaler_all",
- Filename: "gogo.proto",
-}
-
-var E_SizerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63020,
- Name: "gogoproto.sizer_all",
- Tag: "varint,63020,opt,name=sizer_all",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoEnumStringerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63021,
- Name: "gogoproto.goproto_enum_stringer_all",
- Tag: "varint,63021,opt,name=goproto_enum_stringer_all",
- Filename: "gogo.proto",
-}
-
-var E_EnumStringerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63022,
- Name: "gogoproto.enum_stringer_all",
- Tag: "varint,63022,opt,name=enum_stringer_all",
- Filename: "gogo.proto",
-}
-
-var E_UnsafeMarshalerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63023,
- Name: "gogoproto.unsafe_marshaler_all",
- Tag: "varint,63023,opt,name=unsafe_marshaler_all",
- Filename: "gogo.proto",
-}
-
-var E_UnsafeUnmarshalerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63024,
- Name: "gogoproto.unsafe_unmarshaler_all",
- Tag: "varint,63024,opt,name=unsafe_unmarshaler_all",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoExtensionsMapAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63025,
- Name: "gogoproto.goproto_extensions_map_all",
- Tag: "varint,63025,opt,name=goproto_extensions_map_all",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoUnrecognizedAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63026,
- Name: "gogoproto.goproto_unrecognized_all",
- Tag: "varint,63026,opt,name=goproto_unrecognized_all",
- Filename: "gogo.proto",
-}
-
-var E_GogoprotoImport = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63027,
- Name: "gogoproto.gogoproto_import",
- Tag: "varint,63027,opt,name=gogoproto_import",
- Filename: "gogo.proto",
-}
-
-var E_ProtosizerAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63028,
- Name: "gogoproto.protosizer_all",
- Tag: "varint,63028,opt,name=protosizer_all",
- Filename: "gogo.proto",
-}
-
-var E_CompareAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63029,
- Name: "gogoproto.compare_all",
- Tag: "varint,63029,opt,name=compare_all",
- Filename: "gogo.proto",
-}
-
-var E_TypedeclAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63030,
- Name: "gogoproto.typedecl_all",
- Tag: "varint,63030,opt,name=typedecl_all",
- Filename: "gogo.proto",
-}
-
-var E_EnumdeclAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63031,
- Name: "gogoproto.enumdecl_all",
- Tag: "varint,63031,opt,name=enumdecl_all",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoRegistration = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63032,
- Name: "gogoproto.goproto_registration",
- Tag: "varint,63032,opt,name=goproto_registration",
- Filename: "gogo.proto",
-}
-
-var E_MessagenameAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63033,
- Name: "gogoproto.messagename_all",
- Tag: "varint,63033,opt,name=messagename_all",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoSizecacheAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63034,
- Name: "gogoproto.goproto_sizecache_all",
- Tag: "varint,63034,opt,name=goproto_sizecache_all",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoUnkeyedAll = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FileOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 63035,
- Name: "gogoproto.goproto_unkeyed_all",
- Tag: "varint,63035,opt,name=goproto_unkeyed_all",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoGetters = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64001,
- Name: "gogoproto.goproto_getters",
- Tag: "varint,64001,opt,name=goproto_getters",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoStringer = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64003,
- Name: "gogoproto.goproto_stringer",
- Tag: "varint,64003,opt,name=goproto_stringer",
- Filename: "gogo.proto",
-}
-
-var E_VerboseEqual = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64004,
- Name: "gogoproto.verbose_equal",
- Tag: "varint,64004,opt,name=verbose_equal",
- Filename: "gogo.proto",
-}
-
-var E_Face = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64005,
- Name: "gogoproto.face",
- Tag: "varint,64005,opt,name=face",
- Filename: "gogo.proto",
-}
-
-var E_Gostring = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64006,
- Name: "gogoproto.gostring",
- Tag: "varint,64006,opt,name=gostring",
- Filename: "gogo.proto",
-}
-
-var E_Populate = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64007,
- Name: "gogoproto.populate",
- Tag: "varint,64007,opt,name=populate",
- Filename: "gogo.proto",
-}
-
-var E_Stringer = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 67008,
- Name: "gogoproto.stringer",
- Tag: "varint,67008,opt,name=stringer",
- Filename: "gogo.proto",
-}
-
-var E_Onlyone = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64009,
- Name: "gogoproto.onlyone",
- Tag: "varint,64009,opt,name=onlyone",
- Filename: "gogo.proto",
-}
-
-var E_Equal = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64013,
- Name: "gogoproto.equal",
- Tag: "varint,64013,opt,name=equal",
- Filename: "gogo.proto",
-}
-
-var E_Description = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64014,
- Name: "gogoproto.description",
- Tag: "varint,64014,opt,name=description",
- Filename: "gogo.proto",
-}
-
-var E_Testgen = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64015,
- Name: "gogoproto.testgen",
- Tag: "varint,64015,opt,name=testgen",
- Filename: "gogo.proto",
-}
-
-var E_Benchgen = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64016,
- Name: "gogoproto.benchgen",
- Tag: "varint,64016,opt,name=benchgen",
- Filename: "gogo.proto",
-}
-
-var E_Marshaler = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64017,
- Name: "gogoproto.marshaler",
- Tag: "varint,64017,opt,name=marshaler",
- Filename: "gogo.proto",
-}
-
-var E_Unmarshaler = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64018,
- Name: "gogoproto.unmarshaler",
- Tag: "varint,64018,opt,name=unmarshaler",
- Filename: "gogo.proto",
-}
-
-var E_StableMarshaler = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64019,
- Name: "gogoproto.stable_marshaler",
- Tag: "varint,64019,opt,name=stable_marshaler",
- Filename: "gogo.proto",
-}
-
-var E_Sizer = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64020,
- Name: "gogoproto.sizer",
- Tag: "varint,64020,opt,name=sizer",
- Filename: "gogo.proto",
-}
-
-var E_UnsafeMarshaler = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64023,
- Name: "gogoproto.unsafe_marshaler",
- Tag: "varint,64023,opt,name=unsafe_marshaler",
- Filename: "gogo.proto",
-}
-
-var E_UnsafeUnmarshaler = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64024,
- Name: "gogoproto.unsafe_unmarshaler",
- Tag: "varint,64024,opt,name=unsafe_unmarshaler",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoExtensionsMap = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64025,
- Name: "gogoproto.goproto_extensions_map",
- Tag: "varint,64025,opt,name=goproto_extensions_map",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoUnrecognized = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64026,
- Name: "gogoproto.goproto_unrecognized",
- Tag: "varint,64026,opt,name=goproto_unrecognized",
- Filename: "gogo.proto",
-}
-
-var E_Protosizer = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64028,
- Name: "gogoproto.protosizer",
- Tag: "varint,64028,opt,name=protosizer",
- Filename: "gogo.proto",
-}
-
-var E_Compare = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64029,
- Name: "gogoproto.compare",
- Tag: "varint,64029,opt,name=compare",
- Filename: "gogo.proto",
-}
-
-var E_Typedecl = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64030,
- Name: "gogoproto.typedecl",
- Tag: "varint,64030,opt,name=typedecl",
- Filename: "gogo.proto",
-}
-
-var E_Messagename = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64033,
- Name: "gogoproto.messagename",
- Tag: "varint,64033,opt,name=messagename",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoSizecache = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64034,
- Name: "gogoproto.goproto_sizecache",
- Tag: "varint,64034,opt,name=goproto_sizecache",
- Filename: "gogo.proto",
-}
-
-var E_GoprotoUnkeyed = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.MessageOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 64035,
- Name: "gogoproto.goproto_unkeyed",
- Tag: "varint,64035,opt,name=goproto_unkeyed",
- Filename: "gogo.proto",
-}
-
-var E_Nullable = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 65001,
- Name: "gogoproto.nullable",
- Tag: "varint,65001,opt,name=nullable",
- Filename: "gogo.proto",
-}
-
-var E_Embed = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 65002,
- Name: "gogoproto.embed",
- Tag: "varint,65002,opt,name=embed",
- Filename: "gogo.proto",
-}
-
-var E_Customtype = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*string)(nil),
- Field: 65003,
- Name: "gogoproto.customtype",
- Tag: "bytes,65003,opt,name=customtype",
- Filename: "gogo.proto",
-}
-
-var E_Customname = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*string)(nil),
- Field: 65004,
- Name: "gogoproto.customname",
- Tag: "bytes,65004,opt,name=customname",
- Filename: "gogo.proto",
-}
-
-var E_Jsontag = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*string)(nil),
- Field: 65005,
- Name: "gogoproto.jsontag",
- Tag: "bytes,65005,opt,name=jsontag",
- Filename: "gogo.proto",
-}
-
-var E_Moretags = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*string)(nil),
- Field: 65006,
- Name: "gogoproto.moretags",
- Tag: "bytes,65006,opt,name=moretags",
- Filename: "gogo.proto",
-}
-
-var E_Casttype = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*string)(nil),
- Field: 65007,
- Name: "gogoproto.casttype",
- Tag: "bytes,65007,opt,name=casttype",
- Filename: "gogo.proto",
-}
-
-var E_Castkey = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*string)(nil),
- Field: 65008,
- Name: "gogoproto.castkey",
- Tag: "bytes,65008,opt,name=castkey",
- Filename: "gogo.proto",
-}
-
-var E_Castvalue = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*string)(nil),
- Field: 65009,
- Name: "gogoproto.castvalue",
- Tag: "bytes,65009,opt,name=castvalue",
- Filename: "gogo.proto",
-}
-
-var E_Stdtime = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 65010,
- Name: "gogoproto.stdtime",
- Tag: "varint,65010,opt,name=stdtime",
- Filename: "gogo.proto",
-}
-
-var E_Stdduration = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 65011,
- Name: "gogoproto.stdduration",
- Tag: "varint,65011,opt,name=stdduration",
- Filename: "gogo.proto",
-}
-
-var E_Wktpointer = &proto.ExtensionDesc{
- ExtendedType: (*descriptor.FieldOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 65012,
- Name: "gogoproto.wktpointer",
- Tag: "varint,65012,opt,name=wktpointer",
- Filename: "gogo.proto",
-}
-
-func init() {
- proto.RegisterExtension(E_GoprotoEnumPrefix)
- proto.RegisterExtension(E_GoprotoEnumStringer)
- proto.RegisterExtension(E_EnumStringer)
- proto.RegisterExtension(E_EnumCustomname)
- proto.RegisterExtension(E_Enumdecl)
- proto.RegisterExtension(E_EnumvalueCustomname)
- proto.RegisterExtension(E_GoprotoGettersAll)
- proto.RegisterExtension(E_GoprotoEnumPrefixAll)
- proto.RegisterExtension(E_GoprotoStringerAll)
- proto.RegisterExtension(E_VerboseEqualAll)
- proto.RegisterExtension(E_FaceAll)
- proto.RegisterExtension(E_GostringAll)
- proto.RegisterExtension(E_PopulateAll)
- proto.RegisterExtension(E_StringerAll)
- proto.RegisterExtension(E_OnlyoneAll)
- proto.RegisterExtension(E_EqualAll)
- proto.RegisterExtension(E_DescriptionAll)
- proto.RegisterExtension(E_TestgenAll)
- proto.RegisterExtension(E_BenchgenAll)
- proto.RegisterExtension(E_MarshalerAll)
- proto.RegisterExtension(E_UnmarshalerAll)
- proto.RegisterExtension(E_StableMarshalerAll)
- proto.RegisterExtension(E_SizerAll)
- proto.RegisterExtension(E_GoprotoEnumStringerAll)
- proto.RegisterExtension(E_EnumStringerAll)
- proto.RegisterExtension(E_UnsafeMarshalerAll)
- proto.RegisterExtension(E_UnsafeUnmarshalerAll)
- proto.RegisterExtension(E_GoprotoExtensionsMapAll)
- proto.RegisterExtension(E_GoprotoUnrecognizedAll)
- proto.RegisterExtension(E_GogoprotoImport)
- proto.RegisterExtension(E_ProtosizerAll)
- proto.RegisterExtension(E_CompareAll)
- proto.RegisterExtension(E_TypedeclAll)
- proto.RegisterExtension(E_EnumdeclAll)
- proto.RegisterExtension(E_GoprotoRegistration)
- proto.RegisterExtension(E_MessagenameAll)
- proto.RegisterExtension(E_GoprotoSizecacheAll)
- proto.RegisterExtension(E_GoprotoUnkeyedAll)
- proto.RegisterExtension(E_GoprotoGetters)
- proto.RegisterExtension(E_GoprotoStringer)
- proto.RegisterExtension(E_VerboseEqual)
- proto.RegisterExtension(E_Face)
- proto.RegisterExtension(E_Gostring)
- proto.RegisterExtension(E_Populate)
- proto.RegisterExtension(E_Stringer)
- proto.RegisterExtension(E_Onlyone)
- proto.RegisterExtension(E_Equal)
- proto.RegisterExtension(E_Description)
- proto.RegisterExtension(E_Testgen)
- proto.RegisterExtension(E_Benchgen)
- proto.RegisterExtension(E_Marshaler)
- proto.RegisterExtension(E_Unmarshaler)
- proto.RegisterExtension(E_StableMarshaler)
- proto.RegisterExtension(E_Sizer)
- proto.RegisterExtension(E_UnsafeMarshaler)
- proto.RegisterExtension(E_UnsafeUnmarshaler)
- proto.RegisterExtension(E_GoprotoExtensionsMap)
- proto.RegisterExtension(E_GoprotoUnrecognized)
- proto.RegisterExtension(E_Protosizer)
- proto.RegisterExtension(E_Compare)
- proto.RegisterExtension(E_Typedecl)
- proto.RegisterExtension(E_Messagename)
- proto.RegisterExtension(E_GoprotoSizecache)
- proto.RegisterExtension(E_GoprotoUnkeyed)
- proto.RegisterExtension(E_Nullable)
- proto.RegisterExtension(E_Embed)
- proto.RegisterExtension(E_Customtype)
- proto.RegisterExtension(E_Customname)
- proto.RegisterExtension(E_Jsontag)
- proto.RegisterExtension(E_Moretags)
- proto.RegisterExtension(E_Casttype)
- proto.RegisterExtension(E_Castkey)
- proto.RegisterExtension(E_Castvalue)
- proto.RegisterExtension(E_Stdtime)
- proto.RegisterExtension(E_Stdduration)
- proto.RegisterExtension(E_Wktpointer)
-}
-
-func init() { proto.RegisterFile("gogo.proto", fileDescriptor_592445b5231bc2b9) }
-
-var fileDescriptor_592445b5231bc2b9 = []byte{
- // 1328 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x49, 0x6f, 0x1c, 0x45,
- 0x14, 0x80, 0x85, 0x48, 0x64, 0x4f, 0x79, 0x8b, 0xc7, 0xc6, 0x84, 0x08, 0x44, 0xe0, 0xc4, 0xc9,
- 0x3e, 0x45, 0x28, 0x65, 0x45, 0x96, 0x63, 0x39, 0x56, 0x10, 0x0e, 0xc6, 0x89, 0xc3, 0x76, 0x18,
- 0xf5, 0xf4, 0x94, 0xdb, 0x8d, 0xbb, 0xbb, 0x9a, 0xee, 0xea, 0x10, 0xe7, 0x86, 0xc2, 0x22, 0x84,
- 0xd8, 0x91, 0x20, 0x21, 0x09, 0x04, 0xc4, 0xbe, 0x86, 0x7d, 0xb9, 0x70, 0x61, 0xb9, 0xf2, 0x1f,
- 0xb8, 0x00, 0x66, 0xf7, 0xcd, 0x17, 0xf4, 0xba, 0xdf, 0xeb, 0xa9, 0x69, 0x8f, 0x54, 0x35, 0xb7,
- 0xf6, 0xb8, 0xbe, 0x6f, 0xaa, 0xdf, 0xeb, 0x7a, 0xef, 0x4d, 0x33, 0xe6, 0x49, 0x4f, 0x4e, 0xc6,
- 0x89, 0x54, 0xb2, 0x5e, 0x83, 0xeb, 0xfc, 0x72, 0xdf, 0x7e, 0x4f, 0x4a, 0x2f, 0x10, 0x53, 0xf9,
- 0x5f, 0xcd, 0x6c, 0x75, 0xaa, 0x25, 0x52, 0x37, 0xf1, 0x63, 0x25, 0x93, 0x62, 0x31, 0x3f, 0xc6,
- 0xc6, 0x70, 0x71, 0x43, 0x44, 0x59, 0xd8, 0x88, 0x13, 0xb1, 0xea, 0x9f, 0xae, 0x5f, 0x3f, 0x59,
- 0x90, 0x93, 0x44, 0x4e, 0xce, 0x47, 0x59, 0x78, 0x47, 0xac, 0x7c, 0x19, 0xa5, 0x7b, 0xaf, 0xfc,
- 0x72, 0xf5, 0xfe, 0xab, 0x6e, 0xe9, 0x5f, 0x1e, 0x45, 0x14, 0xfe, 0xb7, 0x94, 0x83, 0x7c, 0x99,
- 0x5d, 0xd3, 0xe1, 0x4b, 0x55, 0xe2, 0x47, 0x9e, 0x48, 0x0c, 0xc6, 0xef, 0xd1, 0x38, 0xa6, 0x19,
- 0x8f, 0x23, 0xca, 0xe7, 0xd8, 0x50, 0x2f, 0xae, 0x1f, 0xd0, 0x35, 0x28, 0x74, 0xc9, 0x02, 0x1b,
- 0xc9, 0x25, 0x6e, 0x96, 0x2a, 0x19, 0x46, 0x4e, 0x28, 0x0c, 0x9a, 0x1f, 0x73, 0x4d, 0x6d, 0x79,
- 0x18, 0xb0, 0xb9, 0x92, 0xe2, 0x9c, 0xf5, 0xc3, 0x27, 0x2d, 0xe1, 0x06, 0x06, 0xc3, 0x4f, 0xb8,
- 0x91, 0x72, 0x3d, 0x3f, 0xc9, 0xc6, 0xe1, 0xfa, 0x94, 0x13, 0x64, 0x42, 0xdf, 0xc9, 0x4d, 0x5d,
- 0x3d, 0x27, 0x61, 0x19, 0xc9, 0x7e, 0x3e, 0xbb, 0x2b, 0xdf, 0xce, 0x58, 0x29, 0xd0, 0xf6, 0xa4,
- 0x65, 0xd1, 0x13, 0x4a, 0x89, 0x24, 0x6d, 0x38, 0x41, 0xb7, 0xed, 0x1d, 0xf1, 0x83, 0xd2, 0x78,
- 0x6e, 0xb3, 0x33, 0x8b, 0x0b, 0x05, 0x39, 0x1b, 0x04, 0x7c, 0x85, 0x5d, 0xdb, 0xe5, 0xa9, 0xb0,
- 0x70, 0x9e, 0x47, 0xe7, 0xf8, 0x8e, 0x27, 0x03, 0xb4, 0x4b, 0x8c, 0x3e, 0x2f, 0x73, 0x69, 0xe1,
- 0x7c, 0x19, 0x9d, 0x75, 0x64, 0x29, 0xa5, 0x60, 0xbc, 0x8d, 0x8d, 0x9e, 0x12, 0x49, 0x53, 0xa6,
- 0xa2, 0x21, 0x1e, 0xc8, 0x9c, 0xc0, 0x42, 0x77, 0x01, 0x75, 0x23, 0x08, 0xce, 0x03, 0x07, 0xae,
- 0x83, 0xac, 0x7f, 0xd5, 0x71, 0x85, 0x85, 0xe2, 0x22, 0x2a, 0xfa, 0x60, 0x3d, 0xa0, 0xb3, 0x6c,
- 0xd0, 0x93, 0xc5, 0x2d, 0x59, 0xe0, 0x97, 0x10, 0x1f, 0x20, 0x06, 0x15, 0xb1, 0x8c, 0xb3, 0xc0,
- 0x51, 0x36, 0x3b, 0x78, 0x85, 0x14, 0xc4, 0xa0, 0xa2, 0x87, 0xb0, 0xbe, 0x4a, 0x8a, 0x54, 0x8b,
- 0xe7, 0x0c, 0x1b, 0x90, 0x51, 0xb0, 0x21, 0x23, 0x9b, 0x4d, 0x5c, 0x46, 0x03, 0x43, 0x04, 0x04,
- 0xd3, 0xac, 0x66, 0x9b, 0x88, 0x37, 0x36, 0xe9, 0x78, 0x50, 0x06, 0x16, 0xd8, 0x08, 0x15, 0x28,
- 0x5f, 0x46, 0x16, 0x8a, 0x37, 0x51, 0x31, 0xac, 0x61, 0x78, 0x1b, 0x4a, 0xa4, 0xca, 0x13, 0x36,
- 0x92, 0xb7, 0xe8, 0x36, 0x10, 0xc1, 0x50, 0x36, 0x45, 0xe4, 0xae, 0xd9, 0x19, 0xde, 0xa6, 0x50,
- 0x12, 0x03, 0x8a, 0x39, 0x36, 0x14, 0x3a, 0x49, 0xba, 0xe6, 0x04, 0x56, 0xe9, 0x78, 0x07, 0x1d,
- 0x83, 0x25, 0x84, 0x11, 0xc9, 0xa2, 0x5e, 0x34, 0xef, 0x52, 0x44, 0x34, 0x0c, 0x8f, 0x5e, 0xaa,
- 0x9c, 0x66, 0x20, 0x1a, 0xbd, 0xd8, 0xde, 0xa3, 0xa3, 0x57, 0xb0, 0x8b, 0xba, 0x71, 0x9a, 0xd5,
- 0x52, 0xff, 0x8c, 0x95, 0xe6, 0x7d, 0xca, 0x74, 0x0e, 0x00, 0x7c, 0x0f, 0xbb, 0xae, 0x6b, 0x9b,
- 0xb0, 0x90, 0x7d, 0x80, 0xb2, 0x89, 0x2e, 0xad, 0x02, 0x4b, 0x42, 0xaf, 0xca, 0x0f, 0xa9, 0x24,
- 0x88, 0x8a, 0x6b, 0x89, 0x8d, 0x67, 0x51, 0xea, 0xac, 0xf6, 0x16, 0xb5, 0x8f, 0x28, 0x6a, 0x05,
- 0xdb, 0x11, 0xb5, 0x13, 0x6c, 0x02, 0x8d, 0xbd, 0xe5, 0xf5, 0x63, 0x2a, 0xac, 0x05, 0xbd, 0xd2,
- 0x99, 0xdd, 0xfb, 0xd8, 0xbe, 0x32, 0x9c, 0xa7, 0x95, 0x88, 0x52, 0x60, 0x1a, 0xa1, 0x13, 0x5b,
- 0x98, 0xaf, 0xa0, 0x99, 0x2a, 0xfe, 0x7c, 0x29, 0x58, 0x74, 0x62, 0x90, 0xdf, 0xcd, 0xf6, 0x92,
- 0x3c, 0x8b, 0x12, 0xe1, 0x4a, 0x2f, 0xf2, 0xcf, 0x88, 0x96, 0x85, 0xfa, 0x93, 0x4a, 0xaa, 0x56,
- 0x34, 0x1c, 0xcc, 0x47, 0xd9, 0x9e, 0x72, 0x56, 0x69, 0xf8, 0x61, 0x2c, 0x13, 0x65, 0x30, 0x7e,
- 0x4a, 0x99, 0x2a, 0xb9, 0xa3, 0x39, 0xc6, 0xe7, 0xd9, 0x70, 0xfe, 0xa7, 0xed, 0x23, 0xf9, 0x19,
- 0x8a, 0x86, 0xda, 0x14, 0x16, 0x0e, 0x57, 0x86, 0xb1, 0x93, 0xd8, 0xd4, 0xbf, 0xcf, 0xa9, 0x70,
- 0x20, 0x82, 0x85, 0x43, 0x6d, 0xc4, 0x02, 0xba, 0xbd, 0x85, 0xe1, 0x0b, 0x2a, 0x1c, 0xc4, 0xa0,
- 0x82, 0x06, 0x06, 0x0b, 0xc5, 0x97, 0xa4, 0x20, 0x06, 0x14, 0x77, 0xb6, 0x1b, 0x6d, 0x22, 0x3c,
- 0x3f, 0x55, 0x89, 0x03, 0xab, 0x0d, 0xaa, 0xaf, 0x36, 0x3b, 0x87, 0xb0, 0x65, 0x0d, 0x85, 0x4a,
- 0x14, 0x8a, 0x34, 0x75, 0x3c, 0x01, 0x13, 0x87, 0xc5, 0xc6, 0xbe, 0xa6, 0x4a, 0xa4, 0x61, 0xb0,
- 0x37, 0x6d, 0x42, 0x84, 0xb0, 0xbb, 0x8e, 0xbb, 0x66, 0xa3, 0xfb, 0xa6, 0xb2, 0xb9, 0xe3, 0xc4,
- 0x82, 0x53, 0x9b, 0x7f, 0xb2, 0x68, 0x5d, 0x6c, 0x58, 0x3d, 0x9d, 0xdf, 0x56, 0xe6, 0x9f, 0x95,
- 0x82, 0x2c, 0x6a, 0xc8, 0x48, 0x65, 0x9e, 0xaa, 0xdf, 0xb8, 0xc3, 0xb5, 0x58, 0xdc, 0x17, 0xe9,
- 0x1e, 0xda, 0xc2, 0xfb, 0xed, 0x1c, 0xa7, 0xf8, 0xed, 0xf0, 0x90, 0x77, 0x0e, 0x3d, 0x66, 0xd9,
- 0xd9, 0xad, 0xf2, 0x39, 0xef, 0x98, 0x79, 0xf8, 0x11, 0x36, 0xd4, 0x31, 0xf0, 0x98, 0x55, 0x0f,
- 0xa3, 0x6a, 0x50, 0x9f, 0x77, 0xf8, 0x01, 0xb6, 0x0b, 0x86, 0x17, 0x33, 0xfe, 0x08, 0xe2, 0xf9,
- 0x72, 0x7e, 0x88, 0xf5, 0xd3, 0xd0, 0x62, 0x46, 0x1f, 0x45, 0xb4, 0x44, 0x00, 0xa7, 0x81, 0xc5,
- 0x8c, 0x3f, 0x46, 0x38, 0x21, 0x80, 0xdb, 0x87, 0xf0, 0xbb, 0x27, 0x76, 0x61, 0xd3, 0xa1, 0xd8,
- 0x4d, 0xb3, 0x3e, 0x9c, 0x54, 0xcc, 0xf4, 0xe3, 0xf8, 0xe5, 0x44, 0xf0, 0x5b, 0xd9, 0x6e, 0xcb,
- 0x80, 0x3f, 0x89, 0x68, 0xb1, 0x9e, 0xcf, 0xb1, 0x01, 0x6d, 0x3a, 0x31, 0xe3, 0x4f, 0x21, 0xae,
- 0x53, 0xb0, 0x75, 0x9c, 0x4e, 0xcc, 0x82, 0xa7, 0x69, 0xeb, 0x48, 0x40, 0xd8, 0x68, 0x30, 0x31,
- 0xd3, 0xcf, 0x50, 0xd4, 0x09, 0xe1, 0x33, 0xac, 0x56, 0x36, 0x1b, 0x33, 0xff, 0x2c, 0xf2, 0x6d,
- 0x06, 0x22, 0xa0, 0x35, 0x3b, 0xb3, 0xe2, 0x39, 0x8a, 0x80, 0x46, 0xc1, 0x31, 0xaa, 0x0e, 0x30,
- 0x66, 0xd3, 0xf3, 0x74, 0x8c, 0x2a, 0xf3, 0x0b, 0x64, 0x33, 0xaf, 0xf9, 0x66, 0xc5, 0x0b, 0x94,
- 0xcd, 0x7c, 0x3d, 0x6c, 0xa3, 0x3a, 0x11, 0x98, 0x1d, 0x2f, 0xd2, 0x36, 0x2a, 0x03, 0x01, 0x5f,
- 0x62, 0xf5, 0x9d, 0xd3, 0x80, 0xd9, 0xf7, 0x12, 0xfa, 0x46, 0x77, 0x0c, 0x03, 0xfc, 0x2e, 0x36,
- 0xd1, 0x7d, 0x12, 0x30, 0x5b, 0xcf, 0x6d, 0x55, 0x7e, 0xbb, 0xe9, 0x83, 0x00, 0x3f, 0xd1, 0x6e,
- 0x29, 0xfa, 0x14, 0x60, 0xd6, 0x9e, 0xdf, 0xea, 0x2c, 0xdc, 0xfa, 0x10, 0xc0, 0x67, 0x19, 0x6b,
- 0x37, 0x60, 0xb3, 0xeb, 0x02, 0xba, 0x34, 0x08, 0x8e, 0x06, 0xf6, 0x5f, 0x33, 0x7f, 0x91, 0x8e,
- 0x06, 0x12, 0x70, 0x34, 0xa8, 0xf5, 0x9a, 0xe9, 0x4b, 0x74, 0x34, 0x08, 0x81, 0x27, 0x5b, 0xeb,
- 0x6e, 0x66, 0xc3, 0x65, 0x7a, 0xb2, 0x35, 0x8a, 0x1f, 0x63, 0xa3, 0x3b, 0x1a, 0xa2, 0x59, 0xf5,
- 0x1a, 0xaa, 0xf6, 0x54, 0xfb, 0xa1, 0xde, 0xbc, 0xb0, 0x19, 0x9a, 0x6d, 0xaf, 0x57, 0x9a, 0x17,
- 0xf6, 0x42, 0x3e, 0xcd, 0xfa, 0xa3, 0x2c, 0x08, 0xe0, 0xf0, 0xd4, 0x6f, 0xe8, 0xd2, 0x4d, 0x45,
- 0xd0, 0x22, 0xc5, 0xaf, 0xdb, 0x18, 0x1d, 0x02, 0xf8, 0x01, 0xb6, 0x5b, 0x84, 0x4d, 0xd1, 0x32,
- 0x91, 0xbf, 0x6d, 0x53, 0xc1, 0x84, 0xd5, 0x7c, 0x86, 0xb1, 0xe2, 0xd5, 0x08, 0x84, 0xd9, 0xc4,
- 0xfe, 0xbe, 0x5d, 0xbc, 0xa5, 0xd1, 0x90, 0xb6, 0x20, 0x4f, 0x8a, 0x41, 0xb0, 0xd9, 0x29, 0xc8,
- 0x33, 0x72, 0x90, 0xf5, 0xdd, 0x9f, 0xca, 0x48, 0x39, 0x9e, 0x89, 0xfe, 0x03, 0x69, 0x5a, 0x0f,
- 0x01, 0x0b, 0x65, 0x22, 0x94, 0xe3, 0xa5, 0x26, 0xf6, 0x4f, 0x64, 0x4b, 0x00, 0x60, 0xd7, 0x49,
- 0x95, 0xcd, 0x7d, 0xff, 0x45, 0x30, 0x01, 0xb0, 0x69, 0xb8, 0x5e, 0x17, 0x1b, 0x26, 0xf6, 0x6f,
- 0xda, 0x34, 0xae, 0xe7, 0x87, 0x58, 0x0d, 0x2e, 0xf3, 0xb7, 0x4a, 0x26, 0xf8, 0x1f, 0x84, 0xdb,
- 0x04, 0x7c, 0x73, 0xaa, 0x5a, 0xca, 0x37, 0x07, 0xfb, 0x5f, 0xcc, 0x34, 0xad, 0xe7, 0xb3, 0x6c,
- 0x20, 0x55, 0xad, 0x56, 0x86, 0xf3, 0xa9, 0x01, 0xff, 0x6f, 0xbb, 0x7c, 0x65, 0x51, 0x32, 0x90,
- 0xed, 0x07, 0xd7, 0x55, 0x2c, 0xfd, 0x48, 0x89, 0xc4, 0x64, 0xd8, 0x42, 0x83, 0x86, 0x1c, 0x9e,
- 0x67, 0x63, 0xae, 0x0c, 0xab, 0xdc, 0x61, 0xb6, 0x20, 0x17, 0xe4, 0x52, 0x5e, 0x67, 0xee, 0xbd,
- 0xd9, 0xf3, 0xd5, 0x5a, 0xd6, 0x9c, 0x74, 0x65, 0x38, 0x05, 0xbf, 0x3c, 0xda, 0x2f, 0x54, 0xcb,
- 0xdf, 0x21, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xaf, 0x70, 0x4e, 0x83, 0x15, 0x00, 0x00,
-}
diff --git a/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.golden b/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.golden
deleted file mode 100644
index f6502e4b9..000000000
--- a/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.golden
+++ /dev/null
@@ -1,45 +0,0 @@
-// Code generated by protoc-gen-go.
-// source: gogo.proto
-// DO NOT EDIT!
-
-package gogoproto
-
-import proto "github.com/gogo/protobuf/proto"
-import json "encoding/json"
-import math "math"
-import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
-
-// Reference proto, json, and math imports to suppress error if they are not otherwise used.
-var _ = proto.Marshal
-var _ = &json.SyntaxError{}
-var _ = math.Inf
-
-var E_Nullable = &proto.ExtensionDesc{
- ExtendedType: (*google_protobuf.FieldOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 51235,
- Name: "gogoproto.nullable",
- Tag: "varint,51235,opt,name=nullable",
-}
-
-var E_Embed = &proto.ExtensionDesc{
- ExtendedType: (*google_protobuf.FieldOptions)(nil),
- ExtensionType: (*bool)(nil),
- Field: 51236,
- Name: "gogoproto.embed",
- Tag: "varint,51236,opt,name=embed",
-}
-
-var E_Customtype = &proto.ExtensionDesc{
- ExtendedType: (*google_protobuf.FieldOptions)(nil),
- ExtensionType: (*string)(nil),
- Field: 51237,
- Name: "gogoproto.customtype",
- Tag: "bytes,51237,opt,name=customtype",
-}
-
-func init() {
- proto.RegisterExtension(E_Nullable)
- proto.RegisterExtension(E_Embed)
- proto.RegisterExtension(E_Customtype)
-}
diff --git a/vendor/github.com/gogo/protobuf/gogoproto/gogo.proto b/vendor/github.com/gogo/protobuf/gogoproto/gogo.proto
deleted file mode 100644
index b80c85653..000000000
--- a/vendor/github.com/gogo/protobuf/gogoproto/gogo.proto
+++ /dev/null
@@ -1,144 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-syntax = "proto2";
-package gogoproto;
-
-import "google/protobuf/descriptor.proto";
-
-option java_package = "com.google.protobuf";
-option java_outer_classname = "GoGoProtos";
-option go_package = "github.com/gogo/protobuf/gogoproto";
-
-extend google.protobuf.EnumOptions {
- optional bool goproto_enum_prefix = 62001;
- optional bool goproto_enum_stringer = 62021;
- optional bool enum_stringer = 62022;
- optional string enum_customname = 62023;
- optional bool enumdecl = 62024;
-}
-
-extend google.protobuf.EnumValueOptions {
- optional string enumvalue_customname = 66001;
-}
-
-extend google.protobuf.FileOptions {
- optional bool goproto_getters_all = 63001;
- optional bool goproto_enum_prefix_all = 63002;
- optional bool goproto_stringer_all = 63003;
- optional bool verbose_equal_all = 63004;
- optional bool face_all = 63005;
- optional bool gostring_all = 63006;
- optional bool populate_all = 63007;
- optional bool stringer_all = 63008;
- optional bool onlyone_all = 63009;
-
- optional bool equal_all = 63013;
- optional bool description_all = 63014;
- optional bool testgen_all = 63015;
- optional bool benchgen_all = 63016;
- optional bool marshaler_all = 63017;
- optional bool unmarshaler_all = 63018;
- optional bool stable_marshaler_all = 63019;
-
- optional bool sizer_all = 63020;
-
- optional bool goproto_enum_stringer_all = 63021;
- optional bool enum_stringer_all = 63022;
-
- optional bool unsafe_marshaler_all = 63023;
- optional bool unsafe_unmarshaler_all = 63024;
-
- optional bool goproto_extensions_map_all = 63025;
- optional bool goproto_unrecognized_all = 63026;
- optional bool gogoproto_import = 63027;
- optional bool protosizer_all = 63028;
- optional bool compare_all = 63029;
- optional bool typedecl_all = 63030;
- optional bool enumdecl_all = 63031;
-
- optional bool goproto_registration = 63032;
- optional bool messagename_all = 63033;
-
- optional bool goproto_sizecache_all = 63034;
- optional bool goproto_unkeyed_all = 63035;
-}
-
-extend google.protobuf.MessageOptions {
- optional bool goproto_getters = 64001;
- optional bool goproto_stringer = 64003;
- optional bool verbose_equal = 64004;
- optional bool face = 64005;
- optional bool gostring = 64006;
- optional bool populate = 64007;
- optional bool stringer = 67008;
- optional bool onlyone = 64009;
-
- optional bool equal = 64013;
- optional bool description = 64014;
- optional bool testgen = 64015;
- optional bool benchgen = 64016;
- optional bool marshaler = 64017;
- optional bool unmarshaler = 64018;
- optional bool stable_marshaler = 64019;
-
- optional bool sizer = 64020;
-
- optional bool unsafe_marshaler = 64023;
- optional bool unsafe_unmarshaler = 64024;
-
- optional bool goproto_extensions_map = 64025;
- optional bool goproto_unrecognized = 64026;
-
- optional bool protosizer = 64028;
- optional bool compare = 64029;
-
- optional bool typedecl = 64030;
-
- optional bool messagename = 64033;
-
- optional bool goproto_sizecache = 64034;
- optional bool goproto_unkeyed = 64035;
-}
-
-extend google.protobuf.FieldOptions {
- optional bool nullable = 65001;
- optional bool embed = 65002;
- optional string customtype = 65003;
- optional string customname = 65004;
- optional string jsontag = 65005;
- optional string moretags = 65006;
- optional string casttype = 65007;
- optional string castkey = 65008;
- optional string castvalue = 65009;
-
- optional bool stdtime = 65010;
- optional bool stdduration = 65011;
- optional bool wktpointer = 65012;
-
-}
diff --git a/vendor/github.com/gogo/protobuf/gogoproto/helper.go b/vendor/github.com/gogo/protobuf/gogoproto/helper.go
deleted file mode 100644
index 390d4e4be..000000000
--- a/vendor/github.com/gogo/protobuf/gogoproto/helper.go
+++ /dev/null
@@ -1,415 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-package gogoproto
-
-import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
-import proto "github.com/gogo/protobuf/proto"
-
-func IsEmbed(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Embed, false)
-}
-
-func IsNullable(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Nullable, true)
-}
-
-func IsStdTime(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Stdtime, false)
-}
-
-func IsStdDuration(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Stdduration, false)
-}
-
-func IsStdDouble(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.DoubleValue"
-}
-
-func IsStdFloat(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.FloatValue"
-}
-
-func IsStdInt64(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.Int64Value"
-}
-
-func IsStdUInt64(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.UInt64Value"
-}
-
-func IsStdInt32(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.Int32Value"
-}
-
-func IsStdUInt32(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.UInt32Value"
-}
-
-func IsStdBool(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.BoolValue"
-}
-
-func IsStdString(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.StringValue"
-}
-
-func IsStdBytes(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.BytesValue"
-}
-
-func IsStdType(field *google_protobuf.FieldDescriptorProto) bool {
- return (IsStdTime(field) || IsStdDuration(field) ||
- IsStdDouble(field) || IsStdFloat(field) ||
- IsStdInt64(field) || IsStdUInt64(field) ||
- IsStdInt32(field) || IsStdUInt32(field) ||
- IsStdBool(field) ||
- IsStdString(field) || IsStdBytes(field))
-}
-
-func IsWktPtr(field *google_protobuf.FieldDescriptorProto) bool {
- return proto.GetBoolExtension(field.Options, E_Wktpointer, false)
-}
-
-func NeedsNilCheck(proto3 bool, field *google_protobuf.FieldDescriptorProto) bool {
- nullable := IsNullable(field)
- if field.IsMessage() || IsCustomType(field) {
- return nullable
- }
- if proto3 {
- return false
- }
- return nullable || *field.Type == google_protobuf.FieldDescriptorProto_TYPE_BYTES
-}
-
-func IsCustomType(field *google_protobuf.FieldDescriptorProto) bool {
- typ := GetCustomType(field)
- if len(typ) > 0 {
- return true
- }
- return false
-}
-
-func IsCastType(field *google_protobuf.FieldDescriptorProto) bool {
- typ := GetCastType(field)
- if len(typ) > 0 {
- return true
- }
- return false
-}
-
-func IsCastKey(field *google_protobuf.FieldDescriptorProto) bool {
- typ := GetCastKey(field)
- if len(typ) > 0 {
- return true
- }
- return false
-}
-
-func IsCastValue(field *google_protobuf.FieldDescriptorProto) bool {
- typ := GetCastValue(field)
- if len(typ) > 0 {
- return true
- }
- return false
-}
-
-func HasEnumDecl(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool {
- return proto.GetBoolExtension(enum.Options, E_Enumdecl, proto.GetBoolExtension(file.Options, E_EnumdeclAll, true))
-}
-
-func HasTypeDecl(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Typedecl, proto.GetBoolExtension(file.Options, E_TypedeclAll, true))
-}
-
-func GetCustomType(field *google_protobuf.FieldDescriptorProto) string {
- if field == nil {
- return ""
- }
- if field.Options != nil {
- v, err := proto.GetExtension(field.Options, E_Customtype)
- if err == nil && v.(*string) != nil {
- return *(v.(*string))
- }
- }
- return ""
-}
-
-func GetCastType(field *google_protobuf.FieldDescriptorProto) string {
- if field == nil {
- return ""
- }
- if field.Options != nil {
- v, err := proto.GetExtension(field.Options, E_Casttype)
- if err == nil && v.(*string) != nil {
- return *(v.(*string))
- }
- }
- return ""
-}
-
-func GetCastKey(field *google_protobuf.FieldDescriptorProto) string {
- if field == nil {
- return ""
- }
- if field.Options != nil {
- v, err := proto.GetExtension(field.Options, E_Castkey)
- if err == nil && v.(*string) != nil {
- return *(v.(*string))
- }
- }
- return ""
-}
-
-func GetCastValue(field *google_protobuf.FieldDescriptorProto) string {
- if field == nil {
- return ""
- }
- if field.Options != nil {
- v, err := proto.GetExtension(field.Options, E_Castvalue)
- if err == nil && v.(*string) != nil {
- return *(v.(*string))
- }
- }
- return ""
-}
-
-func IsCustomName(field *google_protobuf.FieldDescriptorProto) bool {
- name := GetCustomName(field)
- if len(name) > 0 {
- return true
- }
- return false
-}
-
-func IsEnumCustomName(field *google_protobuf.EnumDescriptorProto) bool {
- name := GetEnumCustomName(field)
- if len(name) > 0 {
- return true
- }
- return false
-}
-
-func IsEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) bool {
- name := GetEnumValueCustomName(field)
- if len(name) > 0 {
- return true
- }
- return false
-}
-
-func GetCustomName(field *google_protobuf.FieldDescriptorProto) string {
- if field == nil {
- return ""
- }
- if field.Options != nil {
- v, err := proto.GetExtension(field.Options, E_Customname)
- if err == nil && v.(*string) != nil {
- return *(v.(*string))
- }
- }
- return ""
-}
-
-func GetEnumCustomName(field *google_protobuf.EnumDescriptorProto) string {
- if field == nil {
- return ""
- }
- if field.Options != nil {
- v, err := proto.GetExtension(field.Options, E_EnumCustomname)
- if err == nil && v.(*string) != nil {
- return *(v.(*string))
- }
- }
- return ""
-}
-
-func GetEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) string {
- if field == nil {
- return ""
- }
- if field.Options != nil {
- v, err := proto.GetExtension(field.Options, E_EnumvalueCustomname)
- if err == nil && v.(*string) != nil {
- return *(v.(*string))
- }
- }
- return ""
-}
-
-func GetJsonTag(field *google_protobuf.FieldDescriptorProto) *string {
- if field == nil {
- return nil
- }
- if field.Options != nil {
- v, err := proto.GetExtension(field.Options, E_Jsontag)
- if err == nil && v.(*string) != nil {
- return (v.(*string))
- }
- }
- return nil
-}
-
-func GetMoreTags(field *google_protobuf.FieldDescriptorProto) *string {
- if field == nil {
- return nil
- }
- if field.Options != nil {
- v, err := proto.GetExtension(field.Options, E_Moretags)
- if err == nil && v.(*string) != nil {
- return (v.(*string))
- }
- }
- return nil
-}
-
-type EnableFunc func(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool
-
-func EnabledGoEnumPrefix(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool {
- return proto.GetBoolExtension(enum.Options, E_GoprotoEnumPrefix, proto.GetBoolExtension(file.Options, E_GoprotoEnumPrefixAll, true))
-}
-
-func EnabledGoStringer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_GoprotoStringer, proto.GetBoolExtension(file.Options, E_GoprotoStringerAll, true))
-}
-
-func HasGoGetters(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_GoprotoGetters, proto.GetBoolExtension(file.Options, E_GoprotoGettersAll, true))
-}
-
-func IsUnion(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Onlyone, proto.GetBoolExtension(file.Options, E_OnlyoneAll, false))
-}
-
-func HasGoString(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Gostring, proto.GetBoolExtension(file.Options, E_GostringAll, false))
-}
-
-func HasEqual(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Equal, proto.GetBoolExtension(file.Options, E_EqualAll, false))
-}
-
-func HasVerboseEqual(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_VerboseEqual, proto.GetBoolExtension(file.Options, E_VerboseEqualAll, false))
-}
-
-func IsStringer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Stringer, proto.GetBoolExtension(file.Options, E_StringerAll, false))
-}
-
-func IsFace(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Face, proto.GetBoolExtension(file.Options, E_FaceAll, false))
-}
-
-func HasDescription(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Description, proto.GetBoolExtension(file.Options, E_DescriptionAll, false))
-}
-
-func HasPopulate(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Populate, proto.GetBoolExtension(file.Options, E_PopulateAll, false))
-}
-
-func HasTestGen(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Testgen, proto.GetBoolExtension(file.Options, E_TestgenAll, false))
-}
-
-func HasBenchGen(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Benchgen, proto.GetBoolExtension(file.Options, E_BenchgenAll, false))
-}
-
-func IsMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Marshaler, proto.GetBoolExtension(file.Options, E_MarshalerAll, false))
-}
-
-func IsUnmarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Unmarshaler, proto.GetBoolExtension(file.Options, E_UnmarshalerAll, false))
-}
-
-func IsStableMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_StableMarshaler, proto.GetBoolExtension(file.Options, E_StableMarshalerAll, false))
-}
-
-func IsSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Sizer, proto.GetBoolExtension(file.Options, E_SizerAll, false))
-}
-
-func IsProtoSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Protosizer, proto.GetBoolExtension(file.Options, E_ProtosizerAll, false))
-}
-
-func IsGoEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool {
- return proto.GetBoolExtension(enum.Options, E_GoprotoEnumStringer, proto.GetBoolExtension(file.Options, E_GoprotoEnumStringerAll, true))
-}
-
-func IsEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool {
- return proto.GetBoolExtension(enum.Options, E_EnumStringer, proto.GetBoolExtension(file.Options, E_EnumStringerAll, false))
-}
-
-func IsUnsafeMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_UnsafeMarshaler, proto.GetBoolExtension(file.Options, E_UnsafeMarshalerAll, false))
-}
-
-func IsUnsafeUnmarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_UnsafeUnmarshaler, proto.GetBoolExtension(file.Options, E_UnsafeUnmarshalerAll, false))
-}
-
-func HasExtensionsMap(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_GoprotoExtensionsMap, proto.GetBoolExtension(file.Options, E_GoprotoExtensionsMapAll, true))
-}
-
-func HasUnrecognized(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_GoprotoUnrecognized, proto.GetBoolExtension(file.Options, E_GoprotoUnrecognizedAll, true))
-}
-
-func IsProto3(file *google_protobuf.FileDescriptorProto) bool {
- return file.GetSyntax() == "proto3"
-}
-
-func ImportsGoGoProto(file *google_protobuf.FileDescriptorProto) bool {
- return proto.GetBoolExtension(file.Options, E_GogoprotoImport, true)
-}
-
-func HasCompare(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Compare, proto.GetBoolExtension(file.Options, E_CompareAll, false))
-}
-
-func RegistersGolangProto(file *google_protobuf.FileDescriptorProto) bool {
- return proto.GetBoolExtension(file.Options, E_GoprotoRegistration, false)
-}
-
-func HasMessageName(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_Messagename, proto.GetBoolExtension(file.Options, E_MessagenameAll, false))
-}
-
-func HasSizecache(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_GoprotoSizecache, proto.GetBoolExtension(file.Options, E_GoprotoSizecacheAll, true))
-}
-
-func HasUnkeyed(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
- return proto.GetBoolExtension(message.Options, E_GoprotoUnkeyed, proto.GetBoolExtension(file.Options, E_GoprotoUnkeyedAll, true))
-}
diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/Makefile b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/Makefile
deleted file mode 100644
index 3496dc99d..000000000
--- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-# Go support for Protocol Buffers - Google's data interchange format
-#
-# Copyright 2010 The Go Authors. All rights reserved.
-# https://github.com/golang/protobuf
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-regenerate:
- go install github.com/gogo/protobuf/protoc-gen-gogo
- go install github.com/gogo/protobuf/protoc-gen-gostring
- protoc --gogo_out=. -I=../../protobuf/google/protobuf ../../protobuf/google/protobuf/descriptor.proto
- protoc --gostring_out=. -I=../../protobuf/google/protobuf ../../protobuf/google/protobuf/descriptor.proto
diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go
deleted file mode 100644
index a85bf1984..000000000
--- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go
+++ /dev/null
@@ -1,118 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Package descriptor provides functions for obtaining protocol buffer
-// descriptors for generated Go types.
-//
-// These functions cannot go in package proto because they depend on the
-// generated protobuf descriptor messages, which themselves depend on proto.
-package descriptor
-
-import (
- "bytes"
- "compress/gzip"
- "fmt"
- "io/ioutil"
-
- "github.com/gogo/protobuf/proto"
-)
-
-// extractFile extracts a FileDescriptorProto from a gzip'd buffer.
-func extractFile(gz []byte) (*FileDescriptorProto, error) {
- r, err := gzip.NewReader(bytes.NewReader(gz))
- if err != nil {
- return nil, fmt.Errorf("failed to open gzip reader: %v", err)
- }
- defer r.Close()
-
- b, err := ioutil.ReadAll(r)
- if err != nil {
- return nil, fmt.Errorf("failed to uncompress descriptor: %v", err)
- }
-
- fd := new(FileDescriptorProto)
- if err := proto.Unmarshal(b, fd); err != nil {
- return nil, fmt.Errorf("malformed FileDescriptorProto: %v", err)
- }
-
- return fd, nil
-}
-
-// Message is a proto.Message with a method to return its descriptor.
-//
-// Message types generated by the protocol compiler always satisfy
-// the Message interface.
-type Message interface {
- proto.Message
- Descriptor() ([]byte, []int)
-}
-
-// ForMessage returns a FileDescriptorProto and a DescriptorProto from within it
-// describing the given message.
-func ForMessage(msg Message) (fd *FileDescriptorProto, md *DescriptorProto) {
- gz, path := msg.Descriptor()
- fd, err := extractFile(gz)
- if err != nil {
- panic(fmt.Sprintf("invalid FileDescriptorProto for %T: %v", msg, err))
- }
-
- md = fd.MessageType[path[0]]
- for _, i := range path[1:] {
- md = md.NestedType[i]
- }
- return fd, md
-}
-
-// Is this field a scalar numeric type?
-func (field *FieldDescriptorProto) IsScalar() bool {
- if field.Type == nil {
- return false
- }
- switch *field.Type {
- case FieldDescriptorProto_TYPE_DOUBLE,
- FieldDescriptorProto_TYPE_FLOAT,
- FieldDescriptorProto_TYPE_INT64,
- FieldDescriptorProto_TYPE_UINT64,
- FieldDescriptorProto_TYPE_INT32,
- FieldDescriptorProto_TYPE_FIXED64,
- FieldDescriptorProto_TYPE_FIXED32,
- FieldDescriptorProto_TYPE_BOOL,
- FieldDescriptorProto_TYPE_UINT32,
- FieldDescriptorProto_TYPE_ENUM,
- FieldDescriptorProto_TYPE_SFIXED32,
- FieldDescriptorProto_TYPE_SFIXED64,
- FieldDescriptorProto_TYPE_SINT32,
- FieldDescriptorProto_TYPE_SINT64:
- return true
- default:
- return false
- }
-}
diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go
deleted file mode 100644
index 18b2a3318..000000000
--- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go
+++ /dev/null
@@ -1,2865 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: descriptor.proto
-
-package descriptor
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- math "math"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type FieldDescriptorProto_Type int32
-
-const (
- // 0 is reserved for errors.
- // Order is weird for historical reasons.
- FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1
- FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2
- // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
- // negative values are likely.
- FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3
- FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4
- // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
- // negative values are likely.
- FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5
- FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6
- FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7
- FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8
- FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9
- // Tag-delimited aggregate.
- // Group type is deprecated and not supported in proto3. However, Proto3
- // implementations should still be able to parse the group wire format and
- // treat group fields as unknown fields.
- FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10
- FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11
- // New in version 2.
- FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12
- FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13
- FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14
- FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15
- FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16
- FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17
- FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18
-)
-
-var FieldDescriptorProto_Type_name = map[int32]string{
- 1: "TYPE_DOUBLE",
- 2: "TYPE_FLOAT",
- 3: "TYPE_INT64",
- 4: "TYPE_UINT64",
- 5: "TYPE_INT32",
- 6: "TYPE_FIXED64",
- 7: "TYPE_FIXED32",
- 8: "TYPE_BOOL",
- 9: "TYPE_STRING",
- 10: "TYPE_GROUP",
- 11: "TYPE_MESSAGE",
- 12: "TYPE_BYTES",
- 13: "TYPE_UINT32",
- 14: "TYPE_ENUM",
- 15: "TYPE_SFIXED32",
- 16: "TYPE_SFIXED64",
- 17: "TYPE_SINT32",
- 18: "TYPE_SINT64",
-}
-
-var FieldDescriptorProto_Type_value = map[string]int32{
- "TYPE_DOUBLE": 1,
- "TYPE_FLOAT": 2,
- "TYPE_INT64": 3,
- "TYPE_UINT64": 4,
- "TYPE_INT32": 5,
- "TYPE_FIXED64": 6,
- "TYPE_FIXED32": 7,
- "TYPE_BOOL": 8,
- "TYPE_STRING": 9,
- "TYPE_GROUP": 10,
- "TYPE_MESSAGE": 11,
- "TYPE_BYTES": 12,
- "TYPE_UINT32": 13,
- "TYPE_ENUM": 14,
- "TYPE_SFIXED32": 15,
- "TYPE_SFIXED64": 16,
- "TYPE_SINT32": 17,
- "TYPE_SINT64": 18,
-}
-
-func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type {
- p := new(FieldDescriptorProto_Type)
- *p = x
- return p
-}
-
-func (x FieldDescriptorProto_Type) String() string {
- return proto.EnumName(FieldDescriptorProto_Type_name, int32(x))
-}
-
-func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Type_value, data, "FieldDescriptorProto_Type")
- if err != nil {
- return err
- }
- *x = FieldDescriptorProto_Type(value)
- return nil
-}
-
-func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{4, 0}
-}
-
-type FieldDescriptorProto_Label int32
-
-const (
- // 0 is reserved for errors
- FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1
- FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2
- FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3
-)
-
-var FieldDescriptorProto_Label_name = map[int32]string{
- 1: "LABEL_OPTIONAL",
- 2: "LABEL_REQUIRED",
- 3: "LABEL_REPEATED",
-}
-
-var FieldDescriptorProto_Label_value = map[string]int32{
- "LABEL_OPTIONAL": 1,
- "LABEL_REQUIRED": 2,
- "LABEL_REPEATED": 3,
-}
-
-func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label {
- p := new(FieldDescriptorProto_Label)
- *p = x
- return p
-}
-
-func (x FieldDescriptorProto_Label) String() string {
- return proto.EnumName(FieldDescriptorProto_Label_name, int32(x))
-}
-
-func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Label_value, data, "FieldDescriptorProto_Label")
- if err != nil {
- return err
- }
- *x = FieldDescriptorProto_Label(value)
- return nil
-}
-
-func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{4, 1}
-}
-
-// Generated classes can be optimized for speed or code size.
-type FileOptions_OptimizeMode int32
-
-const (
- FileOptions_SPEED FileOptions_OptimizeMode = 1
- // etc.
- FileOptions_CODE_SIZE FileOptions_OptimizeMode = 2
- FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3
-)
-
-var FileOptions_OptimizeMode_name = map[int32]string{
- 1: "SPEED",
- 2: "CODE_SIZE",
- 3: "LITE_RUNTIME",
-}
-
-var FileOptions_OptimizeMode_value = map[string]int32{
- "SPEED": 1,
- "CODE_SIZE": 2,
- "LITE_RUNTIME": 3,
-}
-
-func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode {
- p := new(FileOptions_OptimizeMode)
- *p = x
- return p
-}
-
-func (x FileOptions_OptimizeMode) String() string {
- return proto.EnumName(FileOptions_OptimizeMode_name, int32(x))
-}
-
-func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode")
- if err != nil {
- return err
- }
- *x = FileOptions_OptimizeMode(value)
- return nil
-}
-
-func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{10, 0}
-}
-
-type FieldOptions_CType int32
-
-const (
- // Default mode.
- FieldOptions_STRING FieldOptions_CType = 0
- FieldOptions_CORD FieldOptions_CType = 1
- FieldOptions_STRING_PIECE FieldOptions_CType = 2
-)
-
-var FieldOptions_CType_name = map[int32]string{
- 0: "STRING",
- 1: "CORD",
- 2: "STRING_PIECE",
-}
-
-var FieldOptions_CType_value = map[string]int32{
- "STRING": 0,
- "CORD": 1,
- "STRING_PIECE": 2,
-}
-
-func (x FieldOptions_CType) Enum() *FieldOptions_CType {
- p := new(FieldOptions_CType)
- *p = x
- return p
-}
-
-func (x FieldOptions_CType) String() string {
- return proto.EnumName(FieldOptions_CType_name, int32(x))
-}
-
-func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FieldOptions_CType_value, data, "FieldOptions_CType")
- if err != nil {
- return err
- }
- *x = FieldOptions_CType(value)
- return nil
-}
-
-func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{12, 0}
-}
-
-type FieldOptions_JSType int32
-
-const (
- // Use the default type.
- FieldOptions_JS_NORMAL FieldOptions_JSType = 0
- // Use JavaScript strings.
- FieldOptions_JS_STRING FieldOptions_JSType = 1
- // Use JavaScript numbers.
- FieldOptions_JS_NUMBER FieldOptions_JSType = 2
-)
-
-var FieldOptions_JSType_name = map[int32]string{
- 0: "JS_NORMAL",
- 1: "JS_STRING",
- 2: "JS_NUMBER",
-}
-
-var FieldOptions_JSType_value = map[string]int32{
- "JS_NORMAL": 0,
- "JS_STRING": 1,
- "JS_NUMBER": 2,
-}
-
-func (x FieldOptions_JSType) Enum() *FieldOptions_JSType {
- p := new(FieldOptions_JSType)
- *p = x
- return p
-}
-
-func (x FieldOptions_JSType) String() string {
- return proto.EnumName(FieldOptions_JSType_name, int32(x))
-}
-
-func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FieldOptions_JSType_value, data, "FieldOptions_JSType")
- if err != nil {
- return err
- }
- *x = FieldOptions_JSType(value)
- return nil
-}
-
-func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{12, 1}
-}
-
-// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
-// or neither? HTTP based RPC implementation may choose GET verb for safe
-// methods, and PUT verb for idempotent methods instead of the default POST.
-type MethodOptions_IdempotencyLevel int32
-
-const (
- MethodOptions_IDEMPOTENCY_UNKNOWN MethodOptions_IdempotencyLevel = 0
- MethodOptions_NO_SIDE_EFFECTS MethodOptions_IdempotencyLevel = 1
- MethodOptions_IDEMPOTENT MethodOptions_IdempotencyLevel = 2
-)
-
-var MethodOptions_IdempotencyLevel_name = map[int32]string{
- 0: "IDEMPOTENCY_UNKNOWN",
- 1: "NO_SIDE_EFFECTS",
- 2: "IDEMPOTENT",
-}
-
-var MethodOptions_IdempotencyLevel_value = map[string]int32{
- "IDEMPOTENCY_UNKNOWN": 0,
- "NO_SIDE_EFFECTS": 1,
- "IDEMPOTENT": 2,
-}
-
-func (x MethodOptions_IdempotencyLevel) Enum() *MethodOptions_IdempotencyLevel {
- p := new(MethodOptions_IdempotencyLevel)
- *p = x
- return p
-}
-
-func (x MethodOptions_IdempotencyLevel) String() string {
- return proto.EnumName(MethodOptions_IdempotencyLevel_name, int32(x))
-}
-
-func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(MethodOptions_IdempotencyLevel_value, data, "MethodOptions_IdempotencyLevel")
- if err != nil {
- return err
- }
- *x = MethodOptions_IdempotencyLevel(value)
- return nil
-}
-
-func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{17, 0}
-}
-
-// The protocol compiler can output a FileDescriptorSet containing the .proto
-// files it parses.
-type FileDescriptorSet struct {
- File []*FileDescriptorProto `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FileDescriptorSet) Reset() { *m = FileDescriptorSet{} }
-func (m *FileDescriptorSet) String() string { return proto.CompactTextString(m) }
-func (*FileDescriptorSet) ProtoMessage() {}
-func (*FileDescriptorSet) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{0}
-}
-func (m *FileDescriptorSet) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FileDescriptorSet.Unmarshal(m, b)
-}
-func (m *FileDescriptorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FileDescriptorSet.Marshal(b, m, deterministic)
-}
-func (m *FileDescriptorSet) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FileDescriptorSet.Merge(m, src)
-}
-func (m *FileDescriptorSet) XXX_Size() int {
- return xxx_messageInfo_FileDescriptorSet.Size(m)
-}
-func (m *FileDescriptorSet) XXX_DiscardUnknown() {
- xxx_messageInfo_FileDescriptorSet.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FileDescriptorSet proto.InternalMessageInfo
-
-func (m *FileDescriptorSet) GetFile() []*FileDescriptorProto {
- if m != nil {
- return m.File
- }
- return nil
-}
-
-// Describes a complete .proto file.
-type FileDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"`
- // Names of files imported by this file.
- Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"`
- // Indexes of the public imported files in the dependency list above.
- PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"`
- // Indexes of the weak imported files in the dependency list.
- // For Google-internal migration only. Do not use.
- WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"`
- // All top-level definitions in this file.
- MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"`
- EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"`
- Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"`
- Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"`
- Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"`
- // This field contains optional information about the original source code.
- // You may safely remove this entire field without harming runtime
- // functionality of the descriptors -- the information is needed only by
- // development tools.
- SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"`
- // The syntax of the proto file.
- // The supported values are "proto2" and "proto3".
- Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FileDescriptorProto) Reset() { *m = FileDescriptorProto{} }
-func (m *FileDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*FileDescriptorProto) ProtoMessage() {}
-func (*FileDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{1}
-}
-func (m *FileDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FileDescriptorProto.Unmarshal(m, b)
-}
-func (m *FileDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FileDescriptorProto.Marshal(b, m, deterministic)
-}
-func (m *FileDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FileDescriptorProto.Merge(m, src)
-}
-func (m *FileDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_FileDescriptorProto.Size(m)
-}
-func (m *FileDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_FileDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FileDescriptorProto proto.InternalMessageInfo
-
-func (m *FileDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *FileDescriptorProto) GetPackage() string {
- if m != nil && m.Package != nil {
- return *m.Package
- }
- return ""
-}
-
-func (m *FileDescriptorProto) GetDependency() []string {
- if m != nil {
- return m.Dependency
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetPublicDependency() []int32 {
- if m != nil {
- return m.PublicDependency
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetWeakDependency() []int32 {
- if m != nil {
- return m.WeakDependency
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetMessageType() []*DescriptorProto {
- if m != nil {
- return m.MessageType
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetEnumType() []*EnumDescriptorProto {
- if m != nil {
- return m.EnumType
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetService() []*ServiceDescriptorProto {
- if m != nil {
- return m.Service
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetExtension() []*FieldDescriptorProto {
- if m != nil {
- return m.Extension
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetOptions() *FileOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetSourceCodeInfo() *SourceCodeInfo {
- if m != nil {
- return m.SourceCodeInfo
- }
- return nil
-}
-
-func (m *FileDescriptorProto) GetSyntax() string {
- if m != nil && m.Syntax != nil {
- return *m.Syntax
- }
- return ""
-}
-
-// Describes a message type.
-type DescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"`
- Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"`
- NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type,json=nestedType" json:"nested_type,omitempty"`
- EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"`
- ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range,json=extensionRange" json:"extension_range,omitempty"`
- OneofDecl []*OneofDescriptorProto `protobuf:"bytes,8,rep,name=oneof_decl,json=oneofDecl" json:"oneof_decl,omitempty"`
- Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"`
- ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"`
- // Reserved field names, which may not be used by fields in the same message.
- // A given name may only be reserved once.
- ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DescriptorProto) Reset() { *m = DescriptorProto{} }
-func (m *DescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*DescriptorProto) ProtoMessage() {}
-func (*DescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{2}
-}
-func (m *DescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_DescriptorProto.Unmarshal(m, b)
-}
-func (m *DescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_DescriptorProto.Marshal(b, m, deterministic)
-}
-func (m *DescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DescriptorProto.Merge(m, src)
-}
-func (m *DescriptorProto) XXX_Size() int {
- return xxx_messageInfo_DescriptorProto.Size(m)
-}
-func (m *DescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_DescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DescriptorProto proto.InternalMessageInfo
-
-func (m *DescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *DescriptorProto) GetField() []*FieldDescriptorProto {
- if m != nil {
- return m.Field
- }
- return nil
-}
-
-func (m *DescriptorProto) GetExtension() []*FieldDescriptorProto {
- if m != nil {
- return m.Extension
- }
- return nil
-}
-
-func (m *DescriptorProto) GetNestedType() []*DescriptorProto {
- if m != nil {
- return m.NestedType
- }
- return nil
-}
-
-func (m *DescriptorProto) GetEnumType() []*EnumDescriptorProto {
- if m != nil {
- return m.EnumType
- }
- return nil
-}
-
-func (m *DescriptorProto) GetExtensionRange() []*DescriptorProto_ExtensionRange {
- if m != nil {
- return m.ExtensionRange
- }
- return nil
-}
-
-func (m *DescriptorProto) GetOneofDecl() []*OneofDescriptorProto {
- if m != nil {
- return m.OneofDecl
- }
- return nil
-}
-
-func (m *DescriptorProto) GetOptions() *MessageOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-func (m *DescriptorProto) GetReservedRange() []*DescriptorProto_ReservedRange {
- if m != nil {
- return m.ReservedRange
- }
- return nil
-}
-
-func (m *DescriptorProto) GetReservedName() []string {
- if m != nil {
- return m.ReservedName
- }
- return nil
-}
-
-type DescriptorProto_ExtensionRange struct {
- Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
- End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
- Options *ExtensionRangeOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DescriptorProto_ExtensionRange) Reset() { *m = DescriptorProto_ExtensionRange{} }
-func (m *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(m) }
-func (*DescriptorProto_ExtensionRange) ProtoMessage() {}
-func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{2, 0}
-}
-func (m *DescriptorProto_ExtensionRange) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_DescriptorProto_ExtensionRange.Unmarshal(m, b)
-}
-func (m *DescriptorProto_ExtensionRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_DescriptorProto_ExtensionRange.Marshal(b, m, deterministic)
-}
-func (m *DescriptorProto_ExtensionRange) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DescriptorProto_ExtensionRange.Merge(m, src)
-}
-func (m *DescriptorProto_ExtensionRange) XXX_Size() int {
- return xxx_messageInfo_DescriptorProto_ExtensionRange.Size(m)
-}
-func (m *DescriptorProto_ExtensionRange) XXX_DiscardUnknown() {
- xxx_messageInfo_DescriptorProto_ExtensionRange.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DescriptorProto_ExtensionRange proto.InternalMessageInfo
-
-func (m *DescriptorProto_ExtensionRange) GetStart() int32 {
- if m != nil && m.Start != nil {
- return *m.Start
- }
- return 0
-}
-
-func (m *DescriptorProto_ExtensionRange) GetEnd() int32 {
- if m != nil && m.End != nil {
- return *m.End
- }
- return 0
-}
-
-func (m *DescriptorProto_ExtensionRange) GetOptions() *ExtensionRangeOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-// Range of reserved tag numbers. Reserved tag numbers may not be used by
-// fields or extension ranges in the same message. Reserved ranges may
-// not overlap.
-type DescriptorProto_ReservedRange struct {
- Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
- End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DescriptorProto_ReservedRange) Reset() { *m = DescriptorProto_ReservedRange{} }
-func (m *DescriptorProto_ReservedRange) String() string { return proto.CompactTextString(m) }
-func (*DescriptorProto_ReservedRange) ProtoMessage() {}
-func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{2, 1}
-}
-func (m *DescriptorProto_ReservedRange) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_DescriptorProto_ReservedRange.Unmarshal(m, b)
-}
-func (m *DescriptorProto_ReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_DescriptorProto_ReservedRange.Marshal(b, m, deterministic)
-}
-func (m *DescriptorProto_ReservedRange) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DescriptorProto_ReservedRange.Merge(m, src)
-}
-func (m *DescriptorProto_ReservedRange) XXX_Size() int {
- return xxx_messageInfo_DescriptorProto_ReservedRange.Size(m)
-}
-func (m *DescriptorProto_ReservedRange) XXX_DiscardUnknown() {
- xxx_messageInfo_DescriptorProto_ReservedRange.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DescriptorProto_ReservedRange proto.InternalMessageInfo
-
-func (m *DescriptorProto_ReservedRange) GetStart() int32 {
- if m != nil && m.Start != nil {
- return *m.Start
- }
- return 0
-}
-
-func (m *DescriptorProto_ReservedRange) GetEnd() int32 {
- if m != nil && m.End != nil {
- return *m.End
- }
- return 0
-}
-
-type ExtensionRangeOptions struct {
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ExtensionRangeOptions) Reset() { *m = ExtensionRangeOptions{} }
-func (m *ExtensionRangeOptions) String() string { return proto.CompactTextString(m) }
-func (*ExtensionRangeOptions) ProtoMessage() {}
-func (*ExtensionRangeOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{3}
-}
-
-var extRange_ExtensionRangeOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*ExtensionRangeOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_ExtensionRangeOptions
-}
-
-func (m *ExtensionRangeOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ExtensionRangeOptions.Unmarshal(m, b)
-}
-func (m *ExtensionRangeOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ExtensionRangeOptions.Marshal(b, m, deterministic)
-}
-func (m *ExtensionRangeOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ExtensionRangeOptions.Merge(m, src)
-}
-func (m *ExtensionRangeOptions) XXX_Size() int {
- return xxx_messageInfo_ExtensionRangeOptions.Size(m)
-}
-func (m *ExtensionRangeOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_ExtensionRangeOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ExtensionRangeOptions proto.InternalMessageInfo
-
-func (m *ExtensionRangeOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-// Describes a field within a message.
-type FieldDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"`
- Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=google.protobuf.FieldDescriptorProto_Label" json:"label,omitempty"`
- // If type_name is set, this need not be set. If both this and type_name
- // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
- Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=google.protobuf.FieldDescriptorProto_Type" json:"type,omitempty"`
- // For message and enum types, this is the name of the type. If the name
- // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
- // rules are used to find the type (i.e. first the nested types within this
- // message are searched, then within the parent, on up to the root
- // namespace).
- TypeName *string `protobuf:"bytes,6,opt,name=type_name,json=typeName" json:"type_name,omitempty"`
- // For extensions, this is the name of the type being extended. It is
- // resolved in the same manner as type_name.
- Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"`
- // For numeric types, contains the original text representation of the value.
- // For booleans, "true" or "false".
- // For strings, contains the default text contents (not escaped in any way).
- // For bytes, contains the C escaped value. All bytes >= 128 are escaped.
- // TODO(kenton): Base-64 encode?
- DefaultValue *string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"`
- // If set, gives the index of a oneof in the containing type's oneof_decl
- // list. This field is a member of that oneof.
- OneofIndex *int32 `protobuf:"varint,9,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"`
- // JSON name of this field. The value is set by protocol compiler. If the
- // user has set a "json_name" option on this field, that option's value
- // will be used. Otherwise, it's deduced from the field's name by converting
- // it to camelCase.
- JsonName *string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"`
- Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FieldDescriptorProto) Reset() { *m = FieldDescriptorProto{} }
-func (m *FieldDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*FieldDescriptorProto) ProtoMessage() {}
-func (*FieldDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{4}
-}
-func (m *FieldDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FieldDescriptorProto.Unmarshal(m, b)
-}
-func (m *FieldDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FieldDescriptorProto.Marshal(b, m, deterministic)
-}
-func (m *FieldDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FieldDescriptorProto.Merge(m, src)
-}
-func (m *FieldDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_FieldDescriptorProto.Size(m)
-}
-func (m *FieldDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_FieldDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FieldDescriptorProto proto.InternalMessageInfo
-
-func (m *FieldDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *FieldDescriptorProto) GetNumber() int32 {
- if m != nil && m.Number != nil {
- return *m.Number
- }
- return 0
-}
-
-func (m *FieldDescriptorProto) GetLabel() FieldDescriptorProto_Label {
- if m != nil && m.Label != nil {
- return *m.Label
- }
- return FieldDescriptorProto_LABEL_OPTIONAL
-}
-
-func (m *FieldDescriptorProto) GetType() FieldDescriptorProto_Type {
- if m != nil && m.Type != nil {
- return *m.Type
- }
- return FieldDescriptorProto_TYPE_DOUBLE
-}
-
-func (m *FieldDescriptorProto) GetTypeName() string {
- if m != nil && m.TypeName != nil {
- return *m.TypeName
- }
- return ""
-}
-
-func (m *FieldDescriptorProto) GetExtendee() string {
- if m != nil && m.Extendee != nil {
- return *m.Extendee
- }
- return ""
-}
-
-func (m *FieldDescriptorProto) GetDefaultValue() string {
- if m != nil && m.DefaultValue != nil {
- return *m.DefaultValue
- }
- return ""
-}
-
-func (m *FieldDescriptorProto) GetOneofIndex() int32 {
- if m != nil && m.OneofIndex != nil {
- return *m.OneofIndex
- }
- return 0
-}
-
-func (m *FieldDescriptorProto) GetJsonName() string {
- if m != nil && m.JsonName != nil {
- return *m.JsonName
- }
- return ""
-}
-
-func (m *FieldDescriptorProto) GetOptions() *FieldOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-// Describes a oneof.
-type OneofDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Options *OneofOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OneofDescriptorProto) Reset() { *m = OneofDescriptorProto{} }
-func (m *OneofDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*OneofDescriptorProto) ProtoMessage() {}
-func (*OneofDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{5}
-}
-func (m *OneofDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OneofDescriptorProto.Unmarshal(m, b)
-}
-func (m *OneofDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OneofDescriptorProto.Marshal(b, m, deterministic)
-}
-func (m *OneofDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OneofDescriptorProto.Merge(m, src)
-}
-func (m *OneofDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_OneofDescriptorProto.Size(m)
-}
-func (m *OneofDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_OneofDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OneofDescriptorProto proto.InternalMessageInfo
-
-func (m *OneofDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *OneofDescriptorProto) GetOptions() *OneofOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-// Describes an enum type.
-type EnumDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"`
- Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
- // Range of reserved numeric values. Reserved numeric values may not be used
- // by enum values in the same enum declaration. Reserved ranges may not
- // overlap.
- ReservedRange []*EnumDescriptorProto_EnumReservedRange `protobuf:"bytes,4,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"`
- // Reserved enum value names, which may not be reused. A given name may only
- // be reserved once.
- ReservedName []string `protobuf:"bytes,5,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *EnumDescriptorProto) Reset() { *m = EnumDescriptorProto{} }
-func (m *EnumDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*EnumDescriptorProto) ProtoMessage() {}
-func (*EnumDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{6}
-}
-func (m *EnumDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_EnumDescriptorProto.Unmarshal(m, b)
-}
-func (m *EnumDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_EnumDescriptorProto.Marshal(b, m, deterministic)
-}
-func (m *EnumDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnumDescriptorProto.Merge(m, src)
-}
-func (m *EnumDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_EnumDescriptorProto.Size(m)
-}
-func (m *EnumDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_EnumDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnumDescriptorProto proto.InternalMessageInfo
-
-func (m *EnumDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *EnumDescriptorProto) GetValue() []*EnumValueDescriptorProto {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-func (m *EnumDescriptorProto) GetOptions() *EnumOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-func (m *EnumDescriptorProto) GetReservedRange() []*EnumDescriptorProto_EnumReservedRange {
- if m != nil {
- return m.ReservedRange
- }
- return nil
-}
-
-func (m *EnumDescriptorProto) GetReservedName() []string {
- if m != nil {
- return m.ReservedName
- }
- return nil
-}
-
-// Range of reserved numeric values. Reserved values may not be used by
-// entries in the same enum. Reserved ranges may not overlap.
-//
-// Note that this is distinct from DescriptorProto.ReservedRange in that it
-// is inclusive such that it can appropriately represent the entire int32
-// domain.
-type EnumDescriptorProto_EnumReservedRange struct {
- Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
- End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *EnumDescriptorProto_EnumReservedRange) Reset() { *m = EnumDescriptorProto_EnumReservedRange{} }
-func (m *EnumDescriptorProto_EnumReservedRange) String() string { return proto.CompactTextString(m) }
-func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage() {}
-func (*EnumDescriptorProto_EnumReservedRange) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{6, 0}
-}
-func (m *EnumDescriptorProto_EnumReservedRange) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Unmarshal(m, b)
-}
-func (m *EnumDescriptorProto_EnumReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Marshal(b, m, deterministic)
-}
-func (m *EnumDescriptorProto_EnumReservedRange) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Merge(m, src)
-}
-func (m *EnumDescriptorProto_EnumReservedRange) XXX_Size() int {
- return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Size(m)
-}
-func (m *EnumDescriptorProto_EnumReservedRange) XXX_DiscardUnknown() {
- xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnumDescriptorProto_EnumReservedRange proto.InternalMessageInfo
-
-func (m *EnumDescriptorProto_EnumReservedRange) GetStart() int32 {
- if m != nil && m.Start != nil {
- return *m.Start
- }
- return 0
-}
-
-func (m *EnumDescriptorProto_EnumReservedRange) GetEnd() int32 {
- if m != nil && m.End != nil {
- return *m.End
- }
- return 0
-}
-
-// Describes a value within an enum.
-type EnumValueDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"`
- Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *EnumValueDescriptorProto) Reset() { *m = EnumValueDescriptorProto{} }
-func (m *EnumValueDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*EnumValueDescriptorProto) ProtoMessage() {}
-func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{7}
-}
-func (m *EnumValueDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_EnumValueDescriptorProto.Unmarshal(m, b)
-}
-func (m *EnumValueDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_EnumValueDescriptorProto.Marshal(b, m, deterministic)
-}
-func (m *EnumValueDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnumValueDescriptorProto.Merge(m, src)
-}
-func (m *EnumValueDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_EnumValueDescriptorProto.Size(m)
-}
-func (m *EnumValueDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_EnumValueDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnumValueDescriptorProto proto.InternalMessageInfo
-
-func (m *EnumValueDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *EnumValueDescriptorProto) GetNumber() int32 {
- if m != nil && m.Number != nil {
- return *m.Number
- }
- return 0
-}
-
-func (m *EnumValueDescriptorProto) GetOptions() *EnumValueOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-// Describes a service.
-type ServiceDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"`
- Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ServiceDescriptorProto) Reset() { *m = ServiceDescriptorProto{} }
-func (m *ServiceDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*ServiceDescriptorProto) ProtoMessage() {}
-func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{8}
-}
-func (m *ServiceDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ServiceDescriptorProto.Unmarshal(m, b)
-}
-func (m *ServiceDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ServiceDescriptorProto.Marshal(b, m, deterministic)
-}
-func (m *ServiceDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceDescriptorProto.Merge(m, src)
-}
-func (m *ServiceDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_ServiceDescriptorProto.Size(m)
-}
-func (m *ServiceDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ServiceDescriptorProto proto.InternalMessageInfo
-
-func (m *ServiceDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *ServiceDescriptorProto) GetMethod() []*MethodDescriptorProto {
- if m != nil {
- return m.Method
- }
- return nil
-}
-
-func (m *ServiceDescriptorProto) GetOptions() *ServiceOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-// Describes a method of a service.
-type MethodDescriptorProto struct {
- Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
- // Input and output type names. These are resolved in the same way as
- // FieldDescriptorProto.type_name, but must refer to a message type.
- InputType *string `protobuf:"bytes,2,opt,name=input_type,json=inputType" json:"input_type,omitempty"`
- OutputType *string `protobuf:"bytes,3,opt,name=output_type,json=outputType" json:"output_type,omitempty"`
- Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"`
- // Identifies if client streams multiple client messages
- ClientStreaming *bool `protobuf:"varint,5,opt,name=client_streaming,json=clientStreaming,def=0" json:"client_streaming,omitempty"`
- // Identifies if server streams multiple server messages
- ServerStreaming *bool `protobuf:"varint,6,opt,name=server_streaming,json=serverStreaming,def=0" json:"server_streaming,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MethodDescriptorProto) Reset() { *m = MethodDescriptorProto{} }
-func (m *MethodDescriptorProto) String() string { return proto.CompactTextString(m) }
-func (*MethodDescriptorProto) ProtoMessage() {}
-func (*MethodDescriptorProto) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{9}
-}
-func (m *MethodDescriptorProto) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MethodDescriptorProto.Unmarshal(m, b)
-}
-func (m *MethodDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MethodDescriptorProto.Marshal(b, m, deterministic)
-}
-func (m *MethodDescriptorProto) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MethodDescriptorProto.Merge(m, src)
-}
-func (m *MethodDescriptorProto) XXX_Size() int {
- return xxx_messageInfo_MethodDescriptorProto.Size(m)
-}
-func (m *MethodDescriptorProto) XXX_DiscardUnknown() {
- xxx_messageInfo_MethodDescriptorProto.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MethodDescriptorProto proto.InternalMessageInfo
-
-const Default_MethodDescriptorProto_ClientStreaming bool = false
-const Default_MethodDescriptorProto_ServerStreaming bool = false
-
-func (m *MethodDescriptorProto) GetName() string {
- if m != nil && m.Name != nil {
- return *m.Name
- }
- return ""
-}
-
-func (m *MethodDescriptorProto) GetInputType() string {
- if m != nil && m.InputType != nil {
- return *m.InputType
- }
- return ""
-}
-
-func (m *MethodDescriptorProto) GetOutputType() string {
- if m != nil && m.OutputType != nil {
- return *m.OutputType
- }
- return ""
-}
-
-func (m *MethodDescriptorProto) GetOptions() *MethodOptions {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-func (m *MethodDescriptorProto) GetClientStreaming() bool {
- if m != nil && m.ClientStreaming != nil {
- return *m.ClientStreaming
- }
- return Default_MethodDescriptorProto_ClientStreaming
-}
-
-func (m *MethodDescriptorProto) GetServerStreaming() bool {
- if m != nil && m.ServerStreaming != nil {
- return *m.ServerStreaming
- }
- return Default_MethodDescriptorProto_ServerStreaming
-}
-
-type FileOptions struct {
- // Sets the Java package where classes generated from this .proto will be
- // placed. By default, the proto package is used, but this is often
- // inappropriate because proto packages do not normally start with backwards
- // domain names.
- JavaPackage *string `protobuf:"bytes,1,opt,name=java_package,json=javaPackage" json:"java_package,omitempty"`
- // If set, all the classes from the .proto file are wrapped in a single
- // outer class with the given name. This applies to both Proto1
- // (equivalent to the old "--one_java_file" option) and Proto2 (where
- // a .proto always translates to a single class, but you may want to
- // explicitly choose the class name).
- JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname,json=javaOuterClassname" json:"java_outer_classname,omitempty"`
- // If set true, then the Java code generator will generate a separate .java
- // file for each top-level message, enum, and service defined in the .proto
- // file. Thus, these types will *not* be nested inside the outer class
- // named by java_outer_classname. However, the outer class will still be
- // generated to contain the file's getDescriptor() method as well as any
- // top-level extensions defined in the file.
- JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,json=javaMultipleFiles,def=0" json:"java_multiple_files,omitempty"`
- // This option does nothing.
- JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash" json:"java_generate_equals_and_hash,omitempty"` // Deprecated: Do not use.
- // If set true, then the Java2 code generator will generate code that
- // throws an exception whenever an attempt is made to assign a non-UTF-8
- // byte sequence to a string field.
- // Message reflection will do the same.
- // However, an extension field still accepts non-UTF-8 byte sequences.
- // This option has no effect on when used with the lite runtime.
- JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"`
- OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"`
- // Sets the Go package where structs generated from this .proto will be
- // placed. If omitted, the Go package will be derived from the following:
- // - The basename of the package import path, if provided.
- // - Otherwise, the package statement in the .proto file, if present.
- // - Otherwise, the basename of the .proto file, without extension.
- GoPackage *string `protobuf:"bytes,11,opt,name=go_package,json=goPackage" json:"go_package,omitempty"`
- // Should generic services be generated in each language? "Generic" services
- // are not specific to any particular RPC system. They are generated by the
- // main code generators in each language (without additional plugins).
- // Generic services were the only kind of service generation supported by
- // early versions of google.protobuf.
- //
- // Generic services are now considered deprecated in favor of using plugins
- // that generate code specific to your particular RPC system. Therefore,
- // these default to false. Old code which depends on generic services should
- // explicitly set them to true.
- CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,json=ccGenericServices,def=0" json:"cc_generic_services,omitempty"`
- JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,json=javaGenericServices,def=0" json:"java_generic_services,omitempty"`
- PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,json=pyGenericServices,def=0" json:"py_generic_services,omitempty"`
- PhpGenericServices *bool `protobuf:"varint,42,opt,name=php_generic_services,json=phpGenericServices,def=0" json:"php_generic_services,omitempty"`
- // Is this file deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for everything in the file, or it will be completely ignored; in the very
- // least, this is a formalization for deprecating files.
- Deprecated *bool `protobuf:"varint,23,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // Enables the use of arenas for the proto messages in this file. This applies
- // only to generated classes for C++.
- CcEnableArenas *bool `protobuf:"varint,31,opt,name=cc_enable_arenas,json=ccEnableArenas,def=0" json:"cc_enable_arenas,omitempty"`
- // Sets the objective c class prefix which is prepended to all objective c
- // generated classes from this .proto. There is no default.
- ObjcClassPrefix *string `protobuf:"bytes,36,opt,name=objc_class_prefix,json=objcClassPrefix" json:"objc_class_prefix,omitempty"`
- // Namespace for generated classes; defaults to the package.
- CsharpNamespace *string `protobuf:"bytes,37,opt,name=csharp_namespace,json=csharpNamespace" json:"csharp_namespace,omitempty"`
- // By default Swift generators will take the proto package and CamelCase it
- // replacing '.' with underscore and use that to prefix the types/symbols
- // defined. When this options is provided, they will use this value instead
- // to prefix the types/symbols defined.
- SwiftPrefix *string `protobuf:"bytes,39,opt,name=swift_prefix,json=swiftPrefix" json:"swift_prefix,omitempty"`
- // Sets the php class prefix which is prepended to all php generated classes
- // from this .proto. Default is empty.
- PhpClassPrefix *string `protobuf:"bytes,40,opt,name=php_class_prefix,json=phpClassPrefix" json:"php_class_prefix,omitempty"`
- // Use this option to change the namespace of php generated classes. Default
- // is empty. When this option is empty, the package name will be used for
- // determining the namespace.
- PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"`
- // Use this option to change the namespace of php generated metadata classes.
- // Default is empty. When this option is empty, the proto file name will be
- // used for determining the namespace.
- PhpMetadataNamespace *string `protobuf:"bytes,44,opt,name=php_metadata_namespace,json=phpMetadataNamespace" json:"php_metadata_namespace,omitempty"`
- // Use this option to change the package of ruby generated classes. Default
- // is empty. When this option is not set, the package name will be used for
- // determining the ruby package.
- RubyPackage *string `protobuf:"bytes,45,opt,name=ruby_package,json=rubyPackage" json:"ruby_package,omitempty"`
- // The parser stores options it doesn't recognize here.
- // See the documentation for the "Options" section above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FileOptions) Reset() { *m = FileOptions{} }
-func (m *FileOptions) String() string { return proto.CompactTextString(m) }
-func (*FileOptions) ProtoMessage() {}
-func (*FileOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{10}
-}
-
-var extRange_FileOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*FileOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_FileOptions
-}
-
-func (m *FileOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FileOptions.Unmarshal(m, b)
-}
-func (m *FileOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FileOptions.Marshal(b, m, deterministic)
-}
-func (m *FileOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FileOptions.Merge(m, src)
-}
-func (m *FileOptions) XXX_Size() int {
- return xxx_messageInfo_FileOptions.Size(m)
-}
-func (m *FileOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_FileOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FileOptions proto.InternalMessageInfo
-
-const Default_FileOptions_JavaMultipleFiles bool = false
-const Default_FileOptions_JavaStringCheckUtf8 bool = false
-const Default_FileOptions_OptimizeFor FileOptions_OptimizeMode = FileOptions_SPEED
-const Default_FileOptions_CcGenericServices bool = false
-const Default_FileOptions_JavaGenericServices bool = false
-const Default_FileOptions_PyGenericServices bool = false
-const Default_FileOptions_PhpGenericServices bool = false
-const Default_FileOptions_Deprecated bool = false
-const Default_FileOptions_CcEnableArenas bool = false
-
-func (m *FileOptions) GetJavaPackage() string {
- if m != nil && m.JavaPackage != nil {
- return *m.JavaPackage
- }
- return ""
-}
-
-func (m *FileOptions) GetJavaOuterClassname() string {
- if m != nil && m.JavaOuterClassname != nil {
- return *m.JavaOuterClassname
- }
- return ""
-}
-
-func (m *FileOptions) GetJavaMultipleFiles() bool {
- if m != nil && m.JavaMultipleFiles != nil {
- return *m.JavaMultipleFiles
- }
- return Default_FileOptions_JavaMultipleFiles
-}
-
-// Deprecated: Do not use.
-func (m *FileOptions) GetJavaGenerateEqualsAndHash() bool {
- if m != nil && m.JavaGenerateEqualsAndHash != nil {
- return *m.JavaGenerateEqualsAndHash
- }
- return false
-}
-
-func (m *FileOptions) GetJavaStringCheckUtf8() bool {
- if m != nil && m.JavaStringCheckUtf8 != nil {
- return *m.JavaStringCheckUtf8
- }
- return Default_FileOptions_JavaStringCheckUtf8
-}
-
-func (m *FileOptions) GetOptimizeFor() FileOptions_OptimizeMode {
- if m != nil && m.OptimizeFor != nil {
- return *m.OptimizeFor
- }
- return Default_FileOptions_OptimizeFor
-}
-
-func (m *FileOptions) GetGoPackage() string {
- if m != nil && m.GoPackage != nil {
- return *m.GoPackage
- }
- return ""
-}
-
-func (m *FileOptions) GetCcGenericServices() bool {
- if m != nil && m.CcGenericServices != nil {
- return *m.CcGenericServices
- }
- return Default_FileOptions_CcGenericServices
-}
-
-func (m *FileOptions) GetJavaGenericServices() bool {
- if m != nil && m.JavaGenericServices != nil {
- return *m.JavaGenericServices
- }
- return Default_FileOptions_JavaGenericServices
-}
-
-func (m *FileOptions) GetPyGenericServices() bool {
- if m != nil && m.PyGenericServices != nil {
- return *m.PyGenericServices
- }
- return Default_FileOptions_PyGenericServices
-}
-
-func (m *FileOptions) GetPhpGenericServices() bool {
- if m != nil && m.PhpGenericServices != nil {
- return *m.PhpGenericServices
- }
- return Default_FileOptions_PhpGenericServices
-}
-
-func (m *FileOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_FileOptions_Deprecated
-}
-
-func (m *FileOptions) GetCcEnableArenas() bool {
- if m != nil && m.CcEnableArenas != nil {
- return *m.CcEnableArenas
- }
- return Default_FileOptions_CcEnableArenas
-}
-
-func (m *FileOptions) GetObjcClassPrefix() string {
- if m != nil && m.ObjcClassPrefix != nil {
- return *m.ObjcClassPrefix
- }
- return ""
-}
-
-func (m *FileOptions) GetCsharpNamespace() string {
- if m != nil && m.CsharpNamespace != nil {
- return *m.CsharpNamespace
- }
- return ""
-}
-
-func (m *FileOptions) GetSwiftPrefix() string {
- if m != nil && m.SwiftPrefix != nil {
- return *m.SwiftPrefix
- }
- return ""
-}
-
-func (m *FileOptions) GetPhpClassPrefix() string {
- if m != nil && m.PhpClassPrefix != nil {
- return *m.PhpClassPrefix
- }
- return ""
-}
-
-func (m *FileOptions) GetPhpNamespace() string {
- if m != nil && m.PhpNamespace != nil {
- return *m.PhpNamespace
- }
- return ""
-}
-
-func (m *FileOptions) GetPhpMetadataNamespace() string {
- if m != nil && m.PhpMetadataNamespace != nil {
- return *m.PhpMetadataNamespace
- }
- return ""
-}
-
-func (m *FileOptions) GetRubyPackage() string {
- if m != nil && m.RubyPackage != nil {
- return *m.RubyPackage
- }
- return ""
-}
-
-func (m *FileOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type MessageOptions struct {
- // Set true to use the old proto1 MessageSet wire format for extensions.
- // This is provided for backwards-compatibility with the MessageSet wire
- // format. You should not use this for any other reason: It's less
- // efficient, has fewer features, and is more complicated.
- //
- // The message must be defined exactly as follows:
- // message Foo {
- // option message_set_wire_format = true;
- // extensions 4 to max;
- // }
- // Note that the message cannot have any defined fields; MessageSets only
- // have extensions.
- //
- // All extensions of your type must be singular messages; e.g. they cannot
- // be int32s, enums, or repeated messages.
- //
- // Because this is an option, the above two restrictions are not enforced by
- // the protocol compiler.
- MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,json=messageSetWireFormat,def=0" json:"message_set_wire_format,omitempty"`
- // Disables the generation of the standard "descriptor()" accessor, which can
- // conflict with a field of the same name. This is meant to make migration
- // from proto1 easier; new code should avoid fields named "descriptor".
- NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,json=noStandardDescriptorAccessor,def=0" json:"no_standard_descriptor_accessor,omitempty"`
- // Is this message deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the message, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating messages.
- Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // Whether the message is an automatically generated map entry type for the
- // maps field.
- //
- // For maps fields:
- // map map_field = 1;
- // The parsed descriptor looks like:
- // message MapFieldEntry {
- // option map_entry = true;
- // optional KeyType key = 1;
- // optional ValueType value = 2;
- // }
- // repeated MapFieldEntry map_field = 1;
- //
- // Implementations may choose not to generate the map_entry=true message, but
- // use a native map in the target language to hold the keys and values.
- // The reflection APIs in such implementations still need to work as
- // if the field is a repeated message field.
- //
- // NOTE: Do not set the option in .proto files. Always use the maps syntax
- // instead. The option should only be implicitly set by the proto compiler
- // parser.
- MapEntry *bool `protobuf:"varint,7,opt,name=map_entry,json=mapEntry" json:"map_entry,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MessageOptions) Reset() { *m = MessageOptions{} }
-func (m *MessageOptions) String() string { return proto.CompactTextString(m) }
-func (*MessageOptions) ProtoMessage() {}
-func (*MessageOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{11}
-}
-
-var extRange_MessageOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*MessageOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_MessageOptions
-}
-
-func (m *MessageOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MessageOptions.Unmarshal(m, b)
-}
-func (m *MessageOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MessageOptions.Marshal(b, m, deterministic)
-}
-func (m *MessageOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MessageOptions.Merge(m, src)
-}
-func (m *MessageOptions) XXX_Size() int {
- return xxx_messageInfo_MessageOptions.Size(m)
-}
-func (m *MessageOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_MessageOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MessageOptions proto.InternalMessageInfo
-
-const Default_MessageOptions_MessageSetWireFormat bool = false
-const Default_MessageOptions_NoStandardDescriptorAccessor bool = false
-const Default_MessageOptions_Deprecated bool = false
-
-func (m *MessageOptions) GetMessageSetWireFormat() bool {
- if m != nil && m.MessageSetWireFormat != nil {
- return *m.MessageSetWireFormat
- }
- return Default_MessageOptions_MessageSetWireFormat
-}
-
-func (m *MessageOptions) GetNoStandardDescriptorAccessor() bool {
- if m != nil && m.NoStandardDescriptorAccessor != nil {
- return *m.NoStandardDescriptorAccessor
- }
- return Default_MessageOptions_NoStandardDescriptorAccessor
-}
-
-func (m *MessageOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_MessageOptions_Deprecated
-}
-
-func (m *MessageOptions) GetMapEntry() bool {
- if m != nil && m.MapEntry != nil {
- return *m.MapEntry
- }
- return false
-}
-
-func (m *MessageOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type FieldOptions struct {
- // The ctype option instructs the C++ code generator to use a different
- // representation of the field than it normally would. See the specific
- // options below. This option is not yet implemented in the open source
- // release -- sorry, we'll try to include it in a future version!
- Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=google.protobuf.FieldOptions_CType,def=0" json:"ctype,omitempty"`
- // The packed option can be enabled for repeated primitive fields to enable
- // a more efficient representation on the wire. Rather than repeatedly
- // writing the tag and type for each element, the entire array is encoded as
- // a single length-delimited blob. In proto3, only explicit setting it to
- // false will avoid using packed encoding.
- Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"`
- // The jstype option determines the JavaScript type used for values of the
- // field. The option is permitted only for 64 bit integral and fixed types
- // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
- // is represented as JavaScript string, which avoids loss of precision that
- // can happen when a large value is converted to a floating point JavaScript.
- // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
- // use the JavaScript "number" type. The behavior of the default option
- // JS_NORMAL is implementation dependent.
- //
- // This option is an enum to permit additional types to be added, e.g.
- // goog.math.Integer.
- Jstype *FieldOptions_JSType `protobuf:"varint,6,opt,name=jstype,enum=google.protobuf.FieldOptions_JSType,def=0" json:"jstype,omitempty"`
- // Should this field be parsed lazily? Lazy applies only to message-type
- // fields. It means that when the outer message is initially parsed, the
- // inner message's contents will not be parsed but instead stored in encoded
- // form. The inner message will actually be parsed when it is first accessed.
- //
- // This is only a hint. Implementations are free to choose whether to use
- // eager or lazy parsing regardless of the value of this option. However,
- // setting this option true suggests that the protocol author believes that
- // using lazy parsing on this field is worth the additional bookkeeping
- // overhead typically needed to implement it.
- //
- // This option does not affect the public interface of any generated code;
- // all method signatures remain the same. Furthermore, thread-safety of the
- // interface is not affected by this option; const methods remain safe to
- // call from multiple threads concurrently, while non-const methods continue
- // to require exclusive access.
- //
- //
- // Note that implementations may choose not to check required fields within
- // a lazy sub-message. That is, calling IsInitialized() on the outer message
- // may return true even if the inner message has missing required fields.
- // This is necessary because otherwise the inner message would have to be
- // parsed in order to perform the check, defeating the purpose of lazy
- // parsing. An implementation which chooses not to check required fields
- // must be consistent about it. That is, for any particular sub-message, the
- // implementation must either *always* check its required fields, or *never*
- // check its required fields, regardless of whether or not the message has
- // been parsed.
- Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"`
- // Is this field deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for accessors, or it will be completely ignored; in the very least, this
- // is a formalization for deprecating fields.
- Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // For Google-internal migration only. Do not use.
- Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FieldOptions) Reset() { *m = FieldOptions{} }
-func (m *FieldOptions) String() string { return proto.CompactTextString(m) }
-func (*FieldOptions) ProtoMessage() {}
-func (*FieldOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{12}
-}
-
-var extRange_FieldOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*FieldOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_FieldOptions
-}
-
-func (m *FieldOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FieldOptions.Unmarshal(m, b)
-}
-func (m *FieldOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FieldOptions.Marshal(b, m, deterministic)
-}
-func (m *FieldOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FieldOptions.Merge(m, src)
-}
-func (m *FieldOptions) XXX_Size() int {
- return xxx_messageInfo_FieldOptions.Size(m)
-}
-func (m *FieldOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_FieldOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FieldOptions proto.InternalMessageInfo
-
-const Default_FieldOptions_Ctype FieldOptions_CType = FieldOptions_STRING
-const Default_FieldOptions_Jstype FieldOptions_JSType = FieldOptions_JS_NORMAL
-const Default_FieldOptions_Lazy bool = false
-const Default_FieldOptions_Deprecated bool = false
-const Default_FieldOptions_Weak bool = false
-
-func (m *FieldOptions) GetCtype() FieldOptions_CType {
- if m != nil && m.Ctype != nil {
- return *m.Ctype
- }
- return Default_FieldOptions_Ctype
-}
-
-func (m *FieldOptions) GetPacked() bool {
- if m != nil && m.Packed != nil {
- return *m.Packed
- }
- return false
-}
-
-func (m *FieldOptions) GetJstype() FieldOptions_JSType {
- if m != nil && m.Jstype != nil {
- return *m.Jstype
- }
- return Default_FieldOptions_Jstype
-}
-
-func (m *FieldOptions) GetLazy() bool {
- if m != nil && m.Lazy != nil {
- return *m.Lazy
- }
- return Default_FieldOptions_Lazy
-}
-
-func (m *FieldOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_FieldOptions_Deprecated
-}
-
-func (m *FieldOptions) GetWeak() bool {
- if m != nil && m.Weak != nil {
- return *m.Weak
- }
- return Default_FieldOptions_Weak
-}
-
-func (m *FieldOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type OneofOptions struct {
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *OneofOptions) Reset() { *m = OneofOptions{} }
-func (m *OneofOptions) String() string { return proto.CompactTextString(m) }
-func (*OneofOptions) ProtoMessage() {}
-func (*OneofOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{13}
-}
-
-var extRange_OneofOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*OneofOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_OneofOptions
-}
-
-func (m *OneofOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OneofOptions.Unmarshal(m, b)
-}
-func (m *OneofOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OneofOptions.Marshal(b, m, deterministic)
-}
-func (m *OneofOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OneofOptions.Merge(m, src)
-}
-func (m *OneofOptions) XXX_Size() int {
- return xxx_messageInfo_OneofOptions.Size(m)
-}
-func (m *OneofOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_OneofOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OneofOptions proto.InternalMessageInfo
-
-func (m *OneofOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type EnumOptions struct {
- // Set this option to true to allow mapping different tag names to the same
- // value.
- AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias" json:"allow_alias,omitempty"`
- // Is this enum deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the enum, or it will be completely ignored; in the very least, this
- // is a formalization for deprecating enums.
- Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *EnumOptions) Reset() { *m = EnumOptions{} }
-func (m *EnumOptions) String() string { return proto.CompactTextString(m) }
-func (*EnumOptions) ProtoMessage() {}
-func (*EnumOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{14}
-}
-
-var extRange_EnumOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*EnumOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_EnumOptions
-}
-
-func (m *EnumOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_EnumOptions.Unmarshal(m, b)
-}
-func (m *EnumOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_EnumOptions.Marshal(b, m, deterministic)
-}
-func (m *EnumOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnumOptions.Merge(m, src)
-}
-func (m *EnumOptions) XXX_Size() int {
- return xxx_messageInfo_EnumOptions.Size(m)
-}
-func (m *EnumOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_EnumOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnumOptions proto.InternalMessageInfo
-
-const Default_EnumOptions_Deprecated bool = false
-
-func (m *EnumOptions) GetAllowAlias() bool {
- if m != nil && m.AllowAlias != nil {
- return *m.AllowAlias
- }
- return false
-}
-
-func (m *EnumOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_EnumOptions_Deprecated
-}
-
-func (m *EnumOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type EnumValueOptions struct {
- // Is this enum value deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the enum value, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating enum values.
- Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *EnumValueOptions) Reset() { *m = EnumValueOptions{} }
-func (m *EnumValueOptions) String() string { return proto.CompactTextString(m) }
-func (*EnumValueOptions) ProtoMessage() {}
-func (*EnumValueOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{15}
-}
-
-var extRange_EnumValueOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*EnumValueOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_EnumValueOptions
-}
-
-func (m *EnumValueOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_EnumValueOptions.Unmarshal(m, b)
-}
-func (m *EnumValueOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_EnumValueOptions.Marshal(b, m, deterministic)
-}
-func (m *EnumValueOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnumValueOptions.Merge(m, src)
-}
-func (m *EnumValueOptions) XXX_Size() int {
- return xxx_messageInfo_EnumValueOptions.Size(m)
-}
-func (m *EnumValueOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_EnumValueOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnumValueOptions proto.InternalMessageInfo
-
-const Default_EnumValueOptions_Deprecated bool = false
-
-func (m *EnumValueOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_EnumValueOptions_Deprecated
-}
-
-func (m *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type ServiceOptions struct {
- // Is this service deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the service, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating services.
- Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ServiceOptions) Reset() { *m = ServiceOptions{} }
-func (m *ServiceOptions) String() string { return proto.CompactTextString(m) }
-func (*ServiceOptions) ProtoMessage() {}
-func (*ServiceOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{16}
-}
-
-var extRange_ServiceOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*ServiceOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_ServiceOptions
-}
-
-func (m *ServiceOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ServiceOptions.Unmarshal(m, b)
-}
-func (m *ServiceOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ServiceOptions.Marshal(b, m, deterministic)
-}
-func (m *ServiceOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceOptions.Merge(m, src)
-}
-func (m *ServiceOptions) XXX_Size() int {
- return xxx_messageInfo_ServiceOptions.Size(m)
-}
-func (m *ServiceOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ServiceOptions proto.InternalMessageInfo
-
-const Default_ServiceOptions_Deprecated bool = false
-
-func (m *ServiceOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_ServiceOptions_Deprecated
-}
-
-func (m *ServiceOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-type MethodOptions struct {
- // Is this method deprecated?
- // Depending on the target platform, this can emit Deprecated annotations
- // for the method, or it will be completely ignored; in the very least,
- // this is a formalization for deprecating methods.
- Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
- IdempotencyLevel *MethodOptions_IdempotencyLevel `protobuf:"varint,34,opt,name=idempotency_level,json=idempotencyLevel,enum=google.protobuf.MethodOptions_IdempotencyLevel,def=0" json:"idempotency_level,omitempty"`
- // The parser stores options it doesn't recognize here. See above.
- UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- proto.XXX_InternalExtensions `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MethodOptions) Reset() { *m = MethodOptions{} }
-func (m *MethodOptions) String() string { return proto.CompactTextString(m) }
-func (*MethodOptions) ProtoMessage() {}
-func (*MethodOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{17}
-}
-
-var extRange_MethodOptions = []proto.ExtensionRange{
- {Start: 1000, End: 536870911},
-}
-
-func (*MethodOptions) ExtensionRangeArray() []proto.ExtensionRange {
- return extRange_MethodOptions
-}
-
-func (m *MethodOptions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MethodOptions.Unmarshal(m, b)
-}
-func (m *MethodOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MethodOptions.Marshal(b, m, deterministic)
-}
-func (m *MethodOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MethodOptions.Merge(m, src)
-}
-func (m *MethodOptions) XXX_Size() int {
- return xxx_messageInfo_MethodOptions.Size(m)
-}
-func (m *MethodOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_MethodOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MethodOptions proto.InternalMessageInfo
-
-const Default_MethodOptions_Deprecated bool = false
-const Default_MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel = MethodOptions_IDEMPOTENCY_UNKNOWN
-
-func (m *MethodOptions) GetDeprecated() bool {
- if m != nil && m.Deprecated != nil {
- return *m.Deprecated
- }
- return Default_MethodOptions_Deprecated
-}
-
-func (m *MethodOptions) GetIdempotencyLevel() MethodOptions_IdempotencyLevel {
- if m != nil && m.IdempotencyLevel != nil {
- return *m.IdempotencyLevel
- }
- return Default_MethodOptions_IdempotencyLevel
-}
-
-func (m *MethodOptions) GetUninterpretedOption() []*UninterpretedOption {
- if m != nil {
- return m.UninterpretedOption
- }
- return nil
-}
-
-// A message representing a option the parser does not recognize. This only
-// appears in options protos created by the compiler::Parser class.
-// DescriptorPool resolves these when building Descriptor objects. Therefore,
-// options protos in descriptor objects (e.g. returned by Descriptor::options(),
-// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
-// in them.
-type UninterpretedOption struct {
- Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"`
- // The value of the uninterpreted option, in whatever type the tokenizer
- // identified it as during parsing. Exactly one of these should be set.
- IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value,json=identifierValue" json:"identifier_value,omitempty"`
- PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value,json=positiveIntValue" json:"positive_int_value,omitempty"`
- NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value,json=negativeIntValue" json:"negative_int_value,omitempty"`
- DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"`
- StringValue []byte `protobuf:"bytes,7,opt,name=string_value,json=stringValue" json:"string_value,omitempty"`
- AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value,json=aggregateValue" json:"aggregate_value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UninterpretedOption) Reset() { *m = UninterpretedOption{} }
-func (m *UninterpretedOption) String() string { return proto.CompactTextString(m) }
-func (*UninterpretedOption) ProtoMessage() {}
-func (*UninterpretedOption) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{18}
-}
-func (m *UninterpretedOption) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_UninterpretedOption.Unmarshal(m, b)
-}
-func (m *UninterpretedOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_UninterpretedOption.Marshal(b, m, deterministic)
-}
-func (m *UninterpretedOption) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UninterpretedOption.Merge(m, src)
-}
-func (m *UninterpretedOption) XXX_Size() int {
- return xxx_messageInfo_UninterpretedOption.Size(m)
-}
-func (m *UninterpretedOption) XXX_DiscardUnknown() {
- xxx_messageInfo_UninterpretedOption.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UninterpretedOption proto.InternalMessageInfo
-
-func (m *UninterpretedOption) GetName() []*UninterpretedOption_NamePart {
- if m != nil {
- return m.Name
- }
- return nil
-}
-
-func (m *UninterpretedOption) GetIdentifierValue() string {
- if m != nil && m.IdentifierValue != nil {
- return *m.IdentifierValue
- }
- return ""
-}
-
-func (m *UninterpretedOption) GetPositiveIntValue() uint64 {
- if m != nil && m.PositiveIntValue != nil {
- return *m.PositiveIntValue
- }
- return 0
-}
-
-func (m *UninterpretedOption) GetNegativeIntValue() int64 {
- if m != nil && m.NegativeIntValue != nil {
- return *m.NegativeIntValue
- }
- return 0
-}
-
-func (m *UninterpretedOption) GetDoubleValue() float64 {
- if m != nil && m.DoubleValue != nil {
- return *m.DoubleValue
- }
- return 0
-}
-
-func (m *UninterpretedOption) GetStringValue() []byte {
- if m != nil {
- return m.StringValue
- }
- return nil
-}
-
-func (m *UninterpretedOption) GetAggregateValue() string {
- if m != nil && m.AggregateValue != nil {
- return *m.AggregateValue
- }
- return ""
-}
-
-// The name of the uninterpreted option. Each string represents a segment in
-// a dot-separated name. is_extension is true iff a segment represents an
-// extension (denoted with parentheses in options specs in .proto files).
-// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
-// "foo.(bar.baz).qux".
-type UninterpretedOption_NamePart struct {
- NamePart *string `protobuf:"bytes,1,req,name=name_part,json=namePart" json:"name_part,omitempty"`
- IsExtension *bool `protobuf:"varint,2,req,name=is_extension,json=isExtension" json:"is_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UninterpretedOption_NamePart) Reset() { *m = UninterpretedOption_NamePart{} }
-func (m *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(m) }
-func (*UninterpretedOption_NamePart) ProtoMessage() {}
-func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{18, 0}
-}
-func (m *UninterpretedOption_NamePart) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_UninterpretedOption_NamePart.Unmarshal(m, b)
-}
-func (m *UninterpretedOption_NamePart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_UninterpretedOption_NamePart.Marshal(b, m, deterministic)
-}
-func (m *UninterpretedOption_NamePart) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UninterpretedOption_NamePart.Merge(m, src)
-}
-func (m *UninterpretedOption_NamePart) XXX_Size() int {
- return xxx_messageInfo_UninterpretedOption_NamePart.Size(m)
-}
-func (m *UninterpretedOption_NamePart) XXX_DiscardUnknown() {
- xxx_messageInfo_UninterpretedOption_NamePart.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UninterpretedOption_NamePart proto.InternalMessageInfo
-
-func (m *UninterpretedOption_NamePart) GetNamePart() string {
- if m != nil && m.NamePart != nil {
- return *m.NamePart
- }
- return ""
-}
-
-func (m *UninterpretedOption_NamePart) GetIsExtension() bool {
- if m != nil && m.IsExtension != nil {
- return *m.IsExtension
- }
- return false
-}
-
-// Encapsulates information about the original source file from which a
-// FileDescriptorProto was generated.
-type SourceCodeInfo struct {
- // A Location identifies a piece of source code in a .proto file which
- // corresponds to a particular definition. This information is intended
- // to be useful to IDEs, code indexers, documentation generators, and similar
- // tools.
- //
- // For example, say we have a file like:
- // message Foo {
- // optional string foo = 1;
- // }
- // Let's look at just the field definition:
- // optional string foo = 1;
- // ^ ^^ ^^ ^ ^^^
- // a bc de f ghi
- // We have the following locations:
- // span path represents
- // [a,i) [ 4, 0, 2, 0 ] The whole field definition.
- // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
- // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
- // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
- // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
- //
- // Notes:
- // - A location may refer to a repeated field itself (i.e. not to any
- // particular index within it). This is used whenever a set of elements are
- // logically enclosed in a single code segment. For example, an entire
- // extend block (possibly containing multiple extension definitions) will
- // have an outer location whose path refers to the "extensions" repeated
- // field without an index.
- // - Multiple locations may have the same path. This happens when a single
- // logical declaration is spread out across multiple places. The most
- // obvious example is the "extend" block again -- there may be multiple
- // extend blocks in the same scope, each of which will have the same path.
- // - A location's span is not always a subset of its parent's span. For
- // example, the "extendee" of an extension declaration appears at the
- // beginning of the "extend" block and is shared by all extensions within
- // the block.
- // - Just because a location's span is a subset of some other location's span
- // does not mean that it is a descendant. For example, a "group" defines
- // both a type and a field in a single declaration. Thus, the locations
- // corresponding to the type and field and their components will overlap.
- // - Code which tries to interpret locations should probably be designed to
- // ignore those that it doesn't understand, as more types of locations could
- // be recorded in the future.
- Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SourceCodeInfo) Reset() { *m = SourceCodeInfo{} }
-func (m *SourceCodeInfo) String() string { return proto.CompactTextString(m) }
-func (*SourceCodeInfo) ProtoMessage() {}
-func (*SourceCodeInfo) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{19}
-}
-func (m *SourceCodeInfo) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SourceCodeInfo.Unmarshal(m, b)
-}
-func (m *SourceCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SourceCodeInfo.Marshal(b, m, deterministic)
-}
-func (m *SourceCodeInfo) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SourceCodeInfo.Merge(m, src)
-}
-func (m *SourceCodeInfo) XXX_Size() int {
- return xxx_messageInfo_SourceCodeInfo.Size(m)
-}
-func (m *SourceCodeInfo) XXX_DiscardUnknown() {
- xxx_messageInfo_SourceCodeInfo.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SourceCodeInfo proto.InternalMessageInfo
-
-func (m *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location {
- if m != nil {
- return m.Location
- }
- return nil
-}
-
-type SourceCodeInfo_Location struct {
- // Identifies which part of the FileDescriptorProto was defined at this
- // location.
- //
- // Each element is a field number or an index. They form a path from
- // the root FileDescriptorProto to the place where the definition. For
- // example, this path:
- // [ 4, 3, 2, 7, 1 ]
- // refers to:
- // file.message_type(3) // 4, 3
- // .field(7) // 2, 7
- // .name() // 1
- // This is because FileDescriptorProto.message_type has field number 4:
- // repeated DescriptorProto message_type = 4;
- // and DescriptorProto.field has field number 2:
- // repeated FieldDescriptorProto field = 2;
- // and FieldDescriptorProto.name has field number 1:
- // optional string name = 1;
- //
- // Thus, the above path gives the location of a field name. If we removed
- // the last element:
- // [ 4, 3, 2, 7 ]
- // this path refers to the whole field declaration (from the beginning
- // of the label to the terminating semicolon).
- Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"`
- // Always has exactly three or four elements: start line, start column,
- // end line (optional, otherwise assumed same as start line), end column.
- // These are packed into a single field for efficiency. Note that line
- // and column numbers are zero-based -- typically you will want to add
- // 1 to each before displaying to a user.
- Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"`
- // If this SourceCodeInfo represents a complete declaration, these are any
- // comments appearing before and after the declaration which appear to be
- // attached to the declaration.
- //
- // A series of line comments appearing on consecutive lines, with no other
- // tokens appearing on those lines, will be treated as a single comment.
- //
- // leading_detached_comments will keep paragraphs of comments that appear
- // before (but not connected to) the current element. Each paragraph,
- // separated by empty lines, will be one comment element in the repeated
- // field.
- //
- // Only the comment content is provided; comment markers (e.g. //) are
- // stripped out. For block comments, leading whitespace and an asterisk
- // will be stripped from the beginning of each line other than the first.
- // Newlines are included in the output.
- //
- // Examples:
- //
- // optional int32 foo = 1; // Comment attached to foo.
- // // Comment attached to bar.
- // optional int32 bar = 2;
- //
- // optional string baz = 3;
- // // Comment attached to baz.
- // // Another line attached to baz.
- //
- // // Comment attached to qux.
- // //
- // // Another line attached to qux.
- // optional double qux = 4;
- //
- // // Detached comment for corge. This is not leading or trailing comments
- // // to qux or corge because there are blank lines separating it from
- // // both.
- //
- // // Detached comment for corge paragraph 2.
- //
- // optional string corge = 5;
- // /* Block comment attached
- // * to corge. Leading asterisks
- // * will be removed. */
- // /* Block comment attached to
- // * grault. */
- // optional int32 grault = 6;
- //
- // // ignored detached comments.
- LeadingComments *string `protobuf:"bytes,3,opt,name=leading_comments,json=leadingComments" json:"leading_comments,omitempty"`
- TrailingComments *string `protobuf:"bytes,4,opt,name=trailing_comments,json=trailingComments" json:"trailing_comments,omitempty"`
- LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments" json:"leading_detached_comments,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SourceCodeInfo_Location) Reset() { *m = SourceCodeInfo_Location{} }
-func (m *SourceCodeInfo_Location) String() string { return proto.CompactTextString(m) }
-func (*SourceCodeInfo_Location) ProtoMessage() {}
-func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{19, 0}
-}
-func (m *SourceCodeInfo_Location) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SourceCodeInfo_Location.Unmarshal(m, b)
-}
-func (m *SourceCodeInfo_Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SourceCodeInfo_Location.Marshal(b, m, deterministic)
-}
-func (m *SourceCodeInfo_Location) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SourceCodeInfo_Location.Merge(m, src)
-}
-func (m *SourceCodeInfo_Location) XXX_Size() int {
- return xxx_messageInfo_SourceCodeInfo_Location.Size(m)
-}
-func (m *SourceCodeInfo_Location) XXX_DiscardUnknown() {
- xxx_messageInfo_SourceCodeInfo_Location.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SourceCodeInfo_Location proto.InternalMessageInfo
-
-func (m *SourceCodeInfo_Location) GetPath() []int32 {
- if m != nil {
- return m.Path
- }
- return nil
-}
-
-func (m *SourceCodeInfo_Location) GetSpan() []int32 {
- if m != nil {
- return m.Span
- }
- return nil
-}
-
-func (m *SourceCodeInfo_Location) GetLeadingComments() string {
- if m != nil && m.LeadingComments != nil {
- return *m.LeadingComments
- }
- return ""
-}
-
-func (m *SourceCodeInfo_Location) GetTrailingComments() string {
- if m != nil && m.TrailingComments != nil {
- return *m.TrailingComments
- }
- return ""
-}
-
-func (m *SourceCodeInfo_Location) GetLeadingDetachedComments() []string {
- if m != nil {
- return m.LeadingDetachedComments
- }
- return nil
-}
-
-// Describes the relationship between generated code and its original source
-// file. A GeneratedCodeInfo message is associated with only one generated
-// source file, but may contain references to different source .proto files.
-type GeneratedCodeInfo struct {
- // An Annotation connects some span of text in generated code to an element
- // of its generating .proto file.
- Annotation []*GeneratedCodeInfo_Annotation `protobuf:"bytes,1,rep,name=annotation" json:"annotation,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GeneratedCodeInfo) Reset() { *m = GeneratedCodeInfo{} }
-func (m *GeneratedCodeInfo) String() string { return proto.CompactTextString(m) }
-func (*GeneratedCodeInfo) ProtoMessage() {}
-func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{20}
-}
-func (m *GeneratedCodeInfo) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GeneratedCodeInfo.Unmarshal(m, b)
-}
-func (m *GeneratedCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GeneratedCodeInfo.Marshal(b, m, deterministic)
-}
-func (m *GeneratedCodeInfo) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GeneratedCodeInfo.Merge(m, src)
-}
-func (m *GeneratedCodeInfo) XXX_Size() int {
- return xxx_messageInfo_GeneratedCodeInfo.Size(m)
-}
-func (m *GeneratedCodeInfo) XXX_DiscardUnknown() {
- xxx_messageInfo_GeneratedCodeInfo.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GeneratedCodeInfo proto.InternalMessageInfo
-
-func (m *GeneratedCodeInfo) GetAnnotation() []*GeneratedCodeInfo_Annotation {
- if m != nil {
- return m.Annotation
- }
- return nil
-}
-
-type GeneratedCodeInfo_Annotation struct {
- // Identifies the element in the original source .proto file. This field
- // is formatted the same as SourceCodeInfo.Location.path.
- Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"`
- // Identifies the filesystem path to the original source .proto.
- SourceFile *string `protobuf:"bytes,2,opt,name=source_file,json=sourceFile" json:"source_file,omitempty"`
- // Identifies the starting offset in bytes in the generated code
- // that relates to the identified object.
- Begin *int32 `protobuf:"varint,3,opt,name=begin" json:"begin,omitempty"`
- // Identifies the ending offset in bytes in the generated code that
- // relates to the identified offset. The end offset should be one past
- // the last relevant byte (so the length of the text = end - begin).
- End *int32 `protobuf:"varint,4,opt,name=end" json:"end,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GeneratedCodeInfo_Annotation) Reset() { *m = GeneratedCodeInfo_Annotation{} }
-func (m *GeneratedCodeInfo_Annotation) String() string { return proto.CompactTextString(m) }
-func (*GeneratedCodeInfo_Annotation) ProtoMessage() {}
-func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) {
- return fileDescriptor_308767df5ffe18af, []int{20, 0}
-}
-func (m *GeneratedCodeInfo_Annotation) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_GeneratedCodeInfo_Annotation.Unmarshal(m, b)
-}
-func (m *GeneratedCodeInfo_Annotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_GeneratedCodeInfo_Annotation.Marshal(b, m, deterministic)
-}
-func (m *GeneratedCodeInfo_Annotation) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GeneratedCodeInfo_Annotation.Merge(m, src)
-}
-func (m *GeneratedCodeInfo_Annotation) XXX_Size() int {
- return xxx_messageInfo_GeneratedCodeInfo_Annotation.Size(m)
-}
-func (m *GeneratedCodeInfo_Annotation) XXX_DiscardUnknown() {
- xxx_messageInfo_GeneratedCodeInfo_Annotation.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GeneratedCodeInfo_Annotation proto.InternalMessageInfo
-
-func (m *GeneratedCodeInfo_Annotation) GetPath() []int32 {
- if m != nil {
- return m.Path
- }
- return nil
-}
-
-func (m *GeneratedCodeInfo_Annotation) GetSourceFile() string {
- if m != nil && m.SourceFile != nil {
- return *m.SourceFile
- }
- return ""
-}
-
-func (m *GeneratedCodeInfo_Annotation) GetBegin() int32 {
- if m != nil && m.Begin != nil {
- return *m.Begin
- }
- return 0
-}
-
-func (m *GeneratedCodeInfo_Annotation) GetEnd() int32 {
- if m != nil && m.End != nil {
- return *m.End
- }
- return 0
-}
-
-func init() {
- proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value)
- proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value)
- proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value)
- proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value)
- proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value)
- proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value)
- proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet")
- proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto")
- proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto")
- proto.RegisterType((*DescriptorProto_ExtensionRange)(nil), "google.protobuf.DescriptorProto.ExtensionRange")
- proto.RegisterType((*DescriptorProto_ReservedRange)(nil), "google.protobuf.DescriptorProto.ReservedRange")
- proto.RegisterType((*ExtensionRangeOptions)(nil), "google.protobuf.ExtensionRangeOptions")
- proto.RegisterType((*FieldDescriptorProto)(nil), "google.protobuf.FieldDescriptorProto")
- proto.RegisterType((*OneofDescriptorProto)(nil), "google.protobuf.OneofDescriptorProto")
- proto.RegisterType((*EnumDescriptorProto)(nil), "google.protobuf.EnumDescriptorProto")
- proto.RegisterType((*EnumDescriptorProto_EnumReservedRange)(nil), "google.protobuf.EnumDescriptorProto.EnumReservedRange")
- proto.RegisterType((*EnumValueDescriptorProto)(nil), "google.protobuf.EnumValueDescriptorProto")
- proto.RegisterType((*ServiceDescriptorProto)(nil), "google.protobuf.ServiceDescriptorProto")
- proto.RegisterType((*MethodDescriptorProto)(nil), "google.protobuf.MethodDescriptorProto")
- proto.RegisterType((*FileOptions)(nil), "google.protobuf.FileOptions")
- proto.RegisterType((*MessageOptions)(nil), "google.protobuf.MessageOptions")
- proto.RegisterType((*FieldOptions)(nil), "google.protobuf.FieldOptions")
- proto.RegisterType((*OneofOptions)(nil), "google.protobuf.OneofOptions")
- proto.RegisterType((*EnumOptions)(nil), "google.protobuf.EnumOptions")
- proto.RegisterType((*EnumValueOptions)(nil), "google.protobuf.EnumValueOptions")
- proto.RegisterType((*ServiceOptions)(nil), "google.protobuf.ServiceOptions")
- proto.RegisterType((*MethodOptions)(nil), "google.protobuf.MethodOptions")
- proto.RegisterType((*UninterpretedOption)(nil), "google.protobuf.UninterpretedOption")
- proto.RegisterType((*UninterpretedOption_NamePart)(nil), "google.protobuf.UninterpretedOption.NamePart")
- proto.RegisterType((*SourceCodeInfo)(nil), "google.protobuf.SourceCodeInfo")
- proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location")
- proto.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo")
- proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation")
-}
-
-func init() { proto.RegisterFile("descriptor.proto", fileDescriptor_308767df5ffe18af) }
-
-var fileDescriptor_308767df5ffe18af = []byte{
- // 2522 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x6f, 0xdb, 0xc8,
- 0x15, 0x5f, 0x7d, 0x5a, 0x7a, 0x92, 0x65, 0x7a, 0xec, 0x75, 0x18, 0xef, 0x47, 0x1c, 0xed, 0x66,
- 0xe3, 0x24, 0xbb, 0xca, 0xc2, 0x49, 0x9c, 0xac, 0x53, 0x6c, 0x2b, 0x4b, 0x8c, 0x57, 0xa9, 0xbe,
- 0x4a, 0xc9, 0xdd, 0x64, 0x8b, 0x82, 0x18, 0x93, 0x23, 0x89, 0x09, 0x45, 0x72, 0x49, 0x2a, 0x89,
- 0x83, 0x1e, 0x02, 0xf4, 0x54, 0xa0, 0x7f, 0x40, 0x51, 0x14, 0x3d, 0xf4, 0xb2, 0x40, 0xff, 0x80,
- 0x02, 0xed, 0xbd, 0xd7, 0x02, 0xbd, 0xf7, 0x50, 0xa0, 0x05, 0xda, 0x3f, 0xa1, 0xc7, 0x62, 0x66,
- 0x48, 0x8a, 0xd4, 0x47, 0xe2, 0x5d, 0x20, 0xd9, 0x93, 0x3d, 0xef, 0xfd, 0xde, 0x9b, 0x37, 0x8f,
- 0xbf, 0x79, 0xf3, 0x66, 0x04, 0x82, 0x46, 0x5c, 0xd5, 0xd1, 0x6d, 0xcf, 0x72, 0x2a, 0xb6, 0x63,
- 0x79, 0x16, 0x5a, 0x1b, 0x5a, 0xd6, 0xd0, 0x20, 0x7c, 0x74, 0x32, 0x19, 0x94, 0x5b, 0xb0, 0x7e,
- 0x4f, 0x37, 0x48, 0x3d, 0x04, 0xf6, 0x88, 0x87, 0xee, 0x40, 0x7a, 0xa0, 0x1b, 0x44, 0x4c, 0xec,
- 0xa4, 0x76, 0x0b, 0x7b, 0x1f, 0x56, 0x66, 0x8c, 0x2a, 0x71, 0x8b, 0x2e, 0x15, 0xcb, 0xcc, 0xa2,
- 0xfc, 0xef, 0x34, 0x6c, 0x2c, 0xd0, 0x22, 0x04, 0x69, 0x13, 0x8f, 0xa9, 0xc7, 0xc4, 0x6e, 0x5e,
- 0x66, 0xff, 0x23, 0x11, 0x56, 0x6c, 0xac, 0x3e, 0xc6, 0x43, 0x22, 0x26, 0x99, 0x38, 0x18, 0xa2,
- 0xf7, 0x01, 0x34, 0x62, 0x13, 0x53, 0x23, 0xa6, 0x7a, 0x2a, 0xa6, 0x76, 0x52, 0xbb, 0x79, 0x39,
- 0x22, 0x41, 0xd7, 0x60, 0xdd, 0x9e, 0x9c, 0x18, 0xba, 0xaa, 0x44, 0x60, 0xb0, 0x93, 0xda, 0xcd,
- 0xc8, 0x02, 0x57, 0xd4, 0xa7, 0xe0, 0xcb, 0xb0, 0xf6, 0x94, 0xe0, 0xc7, 0x51, 0x68, 0x81, 0x41,
- 0x4b, 0x54, 0x1c, 0x01, 0xd6, 0xa0, 0x38, 0x26, 0xae, 0x8b, 0x87, 0x44, 0xf1, 0x4e, 0x6d, 0x22,
- 0xa6, 0xd9, 0xea, 0x77, 0xe6, 0x56, 0x3f, 0xbb, 0xf2, 0x82, 0x6f, 0xd5, 0x3f, 0xb5, 0x09, 0xaa,
- 0x42, 0x9e, 0x98, 0x93, 0x31, 0xf7, 0x90, 0x59, 0x92, 0x3f, 0xc9, 0x9c, 0x8c, 0x67, 0xbd, 0xe4,
- 0xa8, 0x99, 0xef, 0x62, 0xc5, 0x25, 0xce, 0x13, 0x5d, 0x25, 0x62, 0x96, 0x39, 0xb8, 0x3c, 0xe7,
- 0xa0, 0xc7, 0xf5, 0xb3, 0x3e, 0x02, 0x3b, 0x54, 0x83, 0x3c, 0x79, 0xe6, 0x11, 0xd3, 0xd5, 0x2d,
- 0x53, 0x5c, 0x61, 0x4e, 0x2e, 0x2d, 0xf8, 0x8a, 0xc4, 0xd0, 0x66, 0x5d, 0x4c, 0xed, 0xd0, 0x3e,
- 0xac, 0x58, 0xb6, 0xa7, 0x5b, 0xa6, 0x2b, 0xe6, 0x76, 0x12, 0xbb, 0x85, 0xbd, 0x77, 0x17, 0x12,
- 0xa1, 0xc3, 0x31, 0x72, 0x00, 0x46, 0x0d, 0x10, 0x5c, 0x6b, 0xe2, 0xa8, 0x44, 0x51, 0x2d, 0x8d,
- 0x28, 0xba, 0x39, 0xb0, 0xc4, 0x3c, 0x73, 0x70, 0x61, 0x7e, 0x21, 0x0c, 0x58, 0xb3, 0x34, 0xd2,
- 0x30, 0x07, 0x96, 0x5c, 0x72, 0x63, 0x63, 0xb4, 0x05, 0x59, 0xf7, 0xd4, 0xf4, 0xf0, 0x33, 0xb1,
- 0xc8, 0x18, 0xe2, 0x8f, 0xca, 0x7f, 0xce, 0xc2, 0xda, 0x59, 0x28, 0x76, 0x17, 0x32, 0x03, 0xba,
- 0x4a, 0x31, 0xf9, 0x6d, 0x72, 0xc0, 0x6d, 0xe2, 0x49, 0xcc, 0x7e, 0xc7, 0x24, 0x56, 0xa1, 0x60,
- 0x12, 0xd7, 0x23, 0x1a, 0x67, 0x44, 0xea, 0x8c, 0x9c, 0x02, 0x6e, 0x34, 0x4f, 0xa9, 0xf4, 0x77,
- 0xa2, 0xd4, 0x03, 0x58, 0x0b, 0x43, 0x52, 0x1c, 0x6c, 0x0e, 0x03, 0x6e, 0x5e, 0x7f, 0x55, 0x24,
- 0x15, 0x29, 0xb0, 0x93, 0xa9, 0x99, 0x5c, 0x22, 0xb1, 0x31, 0xaa, 0x03, 0x58, 0x26, 0xb1, 0x06,
- 0x8a, 0x46, 0x54, 0x43, 0xcc, 0x2d, 0xc9, 0x52, 0x87, 0x42, 0xe6, 0xb2, 0x64, 0x71, 0xa9, 0x6a,
- 0xa0, 0xcf, 0xa6, 0x54, 0x5b, 0x59, 0xc2, 0x94, 0x16, 0xdf, 0x64, 0x73, 0x6c, 0x3b, 0x86, 0x92,
- 0x43, 0x28, 0xef, 0x89, 0xe6, 0xaf, 0x2c, 0xcf, 0x82, 0xa8, 0xbc, 0x72, 0x65, 0xb2, 0x6f, 0xc6,
- 0x17, 0xb6, 0xea, 0x44, 0x87, 0xe8, 0x03, 0x08, 0x05, 0x0a, 0xa3, 0x15, 0xb0, 0x2a, 0x54, 0x0c,
- 0x84, 0x6d, 0x3c, 0x26, 0xdb, 0xcf, 0xa1, 0x14, 0x4f, 0x0f, 0xda, 0x84, 0x8c, 0xeb, 0x61, 0xc7,
- 0x63, 0x2c, 0xcc, 0xc8, 0x7c, 0x80, 0x04, 0x48, 0x11, 0x53, 0x63, 0x55, 0x2e, 0x23, 0xd3, 0x7f,
- 0xd1, 0x8f, 0xa6, 0x0b, 0x4e, 0xb1, 0x05, 0x7f, 0x34, 0xff, 0x45, 0x63, 0x9e, 0x67, 0xd7, 0xbd,
- 0x7d, 0x1b, 0x56, 0x63, 0x0b, 0x38, 0xeb, 0xd4, 0xe5, 0x5f, 0xc0, 0xdb, 0x0b, 0x5d, 0xa3, 0x07,
- 0xb0, 0x39, 0x31, 0x75, 0xd3, 0x23, 0x8e, 0xed, 0x10, 0xca, 0x58, 0x3e, 0x95, 0xf8, 0x9f, 0x95,
- 0x25, 0x9c, 0x3b, 0x8e, 0xa2, 0xb9, 0x17, 0x79, 0x63, 0x32, 0x2f, 0xbc, 0x9a, 0xcf, 0xfd, 0x77,
- 0x45, 0x78, 0xf1, 0xe2, 0xc5, 0x8b, 0x64, 0xf9, 0x37, 0x59, 0xd8, 0x5c, 0xb4, 0x67, 0x16, 0x6e,
- 0xdf, 0x2d, 0xc8, 0x9a, 0x93, 0xf1, 0x09, 0x71, 0x58, 0x92, 0x32, 0xb2, 0x3f, 0x42, 0x55, 0xc8,
- 0x18, 0xf8, 0x84, 0x18, 0x62, 0x7a, 0x27, 0xb1, 0x5b, 0xda, 0xbb, 0x76, 0xa6, 0x5d, 0x59, 0x69,
- 0x52, 0x13, 0x99, 0x5b, 0xa2, 0xcf, 0x21, 0xed, 0x97, 0x68, 0xea, 0xe1, 0xea, 0xd9, 0x3c, 0xd0,
- 0xbd, 0x24, 0x33, 0x3b, 0xf4, 0x0e, 0xe4, 0xe9, 0x5f, 0xce, 0x8d, 0x2c, 0x8b, 0x39, 0x47, 0x05,
- 0x94, 0x17, 0x68, 0x1b, 0x72, 0x6c, 0x9b, 0x68, 0x24, 0x38, 0xda, 0xc2, 0x31, 0x25, 0x96, 0x46,
- 0x06, 0x78, 0x62, 0x78, 0xca, 0x13, 0x6c, 0x4c, 0x08, 0x23, 0x7c, 0x5e, 0x2e, 0xfa, 0xc2, 0x9f,
- 0x52, 0x19, 0xba, 0x00, 0x05, 0xbe, 0xab, 0x74, 0x53, 0x23, 0xcf, 0x58, 0xf5, 0xcc, 0xc8, 0x7c,
- 0xa3, 0x35, 0xa8, 0x84, 0x4e, 0xff, 0xc8, 0xb5, 0xcc, 0x80, 0x9a, 0x6c, 0x0a, 0x2a, 0x60, 0xd3,
- 0xdf, 0x9e, 0x2d, 0xdc, 0xef, 0x2d, 0x5e, 0xde, 0x2c, 0xa7, 0xca, 0x7f, 0x4a, 0x42, 0x9a, 0xd5,
- 0x8b, 0x35, 0x28, 0xf4, 0x1f, 0x76, 0x25, 0xa5, 0xde, 0x39, 0x3e, 0x6c, 0x4a, 0x42, 0x02, 0x95,
- 0x00, 0x98, 0xe0, 0x5e, 0xb3, 0x53, 0xed, 0x0b, 0xc9, 0x70, 0xdc, 0x68, 0xf7, 0xf7, 0x6f, 0x0a,
- 0xa9, 0xd0, 0xe0, 0x98, 0x0b, 0xd2, 0x51, 0xc0, 0x8d, 0x3d, 0x21, 0x83, 0x04, 0x28, 0x72, 0x07,
- 0x8d, 0x07, 0x52, 0x7d, 0xff, 0xa6, 0x90, 0x8d, 0x4b, 0x6e, 0xec, 0x09, 0x2b, 0x68, 0x15, 0xf2,
- 0x4c, 0x72, 0xd8, 0xe9, 0x34, 0x85, 0x5c, 0xe8, 0xb3, 0xd7, 0x97, 0x1b, 0xed, 0x23, 0x21, 0x1f,
- 0xfa, 0x3c, 0x92, 0x3b, 0xc7, 0x5d, 0x01, 0x42, 0x0f, 0x2d, 0xa9, 0xd7, 0xab, 0x1e, 0x49, 0x42,
- 0x21, 0x44, 0x1c, 0x3e, 0xec, 0x4b, 0x3d, 0xa1, 0x18, 0x0b, 0xeb, 0xc6, 0x9e, 0xb0, 0x1a, 0x4e,
- 0x21, 0xb5, 0x8f, 0x5b, 0x42, 0x09, 0xad, 0xc3, 0x2a, 0x9f, 0x22, 0x08, 0x62, 0x6d, 0x46, 0xb4,
- 0x7f, 0x53, 0x10, 0xa6, 0x81, 0x70, 0x2f, 0xeb, 0x31, 0xc1, 0xfe, 0x4d, 0x01, 0x95, 0x6b, 0x90,
- 0x61, 0xec, 0x42, 0x08, 0x4a, 0xcd, 0xea, 0xa1, 0xd4, 0x54, 0x3a, 0xdd, 0x7e, 0xa3, 0xd3, 0xae,
- 0x36, 0x85, 0xc4, 0x54, 0x26, 0x4b, 0x3f, 0x39, 0x6e, 0xc8, 0x52, 0x5d, 0x48, 0x46, 0x65, 0x5d,
- 0xa9, 0xda, 0x97, 0xea, 0x42, 0xaa, 0xac, 0xc2, 0xe6, 0xa2, 0x3a, 0xb9, 0x70, 0x67, 0x44, 0x3e,
- 0x71, 0x72, 0xc9, 0x27, 0x66, 0xbe, 0xe6, 0x3e, 0xf1, 0xbf, 0x92, 0xb0, 0xb1, 0xe0, 0xac, 0x58,
- 0x38, 0xc9, 0x0f, 0x21, 0xc3, 0x29, 0xca, 0x4f, 0xcf, 0x2b, 0x0b, 0x0f, 0x1d, 0x46, 0xd8, 0xb9,
- 0x13, 0x94, 0xd9, 0x45, 0x3b, 0x88, 0xd4, 0x92, 0x0e, 0x82, 0xba, 0x98, 0xab, 0xe9, 0x3f, 0x9f,
- 0xab, 0xe9, 0xfc, 0xd8, 0xdb, 0x3f, 0xcb, 0xb1, 0xc7, 0x64, 0xdf, 0xae, 0xb6, 0x67, 0x16, 0xd4,
- 0xf6, 0xbb, 0xb0, 0x3e, 0xe7, 0xe8, 0xcc, 0x35, 0xf6, 0x97, 0x09, 0x10, 0x97, 0x25, 0xe7, 0x15,
- 0x95, 0x2e, 0x19, 0xab, 0x74, 0x77, 0x67, 0x33, 0x78, 0x71, 0xf9, 0x47, 0x98, 0xfb, 0xd6, 0xdf,
- 0x24, 0x60, 0x6b, 0x71, 0xa7, 0xb8, 0x30, 0x86, 0xcf, 0x21, 0x3b, 0x26, 0xde, 0xc8, 0x0a, 0xba,
- 0xa5, 0x8f, 0x16, 0x9c, 0xc1, 0x54, 0x3d, 0xfb, 0xb1, 0x7d, 0xab, 0xe8, 0x21, 0x9e, 0x5a, 0xd6,
- 0xee, 0xf1, 0x68, 0xe6, 0x22, 0xfd, 0x55, 0x12, 0xde, 0x5e, 0xe8, 0x7c, 0x61, 0xa0, 0xef, 0x01,
- 0xe8, 0xa6, 0x3d, 0xf1, 0x78, 0x47, 0xc4, 0x0b, 0x6c, 0x9e, 0x49, 0x58, 0xf1, 0xa2, 0xc5, 0x73,
- 0xe2, 0x85, 0xfa, 0x14, 0xd3, 0x03, 0x17, 0x31, 0xc0, 0x9d, 0x69, 0xa0, 0x69, 0x16, 0xe8, 0xfb,
- 0x4b, 0x56, 0x3a, 0x47, 0xcc, 0x4f, 0x41, 0x50, 0x0d, 0x9d, 0x98, 0x9e, 0xe2, 0x7a, 0x0e, 0xc1,
- 0x63, 0xdd, 0x1c, 0xb2, 0x13, 0x24, 0x77, 0x90, 0x19, 0x60, 0xc3, 0x25, 0xf2, 0x1a, 0x57, 0xf7,
- 0x02, 0x2d, 0xb5, 0x60, 0x04, 0x72, 0x22, 0x16, 0xd9, 0x98, 0x05, 0x57, 0x87, 0x16, 0xe5, 0x5f,
- 0xe7, 0xa1, 0x10, 0xe9, 0xab, 0xd1, 0x45, 0x28, 0x3e, 0xc2, 0x4f, 0xb0, 0x12, 0xdc, 0x95, 0x78,
- 0x26, 0x0a, 0x54, 0xd6, 0xf5, 0xef, 0x4b, 0x9f, 0xc2, 0x26, 0x83, 0x58, 0x13, 0x8f, 0x38, 0x8a,
- 0x6a, 0x60, 0xd7, 0x65, 0x49, 0xcb, 0x31, 0x28, 0xa2, 0xba, 0x0e, 0x55, 0xd5, 0x02, 0x0d, 0xba,
- 0x05, 0x1b, 0xcc, 0x62, 0x3c, 0x31, 0x3c, 0xdd, 0x36, 0x88, 0x42, 0x6f, 0x6f, 0x2e, 0x3b, 0x49,
- 0xc2, 0xc8, 0xd6, 0x29, 0xa2, 0xe5, 0x03, 0x68, 0x44, 0x2e, 0xaa, 0xc3, 0x7b, 0xcc, 0x6c, 0x48,
- 0x4c, 0xe2, 0x60, 0x8f, 0x28, 0xe4, 0xeb, 0x09, 0x36, 0x5c, 0x05, 0x9b, 0x9a, 0x32, 0xc2, 0xee,
- 0x48, 0xdc, 0xa4, 0x0e, 0x0e, 0x93, 0x62, 0x42, 0x3e, 0x4f, 0x81, 0x47, 0x3e, 0x4e, 0x62, 0xb0,
- 0xaa, 0xa9, 0x7d, 0x81, 0xdd, 0x11, 0x3a, 0x80, 0x2d, 0xe6, 0xc5, 0xf5, 0x1c, 0xdd, 0x1c, 0x2a,
- 0xea, 0x88, 0xa8, 0x8f, 0x95, 0x89, 0x37, 0xb8, 0x23, 0xbe, 0x13, 0x9d, 0x9f, 0x45, 0xd8, 0x63,
- 0x98, 0x1a, 0x85, 0x1c, 0x7b, 0x83, 0x3b, 0xa8, 0x07, 0x45, 0xfa, 0x31, 0xc6, 0xfa, 0x73, 0xa2,
- 0x0c, 0x2c, 0x87, 0x1d, 0x8d, 0xa5, 0x05, 0xa5, 0x29, 0x92, 0xc1, 0x4a, 0xc7, 0x37, 0x68, 0x59,
- 0x1a, 0x39, 0xc8, 0xf4, 0xba, 0x92, 0x54, 0x97, 0x0b, 0x81, 0x97, 0x7b, 0x96, 0x43, 0x09, 0x35,
- 0xb4, 0xc2, 0x04, 0x17, 0x38, 0xa1, 0x86, 0x56, 0x90, 0xde, 0x5b, 0xb0, 0xa1, 0xaa, 0x7c, 0xcd,
- 0xba, 0xaa, 0xf8, 0x77, 0x2c, 0x57, 0x14, 0x62, 0xc9, 0x52, 0xd5, 0x23, 0x0e, 0xf0, 0x39, 0xee,
- 0xa2, 0xcf, 0xe0, 0xed, 0x69, 0xb2, 0xa2, 0x86, 0xeb, 0x73, 0xab, 0x9c, 0x35, 0xbd, 0x05, 0x1b,
- 0xf6, 0xe9, 0xbc, 0x21, 0x8a, 0xcd, 0x68, 0x9f, 0xce, 0x9a, 0xdd, 0x86, 0x4d, 0x7b, 0x64, 0xcf,
- 0xdb, 0x5d, 0x8d, 0xda, 0x21, 0x7b, 0x64, 0xcf, 0x1a, 0x5e, 0x62, 0x17, 0x6e, 0x87, 0xa8, 0xd8,
- 0x23, 0x9a, 0x78, 0x2e, 0x0a, 0x8f, 0x28, 0xd0, 0x75, 0x10, 0x54, 0x55, 0x21, 0x26, 0x3e, 0x31,
- 0x88, 0x82, 0x1d, 0x62, 0x62, 0x57, 0xbc, 0x10, 0x05, 0x97, 0x54, 0x55, 0x62, 0xda, 0x2a, 0x53,
- 0xa2, 0xab, 0xb0, 0x6e, 0x9d, 0x3c, 0x52, 0x39, 0x25, 0x15, 0xdb, 0x21, 0x03, 0xfd, 0x99, 0xf8,
- 0x21, 0xcb, 0xef, 0x1a, 0x55, 0x30, 0x42, 0x76, 0x99, 0x18, 0x5d, 0x01, 0x41, 0x75, 0x47, 0xd8,
- 0xb1, 0x59, 0x4d, 0x76, 0x6d, 0xac, 0x12, 0xf1, 0x12, 0x87, 0x72, 0x79, 0x3b, 0x10, 0xd3, 0x2d,
- 0xe1, 0x3e, 0xd5, 0x07, 0x5e, 0xe0, 0xf1, 0x32, 0xdf, 0x12, 0x4c, 0xe6, 0x7b, 0xdb, 0x05, 0x81,
- 0xa6, 0x22, 0x36, 0xf1, 0x2e, 0x83, 0x95, 0xec, 0x91, 0x1d, 0x9d, 0xf7, 0x03, 0x58, 0xa5, 0xc8,
- 0xe9, 0xa4, 0x57, 0x78, 0x43, 0x66, 0x8f, 0x22, 0x33, 0xde, 0x84, 0x2d, 0x0a, 0x1a, 0x13, 0x0f,
- 0x6b, 0xd8, 0xc3, 0x11, 0xf4, 0xc7, 0x0c, 0x4d, 0xf3, 0xde, 0xf2, 0x95, 0xb1, 0x38, 0x9d, 0xc9,
- 0xc9, 0x69, 0xc8, 0xac, 0x4f, 0x78, 0x9c, 0x54, 0x16, 0x70, 0xeb, 0xb5, 0x35, 0xdd, 0xe5, 0x03,
- 0x28, 0x46, 0x89, 0x8f, 0xf2, 0xc0, 0xa9, 0x2f, 0x24, 0x68, 0x17, 0x54, 0xeb, 0xd4, 0x69, 0xff,
- 0xf2, 0x95, 0x24, 0x24, 0x69, 0x1f, 0xd5, 0x6c, 0xf4, 0x25, 0x45, 0x3e, 0x6e, 0xf7, 0x1b, 0x2d,
- 0x49, 0x48, 0x45, 0x1b, 0xf6, 0xbf, 0x26, 0xa1, 0x14, 0xbf, 0x7b, 0xa1, 0x1f, 0xc0, 0xb9, 0xe0,
- 0xa1, 0xc4, 0x25, 0x9e, 0xf2, 0x54, 0x77, 0xd8, 0x5e, 0x1c, 0x63, 0x7e, 0x2e, 0x86, 0x6c, 0xd8,
- 0xf4, 0x51, 0x3d, 0xe2, 0x7d, 0xa9, 0x3b, 0x74, 0xa7, 0x8d, 0xb1, 0x87, 0x9a, 0x70, 0xc1, 0xb4,
- 0x14, 0xd7, 0xc3, 0xa6, 0x86, 0x1d, 0x4d, 0x99, 0x3e, 0x51, 0x29, 0x58, 0x55, 0x89, 0xeb, 0x5a,
- 0xfc, 0x0c, 0x0c, 0xbd, 0xbc, 0x6b, 0x5a, 0x3d, 0x1f, 0x3c, 0x3d, 0x1c, 0xaa, 0x3e, 0x74, 0x86,
- 0xb9, 0xa9, 0x65, 0xcc, 0x7d, 0x07, 0xf2, 0x63, 0x6c, 0x2b, 0xc4, 0xf4, 0x9c, 0x53, 0xd6, 0x71,
- 0xe7, 0xe4, 0xdc, 0x18, 0xdb, 0x12, 0x1d, 0xbf, 0x99, 0x8b, 0xcf, 0x3f, 0x52, 0x50, 0x8c, 0x76,
- 0xdd, 0xf4, 0x12, 0xa3, 0xb2, 0x03, 0x2a, 0xc1, 0x4a, 0xd8, 0x07, 0x2f, 0xed, 0xd1, 0x2b, 0x35,
- 0x7a, 0x72, 0x1d, 0x64, 0x79, 0x2f, 0x2c, 0x73, 0x4b, 0xda, 0x35, 0x50, 0x6a, 0x11, 0xde, 0x7b,
- 0xe4, 0x64, 0x7f, 0x84, 0x8e, 0x20, 0xfb, 0xc8, 0x65, 0xbe, 0xb3, 0xcc, 0xf7, 0x87, 0x2f, 0xf7,
- 0x7d, 0xbf, 0xc7, 0x9c, 0xe7, 0xef, 0xf7, 0x94, 0x76, 0x47, 0x6e, 0x55, 0x9b, 0xb2, 0x6f, 0x8e,
- 0xce, 0x43, 0xda, 0xc0, 0xcf, 0x4f, 0xe3, 0x67, 0x1c, 0x13, 0x9d, 0x35, 0xf1, 0xe7, 0x21, 0xfd,
- 0x94, 0xe0, 0xc7, 0xf1, 0x93, 0x85, 0x89, 0x5e, 0x23, 0xf5, 0xaf, 0x43, 0x86, 0xe5, 0x0b, 0x01,
- 0xf8, 0x19, 0x13, 0xde, 0x42, 0x39, 0x48, 0xd7, 0x3a, 0x32, 0xa5, 0xbf, 0x00, 0x45, 0x2e, 0x55,
- 0xba, 0x0d, 0xa9, 0x26, 0x09, 0xc9, 0xf2, 0x2d, 0xc8, 0xf2, 0x24, 0xd0, 0xad, 0x11, 0xa6, 0x41,
- 0x78, 0xcb, 0x1f, 0xfa, 0x3e, 0x12, 0x81, 0xf6, 0xb8, 0x75, 0x28, 0xc9, 0x42, 0x32, 0xfa, 0x79,
- 0x5d, 0x28, 0x46, 0x1b, 0xee, 0x37, 0xc3, 0xa9, 0xbf, 0x24, 0xa0, 0x10, 0x69, 0xa0, 0x69, 0xe7,
- 0x83, 0x0d, 0xc3, 0x7a, 0xaa, 0x60, 0x43, 0xc7, 0xae, 0x4f, 0x0a, 0x60, 0xa2, 0x2a, 0x95, 0x9c,
- 0xf5, 0xa3, 0xbd, 0x91, 0xe0, 0x7f, 0x9f, 0x00, 0x61, 0xb6, 0x77, 0x9d, 0x09, 0x30, 0xf1, 0xbd,
- 0x06, 0xf8, 0xbb, 0x04, 0x94, 0xe2, 0x0d, 0xeb, 0x4c, 0x78, 0x17, 0xbf, 0xd7, 0xf0, 0xfe, 0x99,
- 0x84, 0xd5, 0x58, 0x9b, 0x7a, 0xd6, 0xe8, 0xbe, 0x86, 0x75, 0x5d, 0x23, 0x63, 0xdb, 0xf2, 0x88,
- 0xa9, 0x9e, 0x2a, 0x06, 0x79, 0x42, 0x0c, 0xb1, 0xcc, 0x0a, 0xc5, 0xf5, 0x97, 0x37, 0xc2, 0x95,
- 0xc6, 0xd4, 0xae, 0x49, 0xcd, 0x0e, 0x36, 0x1a, 0x75, 0xa9, 0xd5, 0xed, 0xf4, 0xa5, 0x76, 0xed,
- 0xa1, 0x72, 0xdc, 0xfe, 0x71, 0xbb, 0xf3, 0x65, 0x5b, 0x16, 0xf4, 0x19, 0xd8, 0x6b, 0xdc, 0xea,
- 0x5d, 0x10, 0x66, 0x83, 0x42, 0xe7, 0x60, 0x51, 0x58, 0xc2, 0x5b, 0x68, 0x03, 0xd6, 0xda, 0x1d,
- 0xa5, 0xd7, 0xa8, 0x4b, 0x8a, 0x74, 0xef, 0x9e, 0x54, 0xeb, 0xf7, 0xf8, 0xd3, 0x46, 0x88, 0xee,
- 0xc7, 0x37, 0xf5, 0x6f, 0x53, 0xb0, 0xb1, 0x20, 0x12, 0x54, 0xf5, 0x2f, 0x25, 0xfc, 0x9e, 0xf4,
- 0xc9, 0x59, 0xa2, 0xaf, 0xd0, 0xae, 0xa0, 0x8b, 0x1d, 0xcf, 0xbf, 0xc3, 0x5c, 0x01, 0x9a, 0x25,
- 0xd3, 0xd3, 0x07, 0x3a, 0x71, 0xfc, 0x97, 0x20, 0x7e, 0x53, 0x59, 0x9b, 0xca, 0xf9, 0x63, 0xd0,
- 0xc7, 0x80, 0x6c, 0xcb, 0xd5, 0x3d, 0xfd, 0x09, 0x51, 0x74, 0x33, 0x78, 0x36, 0xa2, 0x37, 0x97,
- 0xb4, 0x2c, 0x04, 0x9a, 0x86, 0xe9, 0x85, 0x68, 0x93, 0x0c, 0xf1, 0x0c, 0x9a, 0x16, 0xf0, 0x94,
- 0x2c, 0x04, 0x9a, 0x10, 0x7d, 0x11, 0x8a, 0x9a, 0x35, 0xa1, 0xed, 0x1c, 0xc7, 0xd1, 0xf3, 0x22,
- 0x21, 0x17, 0xb8, 0x2c, 0x84, 0xf8, 0x8d, 0xfa, 0xf4, 0xbd, 0xaa, 0x28, 0x17, 0xb8, 0x8c, 0x43,
- 0x2e, 0xc3, 0x1a, 0x1e, 0x0e, 0x1d, 0xea, 0x3c, 0x70, 0xc4, 0xaf, 0x1e, 0xa5, 0x50, 0xcc, 0x80,
- 0xdb, 0xf7, 0x21, 0x17, 0xe4, 0x81, 0x1e, 0xc9, 0x34, 0x13, 0x8a, 0xcd, 0xef, 0xd3, 0xc9, 0xdd,
- 0xbc, 0x9c, 0x33, 0x03, 0xe5, 0x45, 0x28, 0xea, 0xae, 0x32, 0x7d, 0x7e, 0x4f, 0xee, 0x24, 0x77,
- 0x73, 0x72, 0x41, 0x77, 0xc3, 0xa7, 0xcb, 0xf2, 0x37, 0x49, 0x28, 0xc5, 0x7f, 0x3e, 0x40, 0x75,
- 0xc8, 0x19, 0x96, 0x8a, 0x19, 0xb5, 0xf8, 0x6f, 0x57, 0xbb, 0xaf, 0xf8, 0xc5, 0xa1, 0xd2, 0xf4,
- 0xf1, 0x72, 0x68, 0xb9, 0xfd, 0xb7, 0x04, 0xe4, 0x02, 0x31, 0xda, 0x82, 0xb4, 0x8d, 0xbd, 0x11,
- 0x73, 0x97, 0x39, 0x4c, 0x0a, 0x09, 0x99, 0x8d, 0xa9, 0xdc, 0xb5, 0xb1, 0xc9, 0x28, 0xe0, 0xcb,
- 0xe9, 0x98, 0x7e, 0x57, 0x83, 0x60, 0x8d, 0xdd, 0x6b, 0xac, 0xf1, 0x98, 0x98, 0x9e, 0x1b, 0x7c,
- 0x57, 0x5f, 0x5e, 0xf3, 0xc5, 0xe8, 0x1a, 0xac, 0x7b, 0x0e, 0xd6, 0x8d, 0x18, 0x36, 0xcd, 0xb0,
- 0x42, 0xa0, 0x08, 0xc1, 0x07, 0x70, 0x3e, 0xf0, 0xab, 0x11, 0x0f, 0xab, 0x23, 0xa2, 0x4d, 0x8d,
- 0xb2, 0xec, 0xfd, 0xe2, 0x9c, 0x0f, 0xa8, 0xfb, 0xfa, 0xc0, 0xb6, 0xfc, 0xf7, 0x04, 0xac, 0x07,
- 0x37, 0x31, 0x2d, 0x4c, 0x56, 0x0b, 0x00, 0x9b, 0xa6, 0xe5, 0x45, 0xd3, 0x35, 0x4f, 0xe5, 0x39,
- 0xbb, 0x4a, 0x35, 0x34, 0x92, 0x23, 0x0e, 0xb6, 0xc7, 0x00, 0x53, 0xcd, 0xd2, 0xb4, 0x5d, 0x80,
- 0x82, 0xff, 0xdb, 0x10, 0xfb, 0x81, 0x91, 0xdf, 0xdd, 0x81, 0x8b, 0xe8, 0x95, 0x0d, 0x6d, 0x42,
- 0xe6, 0x84, 0x0c, 0x75, 0xd3, 0x7f, 0xf1, 0xe5, 0x83, 0xe0, 0x85, 0x25, 0x1d, 0xbe, 0xb0, 0x1c,
- 0xfe, 0x0c, 0x36, 0x54, 0x6b, 0x3c, 0x1b, 0xee, 0xa1, 0x30, 0xf3, 0x7e, 0xe0, 0x7e, 0x91, 0xf8,
- 0x0a, 0xa6, 0x2d, 0xe6, 0xff, 0x12, 0x89, 0x3f, 0x24, 0x53, 0x47, 0xdd, 0xc3, 0x3f, 0x26, 0xb7,
- 0x8f, 0xb8, 0x69, 0x37, 0x58, 0xa9, 0x4c, 0x06, 0x06, 0x51, 0x69, 0xf4, 0xff, 0x0f, 0x00, 0x00,
- 0xff, 0xff, 0x88, 0x17, 0xc1, 0xbe, 0x38, 0x1d, 0x00, 0x00,
-}
diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go
deleted file mode 100644
index 165b2110d..000000000
--- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go
+++ /dev/null
@@ -1,752 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: descriptor.proto
-
-package descriptor
-
-import (
- fmt "fmt"
- github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
- proto "github.com/gogo/protobuf/proto"
- math "math"
- reflect "reflect"
- sort "sort"
- strconv "strconv"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-func (this *FileDescriptorSet) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 5)
- s = append(s, "&descriptor.FileDescriptorSet{")
- if this.File != nil {
- s = append(s, "File: "+fmt.Sprintf("%#v", this.File)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *FileDescriptorProto) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 16)
- s = append(s, "&descriptor.FileDescriptorProto{")
- if this.Name != nil {
- s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
- }
- if this.Package != nil {
- s = append(s, "Package: "+valueToGoStringDescriptor(this.Package, "string")+",\n")
- }
- if this.Dependency != nil {
- s = append(s, "Dependency: "+fmt.Sprintf("%#v", this.Dependency)+",\n")
- }
- if this.PublicDependency != nil {
- s = append(s, "PublicDependency: "+fmt.Sprintf("%#v", this.PublicDependency)+",\n")
- }
- if this.WeakDependency != nil {
- s = append(s, "WeakDependency: "+fmt.Sprintf("%#v", this.WeakDependency)+",\n")
- }
- if this.MessageType != nil {
- s = append(s, "MessageType: "+fmt.Sprintf("%#v", this.MessageType)+",\n")
- }
- if this.EnumType != nil {
- s = append(s, "EnumType: "+fmt.Sprintf("%#v", this.EnumType)+",\n")
- }
- if this.Service != nil {
- s = append(s, "Service: "+fmt.Sprintf("%#v", this.Service)+",\n")
- }
- if this.Extension != nil {
- s = append(s, "Extension: "+fmt.Sprintf("%#v", this.Extension)+",\n")
- }
- if this.Options != nil {
- s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
- }
- if this.SourceCodeInfo != nil {
- s = append(s, "SourceCodeInfo: "+fmt.Sprintf("%#v", this.SourceCodeInfo)+",\n")
- }
- if this.Syntax != nil {
- s = append(s, "Syntax: "+valueToGoStringDescriptor(this.Syntax, "string")+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *DescriptorProto) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 14)
- s = append(s, "&descriptor.DescriptorProto{")
- if this.Name != nil {
- s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
- }
- if this.Field != nil {
- s = append(s, "Field: "+fmt.Sprintf("%#v", this.Field)+",\n")
- }
- if this.Extension != nil {
- s = append(s, "Extension: "+fmt.Sprintf("%#v", this.Extension)+",\n")
- }
- if this.NestedType != nil {
- s = append(s, "NestedType: "+fmt.Sprintf("%#v", this.NestedType)+",\n")
- }
- if this.EnumType != nil {
- s = append(s, "EnumType: "+fmt.Sprintf("%#v", this.EnumType)+",\n")
- }
- if this.ExtensionRange != nil {
- s = append(s, "ExtensionRange: "+fmt.Sprintf("%#v", this.ExtensionRange)+",\n")
- }
- if this.OneofDecl != nil {
- s = append(s, "OneofDecl: "+fmt.Sprintf("%#v", this.OneofDecl)+",\n")
- }
- if this.Options != nil {
- s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
- }
- if this.ReservedRange != nil {
- s = append(s, "ReservedRange: "+fmt.Sprintf("%#v", this.ReservedRange)+",\n")
- }
- if this.ReservedName != nil {
- s = append(s, "ReservedName: "+fmt.Sprintf("%#v", this.ReservedName)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *DescriptorProto_ExtensionRange) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 7)
- s = append(s, "&descriptor.DescriptorProto_ExtensionRange{")
- if this.Start != nil {
- s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n")
- }
- if this.End != nil {
- s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n")
- }
- if this.Options != nil {
- s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *DescriptorProto_ReservedRange) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 6)
- s = append(s, "&descriptor.DescriptorProto_ReservedRange{")
- if this.Start != nil {
- s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n")
- }
- if this.End != nil {
- s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *ExtensionRangeOptions) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 5)
- s = append(s, "&descriptor.ExtensionRangeOptions{")
- if this.UninterpretedOption != nil {
- s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
- }
- s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *FieldDescriptorProto) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 14)
- s = append(s, "&descriptor.FieldDescriptorProto{")
- if this.Name != nil {
- s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
- }
- if this.Number != nil {
- s = append(s, "Number: "+valueToGoStringDescriptor(this.Number, "int32")+",\n")
- }
- if this.Label != nil {
- s = append(s, "Label: "+valueToGoStringDescriptor(this.Label, "FieldDescriptorProto_Label")+",\n")
- }
- if this.Type != nil {
- s = append(s, "Type: "+valueToGoStringDescriptor(this.Type, "FieldDescriptorProto_Type")+",\n")
- }
- if this.TypeName != nil {
- s = append(s, "TypeName: "+valueToGoStringDescriptor(this.TypeName, "string")+",\n")
- }
- if this.Extendee != nil {
- s = append(s, "Extendee: "+valueToGoStringDescriptor(this.Extendee, "string")+",\n")
- }
- if this.DefaultValue != nil {
- s = append(s, "DefaultValue: "+valueToGoStringDescriptor(this.DefaultValue, "string")+",\n")
- }
- if this.OneofIndex != nil {
- s = append(s, "OneofIndex: "+valueToGoStringDescriptor(this.OneofIndex, "int32")+",\n")
- }
- if this.JsonName != nil {
- s = append(s, "JsonName: "+valueToGoStringDescriptor(this.JsonName, "string")+",\n")
- }
- if this.Options != nil {
- s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *OneofDescriptorProto) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 6)
- s = append(s, "&descriptor.OneofDescriptorProto{")
- if this.Name != nil {
- s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
- }
- if this.Options != nil {
- s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *EnumDescriptorProto) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 9)
- s = append(s, "&descriptor.EnumDescriptorProto{")
- if this.Name != nil {
- s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
- }
- if this.Value != nil {
- s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
- }
- if this.Options != nil {
- s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
- }
- if this.ReservedRange != nil {
- s = append(s, "ReservedRange: "+fmt.Sprintf("%#v", this.ReservedRange)+",\n")
- }
- if this.ReservedName != nil {
- s = append(s, "ReservedName: "+fmt.Sprintf("%#v", this.ReservedName)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *EnumDescriptorProto_EnumReservedRange) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 6)
- s = append(s, "&descriptor.EnumDescriptorProto_EnumReservedRange{")
- if this.Start != nil {
- s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n")
- }
- if this.End != nil {
- s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *EnumValueDescriptorProto) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 7)
- s = append(s, "&descriptor.EnumValueDescriptorProto{")
- if this.Name != nil {
- s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
- }
- if this.Number != nil {
- s = append(s, "Number: "+valueToGoStringDescriptor(this.Number, "int32")+",\n")
- }
- if this.Options != nil {
- s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *ServiceDescriptorProto) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 7)
- s = append(s, "&descriptor.ServiceDescriptorProto{")
- if this.Name != nil {
- s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
- }
- if this.Method != nil {
- s = append(s, "Method: "+fmt.Sprintf("%#v", this.Method)+",\n")
- }
- if this.Options != nil {
- s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *MethodDescriptorProto) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 10)
- s = append(s, "&descriptor.MethodDescriptorProto{")
- if this.Name != nil {
- s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n")
- }
- if this.InputType != nil {
- s = append(s, "InputType: "+valueToGoStringDescriptor(this.InputType, "string")+",\n")
- }
- if this.OutputType != nil {
- s = append(s, "OutputType: "+valueToGoStringDescriptor(this.OutputType, "string")+",\n")
- }
- if this.Options != nil {
- s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
- }
- if this.ClientStreaming != nil {
- s = append(s, "ClientStreaming: "+valueToGoStringDescriptor(this.ClientStreaming, "bool")+",\n")
- }
- if this.ServerStreaming != nil {
- s = append(s, "ServerStreaming: "+valueToGoStringDescriptor(this.ServerStreaming, "bool")+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *FileOptions) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 25)
- s = append(s, "&descriptor.FileOptions{")
- if this.JavaPackage != nil {
- s = append(s, "JavaPackage: "+valueToGoStringDescriptor(this.JavaPackage, "string")+",\n")
- }
- if this.JavaOuterClassname != nil {
- s = append(s, "JavaOuterClassname: "+valueToGoStringDescriptor(this.JavaOuterClassname, "string")+",\n")
- }
- if this.JavaMultipleFiles != nil {
- s = append(s, "JavaMultipleFiles: "+valueToGoStringDescriptor(this.JavaMultipleFiles, "bool")+",\n")
- }
- if this.JavaGenerateEqualsAndHash != nil {
- s = append(s, "JavaGenerateEqualsAndHash: "+valueToGoStringDescriptor(this.JavaGenerateEqualsAndHash, "bool")+",\n")
- }
- if this.JavaStringCheckUtf8 != nil {
- s = append(s, "JavaStringCheckUtf8: "+valueToGoStringDescriptor(this.JavaStringCheckUtf8, "bool")+",\n")
- }
- if this.OptimizeFor != nil {
- s = append(s, "OptimizeFor: "+valueToGoStringDescriptor(this.OptimizeFor, "FileOptions_OptimizeMode")+",\n")
- }
- if this.GoPackage != nil {
- s = append(s, "GoPackage: "+valueToGoStringDescriptor(this.GoPackage, "string")+",\n")
- }
- if this.CcGenericServices != nil {
- s = append(s, "CcGenericServices: "+valueToGoStringDescriptor(this.CcGenericServices, "bool")+",\n")
- }
- if this.JavaGenericServices != nil {
- s = append(s, "JavaGenericServices: "+valueToGoStringDescriptor(this.JavaGenericServices, "bool")+",\n")
- }
- if this.PyGenericServices != nil {
- s = append(s, "PyGenericServices: "+valueToGoStringDescriptor(this.PyGenericServices, "bool")+",\n")
- }
- if this.PhpGenericServices != nil {
- s = append(s, "PhpGenericServices: "+valueToGoStringDescriptor(this.PhpGenericServices, "bool")+",\n")
- }
- if this.Deprecated != nil {
- s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
- }
- if this.CcEnableArenas != nil {
- s = append(s, "CcEnableArenas: "+valueToGoStringDescriptor(this.CcEnableArenas, "bool")+",\n")
- }
- if this.ObjcClassPrefix != nil {
- s = append(s, "ObjcClassPrefix: "+valueToGoStringDescriptor(this.ObjcClassPrefix, "string")+",\n")
- }
- if this.CsharpNamespace != nil {
- s = append(s, "CsharpNamespace: "+valueToGoStringDescriptor(this.CsharpNamespace, "string")+",\n")
- }
- if this.SwiftPrefix != nil {
- s = append(s, "SwiftPrefix: "+valueToGoStringDescriptor(this.SwiftPrefix, "string")+",\n")
- }
- if this.PhpClassPrefix != nil {
- s = append(s, "PhpClassPrefix: "+valueToGoStringDescriptor(this.PhpClassPrefix, "string")+",\n")
- }
- if this.PhpNamespace != nil {
- s = append(s, "PhpNamespace: "+valueToGoStringDescriptor(this.PhpNamespace, "string")+",\n")
- }
- if this.PhpMetadataNamespace != nil {
- s = append(s, "PhpMetadataNamespace: "+valueToGoStringDescriptor(this.PhpMetadataNamespace, "string")+",\n")
- }
- if this.RubyPackage != nil {
- s = append(s, "RubyPackage: "+valueToGoStringDescriptor(this.RubyPackage, "string")+",\n")
- }
- if this.UninterpretedOption != nil {
- s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
- }
- s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *MessageOptions) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 9)
- s = append(s, "&descriptor.MessageOptions{")
- if this.MessageSetWireFormat != nil {
- s = append(s, "MessageSetWireFormat: "+valueToGoStringDescriptor(this.MessageSetWireFormat, "bool")+",\n")
- }
- if this.NoStandardDescriptorAccessor != nil {
- s = append(s, "NoStandardDescriptorAccessor: "+valueToGoStringDescriptor(this.NoStandardDescriptorAccessor, "bool")+",\n")
- }
- if this.Deprecated != nil {
- s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
- }
- if this.MapEntry != nil {
- s = append(s, "MapEntry: "+valueToGoStringDescriptor(this.MapEntry, "bool")+",\n")
- }
- if this.UninterpretedOption != nil {
- s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
- }
- s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *FieldOptions) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 11)
- s = append(s, "&descriptor.FieldOptions{")
- if this.Ctype != nil {
- s = append(s, "Ctype: "+valueToGoStringDescriptor(this.Ctype, "FieldOptions_CType")+",\n")
- }
- if this.Packed != nil {
- s = append(s, "Packed: "+valueToGoStringDescriptor(this.Packed, "bool")+",\n")
- }
- if this.Jstype != nil {
- s = append(s, "Jstype: "+valueToGoStringDescriptor(this.Jstype, "FieldOptions_JSType")+",\n")
- }
- if this.Lazy != nil {
- s = append(s, "Lazy: "+valueToGoStringDescriptor(this.Lazy, "bool")+",\n")
- }
- if this.Deprecated != nil {
- s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
- }
- if this.Weak != nil {
- s = append(s, "Weak: "+valueToGoStringDescriptor(this.Weak, "bool")+",\n")
- }
- if this.UninterpretedOption != nil {
- s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
- }
- s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *OneofOptions) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 5)
- s = append(s, "&descriptor.OneofOptions{")
- if this.UninterpretedOption != nil {
- s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
- }
- s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *EnumOptions) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 7)
- s = append(s, "&descriptor.EnumOptions{")
- if this.AllowAlias != nil {
- s = append(s, "AllowAlias: "+valueToGoStringDescriptor(this.AllowAlias, "bool")+",\n")
- }
- if this.Deprecated != nil {
- s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
- }
- if this.UninterpretedOption != nil {
- s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
- }
- s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *EnumValueOptions) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 6)
- s = append(s, "&descriptor.EnumValueOptions{")
- if this.Deprecated != nil {
- s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
- }
- if this.UninterpretedOption != nil {
- s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
- }
- s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *ServiceOptions) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 6)
- s = append(s, "&descriptor.ServiceOptions{")
- if this.Deprecated != nil {
- s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
- }
- if this.UninterpretedOption != nil {
- s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
- }
- s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *MethodOptions) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 7)
- s = append(s, "&descriptor.MethodOptions{")
- if this.Deprecated != nil {
- s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n")
- }
- if this.IdempotencyLevel != nil {
- s = append(s, "IdempotencyLevel: "+valueToGoStringDescriptor(this.IdempotencyLevel, "MethodOptions_IdempotencyLevel")+",\n")
- }
- if this.UninterpretedOption != nil {
- s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
- }
- s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n")
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *UninterpretedOption) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 11)
- s = append(s, "&descriptor.UninterpretedOption{")
- if this.Name != nil {
- s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n")
- }
- if this.IdentifierValue != nil {
- s = append(s, "IdentifierValue: "+valueToGoStringDescriptor(this.IdentifierValue, "string")+",\n")
- }
- if this.PositiveIntValue != nil {
- s = append(s, "PositiveIntValue: "+valueToGoStringDescriptor(this.PositiveIntValue, "uint64")+",\n")
- }
- if this.NegativeIntValue != nil {
- s = append(s, "NegativeIntValue: "+valueToGoStringDescriptor(this.NegativeIntValue, "int64")+",\n")
- }
- if this.DoubleValue != nil {
- s = append(s, "DoubleValue: "+valueToGoStringDescriptor(this.DoubleValue, "float64")+",\n")
- }
- if this.StringValue != nil {
- s = append(s, "StringValue: "+valueToGoStringDescriptor(this.StringValue, "byte")+",\n")
- }
- if this.AggregateValue != nil {
- s = append(s, "AggregateValue: "+valueToGoStringDescriptor(this.AggregateValue, "string")+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *UninterpretedOption_NamePart) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 6)
- s = append(s, "&descriptor.UninterpretedOption_NamePart{")
- if this.NamePart != nil {
- s = append(s, "NamePart: "+valueToGoStringDescriptor(this.NamePart, "string")+",\n")
- }
- if this.IsExtension != nil {
- s = append(s, "IsExtension: "+valueToGoStringDescriptor(this.IsExtension, "bool")+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *SourceCodeInfo) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 5)
- s = append(s, "&descriptor.SourceCodeInfo{")
- if this.Location != nil {
- s = append(s, "Location: "+fmt.Sprintf("%#v", this.Location)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *SourceCodeInfo_Location) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 9)
- s = append(s, "&descriptor.SourceCodeInfo_Location{")
- if this.Path != nil {
- s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n")
- }
- if this.Span != nil {
- s = append(s, "Span: "+fmt.Sprintf("%#v", this.Span)+",\n")
- }
- if this.LeadingComments != nil {
- s = append(s, "LeadingComments: "+valueToGoStringDescriptor(this.LeadingComments, "string")+",\n")
- }
- if this.TrailingComments != nil {
- s = append(s, "TrailingComments: "+valueToGoStringDescriptor(this.TrailingComments, "string")+",\n")
- }
- if this.LeadingDetachedComments != nil {
- s = append(s, "LeadingDetachedComments: "+fmt.Sprintf("%#v", this.LeadingDetachedComments)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *GeneratedCodeInfo) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 5)
- s = append(s, "&descriptor.GeneratedCodeInfo{")
- if this.Annotation != nil {
- s = append(s, "Annotation: "+fmt.Sprintf("%#v", this.Annotation)+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func (this *GeneratedCodeInfo_Annotation) GoString() string {
- if this == nil {
- return "nil"
- }
- s := make([]string, 0, 8)
- s = append(s, "&descriptor.GeneratedCodeInfo_Annotation{")
- if this.Path != nil {
- s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n")
- }
- if this.SourceFile != nil {
- s = append(s, "SourceFile: "+valueToGoStringDescriptor(this.SourceFile, "string")+",\n")
- }
- if this.Begin != nil {
- s = append(s, "Begin: "+valueToGoStringDescriptor(this.Begin, "int32")+",\n")
- }
- if this.End != nil {
- s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n")
- }
- if this.XXX_unrecognized != nil {
- s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
- }
- s = append(s, "}")
- return strings.Join(s, "")
-}
-func valueToGoStringDescriptor(v interface{}, typ string) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
-}
-func extensionToGoStringDescriptor(m github_com_gogo_protobuf_proto.Message) string {
- e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m)
- if e == nil {
- return "nil"
- }
- s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{"
- keys := make([]int, 0, len(e))
- for k := range e {
- keys = append(keys, int(k))
- }
- sort.Ints(keys)
- ss := []string{}
- for _, k := range keys {
- ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString())
- }
- s += strings.Join(ss, ",") + "})"
- return s
-}
diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go
deleted file mode 100644
index e0846a357..000000000
--- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go
+++ /dev/null
@@ -1,390 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-package descriptor
-
-import (
- "strings"
-)
-
-func (msg *DescriptorProto) GetMapFields() (*FieldDescriptorProto, *FieldDescriptorProto) {
- if !msg.GetOptions().GetMapEntry() {
- return nil, nil
- }
- return msg.GetField()[0], msg.GetField()[1]
-}
-
-func dotToUnderscore(r rune) rune {
- if r == '.' {
- return '_'
- }
- return r
-}
-
-func (field *FieldDescriptorProto) WireType() (wire int) {
- switch *field.Type {
- case FieldDescriptorProto_TYPE_DOUBLE:
- return 1
- case FieldDescriptorProto_TYPE_FLOAT:
- return 5
- case FieldDescriptorProto_TYPE_INT64:
- return 0
- case FieldDescriptorProto_TYPE_UINT64:
- return 0
- case FieldDescriptorProto_TYPE_INT32:
- return 0
- case FieldDescriptorProto_TYPE_UINT32:
- return 0
- case FieldDescriptorProto_TYPE_FIXED64:
- return 1
- case FieldDescriptorProto_TYPE_FIXED32:
- return 5
- case FieldDescriptorProto_TYPE_BOOL:
- return 0
- case FieldDescriptorProto_TYPE_STRING:
- return 2
- case FieldDescriptorProto_TYPE_GROUP:
- return 2
- case FieldDescriptorProto_TYPE_MESSAGE:
- return 2
- case FieldDescriptorProto_TYPE_BYTES:
- return 2
- case FieldDescriptorProto_TYPE_ENUM:
- return 0
- case FieldDescriptorProto_TYPE_SFIXED32:
- return 5
- case FieldDescriptorProto_TYPE_SFIXED64:
- return 1
- case FieldDescriptorProto_TYPE_SINT32:
- return 0
- case FieldDescriptorProto_TYPE_SINT64:
- return 0
- }
- panic("unreachable")
-}
-
-func (field *FieldDescriptorProto) GetKeyUint64() (x uint64) {
- packed := field.IsPacked()
- wireType := field.WireType()
- fieldNumber := field.GetNumber()
- if packed {
- wireType = 2
- }
- x = uint64(uint32(fieldNumber)<<3 | uint32(wireType))
- return x
-}
-
-func (field *FieldDescriptorProto) GetKey3Uint64() (x uint64) {
- packed := field.IsPacked3()
- wireType := field.WireType()
- fieldNumber := field.GetNumber()
- if packed {
- wireType = 2
- }
- x = uint64(uint32(fieldNumber)<<3 | uint32(wireType))
- return x
-}
-
-func (field *FieldDescriptorProto) GetKey() []byte {
- x := field.GetKeyUint64()
- i := 0
- keybuf := make([]byte, 0)
- for i = 0; x > 127; i++ {
- keybuf = append(keybuf, 0x80|uint8(x&0x7F))
- x >>= 7
- }
- keybuf = append(keybuf, uint8(x))
- return keybuf
-}
-
-func (field *FieldDescriptorProto) GetKey3() []byte {
- x := field.GetKey3Uint64()
- i := 0
- keybuf := make([]byte, 0)
- for i = 0; x > 127; i++ {
- keybuf = append(keybuf, 0x80|uint8(x&0x7F))
- x >>= 7
- }
- keybuf = append(keybuf, uint8(x))
- return keybuf
-}
-
-func (desc *FileDescriptorSet) GetField(packageName, messageName, fieldName string) *FieldDescriptorProto {
- msg := desc.GetMessage(packageName, messageName)
- if msg == nil {
- return nil
- }
- for _, field := range msg.GetField() {
- if field.GetName() == fieldName {
- return field
- }
- }
- return nil
-}
-
-func (file *FileDescriptorProto) GetMessage(typeName string) *DescriptorProto {
- for _, msg := range file.GetMessageType() {
- if msg.GetName() == typeName {
- return msg
- }
- nes := file.GetNestedMessage(msg, strings.TrimPrefix(typeName, msg.GetName()+"."))
- if nes != nil {
- return nes
- }
- }
- return nil
-}
-
-func (file *FileDescriptorProto) GetNestedMessage(msg *DescriptorProto, typeName string) *DescriptorProto {
- for _, nes := range msg.GetNestedType() {
- if nes.GetName() == typeName {
- return nes
- }
- res := file.GetNestedMessage(nes, strings.TrimPrefix(typeName, nes.GetName()+"."))
- if res != nil {
- return res
- }
- }
- return nil
-}
-
-func (desc *FileDescriptorSet) GetMessage(packageName string, typeName string) *DescriptorProto {
- for _, file := range desc.GetFile() {
- if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) {
- continue
- }
- for _, msg := range file.GetMessageType() {
- if msg.GetName() == typeName {
- return msg
- }
- }
- for _, msg := range file.GetMessageType() {
- for _, nes := range msg.GetNestedType() {
- if nes.GetName() == typeName {
- return nes
- }
- if msg.GetName()+"."+nes.GetName() == typeName {
- return nes
- }
- }
- }
- }
- return nil
-}
-
-func (desc *FileDescriptorSet) IsProto3(packageName string, typeName string) bool {
- for _, file := range desc.GetFile() {
- if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) {
- continue
- }
- for _, msg := range file.GetMessageType() {
- if msg.GetName() == typeName {
- return file.GetSyntax() == "proto3"
- }
- }
- for _, msg := range file.GetMessageType() {
- for _, nes := range msg.GetNestedType() {
- if nes.GetName() == typeName {
- return file.GetSyntax() == "proto3"
- }
- if msg.GetName()+"."+nes.GetName() == typeName {
- return file.GetSyntax() == "proto3"
- }
- }
- }
- }
- return false
-}
-
-func (msg *DescriptorProto) IsExtendable() bool {
- return len(msg.GetExtensionRange()) > 0
-}
-
-func (desc *FileDescriptorSet) FindExtension(packageName string, typeName string, fieldName string) (extPackageName string, field *FieldDescriptorProto) {
- parent := desc.GetMessage(packageName, typeName)
- if parent == nil {
- return "", nil
- }
- if !parent.IsExtendable() {
- return "", nil
- }
- extendee := "." + packageName + "." + typeName
- for _, file := range desc.GetFile() {
- for _, ext := range file.GetExtension() {
- if strings.Map(dotToUnderscore, file.GetPackage()) == strings.Map(dotToUnderscore, packageName) {
- if !(ext.GetExtendee() == typeName || ext.GetExtendee() == extendee) {
- continue
- }
- } else {
- if ext.GetExtendee() != extendee {
- continue
- }
- }
- if ext.GetName() == fieldName {
- return file.GetPackage(), ext
- }
- }
- }
- return "", nil
-}
-
-func (desc *FileDescriptorSet) FindExtensionByFieldNumber(packageName string, typeName string, fieldNum int32) (extPackageName string, field *FieldDescriptorProto) {
- parent := desc.GetMessage(packageName, typeName)
- if parent == nil {
- return "", nil
- }
- if !parent.IsExtendable() {
- return "", nil
- }
- extendee := "." + packageName + "." + typeName
- for _, file := range desc.GetFile() {
- for _, ext := range file.GetExtension() {
- if strings.Map(dotToUnderscore, file.GetPackage()) == strings.Map(dotToUnderscore, packageName) {
- if !(ext.GetExtendee() == typeName || ext.GetExtendee() == extendee) {
- continue
- }
- } else {
- if ext.GetExtendee() != extendee {
- continue
- }
- }
- if ext.GetNumber() == fieldNum {
- return file.GetPackage(), ext
- }
- }
- }
- return "", nil
-}
-
-func (desc *FileDescriptorSet) FindMessage(packageName string, typeName string, fieldName string) (msgPackageName string, msgName string) {
- parent := desc.GetMessage(packageName, typeName)
- if parent == nil {
- return "", ""
- }
- field := parent.GetFieldDescriptor(fieldName)
- if field == nil {
- var extPackageName string
- extPackageName, field = desc.FindExtension(packageName, typeName, fieldName)
- if field == nil {
- return "", ""
- }
- packageName = extPackageName
- }
- typeNames := strings.Split(field.GetTypeName(), ".")
- if len(typeNames) == 1 {
- msg := desc.GetMessage(packageName, typeName)
- if msg == nil {
- return "", ""
- }
- return packageName, msg.GetName()
- }
- if len(typeNames) > 2 {
- for i := 1; i < len(typeNames)-1; i++ {
- packageName = strings.Join(typeNames[1:len(typeNames)-i], ".")
- typeName = strings.Join(typeNames[len(typeNames)-i:], ".")
- msg := desc.GetMessage(packageName, typeName)
- if msg != nil {
- typeNames := strings.Split(msg.GetName(), ".")
- if len(typeNames) == 1 {
- return packageName, msg.GetName()
- }
- return strings.Join(typeNames[1:len(typeNames)-1], "."), typeNames[len(typeNames)-1]
- }
- }
- }
- return "", ""
-}
-
-func (msg *DescriptorProto) GetFieldDescriptor(fieldName string) *FieldDescriptorProto {
- for _, field := range msg.GetField() {
- if field.GetName() == fieldName {
- return field
- }
- }
- return nil
-}
-
-func (desc *FileDescriptorSet) GetEnum(packageName string, typeName string) *EnumDescriptorProto {
- for _, file := range desc.GetFile() {
- if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) {
- continue
- }
- for _, enum := range file.GetEnumType() {
- if enum.GetName() == typeName {
- return enum
- }
- }
- }
- return nil
-}
-
-func (f *FieldDescriptorProto) IsEnum() bool {
- return *f.Type == FieldDescriptorProto_TYPE_ENUM
-}
-
-func (f *FieldDescriptorProto) IsMessage() bool {
- return *f.Type == FieldDescriptorProto_TYPE_MESSAGE
-}
-
-func (f *FieldDescriptorProto) IsBytes() bool {
- return *f.Type == FieldDescriptorProto_TYPE_BYTES
-}
-
-func (f *FieldDescriptorProto) IsRepeated() bool {
- return f.Label != nil && *f.Label == FieldDescriptorProto_LABEL_REPEATED
-}
-
-func (f *FieldDescriptorProto) IsString() bool {
- return *f.Type == FieldDescriptorProto_TYPE_STRING
-}
-
-func (f *FieldDescriptorProto) IsBool() bool {
- return *f.Type == FieldDescriptorProto_TYPE_BOOL
-}
-
-func (f *FieldDescriptorProto) IsRequired() bool {
- return f.Label != nil && *f.Label == FieldDescriptorProto_LABEL_REQUIRED
-}
-
-func (f *FieldDescriptorProto) IsPacked() bool {
- return f.Options != nil && f.GetOptions().GetPacked()
-}
-
-func (f *FieldDescriptorProto) IsPacked3() bool {
- if f.IsRepeated() && f.IsScalar() {
- if f.Options == nil || f.GetOptions().Packed == nil {
- return true
- }
- return f.Options != nil && f.GetOptions().GetPacked()
- }
- return false
-}
-
-func (m *DescriptorProto) HasExtension() bool {
- return len(m.ExtensionRange) > 0
-}
diff --git a/vendor/github.com/golang/protobuf/AUTHORS b/vendor/github.com/golang/protobuf/AUTHORS
deleted file mode 100644
index 15167cd74..000000000
--- a/vendor/github.com/golang/protobuf/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-# This source code refers to The Go Authors for copyright purposes.
-# The master list of authors is in the main Go distribution,
-# visible at http://tip.golang.org/AUTHORS.
diff --git a/vendor/github.com/golang/protobuf/CONTRIBUTORS b/vendor/github.com/golang/protobuf/CONTRIBUTORS
deleted file mode 100644
index 1c4577e96..000000000
--- a/vendor/github.com/golang/protobuf/CONTRIBUTORS
+++ /dev/null
@@ -1,3 +0,0 @@
-# This source code was written by the Go contributors.
-# The master list of contributors is in the main Go distribution,
-# visible at http://tip.golang.org/CONTRIBUTORS.
diff --git a/vendor/github.com/golang/protobuf/LICENSE b/vendor/github.com/golang/protobuf/LICENSE
deleted file mode 100644
index 0f646931a..000000000
--- a/vendor/github.com/golang/protobuf/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright 2010 The Go Authors. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/vendor/github.com/golang/protobuf/proto/buffer.go b/vendor/github.com/golang/protobuf/proto/buffer.go
deleted file mode 100644
index e810e6fea..000000000
--- a/vendor/github.com/golang/protobuf/proto/buffer.go
+++ /dev/null
@@ -1,324 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-import (
- "errors"
- "fmt"
-
- "google.golang.org/protobuf/encoding/prototext"
- "google.golang.org/protobuf/encoding/protowire"
- "google.golang.org/protobuf/runtime/protoimpl"
-)
-
-const (
- WireVarint = 0
- WireFixed32 = 5
- WireFixed64 = 1
- WireBytes = 2
- WireStartGroup = 3
- WireEndGroup = 4
-)
-
-// EncodeVarint returns the varint encoded bytes of v.
-func EncodeVarint(v uint64) []byte {
- return protowire.AppendVarint(nil, v)
-}
-
-// SizeVarint returns the length of the varint encoded bytes of v.
-// This is equal to len(EncodeVarint(v)).
-func SizeVarint(v uint64) int {
- return protowire.SizeVarint(v)
-}
-
-// DecodeVarint parses a varint encoded integer from b,
-// returning the integer value and the length of the varint.
-// It returns (0, 0) if there is a parse error.
-func DecodeVarint(b []byte) (uint64, int) {
- v, n := protowire.ConsumeVarint(b)
- if n < 0 {
- return 0, 0
- }
- return v, n
-}
-
-// Buffer is a buffer for encoding and decoding the protobuf wire format.
-// It may be reused between invocations to reduce memory usage.
-type Buffer struct {
- buf []byte
- idx int
- deterministic bool
-}
-
-// NewBuffer allocates a new Buffer initialized with buf,
-// where the contents of buf are considered the unread portion of the buffer.
-func NewBuffer(buf []byte) *Buffer {
- return &Buffer{buf: buf}
-}
-
-// SetDeterministic specifies whether to use deterministic serialization.
-//
-// Deterministic serialization guarantees that for a given binary, equal
-// messages will always be serialized to the same bytes. This implies:
-//
-// - Repeated serialization of a message will return the same bytes.
-// - Different processes of the same binary (which may be executing on
-// different machines) will serialize equal messages to the same bytes.
-//
-// Note that the deterministic serialization is NOT canonical across
-// languages. It is not guaranteed to remain stable over time. It is unstable
-// across different builds with schema changes due to unknown fields.
-// Users who need canonical serialization (e.g., persistent storage in a
-// canonical form, fingerprinting, etc.) should define their own
-// canonicalization specification and implement their own serializer rather
-// than relying on this API.
-//
-// If deterministic serialization is requested, map entries will be sorted
-// by keys in lexographical order. This is an implementation detail and
-// subject to change.
-func (b *Buffer) SetDeterministic(deterministic bool) {
- b.deterministic = deterministic
-}
-
-// SetBuf sets buf as the internal buffer,
-// where the contents of buf are considered the unread portion of the buffer.
-func (b *Buffer) SetBuf(buf []byte) {
- b.buf = buf
- b.idx = 0
-}
-
-// Reset clears the internal buffer of all written and unread data.
-func (b *Buffer) Reset() {
- b.buf = b.buf[:0]
- b.idx = 0
-}
-
-// Bytes returns the internal buffer.
-func (b *Buffer) Bytes() []byte {
- return b.buf
-}
-
-// Unread returns the unread portion of the buffer.
-func (b *Buffer) Unread() []byte {
- return b.buf[b.idx:]
-}
-
-// Marshal appends the wire-format encoding of m to the buffer.
-func (b *Buffer) Marshal(m Message) error {
- var err error
- b.buf, err = marshalAppend(b.buf, m, b.deterministic)
- return err
-}
-
-// Unmarshal parses the wire-format message in the buffer and
-// places the decoded results in m.
-// It does not reset m before unmarshaling.
-func (b *Buffer) Unmarshal(m Message) error {
- err := UnmarshalMerge(b.Unread(), m)
- b.idx = len(b.buf)
- return err
-}
-
-type unknownFields struct{ XXX_unrecognized protoimpl.UnknownFields }
-
-func (m *unknownFields) String() string { panic("not implemented") }
-func (m *unknownFields) Reset() { panic("not implemented") }
-func (m *unknownFields) ProtoMessage() { panic("not implemented") }
-
-// DebugPrint dumps the encoded bytes of b with a header and footer including s
-// to stdout. This is only intended for debugging.
-func (*Buffer) DebugPrint(s string, b []byte) {
- m := MessageReflect(new(unknownFields))
- m.SetUnknown(b)
- b, _ = prototext.MarshalOptions{AllowPartial: true, Indent: "\t"}.Marshal(m.Interface())
- fmt.Printf("==== %s ====\n%s==== %s ====\n", s, b, s)
-}
-
-// EncodeVarint appends an unsigned varint encoding to the buffer.
-func (b *Buffer) EncodeVarint(v uint64) error {
- b.buf = protowire.AppendVarint(b.buf, v)
- return nil
-}
-
-// EncodeZigzag32 appends a 32-bit zig-zag varint encoding to the buffer.
-func (b *Buffer) EncodeZigzag32(v uint64) error {
- return b.EncodeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31))))
-}
-
-// EncodeZigzag64 appends a 64-bit zig-zag varint encoding to the buffer.
-func (b *Buffer) EncodeZigzag64(v uint64) error {
- return b.EncodeVarint(uint64((uint64(v) << 1) ^ uint64((int64(v) >> 63))))
-}
-
-// EncodeFixed32 appends a 32-bit little-endian integer to the buffer.
-func (b *Buffer) EncodeFixed32(v uint64) error {
- b.buf = protowire.AppendFixed32(b.buf, uint32(v))
- return nil
-}
-
-// EncodeFixed64 appends a 64-bit little-endian integer to the buffer.
-func (b *Buffer) EncodeFixed64(v uint64) error {
- b.buf = protowire.AppendFixed64(b.buf, uint64(v))
- return nil
-}
-
-// EncodeRawBytes appends a length-prefixed raw bytes to the buffer.
-func (b *Buffer) EncodeRawBytes(v []byte) error {
- b.buf = protowire.AppendBytes(b.buf, v)
- return nil
-}
-
-// EncodeStringBytes appends a length-prefixed raw bytes to the buffer.
-// It does not validate whether v contains valid UTF-8.
-func (b *Buffer) EncodeStringBytes(v string) error {
- b.buf = protowire.AppendString(b.buf, v)
- return nil
-}
-
-// EncodeMessage appends a length-prefixed encoded message to the buffer.
-func (b *Buffer) EncodeMessage(m Message) error {
- var err error
- b.buf = protowire.AppendVarint(b.buf, uint64(Size(m)))
- b.buf, err = marshalAppend(b.buf, m, b.deterministic)
- return err
-}
-
-// DecodeVarint consumes an encoded unsigned varint from the buffer.
-func (b *Buffer) DecodeVarint() (uint64, error) {
- v, n := protowire.ConsumeVarint(b.buf[b.idx:])
- if n < 0 {
- return 0, protowire.ParseError(n)
- }
- b.idx += n
- return uint64(v), nil
-}
-
-// DecodeZigzag32 consumes an encoded 32-bit zig-zag varint from the buffer.
-func (b *Buffer) DecodeZigzag32() (uint64, error) {
- v, err := b.DecodeVarint()
- if err != nil {
- return 0, err
- }
- return uint64((uint32(v) >> 1) ^ uint32((int32(v&1)<<31)>>31)), nil
-}
-
-// DecodeZigzag64 consumes an encoded 64-bit zig-zag varint from the buffer.
-func (b *Buffer) DecodeZigzag64() (uint64, error) {
- v, err := b.DecodeVarint()
- if err != nil {
- return 0, err
- }
- return uint64((uint64(v) >> 1) ^ uint64((int64(v&1)<<63)>>63)), nil
-}
-
-// DecodeFixed32 consumes a 32-bit little-endian integer from the buffer.
-func (b *Buffer) DecodeFixed32() (uint64, error) {
- v, n := protowire.ConsumeFixed32(b.buf[b.idx:])
- if n < 0 {
- return 0, protowire.ParseError(n)
- }
- b.idx += n
- return uint64(v), nil
-}
-
-// DecodeFixed64 consumes a 64-bit little-endian integer from the buffer.
-func (b *Buffer) DecodeFixed64() (uint64, error) {
- v, n := protowire.ConsumeFixed64(b.buf[b.idx:])
- if n < 0 {
- return 0, protowire.ParseError(n)
- }
- b.idx += n
- return uint64(v), nil
-}
-
-// DecodeRawBytes consumes a length-prefixed raw bytes from the buffer.
-// If alloc is specified, it returns a copy the raw bytes
-// rather than a sub-slice of the buffer.
-func (b *Buffer) DecodeRawBytes(alloc bool) ([]byte, error) {
- v, n := protowire.ConsumeBytes(b.buf[b.idx:])
- if n < 0 {
- return nil, protowire.ParseError(n)
- }
- b.idx += n
- if alloc {
- v = append([]byte(nil), v...)
- }
- return v, nil
-}
-
-// DecodeStringBytes consumes a length-prefixed raw bytes from the buffer.
-// It does not validate whether the raw bytes contain valid UTF-8.
-func (b *Buffer) DecodeStringBytes() (string, error) {
- v, n := protowire.ConsumeString(b.buf[b.idx:])
- if n < 0 {
- return "", protowire.ParseError(n)
- }
- b.idx += n
- return v, nil
-}
-
-// DecodeMessage consumes a length-prefixed message from the buffer.
-// It does not reset m before unmarshaling.
-func (b *Buffer) DecodeMessage(m Message) error {
- v, err := b.DecodeRawBytes(false)
- if err != nil {
- return err
- }
- return UnmarshalMerge(v, m)
-}
-
-// DecodeGroup consumes a message group from the buffer.
-// It assumes that the start group marker has already been consumed and
-// consumes all bytes until (and including the end group marker).
-// It does not reset m before unmarshaling.
-func (b *Buffer) DecodeGroup(m Message) error {
- v, n, err := consumeGroup(b.buf[b.idx:])
- if err != nil {
- return err
- }
- b.idx += n
- return UnmarshalMerge(v, m)
-}
-
-// consumeGroup parses b until it finds an end group marker, returning
-// the raw bytes of the message (excluding the end group marker) and the
-// the total length of the message (including the end group marker).
-func consumeGroup(b []byte) ([]byte, int, error) {
- b0 := b
- depth := 1 // assume this follows a start group marker
- for {
- _, wtyp, tagLen := protowire.ConsumeTag(b)
- if tagLen < 0 {
- return nil, 0, protowire.ParseError(tagLen)
- }
- b = b[tagLen:]
-
- var valLen int
- switch wtyp {
- case protowire.VarintType:
- _, valLen = protowire.ConsumeVarint(b)
- case protowire.Fixed32Type:
- _, valLen = protowire.ConsumeFixed32(b)
- case protowire.Fixed64Type:
- _, valLen = protowire.ConsumeFixed64(b)
- case protowire.BytesType:
- _, valLen = protowire.ConsumeBytes(b)
- case protowire.StartGroupType:
- depth++
- case protowire.EndGroupType:
- depth--
- default:
- return nil, 0, errors.New("proto: cannot parse reserved wire type")
- }
- if valLen < 0 {
- return nil, 0, protowire.ParseError(valLen)
- }
- b = b[valLen:]
-
- if depth == 0 {
- return b0[:len(b0)-len(b)-tagLen], len(b0) - len(b), nil
- }
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/defaults.go b/vendor/github.com/golang/protobuf/proto/defaults.go
deleted file mode 100644
index d399bf069..000000000
--- a/vendor/github.com/golang/protobuf/proto/defaults.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-import (
- "google.golang.org/protobuf/reflect/protoreflect"
-)
-
-// SetDefaults sets unpopulated scalar fields to their default values.
-// Fields within a oneof are not set even if they have a default value.
-// SetDefaults is recursively called upon any populated message fields.
-func SetDefaults(m Message) {
- if m != nil {
- setDefaults(MessageReflect(m))
- }
-}
-
-func setDefaults(m protoreflect.Message) {
- fds := m.Descriptor().Fields()
- for i := 0; i < fds.Len(); i++ {
- fd := fds.Get(i)
- if !m.Has(fd) {
- if fd.HasDefault() && fd.ContainingOneof() == nil {
- v := fd.Default()
- if fd.Kind() == protoreflect.BytesKind {
- v = protoreflect.ValueOf(append([]byte(nil), v.Bytes()...)) // copy the default bytes
- }
- m.Set(fd, v)
- }
- continue
- }
- }
-
- m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
- switch {
- // Handle singular message.
- case fd.Cardinality() != protoreflect.Repeated:
- if fd.Message() != nil {
- setDefaults(m.Get(fd).Message())
- }
- // Handle list of messages.
- case fd.IsList():
- if fd.Message() != nil {
- ls := m.Get(fd).List()
- for i := 0; i < ls.Len(); i++ {
- setDefaults(ls.Get(i).Message())
- }
- }
- // Handle map of messages.
- case fd.IsMap():
- if fd.MapValue().Message() != nil {
- ms := m.Get(fd).Map()
- ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool {
- setDefaults(v.Message())
- return true
- })
- }
- }
- return true
- })
-}
diff --git a/vendor/github.com/golang/protobuf/proto/deprecated.go b/vendor/github.com/golang/protobuf/proto/deprecated.go
deleted file mode 100644
index e8db57e09..000000000
--- a/vendor/github.com/golang/protobuf/proto/deprecated.go
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "strconv"
-
- protoV2 "google.golang.org/protobuf/proto"
-)
-
-var (
- // Deprecated: No longer returned.
- ErrNil = errors.New("proto: Marshal called with nil")
-
- // Deprecated: No longer returned.
- ErrTooLarge = errors.New("proto: message encodes to over 2 GB")
-
- // Deprecated: No longer returned.
- ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof")
-)
-
-// Deprecated: Do not use.
-type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 }
-
-// Deprecated: Do not use.
-func GetStats() Stats { return Stats{} }
-
-// Deprecated: Do not use.
-func MarshalMessageSet(interface{}) ([]byte, error) {
- return nil, errors.New("proto: not implemented")
-}
-
-// Deprecated: Do not use.
-func UnmarshalMessageSet([]byte, interface{}) error {
- return errors.New("proto: not implemented")
-}
-
-// Deprecated: Do not use.
-func MarshalMessageSetJSON(interface{}) ([]byte, error) {
- return nil, errors.New("proto: not implemented")
-}
-
-// Deprecated: Do not use.
-func UnmarshalMessageSetJSON([]byte, interface{}) error {
- return errors.New("proto: not implemented")
-}
-
-// Deprecated: Do not use.
-func RegisterMessageSetType(Message, int32, string) {}
-
-// Deprecated: Do not use.
-func EnumName(m map[int32]string, v int32) string {
- s, ok := m[v]
- if ok {
- return s
- }
- return strconv.Itoa(int(v))
-}
-
-// Deprecated: Do not use.
-func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error) {
- if data[0] == '"' {
- // New style: enums are strings.
- var repr string
- if err := json.Unmarshal(data, &repr); err != nil {
- return -1, err
- }
- val, ok := m[repr]
- if !ok {
- return 0, fmt.Errorf("unrecognized enum %s value %q", enumName, repr)
- }
- return val, nil
- }
- // Old style: enums are ints.
- var val int32
- if err := json.Unmarshal(data, &val); err != nil {
- return 0, fmt.Errorf("cannot unmarshal %#q into enum %s", data, enumName)
- }
- return val, nil
-}
-
-// Deprecated: Do not use; this type existed for intenal-use only.
-type InternalMessageInfo struct{}
-
-// Deprecated: Do not use; this method existed for intenal-use only.
-func (*InternalMessageInfo) DiscardUnknown(m Message) {
- DiscardUnknown(m)
-}
-
-// Deprecated: Do not use; this method existed for intenal-use only.
-func (*InternalMessageInfo) Marshal(b []byte, m Message, deterministic bool) ([]byte, error) {
- return protoV2.MarshalOptions{Deterministic: deterministic}.MarshalAppend(b, MessageV2(m))
-}
-
-// Deprecated: Do not use; this method existed for intenal-use only.
-func (*InternalMessageInfo) Merge(dst, src Message) {
- protoV2.Merge(MessageV2(dst), MessageV2(src))
-}
-
-// Deprecated: Do not use; this method existed for intenal-use only.
-func (*InternalMessageInfo) Size(m Message) int {
- return protoV2.Size(MessageV2(m))
-}
-
-// Deprecated: Do not use; this method existed for intenal-use only.
-func (*InternalMessageInfo) Unmarshal(m Message, b []byte) error {
- return protoV2.UnmarshalOptions{Merge: true}.Unmarshal(b, MessageV2(m))
-}
diff --git a/vendor/github.com/golang/protobuf/proto/discard.go b/vendor/github.com/golang/protobuf/proto/discard.go
deleted file mode 100644
index 2187e877f..000000000
--- a/vendor/github.com/golang/protobuf/proto/discard.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-import (
- "google.golang.org/protobuf/reflect/protoreflect"
-)
-
-// DiscardUnknown recursively discards all unknown fields from this message
-// and all embedded messages.
-//
-// When unmarshaling a message with unrecognized fields, the tags and values
-// of such fields are preserved in the Message. This allows a later call to
-// marshal to be able to produce a message that continues to have those
-// unrecognized fields. To avoid this, DiscardUnknown is used to
-// explicitly clear the unknown fields after unmarshaling.
-func DiscardUnknown(m Message) {
- if m != nil {
- discardUnknown(MessageReflect(m))
- }
-}
-
-func discardUnknown(m protoreflect.Message) {
- m.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool {
- switch {
- // Handle singular message.
- case fd.Cardinality() != protoreflect.Repeated:
- if fd.Message() != nil {
- discardUnknown(m.Get(fd).Message())
- }
- // Handle list of messages.
- case fd.IsList():
- if fd.Message() != nil {
- ls := m.Get(fd).List()
- for i := 0; i < ls.Len(); i++ {
- discardUnknown(ls.Get(i).Message())
- }
- }
- // Handle map of messages.
- case fd.IsMap():
- if fd.MapValue().Message() != nil {
- ms := m.Get(fd).Map()
- ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool {
- discardUnknown(v.Message())
- return true
- })
- }
- }
- return true
- })
-
- // Discard unknown fields.
- if len(m.GetUnknown()) > 0 {
- m.SetUnknown(nil)
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/extensions.go b/vendor/github.com/golang/protobuf/proto/extensions.go
deleted file mode 100644
index 42fc120c9..000000000
--- a/vendor/github.com/golang/protobuf/proto/extensions.go
+++ /dev/null
@@ -1,356 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-import (
- "errors"
- "fmt"
- "reflect"
-
- "google.golang.org/protobuf/encoding/protowire"
- "google.golang.org/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
- "google.golang.org/protobuf/runtime/protoiface"
- "google.golang.org/protobuf/runtime/protoimpl"
-)
-
-type (
- // ExtensionDesc represents an extension descriptor and
- // is used to interact with an extension field in a message.
- //
- // Variables of this type are generated in code by protoc-gen-go.
- ExtensionDesc = protoimpl.ExtensionInfo
-
- // ExtensionRange represents a range of message extensions.
- // Used in code generated by protoc-gen-go.
- ExtensionRange = protoiface.ExtensionRangeV1
-
- // Deprecated: Do not use; this is an internal type.
- Extension = protoimpl.ExtensionFieldV1
-
- // Deprecated: Do not use; this is an internal type.
- XXX_InternalExtensions = protoimpl.ExtensionFields
-)
-
-// ErrMissingExtension reports whether the extension was not present.
-var ErrMissingExtension = errors.New("proto: missing extension")
-
-var errNotExtendable = errors.New("proto: not an extendable proto.Message")
-
-// HasExtension reports whether the extension field is present in m
-// either as an explicitly populated field or as an unknown field.
-func HasExtension(m Message, xt *ExtensionDesc) (has bool) {
- mr := MessageReflect(m)
- if mr == nil || !mr.IsValid() {
- return false
- }
-
- // Check whether any populated known field matches the field number.
- xtd := xt.TypeDescriptor()
- if isValidExtension(mr.Descriptor(), xtd) {
- has = mr.Has(xtd)
- } else {
- mr.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool {
- has = int32(fd.Number()) == xt.Field
- return !has
- })
- }
-
- // Check whether any unknown field matches the field number.
- for b := mr.GetUnknown(); !has && len(b) > 0; {
- num, _, n := protowire.ConsumeField(b)
- has = int32(num) == xt.Field
- b = b[n:]
- }
- return has
-}
-
-// ClearExtension removes the extension field from m
-// either as an explicitly populated field or as an unknown field.
-func ClearExtension(m Message, xt *ExtensionDesc) {
- mr := MessageReflect(m)
- if mr == nil || !mr.IsValid() {
- return
- }
-
- xtd := xt.TypeDescriptor()
- if isValidExtension(mr.Descriptor(), xtd) {
- mr.Clear(xtd)
- } else {
- mr.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool {
- if int32(fd.Number()) == xt.Field {
- mr.Clear(fd)
- return false
- }
- return true
- })
- }
- clearUnknown(mr, fieldNum(xt.Field))
-}
-
-// ClearAllExtensions clears all extensions from m.
-// This includes populated fields and unknown fields in the extension range.
-func ClearAllExtensions(m Message) {
- mr := MessageReflect(m)
- if mr == nil || !mr.IsValid() {
- return
- }
-
- mr.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool {
- if fd.IsExtension() {
- mr.Clear(fd)
- }
- return true
- })
- clearUnknown(mr, mr.Descriptor().ExtensionRanges())
-}
-
-// GetExtension retrieves a proto2 extended field from m.
-//
-// If the descriptor is type complete (i.e., ExtensionDesc.ExtensionType is non-nil),
-// then GetExtension parses the encoded field and returns a Go value of the specified type.
-// If the field is not present, then the default value is returned (if one is specified),
-// otherwise ErrMissingExtension is reported.
-//
-// If the descriptor is type incomplete (i.e., ExtensionDesc.ExtensionType is nil),
-// then GetExtension returns the raw encoded bytes for the extension field.
-func GetExtension(m Message, xt *ExtensionDesc) (interface{}, error) {
- mr := MessageReflect(m)
- if mr == nil || !mr.IsValid() || mr.Descriptor().ExtensionRanges().Len() == 0 {
- return nil, errNotExtendable
- }
-
- // Retrieve the unknown fields for this extension field.
- var bo protoreflect.RawFields
- for bi := mr.GetUnknown(); len(bi) > 0; {
- num, _, n := protowire.ConsumeField(bi)
- if int32(num) == xt.Field {
- bo = append(bo, bi[:n]...)
- }
- bi = bi[n:]
- }
-
- // For type incomplete descriptors, only retrieve the unknown fields.
- if xt.ExtensionType == nil {
- return []byte(bo), nil
- }
-
- // If the extension field only exists as unknown fields, unmarshal it.
- // This is rarely done since proto.Unmarshal eagerly unmarshals extensions.
- xtd := xt.TypeDescriptor()
- if !isValidExtension(mr.Descriptor(), xtd) {
- return nil, fmt.Errorf("proto: bad extended type; %T does not extend %T", xt.ExtendedType, m)
- }
- if !mr.Has(xtd) && len(bo) > 0 {
- m2 := mr.New()
- if err := (proto.UnmarshalOptions{
- Resolver: extensionResolver{xt},
- }.Unmarshal(bo, m2.Interface())); err != nil {
- return nil, err
- }
- if m2.Has(xtd) {
- mr.Set(xtd, m2.Get(xtd))
- clearUnknown(mr, fieldNum(xt.Field))
- }
- }
-
- // Check whether the message has the extension field set or a default.
- var pv protoreflect.Value
- switch {
- case mr.Has(xtd):
- pv = mr.Get(xtd)
- case xtd.HasDefault():
- pv = xtd.Default()
- default:
- return nil, ErrMissingExtension
- }
-
- v := xt.InterfaceOf(pv)
- rv := reflect.ValueOf(v)
- if isScalarKind(rv.Kind()) {
- rv2 := reflect.New(rv.Type())
- rv2.Elem().Set(rv)
- v = rv2.Interface()
- }
- return v, nil
-}
-
-// extensionResolver is a custom extension resolver that stores a single
-// extension type that takes precedence over the global registry.
-type extensionResolver struct{ xt protoreflect.ExtensionType }
-
-func (r extensionResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {
- if xtd := r.xt.TypeDescriptor(); xtd.FullName() == field {
- return r.xt, nil
- }
- return protoregistry.GlobalTypes.FindExtensionByName(field)
-}
-
-func (r extensionResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {
- if xtd := r.xt.TypeDescriptor(); xtd.ContainingMessage().FullName() == message && xtd.Number() == field {
- return r.xt, nil
- }
- return protoregistry.GlobalTypes.FindExtensionByNumber(message, field)
-}
-
-// GetExtensions returns a list of the extensions values present in m,
-// corresponding with the provided list of extension descriptors, xts.
-// If an extension is missing in m, the corresponding value is nil.
-func GetExtensions(m Message, xts []*ExtensionDesc) ([]interface{}, error) {
- mr := MessageReflect(m)
- if mr == nil || !mr.IsValid() {
- return nil, errNotExtendable
- }
-
- vs := make([]interface{}, len(xts))
- for i, xt := range xts {
- v, err := GetExtension(m, xt)
- if err != nil {
- if err == ErrMissingExtension {
- continue
- }
- return vs, err
- }
- vs[i] = v
- }
- return vs, nil
-}
-
-// SetExtension sets an extension field in m to the provided value.
-func SetExtension(m Message, xt *ExtensionDesc, v interface{}) error {
- mr := MessageReflect(m)
- if mr == nil || !mr.IsValid() || mr.Descriptor().ExtensionRanges().Len() == 0 {
- return errNotExtendable
- }
-
- rv := reflect.ValueOf(v)
- if reflect.TypeOf(v) != reflect.TypeOf(xt.ExtensionType) {
- return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", v, xt.ExtensionType)
- }
- if rv.Kind() == reflect.Ptr {
- if rv.IsNil() {
- return fmt.Errorf("proto: SetExtension called with nil value of type %T", v)
- }
- if isScalarKind(rv.Elem().Kind()) {
- v = rv.Elem().Interface()
- }
- }
-
- xtd := xt.TypeDescriptor()
- if !isValidExtension(mr.Descriptor(), xtd) {
- return fmt.Errorf("proto: bad extended type; %T does not extend %T", xt.ExtendedType, m)
- }
- mr.Set(xtd, xt.ValueOf(v))
- clearUnknown(mr, fieldNum(xt.Field))
- return nil
-}
-
-// SetRawExtension inserts b into the unknown fields of m.
-//
-// Deprecated: Use Message.ProtoReflect.SetUnknown instead.
-func SetRawExtension(m Message, fnum int32, b []byte) {
- mr := MessageReflect(m)
- if mr == nil || !mr.IsValid() {
- return
- }
-
- // Verify that the raw field is valid.
- for b0 := b; len(b0) > 0; {
- num, _, n := protowire.ConsumeField(b0)
- if int32(num) != fnum {
- panic(fmt.Sprintf("mismatching field number: got %d, want %d", num, fnum))
- }
- b0 = b0[n:]
- }
-
- ClearExtension(m, &ExtensionDesc{Field: fnum})
- mr.SetUnknown(append(mr.GetUnknown(), b...))
-}
-
-// ExtensionDescs returns a list of extension descriptors found in m,
-// containing descriptors for both populated extension fields in m and
-// also unknown fields of m that are in the extension range.
-// For the later case, an type incomplete descriptor is provided where only
-// the ExtensionDesc.Field field is populated.
-// The order of the extension descriptors is undefined.
-func ExtensionDescs(m Message) ([]*ExtensionDesc, error) {
- mr := MessageReflect(m)
- if mr == nil || !mr.IsValid() || mr.Descriptor().ExtensionRanges().Len() == 0 {
- return nil, errNotExtendable
- }
-
- // Collect a set of known extension descriptors.
- extDescs := make(map[protoreflect.FieldNumber]*ExtensionDesc)
- mr.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
- if fd.IsExtension() {
- xt := fd.(protoreflect.ExtensionTypeDescriptor)
- if xd, ok := xt.Type().(*ExtensionDesc); ok {
- extDescs[fd.Number()] = xd
- }
- }
- return true
- })
-
- // Collect a set of unknown extension descriptors.
- extRanges := mr.Descriptor().ExtensionRanges()
- for b := mr.GetUnknown(); len(b) > 0; {
- num, _, n := protowire.ConsumeField(b)
- if extRanges.Has(num) && extDescs[num] == nil {
- extDescs[num] = nil
- }
- b = b[n:]
- }
-
- // Transpose the set of descriptors into a list.
- var xts []*ExtensionDesc
- for num, xt := range extDescs {
- if xt == nil {
- xt = &ExtensionDesc{Field: int32(num)}
- }
- xts = append(xts, xt)
- }
- return xts, nil
-}
-
-// isValidExtension reports whether xtd is a valid extension descriptor for md.
-func isValidExtension(md protoreflect.MessageDescriptor, xtd protoreflect.ExtensionTypeDescriptor) bool {
- return xtd.ContainingMessage() == md && md.ExtensionRanges().Has(xtd.Number())
-}
-
-// isScalarKind reports whether k is a protobuf scalar kind (except bytes).
-// This function exists for historical reasons since the representation of
-// scalars differs between v1 and v2, where v1 uses *T and v2 uses T.
-func isScalarKind(k reflect.Kind) bool {
- switch k {
- case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String:
- return true
- default:
- return false
- }
-}
-
-// clearUnknown removes unknown fields from m where remover.Has reports true.
-func clearUnknown(m protoreflect.Message, remover interface {
- Has(protoreflect.FieldNumber) bool
-}) {
- var bo protoreflect.RawFields
- for bi := m.GetUnknown(); len(bi) > 0; {
- num, _, n := protowire.ConsumeField(bi)
- if !remover.Has(num) {
- bo = append(bo, bi[:n]...)
- }
- bi = bi[n:]
- }
- if bi := m.GetUnknown(); len(bi) != len(bo) {
- m.SetUnknown(bo)
- }
-}
-
-type fieldNum protoreflect.FieldNumber
-
-func (n1 fieldNum) Has(n2 protoreflect.FieldNumber) bool {
- return protoreflect.FieldNumber(n1) == n2
-}
diff --git a/vendor/github.com/golang/protobuf/proto/properties.go b/vendor/github.com/golang/protobuf/proto/properties.go
deleted file mode 100644
index dcdc2202f..000000000
--- a/vendor/github.com/golang/protobuf/proto/properties.go
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-import (
- "fmt"
- "reflect"
- "strconv"
- "strings"
- "sync"
-
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/runtime/protoimpl"
-)
-
-// StructProperties represents protocol buffer type information for a
-// generated protobuf message in the open-struct API.
-//
-// Deprecated: Do not use.
-type StructProperties struct {
- // Prop are the properties for each field.
- //
- // Fields belonging to a oneof are stored in OneofTypes instead, with a
- // single Properties representing the parent oneof held here.
- //
- // The order of Prop matches the order of fields in the Go struct.
- // Struct fields that are not related to protobufs have a "XXX_" prefix
- // in the Properties.Name and must be ignored by the user.
- Prop []*Properties
-
- // OneofTypes contains information about the oneof fields in this message.
- // It is keyed by the protobuf field name.
- OneofTypes map[string]*OneofProperties
-}
-
-// Properties represents the type information for a protobuf message field.
-//
-// Deprecated: Do not use.
-type Properties struct {
- // Name is a placeholder name with little meaningful semantic value.
- // If the name has an "XXX_" prefix, the entire Properties must be ignored.
- Name string
- // OrigName is the protobuf field name or oneof name.
- OrigName string
- // JSONName is the JSON name for the protobuf field.
- JSONName string
- // Enum is a placeholder name for enums.
- // For historical reasons, this is neither the Go name for the enum,
- // nor the protobuf name for the enum.
- Enum string // Deprecated: Do not use.
- // Weak contains the full name of the weakly referenced message.
- Weak string
- // Wire is a string representation of the wire type.
- Wire string
- // WireType is the protobuf wire type for the field.
- WireType int
- // Tag is the protobuf field number.
- Tag int
- // Required reports whether this is a required field.
- Required bool
- // Optional reports whether this is a optional field.
- Optional bool
- // Repeated reports whether this is a repeated field.
- Repeated bool
- // Packed reports whether this is a packed repeated field of scalars.
- Packed bool
- // Proto3 reports whether this field operates under the proto3 syntax.
- Proto3 bool
- // Oneof reports whether this field belongs within a oneof.
- Oneof bool
-
- // Default is the default value in string form.
- Default string
- // HasDefault reports whether the field has a default value.
- HasDefault bool
-
- // MapKeyProp is the properties for the key field for a map field.
- MapKeyProp *Properties
- // MapValProp is the properties for the value field for a map field.
- MapValProp *Properties
-}
-
-// OneofProperties represents the type information for a protobuf oneof.
-//
-// Deprecated: Do not use.
-type OneofProperties struct {
- // Type is a pointer to the generated wrapper type for the field value.
- // This is nil for messages that are not in the open-struct API.
- Type reflect.Type
- // Field is the index into StructProperties.Prop for the containing oneof.
- Field int
- // Prop is the properties for the field.
- Prop *Properties
-}
-
-// String formats the properties in the protobuf struct field tag style.
-func (p *Properties) String() string {
- s := p.Wire
- s += "," + strconv.Itoa(p.Tag)
- if p.Required {
- s += ",req"
- }
- if p.Optional {
- s += ",opt"
- }
- if p.Repeated {
- s += ",rep"
- }
- if p.Packed {
- s += ",packed"
- }
- s += ",name=" + p.OrigName
- if p.JSONName != "" {
- s += ",json=" + p.JSONName
- }
- if len(p.Enum) > 0 {
- s += ",enum=" + p.Enum
- }
- if len(p.Weak) > 0 {
- s += ",weak=" + p.Weak
- }
- if p.Proto3 {
- s += ",proto3"
- }
- if p.Oneof {
- s += ",oneof"
- }
- if p.HasDefault {
- s += ",def=" + p.Default
- }
- return s
-}
-
-// Parse populates p by parsing a string in the protobuf struct field tag style.
-func (p *Properties) Parse(tag string) {
- // For example: "bytes,49,opt,name=foo,def=hello!"
- for len(tag) > 0 {
- i := strings.IndexByte(tag, ',')
- if i < 0 {
- i = len(tag)
- }
- switch s := tag[:i]; {
- case strings.HasPrefix(s, "name="):
- p.OrigName = s[len("name="):]
- case strings.HasPrefix(s, "json="):
- p.JSONName = s[len("json="):]
- case strings.HasPrefix(s, "enum="):
- p.Enum = s[len("enum="):]
- case strings.HasPrefix(s, "weak="):
- p.Weak = s[len("weak="):]
- case strings.Trim(s, "0123456789") == "":
- n, _ := strconv.ParseUint(s, 10, 32)
- p.Tag = int(n)
- case s == "opt":
- p.Optional = true
- case s == "req":
- p.Required = true
- case s == "rep":
- p.Repeated = true
- case s == "varint" || s == "zigzag32" || s == "zigzag64":
- p.Wire = s
- p.WireType = WireVarint
- case s == "fixed32":
- p.Wire = s
- p.WireType = WireFixed32
- case s == "fixed64":
- p.Wire = s
- p.WireType = WireFixed64
- case s == "bytes":
- p.Wire = s
- p.WireType = WireBytes
- case s == "group":
- p.Wire = s
- p.WireType = WireStartGroup
- case s == "packed":
- p.Packed = true
- case s == "proto3":
- p.Proto3 = true
- case s == "oneof":
- p.Oneof = true
- case strings.HasPrefix(s, "def="):
- // The default tag is special in that everything afterwards is the
- // default regardless of the presence of commas.
- p.HasDefault = true
- p.Default, i = tag[len("def="):], len(tag)
- }
- tag = strings.TrimPrefix(tag[i:], ",")
- }
-}
-
-// Init populates the properties from a protocol buffer struct tag.
-//
-// Deprecated: Do not use.
-func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) {
- p.Name = name
- p.OrigName = name
- if tag == "" {
- return
- }
- p.Parse(tag)
-
- if typ != nil && typ.Kind() == reflect.Map {
- p.MapKeyProp = new(Properties)
- p.MapKeyProp.Init(nil, "Key", f.Tag.Get("protobuf_key"), nil)
- p.MapValProp = new(Properties)
- p.MapValProp.Init(nil, "Value", f.Tag.Get("protobuf_val"), nil)
- }
-}
-
-var propertiesCache sync.Map // map[reflect.Type]*StructProperties
-
-// GetProperties returns the list of properties for the type represented by t,
-// which must be a generated protocol buffer message in the open-struct API,
-// where protobuf message fields are represented by exported Go struct fields.
-//
-// Deprecated: Use protobuf reflection instead.
-func GetProperties(t reflect.Type) *StructProperties {
- if p, ok := propertiesCache.Load(t); ok {
- return p.(*StructProperties)
- }
- p, _ := propertiesCache.LoadOrStore(t, newProperties(t))
- return p.(*StructProperties)
-}
-
-func newProperties(t reflect.Type) *StructProperties {
- if t.Kind() != reflect.Struct {
- panic(fmt.Sprintf("%v is not a generated message in the open-struct API", t))
- }
-
- var hasOneof bool
- prop := new(StructProperties)
-
- // Construct a list of properties for each field in the struct.
- for i := 0; i < t.NumField(); i++ {
- p := new(Properties)
- f := t.Field(i)
- tagField := f.Tag.Get("protobuf")
- p.Init(f.Type, f.Name, tagField, &f)
-
- tagOneof := f.Tag.Get("protobuf_oneof")
- if tagOneof != "" {
- hasOneof = true
- p.OrigName = tagOneof
- }
-
- // Rename unrelated struct fields with the "XXX_" prefix since so much
- // user code simply checks for this to exclude special fields.
- if tagField == "" && tagOneof == "" && !strings.HasPrefix(p.Name, "XXX_") {
- p.Name = "XXX_" + p.Name
- p.OrigName = "XXX_" + p.OrigName
- } else if p.Weak != "" {
- p.Name = p.OrigName // avoid possible "XXX_" prefix on weak field
- }
-
- prop.Prop = append(prop.Prop, p)
- }
-
- // Construct a mapping of oneof field names to properties.
- if hasOneof {
- var oneofWrappers []interface{}
- if fn, ok := reflect.PtrTo(t).MethodByName("XXX_OneofFuncs"); ok {
- oneofWrappers = fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))})[3].Interface().([]interface{})
- }
- if fn, ok := reflect.PtrTo(t).MethodByName("XXX_OneofWrappers"); ok {
- oneofWrappers = fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))})[0].Interface().([]interface{})
- }
- if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(protoreflect.ProtoMessage); ok {
- if m, ok := m.ProtoReflect().(interface{ ProtoMessageInfo() *protoimpl.MessageInfo }); ok {
- oneofWrappers = m.ProtoMessageInfo().OneofWrappers
- }
- }
-
- prop.OneofTypes = make(map[string]*OneofProperties)
- for _, wrapper := range oneofWrappers {
- p := &OneofProperties{
- Type: reflect.ValueOf(wrapper).Type(), // *T
- Prop: new(Properties),
- }
- f := p.Type.Elem().Field(0)
- p.Prop.Name = f.Name
- p.Prop.Parse(f.Tag.Get("protobuf"))
-
- // Determine the struct field that contains this oneof.
- // Each wrapper is assignable to exactly one parent field.
- var foundOneof bool
- for i := 0; i < t.NumField() && !foundOneof; i++ {
- if p.Type.AssignableTo(t.Field(i).Type) {
- p.Field = i
- foundOneof = true
- }
- }
- if !foundOneof {
- panic(fmt.Sprintf("%v is not a generated message in the open-struct API", t))
- }
- prop.OneofTypes[p.Prop.OrigName] = p
- }
- }
-
- return prop
-}
-
-func (sp *StructProperties) Len() int { return len(sp.Prop) }
-func (sp *StructProperties) Less(i, j int) bool { return false }
-func (sp *StructProperties) Swap(i, j int) { return }
diff --git a/vendor/github.com/golang/protobuf/proto/proto.go b/vendor/github.com/golang/protobuf/proto/proto.go
deleted file mode 100644
index 5aee89c32..000000000
--- a/vendor/github.com/golang/protobuf/proto/proto.go
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package proto provides functionality for handling protocol buffer messages.
-// In particular, it provides marshaling and unmarshaling between a protobuf
-// message and the binary wire format.
-//
-// See https://developers.google.com/protocol-buffers/docs/gotutorial for
-// more information.
-//
-// Deprecated: Use the "google.golang.org/protobuf/proto" package instead.
-package proto
-
-import (
- protoV2 "google.golang.org/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/runtime/protoiface"
- "google.golang.org/protobuf/runtime/protoimpl"
-)
-
-const (
- ProtoPackageIsVersion1 = true
- ProtoPackageIsVersion2 = true
- ProtoPackageIsVersion3 = true
- ProtoPackageIsVersion4 = true
-)
-
-// GeneratedEnum is any enum type generated by protoc-gen-go
-// which is a named int32 kind.
-// This type exists for documentation purposes.
-type GeneratedEnum interface{}
-
-// GeneratedMessage is any message type generated by protoc-gen-go
-// which is a pointer to a named struct kind.
-// This type exists for documentation purposes.
-type GeneratedMessage interface{}
-
-// Message is a protocol buffer message.
-//
-// This is the v1 version of the message interface and is marginally better
-// than an empty interface as it lacks any method to programatically interact
-// with the contents of the message.
-//
-// A v2 message is declared in "google.golang.org/protobuf/proto".Message and
-// exposes protobuf reflection as a first-class feature of the interface.
-//
-// To convert a v1 message to a v2 message, use the MessageV2 function.
-// To convert a v2 message to a v1 message, use the MessageV1 function.
-type Message = protoiface.MessageV1
-
-// MessageV1 converts either a v1 or v2 message to a v1 message.
-// It returns nil if m is nil.
-func MessageV1(m GeneratedMessage) protoiface.MessageV1 {
- return protoimpl.X.ProtoMessageV1Of(m)
-}
-
-// MessageV2 converts either a v1 or v2 message to a v2 message.
-// It returns nil if m is nil.
-func MessageV2(m GeneratedMessage) protoV2.Message {
- return protoimpl.X.ProtoMessageV2Of(m)
-}
-
-// MessageReflect returns a reflective view for a message.
-// It returns nil if m is nil.
-func MessageReflect(m Message) protoreflect.Message {
- return protoimpl.X.MessageOf(m)
-}
-
-// Marshaler is implemented by messages that can marshal themselves.
-// This interface is used by the following functions: Size, Marshal,
-// Buffer.Marshal, and Buffer.EncodeMessage.
-//
-// Deprecated: Do not implement.
-type Marshaler interface {
- // Marshal formats the encoded bytes of the message.
- // It should be deterministic and emit valid protobuf wire data.
- // The caller takes ownership of the returned buffer.
- Marshal() ([]byte, error)
-}
-
-// Unmarshaler is implemented by messages that can unmarshal themselves.
-// This interface is used by the following functions: Unmarshal, UnmarshalMerge,
-// Buffer.Unmarshal, Buffer.DecodeMessage, and Buffer.DecodeGroup.
-//
-// Deprecated: Do not implement.
-type Unmarshaler interface {
- // Unmarshal parses the encoded bytes of the protobuf wire input.
- // The provided buffer is only valid for during method call.
- // It should not reset the receiver message.
- Unmarshal([]byte) error
-}
-
-// Merger is implemented by messages that can merge themselves.
-// This interface is used by the following functions: Clone and Merge.
-//
-// Deprecated: Do not implement.
-type Merger interface {
- // Merge merges the contents of src into the receiver message.
- // It clones all data structures in src such that it aliases no mutable
- // memory referenced by src.
- Merge(src Message)
-}
-
-// RequiredNotSetError is an error type returned when
-// marshaling or unmarshaling a message with missing required fields.
-type RequiredNotSetError struct {
- err error
-}
-
-func (e *RequiredNotSetError) Error() string {
- if e.err != nil {
- return e.err.Error()
- }
- return "proto: required field not set"
-}
-func (e *RequiredNotSetError) RequiredNotSet() bool {
- return true
-}
-
-func checkRequiredNotSet(m protoV2.Message) error {
- if err := protoV2.CheckInitialized(m); err != nil {
- return &RequiredNotSetError{err: err}
- }
- return nil
-}
-
-// Clone returns a deep copy of src.
-func Clone(src Message) Message {
- return MessageV1(protoV2.Clone(MessageV2(src)))
-}
-
-// Merge merges src into dst, which must be messages of the same type.
-//
-// Populated scalar fields in src are copied to dst, while populated
-// singular messages in src are merged into dst by recursively calling Merge.
-// The elements of every list field in src is appended to the corresponded
-// list fields in dst. The entries of every map field in src is copied into
-// the corresponding map field in dst, possibly replacing existing entries.
-// The unknown fields of src are appended to the unknown fields of dst.
-func Merge(dst, src Message) {
- protoV2.Merge(MessageV2(dst), MessageV2(src))
-}
-
-// Equal reports whether two messages are equal.
-// If two messages marshal to the same bytes under deterministic serialization,
-// then Equal is guaranteed to report true.
-//
-// Two messages are equal if they are the same protobuf message type,
-// have the same set of populated known and extension field values,
-// and the same set of unknown fields values.
-//
-// Scalar values are compared with the equivalent of the == operator in Go,
-// except bytes values which are compared using bytes.Equal and
-// floating point values which specially treat NaNs as equal.
-// Message values are compared by recursively calling Equal.
-// Lists are equal if each element value is also equal.
-// Maps are equal if they have the same set of keys, where the pair of values
-// for each key is also equal.
-func Equal(x, y Message) bool {
- return protoV2.Equal(MessageV2(x), MessageV2(y))
-}
-
-func isMessageSet(md protoreflect.MessageDescriptor) bool {
- ms, ok := md.(interface{ IsMessageSet() bool })
- return ok && ms.IsMessageSet()
-}
diff --git a/vendor/github.com/golang/protobuf/proto/registry.go b/vendor/github.com/golang/protobuf/proto/registry.go
deleted file mode 100644
index 066b4323b..000000000
--- a/vendor/github.com/golang/protobuf/proto/registry.go
+++ /dev/null
@@ -1,317 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-import (
- "bytes"
- "compress/gzip"
- "fmt"
- "io/ioutil"
- "reflect"
- "strings"
- "sync"
-
- "google.golang.org/protobuf/reflect/protodesc"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
- "google.golang.org/protobuf/runtime/protoimpl"
-)
-
-// filePath is the path to the proto source file.
-type filePath = string // e.g., "google/protobuf/descriptor.proto"
-
-// fileDescGZIP is the compressed contents of the encoded FileDescriptorProto.
-type fileDescGZIP = []byte
-
-var fileCache sync.Map // map[filePath]fileDescGZIP
-
-// RegisterFile is called from generated code to register the compressed
-// FileDescriptorProto with the file path for a proto source file.
-//
-// Deprecated: Use protoregistry.GlobalFiles.RegisterFile instead.
-func RegisterFile(s filePath, d fileDescGZIP) {
- // Decompress the descriptor.
- zr, err := gzip.NewReader(bytes.NewReader(d))
- if err != nil {
- panic(fmt.Sprintf("proto: invalid compressed file descriptor: %v", err))
- }
- b, err := ioutil.ReadAll(zr)
- if err != nil {
- panic(fmt.Sprintf("proto: invalid compressed file descriptor: %v", err))
- }
-
- // Construct a protoreflect.FileDescriptor from the raw descriptor.
- // Note that DescBuilder.Build automatically registers the constructed
- // file descriptor with the v2 registry.
- protoimpl.DescBuilder{RawDescriptor: b}.Build()
-
- // Locally cache the raw descriptor form for the file.
- fileCache.Store(s, d)
-}
-
-// FileDescriptor returns the compressed FileDescriptorProto given the file path
-// for a proto source file. It returns nil if not found.
-//
-// Deprecated: Use protoregistry.GlobalFiles.FindFileByPath instead.
-func FileDescriptor(s filePath) fileDescGZIP {
- if v, ok := fileCache.Load(s); ok {
- return v.(fileDescGZIP)
- }
-
- // Find the descriptor in the v2 registry.
- var b []byte
- if fd, _ := protoregistry.GlobalFiles.FindFileByPath(s); fd != nil {
- b, _ = Marshal(protodesc.ToFileDescriptorProto(fd))
- }
-
- // Locally cache the raw descriptor form for the file.
- if len(b) > 0 {
- v, _ := fileCache.LoadOrStore(s, protoimpl.X.CompressGZIP(b))
- return v.(fileDescGZIP)
- }
- return nil
-}
-
-// enumName is the name of an enum. For historical reasons, the enum name is
-// neither the full Go name nor the full protobuf name of the enum.
-// The name is the dot-separated combination of just the proto package that the
-// enum is declared within followed by the Go type name of the generated enum.
-type enumName = string // e.g., "my.proto.package.GoMessage_GoEnum"
-
-// enumsByName maps enum values by name to their numeric counterpart.
-type enumsByName = map[string]int32
-
-// enumsByNumber maps enum values by number to their name counterpart.
-type enumsByNumber = map[int32]string
-
-var enumCache sync.Map // map[enumName]enumsByName
-var numFilesCache sync.Map // map[protoreflect.FullName]int
-
-// RegisterEnum is called from the generated code to register the mapping of
-// enum value names to enum numbers for the enum identified by s.
-//
-// Deprecated: Use protoregistry.GlobalTypes.RegisterEnum instead.
-func RegisterEnum(s enumName, _ enumsByNumber, m enumsByName) {
- if _, ok := enumCache.Load(s); ok {
- panic("proto: duplicate enum registered: " + s)
- }
- enumCache.Store(s, m)
-
- // This does not forward registration to the v2 registry since this API
- // lacks sufficient information to construct a complete v2 enum descriptor.
-}
-
-// EnumValueMap returns the mapping from enum value names to enum numbers for
-// the enum of the given name. It returns nil if not found.
-//
-// Deprecated: Use protoregistry.GlobalTypes.FindEnumByName instead.
-func EnumValueMap(s enumName) enumsByName {
- if v, ok := enumCache.Load(s); ok {
- return v.(enumsByName)
- }
-
- // Check whether the cache is stale. If the number of files in the current
- // package differs, then it means that some enums may have been recently
- // registered upstream that we do not know about.
- var protoPkg protoreflect.FullName
- if i := strings.LastIndexByte(s, '.'); i >= 0 {
- protoPkg = protoreflect.FullName(s[:i])
- }
- v, _ := numFilesCache.Load(protoPkg)
- numFiles, _ := v.(int)
- if protoregistry.GlobalFiles.NumFilesByPackage(protoPkg) == numFiles {
- return nil // cache is up-to-date; was not found earlier
- }
-
- // Update the enum cache for all enums declared in the given proto package.
- numFiles = 0
- protoregistry.GlobalFiles.RangeFilesByPackage(protoPkg, func(fd protoreflect.FileDescriptor) bool {
- walkEnums(fd, func(ed protoreflect.EnumDescriptor) {
- name := protoimpl.X.LegacyEnumName(ed)
- if _, ok := enumCache.Load(name); !ok {
- m := make(enumsByName)
- evs := ed.Values()
- for i := evs.Len() - 1; i >= 0; i-- {
- ev := evs.Get(i)
- m[string(ev.Name())] = int32(ev.Number())
- }
- enumCache.LoadOrStore(name, m)
- }
- })
- numFiles++
- return true
- })
- numFilesCache.Store(protoPkg, numFiles)
-
- // Check cache again for enum map.
- if v, ok := enumCache.Load(s); ok {
- return v.(enumsByName)
- }
- return nil
-}
-
-// walkEnums recursively walks all enums declared in d.
-func walkEnums(d interface {
- Enums() protoreflect.EnumDescriptors
- Messages() protoreflect.MessageDescriptors
-}, f func(protoreflect.EnumDescriptor)) {
- eds := d.Enums()
- for i := eds.Len() - 1; i >= 0; i-- {
- f(eds.Get(i))
- }
- mds := d.Messages()
- for i := mds.Len() - 1; i >= 0; i-- {
- walkEnums(mds.Get(i), f)
- }
-}
-
-// messageName is the full name of protobuf message.
-type messageName = string
-
-var messageTypeCache sync.Map // map[messageName]reflect.Type
-
-// RegisterType is called from generated code to register the message Go type
-// for a message of the given name.
-//
-// Deprecated: Use protoregistry.GlobalTypes.RegisterMessage instead.
-func RegisterType(m Message, s messageName) {
- mt := protoimpl.X.LegacyMessageTypeOf(m, protoreflect.FullName(s))
- if err := protoregistry.GlobalTypes.RegisterMessage(mt); err != nil {
- panic(err)
- }
- messageTypeCache.Store(s, reflect.TypeOf(m))
-}
-
-// RegisterMapType is called from generated code to register the Go map type
-// for a protobuf message representing a map entry.
-//
-// Deprecated: Do not use.
-func RegisterMapType(m interface{}, s messageName) {
- t := reflect.TypeOf(m)
- if t.Kind() != reflect.Map {
- panic(fmt.Sprintf("invalid map kind: %v", t))
- }
- if _, ok := messageTypeCache.Load(s); ok {
- panic(fmt.Errorf("proto: duplicate proto message registered: %s", s))
- }
- messageTypeCache.Store(s, t)
-}
-
-// MessageType returns the message type for a named message.
-// It returns nil if not found.
-//
-// Deprecated: Use protoregistry.GlobalTypes.FindMessageByName instead.
-func MessageType(s messageName) reflect.Type {
- if v, ok := messageTypeCache.Load(s); ok {
- return v.(reflect.Type)
- }
-
- // Derive the message type from the v2 registry.
- var t reflect.Type
- if mt, _ := protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(s)); mt != nil {
- t = messageGoType(mt)
- }
-
- // If we could not get a concrete type, it is possible that it is a
- // pseudo-message for a map entry.
- if t == nil {
- d, _ := protoregistry.GlobalFiles.FindDescriptorByName(protoreflect.FullName(s))
- if md, _ := d.(protoreflect.MessageDescriptor); md != nil && md.IsMapEntry() {
- kt := goTypeForField(md.Fields().ByNumber(1))
- vt := goTypeForField(md.Fields().ByNumber(2))
- t = reflect.MapOf(kt, vt)
- }
- }
-
- // Locally cache the message type for the given name.
- if t != nil {
- v, _ := messageTypeCache.LoadOrStore(s, t)
- return v.(reflect.Type)
- }
- return nil
-}
-
-func goTypeForField(fd protoreflect.FieldDescriptor) reflect.Type {
- switch k := fd.Kind(); k {
- case protoreflect.EnumKind:
- if et, _ := protoregistry.GlobalTypes.FindEnumByName(fd.Enum().FullName()); et != nil {
- return enumGoType(et)
- }
- return reflect.TypeOf(protoreflect.EnumNumber(0))
- case protoreflect.MessageKind, protoreflect.GroupKind:
- if mt, _ := protoregistry.GlobalTypes.FindMessageByName(fd.Message().FullName()); mt != nil {
- return messageGoType(mt)
- }
- return reflect.TypeOf((*protoreflect.Message)(nil)).Elem()
- default:
- return reflect.TypeOf(fd.Default().Interface())
- }
-}
-
-func enumGoType(et protoreflect.EnumType) reflect.Type {
- return reflect.TypeOf(et.New(0))
-}
-
-func messageGoType(mt protoreflect.MessageType) reflect.Type {
- return reflect.TypeOf(MessageV1(mt.Zero().Interface()))
-}
-
-// MessageName returns the full protobuf name for the given message type.
-//
-// Deprecated: Use protoreflect.MessageDescriptor.FullName instead.
-func MessageName(m Message) messageName {
- if m == nil {
- return ""
- }
- if m, ok := m.(interface{ XXX_MessageName() messageName }); ok {
- return m.XXX_MessageName()
- }
- return messageName(protoimpl.X.MessageDescriptorOf(m).FullName())
-}
-
-// RegisterExtension is called from the generated code to register
-// the extension descriptor.
-//
-// Deprecated: Use protoregistry.GlobalTypes.RegisterExtension instead.
-func RegisterExtension(d *ExtensionDesc) {
- if err := protoregistry.GlobalTypes.RegisterExtension(d); err != nil {
- panic(err)
- }
-}
-
-type extensionsByNumber = map[int32]*ExtensionDesc
-
-var extensionCache sync.Map // map[messageName]extensionsByNumber
-
-// RegisteredExtensions returns a map of the registered extensions for the
-// provided protobuf message, indexed by the extension field number.
-//
-// Deprecated: Use protoregistry.GlobalTypes.RangeExtensionsByMessage instead.
-func RegisteredExtensions(m Message) extensionsByNumber {
- // Check whether the cache is stale. If the number of extensions for
- // the given message differs, then it means that some extensions were
- // recently registered upstream that we do not know about.
- s := MessageName(m)
- v, _ := extensionCache.Load(s)
- xs, _ := v.(extensionsByNumber)
- if protoregistry.GlobalTypes.NumExtensionsByMessage(protoreflect.FullName(s)) == len(xs) {
- return xs // cache is up-to-date
- }
-
- // Cache is stale, re-compute the extensions map.
- xs = make(extensionsByNumber)
- protoregistry.GlobalTypes.RangeExtensionsByMessage(protoreflect.FullName(s), func(xt protoreflect.ExtensionType) bool {
- if xd, ok := xt.(*ExtensionDesc); ok {
- xs[int32(xt.TypeDescriptor().Number())] = xd
- } else {
- // TODO: This implies that the protoreflect.ExtensionType is a
- // custom type not generated by protoc-gen-go. We could try and
- // convert the type to an ExtensionDesc.
- }
- return true
- })
- extensionCache.Store(s, xs)
- return xs
-}
diff --git a/vendor/github.com/golang/protobuf/proto/text_decode.go b/vendor/github.com/golang/protobuf/proto/text_decode.go
deleted file mode 100644
index 47eb3e445..000000000
--- a/vendor/github.com/golang/protobuf/proto/text_decode.go
+++ /dev/null
@@ -1,801 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-import (
- "encoding"
- "errors"
- "fmt"
- "reflect"
- "strconv"
- "strings"
- "unicode/utf8"
-
- "google.golang.org/protobuf/encoding/prototext"
- protoV2 "google.golang.org/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
-)
-
-const wrapTextUnmarshalV2 = false
-
-// ParseError is returned by UnmarshalText.
-type ParseError struct {
- Message string
-
- // Deprecated: Do not use.
- Line, Offset int
-}
-
-func (e *ParseError) Error() string {
- if wrapTextUnmarshalV2 {
- return e.Message
- }
- if e.Line == 1 {
- return fmt.Sprintf("line 1.%d: %v", e.Offset, e.Message)
- }
- return fmt.Sprintf("line %d: %v", e.Line, e.Message)
-}
-
-// UnmarshalText parses a proto text formatted string into m.
-func UnmarshalText(s string, m Message) error {
- if u, ok := m.(encoding.TextUnmarshaler); ok {
- return u.UnmarshalText([]byte(s))
- }
-
- m.Reset()
- mi := MessageV2(m)
-
- if wrapTextUnmarshalV2 {
- err := prototext.UnmarshalOptions{
- AllowPartial: true,
- }.Unmarshal([]byte(s), mi)
- if err != nil {
- return &ParseError{Message: err.Error()}
- }
- return checkRequiredNotSet(mi)
- } else {
- if err := newTextParser(s).unmarshalMessage(mi.ProtoReflect(), ""); err != nil {
- return err
- }
- return checkRequiredNotSet(mi)
- }
-}
-
-type textParser struct {
- s string // remaining input
- done bool // whether the parsing is finished (success or error)
- backed bool // whether back() was called
- offset, line int
- cur token
-}
-
-type token struct {
- value string
- err *ParseError
- line int // line number
- offset int // byte number from start of input, not start of line
- unquoted string // the unquoted version of value, if it was a quoted string
-}
-
-func newTextParser(s string) *textParser {
- p := new(textParser)
- p.s = s
- p.line = 1
- p.cur.line = 1
- return p
-}
-
-func (p *textParser) unmarshalMessage(m protoreflect.Message, terminator string) (err error) {
- md := m.Descriptor()
- fds := md.Fields()
-
- // A struct is a sequence of "name: value", terminated by one of
- // '>' or '}', or the end of the input. A name may also be
- // "[extension]" or "[type/url]".
- //
- // The whole struct can also be an expanded Any message, like:
- // [type/url] < ... struct contents ... >
- seen := make(map[protoreflect.FieldNumber]bool)
- for {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- if tok.value == terminator {
- break
- }
- if tok.value == "[" {
- if err := p.unmarshalExtensionOrAny(m, seen); err != nil {
- return err
- }
- continue
- }
-
- // This is a normal, non-extension field.
- name := protoreflect.Name(tok.value)
- fd := fds.ByName(name)
- switch {
- case fd == nil:
- gd := fds.ByName(protoreflect.Name(strings.ToLower(string(name))))
- if gd != nil && gd.Kind() == protoreflect.GroupKind && gd.Message().Name() == name {
- fd = gd
- }
- case fd.Kind() == protoreflect.GroupKind && fd.Message().Name() != name:
- fd = nil
- case fd.IsWeak() && fd.Message().IsPlaceholder():
- fd = nil
- }
- if fd == nil {
- typeName := string(md.FullName())
- if m, ok := m.Interface().(Message); ok {
- t := reflect.TypeOf(m)
- if t.Kind() == reflect.Ptr {
- typeName = t.Elem().String()
- }
- }
- return p.errorf("unknown field name %q in %v", name, typeName)
- }
- if od := fd.ContainingOneof(); od != nil && m.WhichOneof(od) != nil {
- return p.errorf("field '%s' would overwrite already parsed oneof '%s'", name, od.Name())
- }
- if fd.Cardinality() != protoreflect.Repeated && seen[fd.Number()] {
- return p.errorf("non-repeated field %q was repeated", fd.Name())
- }
- seen[fd.Number()] = true
-
- // Consume any colon.
- if err := p.checkForColon(fd); err != nil {
- return err
- }
-
- // Parse into the field.
- v := m.Get(fd)
- if !m.Has(fd) && (fd.IsList() || fd.IsMap() || fd.Message() != nil) {
- v = m.Mutable(fd)
- }
- if v, err = p.unmarshalValue(v, fd); err != nil {
- return err
- }
- m.Set(fd, v)
-
- if err := p.consumeOptionalSeparator(); err != nil {
- return err
- }
- }
- return nil
-}
-
-func (p *textParser) unmarshalExtensionOrAny(m protoreflect.Message, seen map[protoreflect.FieldNumber]bool) error {
- name, err := p.consumeExtensionOrAnyName()
- if err != nil {
- return err
- }
-
- // If it contains a slash, it's an Any type URL.
- if slashIdx := strings.LastIndex(name, "/"); slashIdx >= 0 {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- // consume an optional colon
- if tok.value == ":" {
- tok = p.next()
- if tok.err != nil {
- return tok.err
- }
- }
-
- var terminator string
- switch tok.value {
- case "<":
- terminator = ">"
- case "{":
- terminator = "}"
- default:
- return p.errorf("expected '{' or '<', found %q", tok.value)
- }
-
- mt, err := protoregistry.GlobalTypes.FindMessageByURL(name)
- if err != nil {
- return p.errorf("unrecognized message %q in google.protobuf.Any", name[slashIdx+len("/"):])
- }
- m2 := mt.New()
- if err := p.unmarshalMessage(m2, terminator); err != nil {
- return err
- }
- b, err := protoV2.Marshal(m2.Interface())
- if err != nil {
- return p.errorf("failed to marshal message of type %q: %v", name[slashIdx+len("/"):], err)
- }
-
- urlFD := m.Descriptor().Fields().ByName("type_url")
- valFD := m.Descriptor().Fields().ByName("value")
- if seen[urlFD.Number()] {
- return p.errorf("Any message unpacked multiple times, or %q already set", urlFD.Name())
- }
- if seen[valFD.Number()] {
- return p.errorf("Any message unpacked multiple times, or %q already set", valFD.Name())
- }
- m.Set(urlFD, protoreflect.ValueOfString(name))
- m.Set(valFD, protoreflect.ValueOfBytes(b))
- seen[urlFD.Number()] = true
- seen[valFD.Number()] = true
- return nil
- }
-
- xname := protoreflect.FullName(name)
- xt, _ := protoregistry.GlobalTypes.FindExtensionByName(xname)
- if xt == nil && isMessageSet(m.Descriptor()) {
- xt, _ = protoregistry.GlobalTypes.FindExtensionByName(xname.Append("message_set_extension"))
- }
- if xt == nil {
- return p.errorf("unrecognized extension %q", name)
- }
- fd := xt.TypeDescriptor()
- if fd.ContainingMessage().FullName() != m.Descriptor().FullName() {
- return p.errorf("extension field %q does not extend message %q", name, m.Descriptor().FullName())
- }
-
- if err := p.checkForColon(fd); err != nil {
- return err
- }
-
- v := m.Get(fd)
- if !m.Has(fd) && (fd.IsList() || fd.IsMap() || fd.Message() != nil) {
- v = m.Mutable(fd)
- }
- v, err = p.unmarshalValue(v, fd)
- if err != nil {
- return err
- }
- m.Set(fd, v)
- return p.consumeOptionalSeparator()
-}
-
-func (p *textParser) unmarshalValue(v protoreflect.Value, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) {
- tok := p.next()
- if tok.err != nil {
- return v, tok.err
- }
- if tok.value == "" {
- return v, p.errorf("unexpected EOF")
- }
-
- switch {
- case fd.IsList():
- lv := v.List()
- var err error
- if tok.value == "[" {
- // Repeated field with list notation, like [1,2,3].
- for {
- vv := lv.NewElement()
- vv, err = p.unmarshalSingularValue(vv, fd)
- if err != nil {
- return v, err
- }
- lv.Append(vv)
-
- tok := p.next()
- if tok.err != nil {
- return v, tok.err
- }
- if tok.value == "]" {
- break
- }
- if tok.value != "," {
- return v, p.errorf("Expected ']' or ',' found %q", tok.value)
- }
- }
- return v, nil
- }
-
- // One value of the repeated field.
- p.back()
- vv := lv.NewElement()
- vv, err = p.unmarshalSingularValue(vv, fd)
- if err != nil {
- return v, err
- }
- lv.Append(vv)
- return v, nil
- case fd.IsMap():
- // The map entry should be this sequence of tokens:
- // < key : KEY value : VALUE >
- // However, implementations may omit key or value, and technically
- // we should support them in any order.
- var terminator string
- switch tok.value {
- case "<":
- terminator = ">"
- case "{":
- terminator = "}"
- default:
- return v, p.errorf("expected '{' or '<', found %q", tok.value)
- }
-
- keyFD := fd.MapKey()
- valFD := fd.MapValue()
-
- mv := v.Map()
- kv := keyFD.Default()
- vv := mv.NewValue()
- for {
- tok := p.next()
- if tok.err != nil {
- return v, tok.err
- }
- if tok.value == terminator {
- break
- }
- var err error
- switch tok.value {
- case "key":
- if err := p.consumeToken(":"); err != nil {
- return v, err
- }
- if kv, err = p.unmarshalSingularValue(kv, keyFD); err != nil {
- return v, err
- }
- if err := p.consumeOptionalSeparator(); err != nil {
- return v, err
- }
- case "value":
- if err := p.checkForColon(valFD); err != nil {
- return v, err
- }
- if vv, err = p.unmarshalSingularValue(vv, valFD); err != nil {
- return v, err
- }
- if err := p.consumeOptionalSeparator(); err != nil {
- return v, err
- }
- default:
- p.back()
- return v, p.errorf(`expected "key", "value", or %q, found %q`, terminator, tok.value)
- }
- }
- mv.Set(kv.MapKey(), vv)
- return v, nil
- default:
- p.back()
- return p.unmarshalSingularValue(v, fd)
- }
-}
-
-func (p *textParser) unmarshalSingularValue(v protoreflect.Value, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) {
- tok := p.next()
- if tok.err != nil {
- return v, tok.err
- }
- if tok.value == "" {
- return v, p.errorf("unexpected EOF")
- }
-
- switch fd.Kind() {
- case protoreflect.BoolKind:
- switch tok.value {
- case "true", "1", "t", "True":
- return protoreflect.ValueOfBool(true), nil
- case "false", "0", "f", "False":
- return protoreflect.ValueOfBool(false), nil
- }
- case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
- if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil {
- return protoreflect.ValueOfInt32(int32(x)), nil
- }
-
- // The C++ parser accepts large positive hex numbers that uses
- // two's complement arithmetic to represent negative numbers.
- // This feature is here for backwards compatibility with C++.
- if strings.HasPrefix(tok.value, "0x") {
- if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil {
- return protoreflect.ValueOfInt32(int32(-(int64(^x) + 1))), nil
- }
- }
- case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
- if x, err := strconv.ParseInt(tok.value, 0, 64); err == nil {
- return protoreflect.ValueOfInt64(int64(x)), nil
- }
-
- // The C++ parser accepts large positive hex numbers that uses
- // two's complement arithmetic to represent negative numbers.
- // This feature is here for backwards compatibility with C++.
- if strings.HasPrefix(tok.value, "0x") {
- if x, err := strconv.ParseUint(tok.value, 0, 64); err == nil {
- return protoreflect.ValueOfInt64(int64(-(int64(^x) + 1))), nil
- }
- }
- case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
- if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil {
- return protoreflect.ValueOfUint32(uint32(x)), nil
- }
- case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
- if x, err := strconv.ParseUint(tok.value, 0, 64); err == nil {
- return protoreflect.ValueOfUint64(uint64(x)), nil
- }
- case protoreflect.FloatKind:
- // Ignore 'f' for compatibility with output generated by C++,
- // but don't remove 'f' when the value is "-inf" or "inf".
- v := tok.value
- if strings.HasSuffix(v, "f") && v != "-inf" && v != "inf" {
- v = v[:len(v)-len("f")]
- }
- if x, err := strconv.ParseFloat(v, 32); err == nil {
- return protoreflect.ValueOfFloat32(float32(x)), nil
- }
- case protoreflect.DoubleKind:
- // Ignore 'f' for compatibility with output generated by C++,
- // but don't remove 'f' when the value is "-inf" or "inf".
- v := tok.value
- if strings.HasSuffix(v, "f") && v != "-inf" && v != "inf" {
- v = v[:len(v)-len("f")]
- }
- if x, err := strconv.ParseFloat(v, 64); err == nil {
- return protoreflect.ValueOfFloat64(float64(x)), nil
- }
- case protoreflect.StringKind:
- if isQuote(tok.value[0]) {
- return protoreflect.ValueOfString(tok.unquoted), nil
- }
- case protoreflect.BytesKind:
- if isQuote(tok.value[0]) {
- return protoreflect.ValueOfBytes([]byte(tok.unquoted)), nil
- }
- case protoreflect.EnumKind:
- if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil {
- return protoreflect.ValueOfEnum(protoreflect.EnumNumber(x)), nil
- }
- vd := fd.Enum().Values().ByName(protoreflect.Name(tok.value))
- if vd != nil {
- return protoreflect.ValueOfEnum(vd.Number()), nil
- }
- case protoreflect.MessageKind, protoreflect.GroupKind:
- var terminator string
- switch tok.value {
- case "{":
- terminator = "}"
- case "<":
- terminator = ">"
- default:
- return v, p.errorf("expected '{' or '<', found %q", tok.value)
- }
- err := p.unmarshalMessage(v.Message(), terminator)
- return v, err
- default:
- panic(fmt.Sprintf("invalid kind %v", fd.Kind()))
- }
- return v, p.errorf("invalid %v: %v", fd.Kind(), tok.value)
-}
-
-// Consume a ':' from the input stream (if the next token is a colon),
-// returning an error if a colon is needed but not present.
-func (p *textParser) checkForColon(fd protoreflect.FieldDescriptor) *ParseError {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- if tok.value != ":" {
- if fd.Message() == nil {
- return p.errorf("expected ':', found %q", tok.value)
- }
- p.back()
- }
- return nil
-}
-
-// consumeExtensionOrAnyName consumes an extension name or an Any type URL and
-// the following ']'. It returns the name or URL consumed.
-func (p *textParser) consumeExtensionOrAnyName() (string, error) {
- tok := p.next()
- if tok.err != nil {
- return "", tok.err
- }
-
- // If extension name or type url is quoted, it's a single token.
- if len(tok.value) > 2 && isQuote(tok.value[0]) && tok.value[len(tok.value)-1] == tok.value[0] {
- name, err := unquoteC(tok.value[1:len(tok.value)-1], rune(tok.value[0]))
- if err != nil {
- return "", err
- }
- return name, p.consumeToken("]")
- }
-
- // Consume everything up to "]"
- var parts []string
- for tok.value != "]" {
- parts = append(parts, tok.value)
- tok = p.next()
- if tok.err != nil {
- return "", p.errorf("unrecognized type_url or extension name: %s", tok.err)
- }
- if p.done && tok.value != "]" {
- return "", p.errorf("unclosed type_url or extension name")
- }
- }
- return strings.Join(parts, ""), nil
-}
-
-// consumeOptionalSeparator consumes an optional semicolon or comma.
-// It is used in unmarshalMessage to provide backward compatibility.
-func (p *textParser) consumeOptionalSeparator() error {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- if tok.value != ";" && tok.value != "," {
- p.back()
- }
- return nil
-}
-
-func (p *textParser) errorf(format string, a ...interface{}) *ParseError {
- pe := &ParseError{fmt.Sprintf(format, a...), p.cur.line, p.cur.offset}
- p.cur.err = pe
- p.done = true
- return pe
-}
-
-func (p *textParser) skipWhitespace() {
- i := 0
- for i < len(p.s) && (isWhitespace(p.s[i]) || p.s[i] == '#') {
- if p.s[i] == '#' {
- // comment; skip to end of line or input
- for i < len(p.s) && p.s[i] != '\n' {
- i++
- }
- if i == len(p.s) {
- break
- }
- }
- if p.s[i] == '\n' {
- p.line++
- }
- i++
- }
- p.offset += i
- p.s = p.s[i:len(p.s)]
- if len(p.s) == 0 {
- p.done = true
- }
-}
-
-func (p *textParser) advance() {
- // Skip whitespace
- p.skipWhitespace()
- if p.done {
- return
- }
-
- // Start of non-whitespace
- p.cur.err = nil
- p.cur.offset, p.cur.line = p.offset, p.line
- p.cur.unquoted = ""
- switch p.s[0] {
- case '<', '>', '{', '}', ':', '[', ']', ';', ',', '/':
- // Single symbol
- p.cur.value, p.s = p.s[0:1], p.s[1:len(p.s)]
- case '"', '\'':
- // Quoted string
- i := 1
- for i < len(p.s) && p.s[i] != p.s[0] && p.s[i] != '\n' {
- if p.s[i] == '\\' && i+1 < len(p.s) {
- // skip escaped char
- i++
- }
- i++
- }
- if i >= len(p.s) || p.s[i] != p.s[0] {
- p.errorf("unmatched quote")
- return
- }
- unq, err := unquoteC(p.s[1:i], rune(p.s[0]))
- if err != nil {
- p.errorf("invalid quoted string %s: %v", p.s[0:i+1], err)
- return
- }
- p.cur.value, p.s = p.s[0:i+1], p.s[i+1:len(p.s)]
- p.cur.unquoted = unq
- default:
- i := 0
- for i < len(p.s) && isIdentOrNumberChar(p.s[i]) {
- i++
- }
- if i == 0 {
- p.errorf("unexpected byte %#x", p.s[0])
- return
- }
- p.cur.value, p.s = p.s[0:i], p.s[i:len(p.s)]
- }
- p.offset += len(p.cur.value)
-}
-
-// Back off the parser by one token. Can only be done between calls to next().
-// It makes the next advance() a no-op.
-func (p *textParser) back() { p.backed = true }
-
-// Advances the parser and returns the new current token.
-func (p *textParser) next() *token {
- if p.backed || p.done {
- p.backed = false
- return &p.cur
- }
- p.advance()
- if p.done {
- p.cur.value = ""
- } else if len(p.cur.value) > 0 && isQuote(p.cur.value[0]) {
- // Look for multiple quoted strings separated by whitespace,
- // and concatenate them.
- cat := p.cur
- for {
- p.skipWhitespace()
- if p.done || !isQuote(p.s[0]) {
- break
- }
- p.advance()
- if p.cur.err != nil {
- return &p.cur
- }
- cat.value += " " + p.cur.value
- cat.unquoted += p.cur.unquoted
- }
- p.done = false // parser may have seen EOF, but we want to return cat
- p.cur = cat
- }
- return &p.cur
-}
-
-func (p *textParser) consumeToken(s string) error {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- if tok.value != s {
- p.back()
- return p.errorf("expected %q, found %q", s, tok.value)
- }
- return nil
-}
-
-var errBadUTF8 = errors.New("proto: bad UTF-8")
-
-func unquoteC(s string, quote rune) (string, error) {
- // This is based on C++'s tokenizer.cc.
- // Despite its name, this is *not* parsing C syntax.
- // For instance, "\0" is an invalid quoted string.
-
- // Avoid allocation in trivial cases.
- simple := true
- for _, r := range s {
- if r == '\\' || r == quote {
- simple = false
- break
- }
- }
- if simple {
- return s, nil
- }
-
- buf := make([]byte, 0, 3*len(s)/2)
- for len(s) > 0 {
- r, n := utf8.DecodeRuneInString(s)
- if r == utf8.RuneError && n == 1 {
- return "", errBadUTF8
- }
- s = s[n:]
- if r != '\\' {
- if r < utf8.RuneSelf {
- buf = append(buf, byte(r))
- } else {
- buf = append(buf, string(r)...)
- }
- continue
- }
-
- ch, tail, err := unescape(s)
- if err != nil {
- return "", err
- }
- buf = append(buf, ch...)
- s = tail
- }
- return string(buf), nil
-}
-
-func unescape(s string) (ch string, tail string, err error) {
- r, n := utf8.DecodeRuneInString(s)
- if r == utf8.RuneError && n == 1 {
- return "", "", errBadUTF8
- }
- s = s[n:]
- switch r {
- case 'a':
- return "\a", s, nil
- case 'b':
- return "\b", s, nil
- case 'f':
- return "\f", s, nil
- case 'n':
- return "\n", s, nil
- case 'r':
- return "\r", s, nil
- case 't':
- return "\t", s, nil
- case 'v':
- return "\v", s, nil
- case '?':
- return "?", s, nil // trigraph workaround
- case '\'', '"', '\\':
- return string(r), s, nil
- case '0', '1', '2', '3', '4', '5', '6', '7':
- if len(s) < 2 {
- return "", "", fmt.Errorf(`\%c requires 2 following digits`, r)
- }
- ss := string(r) + s[:2]
- s = s[2:]
- i, err := strconv.ParseUint(ss, 8, 8)
- if err != nil {
- return "", "", fmt.Errorf(`\%s contains non-octal digits`, ss)
- }
- return string([]byte{byte(i)}), s, nil
- case 'x', 'X', 'u', 'U':
- var n int
- switch r {
- case 'x', 'X':
- n = 2
- case 'u':
- n = 4
- case 'U':
- n = 8
- }
- if len(s) < n {
- return "", "", fmt.Errorf(`\%c requires %d following digits`, r, n)
- }
- ss := s[:n]
- s = s[n:]
- i, err := strconv.ParseUint(ss, 16, 64)
- if err != nil {
- return "", "", fmt.Errorf(`\%c%s contains non-hexadecimal digits`, r, ss)
- }
- if r == 'x' || r == 'X' {
- return string([]byte{byte(i)}), s, nil
- }
- if i > utf8.MaxRune {
- return "", "", fmt.Errorf(`\%c%s is not a valid Unicode code point`, r, ss)
- }
- return string(rune(i)), s, nil
- }
- return "", "", fmt.Errorf(`unknown escape \%c`, r)
-}
-
-func isIdentOrNumberChar(c byte) bool {
- switch {
- case 'A' <= c && c <= 'Z', 'a' <= c && c <= 'z':
- return true
- case '0' <= c && c <= '9':
- return true
- }
- switch c {
- case '-', '+', '.', '_':
- return true
- }
- return false
-}
-
-func isWhitespace(c byte) bool {
- switch c {
- case ' ', '\t', '\n', '\r':
- return true
- }
- return false
-}
-
-func isQuote(c byte) bool {
- switch c {
- case '"', '\'':
- return true
- }
- return false
-}
diff --git a/vendor/github.com/golang/protobuf/proto/text_encode.go b/vendor/github.com/golang/protobuf/proto/text_encode.go
deleted file mode 100644
index a31134eeb..000000000
--- a/vendor/github.com/golang/protobuf/proto/text_encode.go
+++ /dev/null
@@ -1,560 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-import (
- "bytes"
- "encoding"
- "fmt"
- "io"
- "math"
- "sort"
- "strings"
-
- "google.golang.org/protobuf/encoding/prototext"
- "google.golang.org/protobuf/encoding/protowire"
- "google.golang.org/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
-)
-
-const wrapTextMarshalV2 = false
-
-// TextMarshaler is a configurable text format marshaler.
-type TextMarshaler struct {
- Compact bool // use compact text format (one line)
- ExpandAny bool // expand google.protobuf.Any messages of known types
-}
-
-// Marshal writes the proto text format of m to w.
-func (tm *TextMarshaler) Marshal(w io.Writer, m Message) error {
- b, err := tm.marshal(m)
- if len(b) > 0 {
- if _, err := w.Write(b); err != nil {
- return err
- }
- }
- return err
-}
-
-// Text returns a proto text formatted string of m.
-func (tm *TextMarshaler) Text(m Message) string {
- b, _ := tm.marshal(m)
- return string(b)
-}
-
-func (tm *TextMarshaler) marshal(m Message) ([]byte, error) {
- mr := MessageReflect(m)
- if mr == nil || !mr.IsValid() {
- return []byte(""), nil
- }
-
- if wrapTextMarshalV2 {
- if m, ok := m.(encoding.TextMarshaler); ok {
- return m.MarshalText()
- }
-
- opts := prototext.MarshalOptions{
- AllowPartial: true,
- EmitUnknown: true,
- }
- if !tm.Compact {
- opts.Indent = " "
- }
- if !tm.ExpandAny {
- opts.Resolver = (*protoregistry.Types)(nil)
- }
- return opts.Marshal(mr.Interface())
- } else {
- w := &textWriter{
- compact: tm.Compact,
- expandAny: tm.ExpandAny,
- complete: true,
- }
-
- if m, ok := m.(encoding.TextMarshaler); ok {
- b, err := m.MarshalText()
- if err != nil {
- return nil, err
- }
- w.Write(b)
- return w.buf, nil
- }
-
- err := w.writeMessage(mr)
- return w.buf, err
- }
-}
-
-var (
- defaultTextMarshaler = TextMarshaler{}
- compactTextMarshaler = TextMarshaler{Compact: true}
-)
-
-// MarshalText writes the proto text format of m to w.
-func MarshalText(w io.Writer, m Message) error { return defaultTextMarshaler.Marshal(w, m) }
-
-// MarshalTextString returns a proto text formatted string of m.
-func MarshalTextString(m Message) string { return defaultTextMarshaler.Text(m) }
-
-// CompactText writes the compact proto text format of m to w.
-func CompactText(w io.Writer, m Message) error { return compactTextMarshaler.Marshal(w, m) }
-
-// CompactTextString returns a compact proto text formatted string of m.
-func CompactTextString(m Message) string { return compactTextMarshaler.Text(m) }
-
-var (
- newline = []byte("\n")
- endBraceNewline = []byte("}\n")
- posInf = []byte("inf")
- negInf = []byte("-inf")
- nan = []byte("nan")
-)
-
-// textWriter is an io.Writer that tracks its indentation level.
-type textWriter struct {
- compact bool // same as TextMarshaler.Compact
- expandAny bool // same as TextMarshaler.ExpandAny
- complete bool // whether the current position is a complete line
- indent int // indentation level; never negative
- buf []byte
-}
-
-func (w *textWriter) Write(p []byte) (n int, _ error) {
- newlines := bytes.Count(p, newline)
- if newlines == 0 {
- if !w.compact && w.complete {
- w.writeIndent()
- }
- w.buf = append(w.buf, p...)
- w.complete = false
- return len(p), nil
- }
-
- frags := bytes.SplitN(p, newline, newlines+1)
- if w.compact {
- for i, frag := range frags {
- if i > 0 {
- w.buf = append(w.buf, ' ')
- n++
- }
- w.buf = append(w.buf, frag...)
- n += len(frag)
- }
- return n, nil
- }
-
- for i, frag := range frags {
- if w.complete {
- w.writeIndent()
- }
- w.buf = append(w.buf, frag...)
- n += len(frag)
- if i+1 < len(frags) {
- w.buf = append(w.buf, '\n')
- n++
- }
- }
- w.complete = len(frags[len(frags)-1]) == 0
- return n, nil
-}
-
-func (w *textWriter) WriteByte(c byte) error {
- if w.compact && c == '\n' {
- c = ' '
- }
- if !w.compact && w.complete {
- w.writeIndent()
- }
- w.buf = append(w.buf, c)
- w.complete = c == '\n'
- return nil
-}
-
-func (w *textWriter) writeName(fd protoreflect.FieldDescriptor) {
- if !w.compact && w.complete {
- w.writeIndent()
- }
- w.complete = false
-
- if fd.Kind() != protoreflect.GroupKind {
- w.buf = append(w.buf, fd.Name()...)
- w.WriteByte(':')
- } else {
- // Use message type name for group field name.
- w.buf = append(w.buf, fd.Message().Name()...)
- }
-
- if !w.compact {
- w.WriteByte(' ')
- }
-}
-
-func requiresQuotes(u string) bool {
- // When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted.
- for _, ch := range u {
- switch {
- case ch == '.' || ch == '/' || ch == '_':
- continue
- case '0' <= ch && ch <= '9':
- continue
- case 'A' <= ch && ch <= 'Z':
- continue
- case 'a' <= ch && ch <= 'z':
- continue
- default:
- return true
- }
- }
- return false
-}
-
-// writeProto3Any writes an expanded google.protobuf.Any message.
-//
-// It returns (false, nil) if sv value can't be unmarshaled (e.g. because
-// required messages are not linked in).
-//
-// It returns (true, error) when sv was written in expanded format or an error
-// was encountered.
-func (w *textWriter) writeProto3Any(m protoreflect.Message) (bool, error) {
- md := m.Descriptor()
- fdURL := md.Fields().ByName("type_url")
- fdVal := md.Fields().ByName("value")
-
- url := m.Get(fdURL).String()
- mt, err := protoregistry.GlobalTypes.FindMessageByURL(url)
- if err != nil {
- return false, nil
- }
-
- b := m.Get(fdVal).Bytes()
- m2 := mt.New()
- if err := proto.Unmarshal(b, m2.Interface()); err != nil {
- return false, nil
- }
- w.Write([]byte("["))
- if requiresQuotes(url) {
- w.writeQuotedString(url)
- } else {
- w.Write([]byte(url))
- }
- if w.compact {
- w.Write([]byte("]:<"))
- } else {
- w.Write([]byte("]: <\n"))
- w.indent++
- }
- if err := w.writeMessage(m2); err != nil {
- return true, err
- }
- if w.compact {
- w.Write([]byte("> "))
- } else {
- w.indent--
- w.Write([]byte(">\n"))
- }
- return true, nil
-}
-
-func (w *textWriter) writeMessage(m protoreflect.Message) error {
- md := m.Descriptor()
- if w.expandAny && md.FullName() == "google.protobuf.Any" {
- if canExpand, err := w.writeProto3Any(m); canExpand {
- return err
- }
- }
-
- fds := md.Fields()
- for i := 0; i < fds.Len(); {
- fd := fds.Get(i)
- if od := fd.ContainingOneof(); od != nil {
- fd = m.WhichOneof(od)
- i += od.Fields().Len()
- } else {
- i++
- }
- if fd == nil || !m.Has(fd) {
- continue
- }
-
- switch {
- case fd.IsList():
- lv := m.Get(fd).List()
- for j := 0; j < lv.Len(); j++ {
- w.writeName(fd)
- v := lv.Get(j)
- if err := w.writeSingularValue(v, fd); err != nil {
- return err
- }
- w.WriteByte('\n')
- }
- case fd.IsMap():
- kfd := fd.MapKey()
- vfd := fd.MapValue()
- mv := m.Get(fd).Map()
-
- type entry struct{ key, val protoreflect.Value }
- var entries []entry
- mv.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool {
- entries = append(entries, entry{k.Value(), v})
- return true
- })
- sort.Slice(entries, func(i, j int) bool {
- switch kfd.Kind() {
- case protoreflect.BoolKind:
- return !entries[i].key.Bool() && entries[j].key.Bool()
- case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
- return entries[i].key.Int() < entries[j].key.Int()
- case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
- return entries[i].key.Uint() < entries[j].key.Uint()
- case protoreflect.StringKind:
- return entries[i].key.String() < entries[j].key.String()
- default:
- panic("invalid kind")
- }
- })
- for _, entry := range entries {
- w.writeName(fd)
- w.WriteByte('<')
- if !w.compact {
- w.WriteByte('\n')
- }
- w.indent++
- w.writeName(kfd)
- if err := w.writeSingularValue(entry.key, kfd); err != nil {
- return err
- }
- w.WriteByte('\n')
- w.writeName(vfd)
- if err := w.writeSingularValue(entry.val, vfd); err != nil {
- return err
- }
- w.WriteByte('\n')
- w.indent--
- w.WriteByte('>')
- w.WriteByte('\n')
- }
- default:
- w.writeName(fd)
- if err := w.writeSingularValue(m.Get(fd), fd); err != nil {
- return err
- }
- w.WriteByte('\n')
- }
- }
-
- if b := m.GetUnknown(); len(b) > 0 {
- w.writeUnknownFields(b)
- }
- return w.writeExtensions(m)
-}
-
-func (w *textWriter) writeSingularValue(v protoreflect.Value, fd protoreflect.FieldDescriptor) error {
- switch fd.Kind() {
- case protoreflect.FloatKind, protoreflect.DoubleKind:
- switch vf := v.Float(); {
- case math.IsInf(vf, +1):
- w.Write(posInf)
- case math.IsInf(vf, -1):
- w.Write(negInf)
- case math.IsNaN(vf):
- w.Write(nan)
- default:
- fmt.Fprint(w, v.Interface())
- }
- case protoreflect.StringKind:
- // NOTE: This does not validate UTF-8 for historical reasons.
- w.writeQuotedString(string(v.String()))
- case protoreflect.BytesKind:
- w.writeQuotedString(string(v.Bytes()))
- case protoreflect.MessageKind, protoreflect.GroupKind:
- var bra, ket byte = '<', '>'
- if fd.Kind() == protoreflect.GroupKind {
- bra, ket = '{', '}'
- }
- w.WriteByte(bra)
- if !w.compact {
- w.WriteByte('\n')
- }
- w.indent++
- m := v.Message()
- if m2, ok := m.Interface().(encoding.TextMarshaler); ok {
- b, err := m2.MarshalText()
- if err != nil {
- return err
- }
- w.Write(b)
- } else {
- w.writeMessage(m)
- }
- w.indent--
- w.WriteByte(ket)
- case protoreflect.EnumKind:
- if ev := fd.Enum().Values().ByNumber(v.Enum()); ev != nil {
- fmt.Fprint(w, ev.Name())
- } else {
- fmt.Fprint(w, v.Enum())
- }
- default:
- fmt.Fprint(w, v.Interface())
- }
- return nil
-}
-
-// writeQuotedString writes a quoted string in the protocol buffer text format.
-func (w *textWriter) writeQuotedString(s string) {
- w.WriteByte('"')
- for i := 0; i < len(s); i++ {
- switch c := s[i]; c {
- case '\n':
- w.buf = append(w.buf, `\n`...)
- case '\r':
- w.buf = append(w.buf, `\r`...)
- case '\t':
- w.buf = append(w.buf, `\t`...)
- case '"':
- w.buf = append(w.buf, `\"`...)
- case '\\':
- w.buf = append(w.buf, `\\`...)
- default:
- if isPrint := c >= 0x20 && c < 0x7f; isPrint {
- w.buf = append(w.buf, c)
- } else {
- w.buf = append(w.buf, fmt.Sprintf(`\%03o`, c)...)
- }
- }
- }
- w.WriteByte('"')
-}
-
-func (w *textWriter) writeUnknownFields(b []byte) {
- if !w.compact {
- fmt.Fprintf(w, "/* %d unknown bytes */\n", len(b))
- }
-
- for len(b) > 0 {
- num, wtyp, n := protowire.ConsumeTag(b)
- if n < 0 {
- return
- }
- b = b[n:]
-
- if wtyp == protowire.EndGroupType {
- w.indent--
- w.Write(endBraceNewline)
- continue
- }
- fmt.Fprint(w, num)
- if wtyp != protowire.StartGroupType {
- w.WriteByte(':')
- }
- if !w.compact || wtyp == protowire.StartGroupType {
- w.WriteByte(' ')
- }
- switch wtyp {
- case protowire.VarintType:
- v, n := protowire.ConsumeVarint(b)
- if n < 0 {
- return
- }
- b = b[n:]
- fmt.Fprint(w, v)
- case protowire.Fixed32Type:
- v, n := protowire.ConsumeFixed32(b)
- if n < 0 {
- return
- }
- b = b[n:]
- fmt.Fprint(w, v)
- case protowire.Fixed64Type:
- v, n := protowire.ConsumeFixed64(b)
- if n < 0 {
- return
- }
- b = b[n:]
- fmt.Fprint(w, v)
- case protowire.BytesType:
- v, n := protowire.ConsumeBytes(b)
- if n < 0 {
- return
- }
- b = b[n:]
- fmt.Fprintf(w, "%q", v)
- case protowire.StartGroupType:
- w.WriteByte('{')
- w.indent++
- default:
- fmt.Fprintf(w, "/* unknown wire type %d */", wtyp)
- }
- w.WriteByte('\n')
- }
-}
-
-// writeExtensions writes all the extensions in m.
-func (w *textWriter) writeExtensions(m protoreflect.Message) error {
- md := m.Descriptor()
- if md.ExtensionRanges().Len() == 0 {
- return nil
- }
-
- type ext struct {
- desc protoreflect.FieldDescriptor
- val protoreflect.Value
- }
- var exts []ext
- m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
- if fd.IsExtension() {
- exts = append(exts, ext{fd, v})
- }
- return true
- })
- sort.Slice(exts, func(i, j int) bool {
- return exts[i].desc.Number() < exts[j].desc.Number()
- })
-
- for _, ext := range exts {
- // For message set, use the name of the message as the extension name.
- name := string(ext.desc.FullName())
- if isMessageSet(ext.desc.ContainingMessage()) {
- name = strings.TrimSuffix(name, ".message_set_extension")
- }
-
- if !ext.desc.IsList() {
- if err := w.writeSingularExtension(name, ext.val, ext.desc); err != nil {
- return err
- }
- } else {
- lv := ext.val.List()
- for i := 0; i < lv.Len(); i++ {
- if err := w.writeSingularExtension(name, lv.Get(i), ext.desc); err != nil {
- return err
- }
- }
- }
- }
- return nil
-}
-
-func (w *textWriter) writeSingularExtension(name string, v protoreflect.Value, fd protoreflect.FieldDescriptor) error {
- fmt.Fprintf(w, "[%s]:", name)
- if !w.compact {
- w.WriteByte(' ')
- }
- if err := w.writeSingularValue(v, fd); err != nil {
- return err
- }
- w.WriteByte('\n')
- return nil
-}
-
-func (w *textWriter) writeIndent() {
- if !w.complete {
- return
- }
- for i := 0; i < w.indent*2; i++ {
- w.buf = append(w.buf, ' ')
- }
- w.complete = false
-}
diff --git a/vendor/github.com/golang/protobuf/proto/wire.go b/vendor/github.com/golang/protobuf/proto/wire.go
deleted file mode 100644
index d7c28da5a..000000000
--- a/vendor/github.com/golang/protobuf/proto/wire.go
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-import (
- protoV2 "google.golang.org/protobuf/proto"
- "google.golang.org/protobuf/runtime/protoiface"
-)
-
-// Size returns the size in bytes of the wire-format encoding of m.
-func Size(m Message) int {
- if m == nil {
- return 0
- }
- mi := MessageV2(m)
- return protoV2.Size(mi)
-}
-
-// Marshal returns the wire-format encoding of m.
-func Marshal(m Message) ([]byte, error) {
- b, err := marshalAppend(nil, m, false)
- if b == nil {
- b = zeroBytes
- }
- return b, err
-}
-
-var zeroBytes = make([]byte, 0, 0)
-
-func marshalAppend(buf []byte, m Message, deterministic bool) ([]byte, error) {
- if m == nil {
- return nil, ErrNil
- }
- mi := MessageV2(m)
- nbuf, err := protoV2.MarshalOptions{
- Deterministic: deterministic,
- AllowPartial: true,
- }.MarshalAppend(buf, mi)
- if err != nil {
- return buf, err
- }
- if len(buf) == len(nbuf) {
- if !mi.ProtoReflect().IsValid() {
- return buf, ErrNil
- }
- }
- return nbuf, checkRequiredNotSet(mi)
-}
-
-// Unmarshal parses a wire-format message in b and places the decoded results in m.
-//
-// Unmarshal resets m before starting to unmarshal, so any existing data in m is always
-// removed. Use UnmarshalMerge to preserve and append to existing data.
-func Unmarshal(b []byte, m Message) error {
- m.Reset()
- return UnmarshalMerge(b, m)
-}
-
-// UnmarshalMerge parses a wire-format message in b and places the decoded results in m.
-func UnmarshalMerge(b []byte, m Message) error {
- mi := MessageV2(m)
- out, err := protoV2.UnmarshalOptions{
- AllowPartial: true,
- Merge: true,
- }.UnmarshalState(protoiface.UnmarshalInput{
- Buf: b,
- Message: mi.ProtoReflect(),
- })
- if err != nil {
- return err
- }
- if out.Flags&protoiface.UnmarshalInitialized > 0 {
- return nil
- }
- return checkRequiredNotSet(mi)
-}
diff --git a/vendor/github.com/golang/protobuf/proto/wrappers.go b/vendor/github.com/golang/protobuf/proto/wrappers.go
deleted file mode 100644
index 398e34859..000000000
--- a/vendor/github.com/golang/protobuf/proto/wrappers.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package proto
-
-// Bool stores v in a new bool value and returns a pointer to it.
-func Bool(v bool) *bool { return &v }
-
-// Int stores v in a new int32 value and returns a pointer to it.
-//
-// Deprecated: Use Int32 instead.
-func Int(v int) *int32 { return Int32(int32(v)) }
-
-// Int32 stores v in a new int32 value and returns a pointer to it.
-func Int32(v int32) *int32 { return &v }
-
-// Int64 stores v in a new int64 value and returns a pointer to it.
-func Int64(v int64) *int64 { return &v }
-
-// Uint32 stores v in a new uint32 value and returns a pointer to it.
-func Uint32(v uint32) *uint32 { return &v }
-
-// Uint64 stores v in a new uint64 value and returns a pointer to it.
-func Uint64(v uint64) *uint64 { return &v }
-
-// Float32 stores v in a new float32 value and returns a pointer to it.
-func Float32(v float32) *float32 { return &v }
-
-// Float64 stores v in a new float64 value and returns a pointer to it.
-func Float64(v float64) *float64 { return &v }
-
-// String stores v in a new string value and returns a pointer to it.
-func String(v string) *string { return &v }
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/config_verify.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/config_verify.go
index ef7a4e094..1bbc47d8d 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/config_verify.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/config_verify.go
@@ -17,7 +17,7 @@ import (
"github.com/santhosh-tekuri/jsonschema/v6"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
- "gopkg.in/yaml.v3"
+ "go.yaml.in/yaml/v3"
"github.com/golangci/golangci-lint/v2/pkg/exitcodes"
)
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/custom.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/custom.go
index 227df9bee..e6a7f5ed7 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/custom.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/custom.go
@@ -5,6 +5,7 @@ import (
"log"
"os"
+ "github.com/fatih/color"
"github.com/spf13/cobra"
"github.com/golangci/golangci-lint/v2/pkg/commands/internal"
@@ -13,11 +14,19 @@ import (
const envKeepTempFiles = "CUSTOM_GCL_KEEP_TEMP_FILES"
+type customOptions struct {
+ version string
+ name string
+ destination string
+}
+
type customCommand struct {
cmd *cobra.Command
cfg *internal.Configuration
+ opts customOptions
+
log logutils.Log
}
@@ -33,6 +42,13 @@ func newCustomCommand(logger logutils.Log) *customCommand {
SilenceUsage: true,
}
+ flagSet := customCmd.PersistentFlags()
+ flagSet.SortFlags = false // sort them as they are defined here
+
+ flagSet.StringVar(&c.opts.version, "version", "", color.GreenString("The golangci-lint version used to build the custom binary"))
+ flagSet.StringVar(&c.opts.name, "name", "", color.GreenString("The name of the custom binary"))
+ flagSet.StringVar(&c.opts.destination, "destination", "", color.GreenString("The directory path used to store the custom binary"))
+
c.cmd = customCmd
return c
@@ -44,6 +60,18 @@ func (c *customCommand) preRunE(_ *cobra.Command, _ []string) error {
return err
}
+ if c.opts.version != "" {
+ cfg.Version = c.opts.version
+ }
+
+ if c.opts.name != "" {
+ cfg.Name = c.opts.name
+ }
+
+ if c.opts.destination != "" {
+ cfg.Destination = c.opts.destination
+ }
+
err = cfg.Validate()
if err != nil {
return err
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/builder.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/builder.go
index bfd242f15..63f6f2f18 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/builder.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/builder.go
@@ -92,7 +92,7 @@ func (b Builder) clone(ctx context.Context) error {
//nolint:gosec // the variable is sanitized.
cmd := exec.CommandContext(ctx,
"git", "clone", "--branch", sanitizeVersion(b.cfg.Version),
- "--single-branch", "--depth", "1", "-c advice.detachedHead=false", "-q",
+ "--single-branch", "--depth", "1", "-c", "advice.detachedHead=false", "-q",
"https://github.com/golangci/golangci-lint.git",
)
cmd.Dir = b.root
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/configuration.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/configuration.go
index f9de4c47a..0982c3eca 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/configuration.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/configuration.go
@@ -7,7 +7,7 @@ import (
"path/filepath"
"strings"
- "gopkg.in/yaml.v3"
+ "go.yaml.in/yaml/v3"
)
const base = ".custom-gcl"
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/migrate/parser/parser.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/migrate/parser/parser.go
index ea00b41f5..293eaf18a 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/migrate/parser/parser.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/migrate/parser/parser.go
@@ -10,7 +10,7 @@ import (
"strings"
"github.com/pelletier/go-toml/v2"
- "gopkg.in/yaml.v3"
+ "go.yaml.in/yaml/v3"
)
type File interface {
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/migrate/versionone/linters_settings.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/migrate/versionone/linters_settings.go
index 44583b7d3..3c641541c 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/migrate/versionone/linters_settings.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/internal/migrate/versionone/linters_settings.go
@@ -3,7 +3,7 @@ package versionone
import (
"encoding"
- "gopkg.in/yaml.v3"
+ "go.yaml.in/yaml/v3"
"github.com/golangci/golangci-lint/v2/pkg/commands/internal/migrate/ptr"
)
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/run.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/run.go
index d1c96b88e..93efa6d9c 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/run.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/run.go
@@ -26,8 +26,8 @@ import (
"github.com/spf13/pflag"
"github.com/spf13/viper"
"go.uber.org/automaxprocs/maxprocs"
+ "go.yaml.in/yaml/v3"
"golang.org/x/mod/sumdb/dirhash"
- "gopkg.in/yaml.v3"
"github.com/golangci/golangci-lint/v2/internal/cache"
"github.com/golangci/golangci-lint/v2/pkg/config"
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/config/linters_settings.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/config/linters_settings.go
index ba60dd2c6..fefa94ca3 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/config/linters_settings.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/config/linters_settings.go
@@ -834,15 +834,16 @@ type RecvcheckSettings struct {
}
type ReviveSettings struct {
- Go string `mapstructure:"-"`
- MaxOpenFiles int `mapstructure:"max-open-files"`
- Confidence float64 `mapstructure:"confidence"`
- Severity string `mapstructure:"severity"`
- EnableAllRules bool `mapstructure:"enable-all-rules"`
- Rules []ReviveRule `mapstructure:"rules"`
- ErrorCode int `mapstructure:"error-code"`
- WarningCode int `mapstructure:"warning-code"`
- Directives []ReviveDirective `mapstructure:"directives"`
+ Go string `mapstructure:"-"`
+ MaxOpenFiles int `mapstructure:"max-open-files"`
+ Confidence float64 `mapstructure:"confidence"`
+ Severity string `mapstructure:"severity"`
+ EnableAllRules bool `mapstructure:"enable-all-rules"`
+ EnableDefaultRules bool `mapstructure:"enable-default-rules"`
+ Rules []ReviveRule `mapstructure:"rules"`
+ ErrorCode int `mapstructure:"error-code"`
+ WarningCode int `mapstructure:"warning-code"`
+ Directives []ReviveDirective `mapstructure:"directives"`
}
type ReviveRule struct {
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/goformatters/gci/internal/config/config.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/goformatters/gci/internal/config/config.go
index c859b442f..13ca6dd86 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/goformatters/gci/internal/config/config.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/goformatters/gci/internal/config/config.go
@@ -4,7 +4,7 @@ import (
"sort"
"strings"
- "gopkg.in/yaml.v3"
+ "go.yaml.in/yaml/v3"
"github.com/daixiang0/gci/pkg/config"
"github.com/daixiang0/gci/pkg/section"
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/contextcheck/contextcheck.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/contextcheck/contextcheck.go
index 88c71d2d3..b01df7d98 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/contextcheck/contextcheck.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/contextcheck/contextcheck.go
@@ -2,6 +2,8 @@ package contextcheck
import (
"github.com/kkHAIKE/contextcheck"
+ "golang.org/x/tools/go/analysis/passes/ctrlflow"
+ "golang.org/x/tools/go/analysis/passes/inspect"
"github.com/golangci/golangci-lint/v2/pkg/goanalysis"
"github.com/golangci/golangci-lint/v2/pkg/lint/linter"
@@ -9,6 +11,11 @@ import (
func New() *goanalysis.Linter {
analyzer := contextcheck.NewAnalyzer(contextcheck.Configuration{})
+ // TODO(ldez) there is a problem with this linter:
+ // I think the problem related to facts.
+ // The BuildSSA pass has been changed inside (0.39.0):
+ // https://github.com/golang/tools/commit/b74c09864920a69a4d2f6ef0ecb4f9cff226893a
+ analyzer.Requires = append(analyzer.Requires, ctrlflow.Analyzer, inspect.Analyzer)
return goanalysis.
NewLinterFromAnalyzer(analyzer).
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/forbidigo/forbidigo.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/forbidigo/forbidigo.go
index 796faf3a6..1473b4d6e 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/forbidigo/forbidigo.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/forbidigo/forbidigo.go
@@ -4,8 +4,8 @@ import (
"fmt"
"github.com/ashanbrown/forbidigo/v2/forbidigo"
+ "go.yaml.in/yaml/v3"
"golang.org/x/tools/go/analysis"
- "gopkg.in/yaml.v3"
"github.com/golangci/golangci-lint/v2/pkg/config"
"github.com/golangci/golangci-lint/v2/pkg/goanalysis"
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/modernize/modernize.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/modernize/modernize.go
index 97825c07e..08cccdeb8 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/modernize/modernize.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/modernize/modernize.go
@@ -14,9 +14,9 @@ func New(settings *config.ModernizeSettings) *goanalysis.Linter {
var analyzers []*analysis.Analyzer
if settings == nil {
- analyzers = modernize.Suite
+ analyzers = cleanSuite()
} else {
- for _, analyzer := range modernize.Suite {
+ for _, analyzer := range cleanSuite() {
if slices.Contains(settings.Disable, analyzer.Name) {
continue
}
@@ -32,3 +32,19 @@ func New(settings *config.ModernizeSettings) *goanalysis.Linter {
nil).
WithLoadMode(goanalysis.LoadModeTypesInfo)
}
+
+func cleanSuite() []*analysis.Analyzer {
+ var analyzers []*analysis.Analyzer
+
+ for _, analyzer := range modernize.Suite {
+ // Disabled because of false positives
+ // https://github.com/golang/go/issues/76687
+ if analyzer.Name == "stringscut" {
+ continue
+ }
+
+ analyzers = append(analyzers, analyzer)
+ }
+
+ return analyzers
+}
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/revive/revive.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/revive/revive.go
index 8e5a7835d..6799e1a42 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/revive/revive.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/revive/revive.go
@@ -169,8 +169,8 @@ func (w *wrapper) toIssue(pass *analysis.Pass, failure *lint.Failure) *goanalysi
// This function mimics the GetConfig function of revive.
// This allows to get default values and right types.
// https://github.com/golangci/golangci-lint/issues/1745
-// https://github.com/mgechev/revive/blob/v1.6.0/config/config.go#L230
-// https://github.com/mgechev/revive/blob/v1.6.0/config/config.go#L182-L188
+// https://github.com/mgechev/revive/blob/v1.13.0/config/config.go#L249
+// https://github.com/mgechev/revive/blob/v1.13.0/config/config.go#L198-L204
func getConfig(cfg *config.ReviveSettings) (*lint.Config, error) {
conf := defaultConfig()
@@ -269,7 +269,7 @@ func safeTomlSlice(r []any) []any {
}
// This element is not exported by revive, so we need copy the code.
-// Extracted from https://github.com/mgechev/revive/blob/v1.12.0/config/config.go#L16
+// Extracted from https://github.com/mgechev/revive/blob/v1.13.0/config/config.go#L16
var defaultRules = []lint.Rule{
&rule.VarDeclarationsRule{},
&rule.PackageCommentsRule{},
@@ -325,6 +325,7 @@ var allRules = append([]lint.Rule{
&rule.FileLengthLimitRule{},
&rule.FilenameFormatRule{},
&rule.FlagParamRule{},
+ &rule.ForbiddenCallInWgGoRule{},
&rule.FunctionLength{},
&rule.FunctionResultsLimitRule{},
&rule.GetReturnRule{},
@@ -337,6 +338,7 @@ var allRules = append([]lint.Rule{
&rule.ImportAliasNamingRule{},
&rule.ImportsBlocklistRule{},
&rule.ImportShadowingRule{},
+ &rule.InefficientMapLookupRule{},
&rule.LineLengthLimitRule{},
&rule.MaxControlNestingRule{},
&rule.MaxPublicStructsRule{},
@@ -360,6 +362,7 @@ var allRules = append([]lint.Rule{
&rule.UnexportedNamingRule{},
&rule.UnhandledErrorRule{},
&rule.UnnecessaryFormatRule{},
+ &rule.UnnecessaryIfRule{},
&rule.UnnecessaryStmtRule{},
&rule.UnsecureURLSchemeRule{},
&rule.UnusedReceiverRule{},
@@ -375,7 +378,7 @@ var allRules = append([]lint.Rule{
const defaultConfidence = 0.8
// This element is not exported by revive, so we need copy the code.
-// Extracted from https://github.com/mgechev/revive/blob/v1.12.0/config/config.go#L206
+// Extracted from https://github.com/mgechev/revive/blob/v1.13.0/config/config.go#L209
func normalizeConfig(cfg *lint.Config) {
// NOTE(ldez): this custom section for golangci-lint should be kept.
// ---
@@ -386,19 +389,22 @@ func normalizeConfig(cfg *lint.Config) {
if len(cfg.Rules) == 0 {
cfg.Rules = map[string]lint.RuleConfig{}
}
- if cfg.EnableAllRules {
- // Add to the configuration all rules not yet present in it
- for _, r := range allRules {
+
+ addRules := func(config *lint.Config, rules []lint.Rule) {
+ for _, r := range rules {
ruleName := r.Name()
- _, alreadyInConf := cfg.Rules[ruleName]
- if alreadyInConf {
- continue
+ if _, ok := config.Rules[ruleName]; !ok {
+ config.Rules[ruleName] = lint.RuleConfig{}
}
- // Add the rule with an empty conf for
- cfg.Rules[ruleName] = lint.RuleConfig{}
}
}
+ if cfg.EnableAllRules {
+ addRules(cfg, allRules)
+ } else if cfg.EnableDefaultRules {
+ addRules(cfg, defaultRules)
+ }
+
severity := cfg.Severity
if severity != "" {
for k, v := range cfg.Rules {
@@ -417,7 +423,7 @@ func normalizeConfig(cfg *lint.Config) {
}
// This element is not exported by revive, so we need copy the code.
-// Extracted from https://github.com/mgechev/revive/blob/v1.12.0/config/config.go#L274
+// Extracted from https://github.com/mgechev/revive/blob/v1.13.0/config/config.go#L280
func defaultConfig() *lint.Config {
defaultConfig := lint.Config{
Confidence: defaultConfidence,
@@ -463,7 +469,7 @@ func extractRulesName(rules []lint.Rule) []string {
return names
}
-// Extracted from https://github.com/mgechev/revive/blob/v1.12.0/formatter/severity.go
+// Extracted from https://github.com/mgechev/revive/blob/v1.13.0/formatter/severity.go
// Modified to use pointers (related to hugeParam rule).
func severity(cfg *lint.Config, failure *lint.Failure) lint.Severity {
if cfg, ok := cfg.Rules[failure.RuleName]; ok && cfg.Severity == lint.SeverityError {
diff --git a/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/linter/config.go b/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/linter/config.go
index 0287dece9..a5b98413d 100644
--- a/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/linter/config.go
+++ b/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/linter/config.go
@@ -4,8 +4,8 @@ import (
"bytes"
"fmt"
+ "go.yaml.in/yaml/v3"
"golang.org/x/tools/go/packages"
- "gopkg.in/yaml.v3"
"github.com/golangci/golangci-lint/v2/pkg/config"
)
diff --git a/vendor/github.com/google/cel-go/cel/BUILD.bazel b/vendor/github.com/google/cel-go/cel/BUILD.bazel
index 81549fb4c..c12e4904d 100644
--- a/vendor/github.com/google/cel-go/cel/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/cel/BUILD.bazel
@@ -11,15 +11,17 @@ go_library(
"decls.go",
"env.go",
"folding.go",
- "io.go",
"inlining.go",
+ "io.go",
"library.go",
"macro.go",
"optimizer.go",
"options.go",
"program.go",
+ "prompt.go",
"validator.go",
],
+ embedsrcs = ["//cel/templates"],
importpath = "github.com/google/cel-go/cel",
visibility = ["//visibility:public"],
deps = [
@@ -29,6 +31,7 @@ go_library(
"//common/ast:go_default_library",
"//common/containers:go_default_library",
"//common/decls:go_default_library",
+ "//common/env:go_default_library",
"//common/functions:go_default_library",
"//common/operators:go_default_library",
"//common/overloads:go_default_library",
@@ -61,9 +64,10 @@ go_test(
"decls_test.go",
"env_test.go",
"folding_test.go",
- "io_test.go",
"inlining_test.go",
+ "io_test.go",
"optimizer_test.go",
+ "prompt_test.go",
"validator_test.go",
],
data = [
@@ -72,6 +76,9 @@ go_test(
embed = [
":go_default_library",
],
+ embedsrcs = [
+ "//cel/testdata:prompts",
+ ],
deps = [
"//common/operators:go_default_library",
"//common/overloads:go_default_library",
@@ -83,8 +90,8 @@ go_test(
"//test/proto2pb:go_default_library",
"//test/proto3pb:go_default_library",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
- "@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//encoding/prototext:go_default_library",
+ "@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//types/known/structpb:go_default_library",
"@org_golang_google_protobuf//types/known/wrapperspb:go_default_library",
],
diff --git a/vendor/github.com/google/cel-go/cel/decls.go b/vendor/github.com/google/cel-go/cel/decls.go
index 418806021..4d4873bd6 100644
--- a/vendor/github.com/google/cel-go/cel/decls.go
+++ b/vendor/github.com/google/cel-go/cel/decls.go
@@ -142,8 +142,23 @@ func Constant(name string, t *Type, v ref.Val) EnvOption {
// Variable creates an instance of a variable declaration with a variable name and type.
func Variable(name string, t *Type) EnvOption {
+ return VariableWithDoc(name, t, "")
+}
+
+// VariableWithDoc creates an instance of a variable declaration with a variable name, type, and doc string.
+func VariableWithDoc(name string, t *Type, doc string) EnvOption {
+ return func(e *Env) (*Env, error) {
+ e.variables = append(e.variables, decls.NewVariableWithDoc(name, t, doc))
+ return e, nil
+ }
+}
+
+// VariableDecls configures a set of fully defined cel.VariableDecl instances in the environment.
+func VariableDecls(vars ...*decls.VariableDecl) EnvOption {
return func(e *Env) (*Env, error) {
- e.variables = append(e.variables, decls.NewVariable(name, t))
+ for _, v := range vars {
+ e.variables = append(e.variables, v)
+ }
return e, nil
}
}
@@ -183,13 +198,38 @@ func Function(name string, opts ...FunctionOpt) EnvOption {
if err != nil {
return nil, err
}
- if existing, found := e.functions[fn.Name()]; found {
- fn, err = existing.Merge(fn)
- if err != nil {
- return nil, err
+ return FunctionDecls(fn)(e)
+ }
+}
+
+// OverloadSelector selects an overload associated with a given function when it returns true.
+//
+// Used in combination with the FunctionDecl.Subset method.
+type OverloadSelector = decls.OverloadSelector
+
+// IncludeOverloads defines an OverloadSelector which allow-lists a set of overloads by their ids.
+func IncludeOverloads(overloadIDs ...string) OverloadSelector {
+ return decls.IncludeOverloads(overloadIDs...)
+}
+
+// ExcludeOverloads defines an OverloadSelector which deny-lists a set of overloads by their ids.
+func ExcludeOverloads(overloadIDs ...string) OverloadSelector {
+ return decls.ExcludeOverloads(overloadIDs...)
+}
+
+// FunctionDecls provides one or more fully formed function declarations to be added to the environment.
+func FunctionDecls(funcs ...*decls.FunctionDecl) EnvOption {
+ return func(e *Env) (*Env, error) {
+ var err error
+ for _, fn := range funcs {
+ if existing, found := e.functions[fn.Name()]; found {
+ fn, err = existing.Merge(fn)
+ if err != nil {
+ return nil, err
+ }
}
+ e.functions[fn.Name()] = fn
}
- e.functions[fn.Name()] = fn
return e, nil
}
}
@@ -197,6 +237,13 @@ func Function(name string, opts ...FunctionOpt) EnvOption {
// FunctionOpt defines a functional option for configuring a function declaration.
type FunctionOpt = decls.FunctionOpt
+// FunctionDocs provides a general usage documentation for the function.
+//
+// Use OverloadExamples to provide example usage instructions for specific overloads.
+func FunctionDocs(docs ...string) FunctionOpt {
+ return decls.FunctionDocs(docs...)
+}
+
// SingletonUnaryBinding creates a singleton function definition to be used for all function overloads.
//
// Note, this approach works well if operand is expected to have a specific trait which it implements,
@@ -270,6 +317,11 @@ func MemberOverload(overloadID string, args []*Type, resultType *Type, opts ...O
// OverloadOpt is a functional option for configuring a function overload.
type OverloadOpt = decls.OverloadOpt
+// OverloadExamples configures an example of how to invoke the overload.
+func OverloadExamples(docs ...string) OverloadOpt {
+ return decls.OverloadExamples(docs...)
+}
+
// UnaryBinding provides the implementation of a unary overload. The provided function is protected by a runtime
// type-guard which ensures runtime type agreement between the overload signature and runtime argument types.
func UnaryBinding(binding functions.UnaryOp) OverloadOpt {
@@ -288,6 +340,12 @@ func FunctionBinding(binding functions.FunctionOp) OverloadOpt {
return decls.FunctionBinding(binding)
}
+// LateFunctionBinding indicates that the function has a binding which is not known at compile time.
+// This is useful for functions which have side-effects or are not deterministically computable.
+func LateFunctionBinding() OverloadOpt {
+ return decls.LateFunctionBinding()
+}
+
// OverloadIsNonStrict enables the function to be called with error and unknown argument values.
//
// Note: do not use this option unless absoluately necessary as it should be an uncommon feature.
diff --git a/vendor/github.com/google/cel-go/cel/env.go b/vendor/github.com/google/cel-go/cel/env.go
index caee8e8c1..58819e872 100644
--- a/vendor/github.com/google/cel-go/cel/env.go
+++ b/vendor/github.com/google/cel-go/cel/env.go
@@ -16,6 +16,8 @@ package cel
import (
"errors"
+ "fmt"
+ "math"
"sync"
"github.com/google/cel-go/checker"
@@ -24,12 +26,16 @@ import (
celast "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/containers"
"github.com/google/cel-go/common/decls"
+ "github.com/google/cel-go/common/env"
+ "github.com/google/cel-go/common/functions"
+ "github.com/google/cel-go/common/stdlib"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/interpreter"
"github.com/google/cel-go/parser"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "google.golang.org/protobuf/reflect/protoreflect"
)
// Source interface representing a user-provided expression.
@@ -127,15 +133,19 @@ type Env struct {
Container *containers.Container
variables []*decls.VariableDecl
functions map[string]*decls.FunctionDecl
- macros []parser.Macro
+ macros []Macro
+ contextProto protoreflect.MessageDescriptor
adapter types.Adapter
provider types.Provider
features map[int]bool
appliedFeatures map[int]bool
- libraries map[string]bool
+ libraries map[string]SingletonLibrary
validators []ASTValidator
costOptions []checker.CostOption
+ funcBindOnce sync.Once
+ functionBindings []*functions.Overload
+
// Internal parser representation
prsr *parser.Parser
prsrOpts []parser.Option
@@ -151,6 +161,134 @@ type Env struct {
progOpts []ProgramOption
}
+// ToConfig produces a YAML-serializable env.Config object from the given environment.
+//
+// The serialized configuration value is intended to represent a baseline set of config
+// options which could be used as input to an EnvOption to configure the majority of the
+// environment from a file.
+//
+// Note: validators, features, flags, and safe-guard settings are not yet supported by
+// the serialize method. Since optimizers are a separate construct from the environment
+// and the standard expression components (parse, check, evalute), they are also not
+// supported by the serialize method.
+func (e *Env) ToConfig(name string) (*env.Config, error) {
+ conf := env.NewConfig(name)
+ // Container settings
+ if e.Container != containers.DefaultContainer {
+ conf.SetContainer(e.Container.Name())
+ }
+ for _, typeName := range e.Container.AliasSet() {
+ conf.AddImports(env.NewImport(typeName))
+ }
+
+ libOverloads := map[string][]string{}
+ for libName, lib := range e.libraries {
+ // Track the options which have been configured by a library and
+ // then diff the library version against the configured function
+ // to detect incremental overloads or rewrites.
+ libEnv, _ := NewCustomEnv()
+ libEnv, _ = Lib(lib)(libEnv)
+ for fnName, fnDecl := range libEnv.Functions() {
+ if len(fnDecl.OverloadDecls()) == 0 {
+ continue
+ }
+ overloads, exist := libOverloads[fnName]
+ if !exist {
+ overloads = make([]string, 0, len(fnDecl.OverloadDecls()))
+ }
+ for _, o := range fnDecl.OverloadDecls() {
+ overloads = append(overloads, o.ID())
+ }
+ libOverloads[fnName] = overloads
+ }
+ subsetLib, canSubset := lib.(LibrarySubsetter)
+ alias := ""
+ if aliasLib, canAlias := lib.(LibraryAliaser); canAlias {
+ alias = aliasLib.LibraryAlias()
+ libName = alias
+ }
+ if libName == "stdlib" && canSubset {
+ conf.SetStdLib(subsetLib.LibrarySubset())
+ continue
+ }
+ version := uint32(math.MaxUint32)
+ if versionLib, isVersioned := lib.(LibraryVersioner); isVersioned {
+ version = versionLib.LibraryVersion()
+ }
+ conf.AddExtensions(env.NewExtension(libName, version))
+ }
+
+ // If this is a custom environment without the standard env, mark the stdlib as disabled.
+ if conf.StdLib == nil && !e.HasLibrary("cel.lib.std") {
+ conf.SetStdLib(env.NewLibrarySubset().SetDisabled(true))
+ }
+
+ // Serialize the variables
+ vars := make([]*decls.VariableDecl, 0, len(e.Variables()))
+ stdTypeVars := map[string]*decls.VariableDecl{}
+ for _, v := range stdlib.Types() {
+ stdTypeVars[v.Name()] = v
+ }
+ for _, v := range e.Variables() {
+ if _, isStdType := stdTypeVars[v.Name()]; isStdType {
+ continue
+ }
+ vars = append(vars, v)
+ }
+ if e.contextProto != nil {
+ conf.SetContextVariable(env.NewContextVariable(string(e.contextProto.FullName())))
+ skipVariables := map[string]bool{}
+ fields := e.contextProto.Fields()
+ for i := 0; i < fields.Len(); i++ {
+ field := fields.Get(i)
+ variable, err := fieldToVariable(field)
+ if err != nil {
+ return nil, fmt.Errorf("could not serialize context field variable %q, reason: %w", field.FullName(), err)
+ }
+ skipVariables[variable.Name()] = true
+ }
+ for _, v := range vars {
+ if _, found := skipVariables[v.Name()]; !found {
+ conf.AddVariableDecls(v)
+ }
+ }
+ } else {
+ conf.AddVariableDecls(vars...)
+ }
+
+ // Serialize functions which are distinct from the ones configured by libraries.
+ for fnName, fnDecl := range e.Functions() {
+ if excludedOverloads, found := libOverloads[fnName]; found {
+ if newDecl := fnDecl.Subset(decls.ExcludeOverloads(excludedOverloads...)); newDecl != nil {
+ conf.AddFunctionDecls(newDecl)
+ }
+ } else {
+ conf.AddFunctionDecls(fnDecl)
+ }
+ }
+
+ // Serialize validators
+ for _, val := range e.Validators() {
+ // Only add configurable validators to the env.Config as all others are
+ // expected to be implicitly enabled via extension libraries.
+ if confVal, ok := val.(ConfigurableASTValidator); ok {
+ conf.AddValidators(confVal.ToConfig())
+ }
+ }
+
+ // Serialize features
+ for featID, enabled := range e.features {
+ featName, found := featureNameByID(featID)
+ if !found {
+ // If the feature isn't named, it isn't intended to be publicly exposed
+ continue
+ }
+ conf.AddFeatures(env.NewFeature(featName, enabled))
+ }
+
+ return conf, nil
+}
+
// NewEnv creates a program environment configured with the standard library of CEL functions and
// macros. The Env value returned can parse and check any CEL program which builds upon the core
// features documented in the CEL specification.
@@ -186,18 +324,19 @@ func NewCustomEnv(opts ...EnvOption) (*Env, error) {
return nil, err
}
return (&Env{
- variables: []*decls.VariableDecl{},
- functions: map[string]*decls.FunctionDecl{},
- macros: []parser.Macro{},
- Container: containers.DefaultContainer,
- adapter: registry,
- provider: registry,
- features: map[int]bool{},
- appliedFeatures: map[int]bool{},
- libraries: map[string]bool{},
- validators: []ASTValidator{},
- progOpts: []ProgramOption{},
- costOptions: []checker.CostOption{},
+ variables: []*decls.VariableDecl{},
+ functions: map[string]*decls.FunctionDecl{},
+ functionBindings: []*functions.Overload{},
+ macros: []parser.Macro{},
+ Container: containers.DefaultContainer,
+ adapter: registry,
+ provider: registry,
+ features: map[int]bool{},
+ appliedFeatures: map[int]bool{},
+ libraries: map[string]SingletonLibrary{},
+ validators: []ASTValidator{},
+ progOpts: []ProgramOption{},
+ costOptions: []checker.CostOption{},
}).configure(opts)
}
@@ -217,7 +356,7 @@ func (e *Env) Check(ast *Ast) (*Ast, *Issues) {
chk, err := e.initChecker()
if err != nil {
errs := common.NewErrors(ast.Source())
- errs.ReportError(common.NoLocation, err.Error())
+ errs.ReportErrorString(common.NoLocation, err.Error())
return nil, NewIssuesWithSourceInfo(errs, ast.NativeRep().SourceInfo())
}
@@ -362,7 +501,7 @@ func (e *Env) Extend(opts ...EnvOption) (*Env, error) {
for k, v := range e.functions {
funcsCopy[k] = v
}
- libsCopy := make(map[string]bool, len(e.libraries))
+ libsCopy := make(map[string]SingletonLibrary, len(e.libraries))
for k, v := range e.libraries {
libsCopy[k] = v
}
@@ -376,6 +515,7 @@ func (e *Env) Extend(opts ...EnvOption) (*Env, error) {
variables: varsCopy,
functions: funcsCopy,
macros: macsCopy,
+ contextProto: e.contextProto,
progOpts: progOptsCopy,
adapter: adapter,
features: featuresCopy,
@@ -399,8 +539,8 @@ func (e *Env) HasFeature(flag int) bool {
// HasLibrary returns whether a specific SingletonLibrary has been configured in the environment.
func (e *Env) HasLibrary(libName string) bool {
- configured, exists := e.libraries[libName]
- return exists && configured
+ _, exists := e.libraries[libName]
+ return exists
}
// Libraries returns a list of SingletonLibrary that have been configured in the environment.
@@ -418,9 +558,27 @@ func (e *Env) HasFunction(functionName string) bool {
return ok
}
-// Functions returns map of Functions, keyed by function name, that have been configured in the environment.
+// Functions returns a shallow copy of the Functions, keyed by function name, that have been configured in the environment.
func (e *Env) Functions() map[string]*decls.FunctionDecl {
- return e.functions
+ shallowCopy := make(map[string]*decls.FunctionDecl, len(e.functions))
+ for nm, fn := range e.functions {
+ shallowCopy[nm] = fn
+ }
+ return shallowCopy
+}
+
+// Variables returns a shallow copy of the variables associated with the environment.
+func (e *Env) Variables() []*decls.VariableDecl {
+ shallowCopy := make([]*decls.VariableDecl, len(e.variables))
+ copy(shallowCopy, e.variables)
+ return shallowCopy
+}
+
+// Macros returns a shallow copy of macros associated with the environment.
+func (e *Env) Macros() []Macro {
+ shallowCopy := make([]Macro, len(e.macros))
+ copy(shallowCopy, e.macros)
+ return shallowCopy
}
// HasValidator returns whether a specific ASTValidator has been configured in the environment.
@@ -433,6 +591,11 @@ func (e *Env) HasValidator(name string) bool {
return false
}
+// Validators returns the set of ASTValidators configured on the environment.
+func (e *Env) Validators() []ASTValidator {
+ return e.validators[:]
+}
+
// Parse parses the input expression value `txt` to a Ast and/or a set of Issues.
//
// This form of Parse creates a Source value for the input `txt` and forwards to the
@@ -502,31 +665,30 @@ func (e *Env) TypeProvider() ref.TypeProvider {
return &interopLegacyTypeProvider{Provider: e.provider}
}
-// UnknownVars returns an interpreter.PartialActivation which marks all variables declared in the
-// Env as unknown AttributePattern values.
+// UnknownVars returns a PartialActivation which marks all variables declared in the Env as
+// unknown AttributePattern values.
//
-// Note, the UnknownVars will behave the same as an interpreter.EmptyActivation unless the
-// PartialAttributes option is provided as a ProgramOption.
-func (e *Env) UnknownVars() interpreter.PartialActivation {
+// Note, the UnknownVars will behave the same as an cel.NoVars() unless the PartialAttributes
+// option is provided as a ProgramOption.
+func (e *Env) UnknownVars() PartialActivation {
act := interpreter.EmptyActivation()
part, _ := PartialVars(act, e.computeUnknownVars(act)...)
return part
}
-// PartialVars returns an interpreter.PartialActivation where all variables not in the input variable
+// PartialVars returns a PartialActivation where all variables not in the input variable
// set, but which have been configured in the environment, are marked as unknown.
//
-// The `vars` value may either be an interpreter.Activation or any valid input to the
-// interpreter.NewActivation call.
+// The `vars` value may either be an Activation or any valid input to the cel.NewActivation call.
//
// Note, this is equivalent to calling cel.PartialVars and manually configuring the set of unknown
// variables. For more advanced use cases of partial state where portions of an object graph, rather
// than top-level variables, are missing the PartialVars() method may be a more suitable choice.
//
-// Note, the PartialVars will behave the same as an interpreter.EmptyActivation unless the
-// PartialAttributes option is provided as a ProgramOption.
-func (e *Env) PartialVars(vars any) (interpreter.PartialActivation, error) {
- act, err := interpreter.NewActivation(vars)
+// Note, the PartialVars will behave the same as cel.NoVars() unless the PartialAttributes
+// option is provided as a ProgramOption.
+func (e *Env) PartialVars(vars any) (PartialActivation, error) {
+ act, err := NewActivation(vars)
if err != nil {
return nil, err
}
@@ -598,10 +760,15 @@ func (e *Env) configure(opts []EnvOption) (*Env, error) {
}
}
- // If the default UTC timezone fix has been enabled, make sure the library is configured
- e, err = e.maybeApplyFeature(featureDefaultUTCTimeZone, Lib(timeUTCLibrary{}))
- if err != nil {
- return nil, err
+ // If the default UTC timezone has been disabled, configure the legacy overloads
+ if utcTime, isSet := e.features[featureDefaultUTCTimeZone]; isSet && !utcTime {
+ if !e.appliedFeatures[featureDefaultUTCTimeZone] {
+ e.appliedFeatures[featureDefaultUTCTimeZone] = true
+ e, err = Lib(timeLegacyLibrary{})(e)
+ if err != nil {
+ return nil, err
+ }
+ }
}
// Configure the parser.
@@ -615,6 +782,9 @@ func (e *Env) configure(opts []EnvOption) (*Env, error) {
if e.HasFeature(featureVariadicLogicalASTs) {
prsrOpts = append(prsrOpts, parser.EnableVariadicOperatorASTs(true))
}
+ if e.HasFeature(featureIdentEscapeSyntax) {
+ prsrOpts = append(prsrOpts, parser.EnableIdentEscapeSyntax(true))
+ }
e.prsr, err = parser.NewParser(prsrOpts...)
if err != nil {
return nil, err
@@ -682,30 +852,9 @@ func (e *Env) getCheckerOrError() (*checker.Env, error) {
return e.chk, e.chkErr
}
-// maybeApplyFeature determines whether the feature-guarded option is enabled, and if so applies
-// the feature if it has not already been enabled.
-func (e *Env) maybeApplyFeature(feature int, option EnvOption) (*Env, error) {
- if !e.HasFeature(feature) {
- return e, nil
- }
- _, applied := e.appliedFeatures[feature]
- if applied {
- return e, nil
- }
- e, err := option(e)
- if err != nil {
- return nil, err
- }
- // record that the feature has been applied since it will generate declarations
- // and functions which will be propagated on Extend() calls and which should only
- // be registered once.
- e.appliedFeatures[feature] = true
- return e, nil
-}
-
// computeUnknownVars determines a set of missing variables based on the input activation and the
// environment's configured declaration set.
-func (e *Env) computeUnknownVars(vars interpreter.Activation) []*interpreter.AttributePattern {
+func (e *Env) computeUnknownVars(vars Activation) []*interpreter.AttributePattern {
var unknownPatterns []*interpreter.AttributePattern
for _, v := range e.variables {
varName := v.Name()
diff --git a/vendor/github.com/google/cel-go/cel/folding.go b/vendor/github.com/google/cel-go/cel/folding.go
index d7060896d..d1ea6b19d 100644
--- a/vendor/github.com/google/cel-go/cel/folding.go
+++ b/vendor/github.com/google/cel-go/cel/folding.go
@@ -38,6 +38,23 @@ func MaxConstantFoldIterations(limit int) ConstantFoldingOption {
}
}
+// FoldKnownValues adds an Activation which provides known values for the folding evaluator
+//
+// Any values the activation provides will be used by the constant folder and turned into
+// literals in the AST.
+//
+// Defaults to the NoVars() Activation
+func FoldKnownValues(knownValues Activation) ConstantFoldingOption {
+ return func(opt *constantFoldingOptimizer) (*constantFoldingOptimizer, error) {
+ if knownValues != nil {
+ opt.knownValues = knownValues
+ } else {
+ opt.knownValues = NoVars()
+ }
+ return opt, nil
+ }
+}
+
// NewConstantFoldingOptimizer creates an optimizer which inlines constant scalar an aggregate
// literal values within function calls and select statements with their evaluated result.
func NewConstantFoldingOptimizer(opts ...ConstantFoldingOption) (ASTOptimizer, error) {
@@ -56,6 +73,7 @@ func NewConstantFoldingOptimizer(opts ...ConstantFoldingOption) (ASTOptimizer, e
type constantFoldingOptimizer struct {
maxFoldIterations int
+ knownValues Activation
}
// Optimize queries the expression graph for scalar and aggregate literal expressions within call and
@@ -68,7 +86,8 @@ func (opt *constantFoldingOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST)
// Walk the list of foldable expression and continue to fold until there are no more folds left.
// All of the fold candidates returned by the constantExprMatcher should succeed unless there's
// a logic bug with the selection of expressions.
- foldableExprs := ast.MatchDescendants(root, constantExprMatcher)
+ constantExprMatcherCapture := func(e ast.NavigableExpr) bool { return opt.constantExprMatcher(ctx, a, e) }
+ foldableExprs := ast.MatchDescendants(root, constantExprMatcherCapture)
foldCount := 0
for len(foldableExprs) != 0 && foldCount < opt.maxFoldIterations {
for _, fold := range foldableExprs {
@@ -77,21 +96,27 @@ func (opt *constantFoldingOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST)
if fold.Kind() == ast.CallKind && maybePruneBranches(ctx, fold) {
continue
}
+ // Late-bound function calls cannot be folded.
+ if fold.Kind() == ast.CallKind && isLateBoundFunctionCall(ctx, a, fold) {
+ continue
+ }
// Otherwise, assume all context is needed to evaluate the expression.
- err := tryFold(ctx, a, fold)
- if err != nil {
+ err := opt.tryFold(ctx, a, fold)
+ // Ignore errors for identifiers, since there is no guarantee that the environment
+ // has a value for them.
+ if err != nil && fold.Kind() != ast.IdentKind {
ctx.ReportErrorAtID(fold.ID(), "constant-folding evaluation failed: %v", err.Error())
return a
}
}
foldCount++
- foldableExprs = ast.MatchDescendants(root, constantExprMatcher)
+ foldableExprs = ast.MatchDescendants(root, constantExprMatcherCapture)
}
// Once all of the constants have been folded, try to run through the remaining comprehensions
// one last time. In this case, there's no guarantee they'll run, so we only update the
// target comprehension node with the literal value if the evaluation succeeds.
for _, compre := range ast.MatchDescendants(root, ast.KindMatcher(ast.ComprehensionKind)) {
- tryFold(ctx, a, compre)
+ opt.tryFold(ctx, a, compre)
}
// If the output is a list, map, or struct which contains optional entries, then prune it
@@ -121,7 +146,7 @@ func (opt *constantFoldingOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST)
//
// If the evaluation succeeds, the input expr value will be modified to become a literal, otherwise
// the method will return an error.
-func tryFold(ctx *OptimizerContext, a *ast.AST, expr ast.Expr) error {
+func (opt *constantFoldingOptimizer) tryFold(ctx *OptimizerContext, a *ast.AST, expr ast.Expr) error {
// Assume all context is needed to evaluate the expression.
subAST := &Ast{
impl: ast.NewCheckedAST(ast.NewAST(expr, a.SourceInfo()), a.TypeMap(), a.ReferenceMap()),
@@ -130,7 +155,11 @@ func tryFold(ctx *OptimizerContext, a *ast.AST, expr ast.Expr) error {
if err != nil {
return err
}
- out, _, err := prg.Eval(NoVars())
+ activation := opt.knownValues
+ if activation == nil {
+ activation = NoVars()
+ }
+ out, _, err := prg.Eval(activation)
if err != nil {
return err
}
@@ -139,6 +168,15 @@ func tryFold(ctx *OptimizerContext, a *ast.AST, expr ast.Expr) error {
return nil
}
+func isLateBoundFunctionCall(ctx *OptimizerContext, a *ast.AST, expr ast.Expr) bool {
+ call := expr.AsCall()
+ function := ctx.Functions()[call.FunctionName()]
+ if function == nil {
+ return false
+ }
+ return function.HasLateBinding()
+}
+
// maybePruneBranches inspects the non-strict call expression to determine whether
// a branch can be removed. Evaluation will naturally prune logical and / or calls,
// but conditional will not be pruned cleanly, so this is one small area where the
@@ -455,13 +493,15 @@ func adaptLiteral(ctx *OptimizerContext, val ref.Val) (ast.Expr, error) {
// Only comprehensions which are not nested are included as possible constant folds, and only
// if all variables referenced in the comprehension stack exist are only iteration or
// accumulation variables.
-func constantExprMatcher(e ast.NavigableExpr) bool {
+func (opt *constantFoldingOptimizer) constantExprMatcher(ctx *OptimizerContext, a *ast.AST, e ast.NavigableExpr) bool {
switch e.Kind() {
case ast.CallKind:
return constantCallMatcher(e)
case ast.SelectKind:
sel := e.AsSelect() // guaranteed to be a navigable value
return constantMatcher(sel.Operand().(ast.NavigableExpr))
+ case ast.IdentKind:
+ return opt.knownValues != nil && a.ReferenceMap()[e.ID()] != nil
case ast.ComprehensionKind:
if isNestedComprehension(e) {
return false
@@ -477,6 +517,10 @@ func constantExprMatcher(e ast.NavigableExpr) bool {
if e.Kind() == ast.IdentKind && !vars[e.AsIdent()] {
constantExprs = false
}
+ // Late-bound function calls cannot be folded.
+ if e.Kind() == ast.CallKind && isLateBoundFunctionCall(ctx, a, e) {
+ constantExprs = false
+ }
})
ast.PreOrderVisit(e, visitor)
return constantExprs
diff --git a/vendor/github.com/google/cel-go/cel/io.go b/vendor/github.com/google/cel-go/cel/io.go
index a327c9672..2e611228d 100644
--- a/vendor/github.com/google/cel-go/cel/io.go
+++ b/vendor/github.com/google/cel-go/cel/io.go
@@ -99,7 +99,13 @@ func AstToParsedExpr(a *Ast) (*exprpb.ParsedExpr, error) {
// Note, the conversion may not be an exact replica of the original expression, but will produce
// a string that is semantically equivalent and whose textual representation is stable.
func AstToString(a *Ast) (string, error) {
- return parser.Unparse(a.NativeRep().Expr(), a.NativeRep().SourceInfo())
+ return ExprToString(a.NativeRep().Expr(), a.NativeRep().SourceInfo())
+}
+
+// ExprToString converts an AST Expr node back to a string using macro call tracking metadata from
+// source info if any macros are encountered within the expression.
+func ExprToString(e ast.Expr, info *ast.SourceInfo) (string, error) {
+ return parser.Unparse(e, info)
}
// RefValueToValue converts between ref.Val and google.api.expr.v1alpha1.Value.
@@ -120,6 +126,55 @@ func ValueAsAlphaProto(res ref.Val) (*exprpb.Value, error) {
return alpha, err
}
+// RefValToExprValue converts between ref.Val and google.api.expr.v1alpha1.ExprValue.
+// The result ExprValue is the serialized proto form.
+func RefValToExprValue(res ref.Val) (*exprpb.ExprValue, error) {
+ return ExprValueAsAlphaProto(res)
+}
+
+// ExprValueAsAlphaProto converts between ref.Val and google.api.expr.v1alpha1.ExprValue.
+// The result ExprValue is the serialized proto form.
+func ExprValueAsAlphaProto(res ref.Val) (*exprpb.ExprValue, error) {
+ canonical, err := ExprValueAsProto(res)
+ if err != nil {
+ return nil, err
+ }
+ alpha := &exprpb.ExprValue{}
+ err = convertProto(canonical, alpha)
+ return alpha, err
+}
+
+// ExprValueAsProto converts between ref.Val and cel.expr.ExprValue.
+// The result ExprValue is the serialized proto form.
+func ExprValueAsProto(res ref.Val) (*celpb.ExprValue, error) {
+ switch res := res.(type) {
+ case *types.Unknown:
+ return &celpb.ExprValue{
+ Kind: &celpb.ExprValue_Unknown{
+ Unknown: &celpb.UnknownSet{
+ Exprs: res.IDs(),
+ },
+ }}, nil
+ case *types.Err:
+ return &celpb.ExprValue{
+ Kind: &celpb.ExprValue_Error{
+ Error: &celpb.ErrorSet{
+ // Keeping the error code as UNKNOWN since there's no error codes associated with
+ // Cel-Go runtime errors.
+ Errors: []*celpb.Status{{Code: 2, Message: res.Error()}},
+ },
+ },
+ }, nil
+ default:
+ val, err := ValueAsProto(res)
+ if err != nil {
+ return nil, err
+ }
+ return &celpb.ExprValue{
+ Kind: &celpb.ExprValue_Value{Value: val}}, nil
+ }
+}
+
// ValueAsProto converts between ref.Val and cel.expr.Value.
// The result Value is the serialized proto form. The ref.Val must not be error or unknown.
func ValueAsProto(res ref.Val) (*celpb.Value, error) {
diff --git a/vendor/github.com/google/cel-go/cel/library.go b/vendor/github.com/google/cel-go/cel/library.go
index be59f1b02..59a10e81d 100644
--- a/vendor/github.com/google/cel-go/cel/library.go
+++ b/vendor/github.com/google/cel-go/cel/library.go
@@ -15,12 +15,13 @@
package cel
import (
+ "fmt"
"math"
- "strconv"
- "strings"
- "time"
+ "github.com/google/cel-go/common"
"github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/decls"
+ "github.com/google/cel-go/common/env"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/overloads"
"github.com/google/cel-go/common/stdlib"
@@ -35,9 +36,11 @@ const (
optMapMacro = "optMap"
optFlatMapMacro = "optFlatMap"
hasValueFunc = "hasValue"
+ unwrapOptFunc = "unwrapOpt"
optionalNoneFunc = "optional.none"
optionalOfFunc = "optional.of"
optionalOfNonZeroValueFunc = "optional.ofNonZeroValue"
+ optionalUnwrapFunc = "optional.unwrap"
valueFunc = "value"
unusedIterVar = "#unused"
)
@@ -68,6 +71,23 @@ type SingletonLibrary interface {
LibraryName() string
}
+// LibraryAliaser generates a simple named alias for the library, for use during environment serialization.
+type LibraryAliaser interface {
+ LibraryAlias() string
+}
+
+// LibrarySubsetter provides the subset description associated with the library, nil if not subset.
+type LibrarySubsetter interface {
+ LibrarySubset() *env.LibrarySubset
+}
+
+// LibraryVersioner provides a version number for the library.
+//
+// If not implemented, the library version will be flagged as 'latest' during environment serialization.
+type LibraryVersioner interface {
+ LibraryVersion() uint32
+}
+
// Lib creates an EnvOption out of a Library, allowing libraries to be provided as functional args,
// and to be linked to each other.
func Lib(l Library) EnvOption {
@@ -77,7 +97,7 @@ func Lib(l Library) EnvOption {
if e.HasLibrary(singleton.LibraryName()) {
return e, nil
}
- e.libraries[singleton.LibraryName()] = true
+ e.libraries[singleton.LibraryName()] = singleton
}
var err error
for _, opt := range l.CompileOptions() {
@@ -91,26 +111,79 @@ func Lib(l Library) EnvOption {
}
}
+// StdLibOption specifies a functional option for configuring the standard CEL library.
+type StdLibOption func(*stdLibrary) *stdLibrary
+
+// StdLibSubset configures the standard library to use a subset of its functions and macros.
+//
+// Since the StdLib is a singleton library, only the first instance of the StdLib() environment options
+// will be configured on the environment which means only the StdLibSubset() initially configured with
+// the library will be used.
+func StdLibSubset(subset *env.LibrarySubset) StdLibOption {
+ return func(lib *stdLibrary) *stdLibrary {
+ lib.subset = subset
+ return lib
+ }
+}
+
// StdLib returns an EnvOption for the standard library of CEL functions and macros.
-func StdLib() EnvOption {
- return Lib(stdLibrary{})
+func StdLib(opts ...StdLibOption) EnvOption {
+ lib := &stdLibrary{}
+ for _, o := range opts {
+ lib = o(lib)
+ }
+ return Lib(lib)
}
// stdLibrary implements the Library interface and provides functional options for the core CEL
// features documented in the specification.
-type stdLibrary struct{}
+type stdLibrary struct {
+ subset *env.LibrarySubset
+}
// LibraryName implements the SingletonLibrary interface method.
-func (stdLibrary) LibraryName() string {
+func (*stdLibrary) LibraryName() string {
return "cel.lib.std"
}
+// LibraryAlias returns the simple name of the library.
+func (*stdLibrary) LibraryAlias() string {
+ return "stdlib"
+}
+
+// LibrarySubset returns the env.LibrarySubset definition associated with the CEL Library.
+func (lib *stdLibrary) LibrarySubset() *env.LibrarySubset {
+ return lib.subset
+}
+
// CompileOptions returns options for the standard CEL function declarations and macros.
-func (stdLibrary) CompileOptions() []EnvOption {
+func (lib *stdLibrary) CompileOptions() []EnvOption {
+ funcs := stdlib.Functions()
+ macros := StandardMacros
+ if lib.subset != nil {
+ subMacros := []Macro{}
+ for _, m := range macros {
+ if lib.subset.SubsetMacro(m.Function()) {
+ subMacros = append(subMacros, m)
+ }
+ }
+ macros = subMacros
+ subFuncs := []*decls.FunctionDecl{}
+ for _, fn := range funcs {
+ if f, include := lib.subset.SubsetFunction(fn); include {
+ subFuncs = append(subFuncs, f)
+ }
+ }
+ funcs = subFuncs
+ }
return []EnvOption{
func(e *Env) (*Env, error) {
var err error
- for _, fn := range stdlib.Functions() {
+ if err = lib.subset.Validate(); err != nil {
+ return nil, err
+ }
+ e.variables = append(e.variables, stdlib.Types()...)
+ for _, fn := range funcs {
existing, found := e.functions[fn.Name()]
if found {
fn, err = existing.Merge(fn)
@@ -122,16 +195,12 @@ func (stdLibrary) CompileOptions() []EnvOption {
}
return e, nil
},
- func(e *Env) (*Env, error) {
- e.variables = append(e.variables, stdlib.Types()...)
- return e, nil
- },
- Macros(StandardMacros...),
+ Macros(macros...),
}
}
// ProgramOptions returns function implementations for the standard CEL functions.
-func (stdLibrary) ProgramOptions() []ProgramOption {
+func (*stdLibrary) ProgramOptions() []ProgramOption {
return []ProgramOption{}
}
@@ -260,6 +329,36 @@ func (stdLibrary) ProgramOptions() []ProgramOption {
// be expressed with `optMap`.
//
// msg.?elements.optFlatMap(e, e[?0]) // return the first element if present.
+//
+// # First
+//
+// Introduced in version: 2
+//
+// Returns an optional with the first value from the right hand list, or
+// optional.None.
+//
+// [1, 2, 3].first().value() == 1
+//
+// # Last
+//
+// Introduced in version: 2
+//
+// Returns an optional with the last value from the right hand list, or
+// optional.None.
+//
+// [1, 2, 3].last().value() == 3
+//
+// This is syntactic sugar for msg.elements[msg.elements.size()-1].
+//
+// # Unwrap / UnwrapOpt
+//
+// Introduced in version: 2
+//
+// Returns a list of all the values that are not none in the input list of optional values.
+// Can be used as optional.unwrap(List[T]) or with postfix notation: List[T].unwrapOpt()
+//
+// optional.unwrap([optional.of(42), optional.none()]) == [42]
+// [optional.of(42), optional.none()].unwrapOpt() == [42]
func OptionalTypes(opts ...OptionalTypesOption) EnvOption {
lib := &optionalLib{version: math.MaxUint32}
for _, opt := range opts {
@@ -292,10 +391,20 @@ func OptionalTypesVersion(version uint32) OptionalTypesOption {
}
// LibraryName implements the SingletonLibrary interface method.
-func (lib *optionalLib) LibraryName() string {
+func (*optionalLib) LibraryName() string {
return "cel.lib.optional"
}
+// LibraryAlias returns the simple name of the library.
+func (*optionalLib) LibraryAlias() string {
+ return "optional"
+}
+
+// LibraryVersion returns the version of the library.
+func (lib *optionalLib) LibraryVersion() uint32 {
+ return lib.version
+}
+
// CompileOptions implements the Library interface method.
func (lib *optionalLib) CompileOptions() []EnvOption {
paramTypeK := TypeParamType("K")
@@ -303,6 +412,7 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
optionalTypeV := OptionalType(paramTypeV)
listTypeV := ListType(paramTypeV)
mapTypeKV := MapType(paramTypeK, paramTypeV)
+ listOptionalTypeV := ListType(optionalTypeV)
opts := []EnvOption{
// Enable the optional syntax in the parser.
@@ -312,16 +422,29 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
Types(types.OptionalType),
// Configure the optMap and optFlatMap macros.
- Macros(ReceiverMacro(optMapMacro, 2, optMap)),
+ Macros(ReceiverMacro(optMapMacro, 2, optMap,
+ MacroDocs(`perform computation on the value if present and return the result as an optional`),
+ MacroExamples(
+ common.MultilineDescription(
+ `// sub with the prefix 'dev.cel' or optional.none()`,
+ `request.auth.tokens.?sub.optMap(id, 'dev.cel.' + id)`),
+ `optional.none().optMap(i, i * 2) // optional.none()`))),
// Global and member functions for working with optional values.
Function(optionalOfFunc,
+ FunctionDocs(`create a new optional_type(T) with a value where any value is considered valid`),
Overload("optional_of", []*Type{paramTypeV}, optionalTypeV,
+ OverloadExamples(`optional.of(1) // optional(1)`),
UnaryBinding(func(value ref.Val) ref.Val {
return types.OptionalOf(value)
}))),
Function(optionalOfNonZeroValueFunc,
+ FunctionDocs(`create a new optional_type(T) with a value, if the value is not a zero or empty value`),
Overload("optional_ofNonZeroValue", []*Type{paramTypeV}, optionalTypeV,
+ OverloadExamples(
+ `optional.ofNonZeroValue(null) // optional.none()`,
+ `optional.ofNonZeroValue("") // optional.none()`,
+ `optional.ofNonZeroValue("hello") // optional.of('hello')`),
UnaryBinding(func(value ref.Val) ref.Val {
v, isZeroer := value.(traits.Zeroer)
if !isZeroer || !v.IsZeroValue() {
@@ -330,18 +453,26 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
return types.OptionalNone
}))),
Function(optionalNoneFunc,
+ FunctionDocs(`singleton value representing an optional without a value`),
Overload("optional_none", []*Type{}, optionalTypeV,
+ OverloadExamples(`optional.none()`),
FunctionBinding(func(values ...ref.Val) ref.Val {
return types.OptionalNone
}))),
Function(valueFunc,
+ FunctionDocs(`obtain the value contained by the optional, error if optional.none()`),
MemberOverload("optional_value", []*Type{optionalTypeV}, paramTypeV,
+ OverloadExamples(
+ `optional.of(1).value() // 1`,
+ `optional.none().value() // error`),
UnaryBinding(func(value ref.Val) ref.Val {
opt := value.(*types.Optional)
return opt.GetValue()
}))),
Function(hasValueFunc,
+ FunctionDocs(`determine whether the optional contains a value`),
MemberOverload("optional_hasValue", []*Type{optionalTypeV}, BoolType,
+ OverloadExamples(`optional.of({1: 2}).hasValue() // true`),
UnaryBinding(func(value ref.Val) ref.Val {
opt := value.(*types.Optional)
return types.Bool(opt.HasValue())
@@ -350,21 +481,43 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
// Implementation of 'or' and 'orValue' are special-cased to support short-circuiting in the
// evaluation chain.
Function("or",
- MemberOverload("optional_or_optional", []*Type{optionalTypeV, optionalTypeV}, optionalTypeV)),
+ FunctionDocs(`chain optional expressions together, picking the first valued optional expression`),
+ MemberOverload("optional_or_optional", []*Type{optionalTypeV, optionalTypeV}, optionalTypeV,
+ OverloadExamples(
+ `optional.none().or(optional.of(1)) // optional.of(1)`,
+ common.MultilineDescription(
+ `// either a value from the first list, a value from the second, or optional.none()`,
+ `[1, 2, 3][?x].or([3, 4, 5][?y])`)))),
Function("orValue",
- MemberOverload("optional_orValue_value", []*Type{optionalTypeV, paramTypeV}, paramTypeV)),
+ FunctionDocs(`chain optional expressions together picking the first valued optional or the default value`),
+ MemberOverload("optional_orValue_value", []*Type{optionalTypeV, paramTypeV}, paramTypeV,
+ OverloadExamples(
+ common.MultilineDescription(
+ `// pick the value for the given key if the key exists, otherwise return 'you'`,
+ `{'hello': 'world', 'goodbye': 'cruel world'}[?greeting].orValue('you')`)))),
// OptSelect is handled specially by the type-checker, so the receiver's field type is used to determine the
// optput type.
Function(operators.OptSelect,
- Overload("select_optional_field", []*Type{DynType, StringType}, optionalTypeV)),
+ FunctionDocs(`if the field is present create an optional of the field value, otherwise return optional.none()`),
+ Overload("select_optional_field", []*Type{DynType, StringType}, optionalTypeV,
+ OverloadExamples(
+ `msg.?field // optional.of(field) if non-empty, otherwise optional.none()`,
+ `msg.?field.?nested_field // optional.of(nested_field) if both field and nested_field are non-empty.`))),
// OptIndex is handled mostly like any other indexing operation on a list or map, so the type-checker can use
// these signatures to determine type-agreement without any special handling.
Function(operators.OptIndex,
- Overload("list_optindex_optional_int", []*Type{listTypeV, IntType}, optionalTypeV),
+ FunctionDocs(`if the index is present create an optional of the field value, otherwise return optional.none()`),
+ Overload("list_optindex_optional_int", []*Type{listTypeV, IntType}, optionalTypeV,
+ OverloadExamples(`[1, 2, 3][?x] // element value if x is in the list size, else optional.none()`)),
Overload("optional_list_optindex_optional_int", []*Type{OptionalType(listTypeV), IntType}, optionalTypeV),
- Overload("map_optindex_optional_value", []*Type{mapTypeKV, paramTypeK}, optionalTypeV),
+ Overload("map_optindex_optional_value", []*Type{mapTypeKV, paramTypeK}, optionalTypeV,
+ OverloadExamples(
+ `map_value[?key] // value at the key if present, else optional.none()`,
+ common.MultilineDescription(
+ `// map key-value if index is a valid map key, else optional.none()`,
+ `{0: 2, 2: 4, 6: 8}[?index]`))),
Overload("optional_map_optindex_optional_value", []*Type{OptionalType(mapTypeKV), paramTypeK}, optionalTypeV)),
// Index overloads to accommodate using an optional value as the operand.
@@ -373,8 +526,65 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
Overload("optional_map_index_value", []*Type{OptionalType(mapTypeKV), paramTypeK}, optionalTypeV)),
}
if lib.version >= 1 {
- opts = append(opts, Macros(ReceiverMacro(optFlatMapMacro, 2, optFlatMap)))
+ opts = append(opts, Macros(ReceiverMacro(optFlatMapMacro, 2, optFlatMap,
+ MacroDocs(`perform computation on the value if present and produce an optional value within the computation`),
+ MacroExamples(
+ common.MultilineDescription(
+ `// m = {'key': {}}`,
+ `m.?key.optFlatMap(k, k.?subkey) // optional.none()`),
+ common.MultilineDescription(
+ `// m = {'key': {'subkey': 'value'}}`,
+ `m.?key.optFlatMap(k, k.?subkey) // optional.of('value')`),
+ ))))
+ }
+
+ if lib.version >= 2 {
+ opts = append(opts, Function("last",
+ FunctionDocs(`return the last value in a list if present, otherwise optional.none()`),
+ MemberOverload("list_last", []*Type{listTypeV}, optionalTypeV,
+ OverloadExamples(
+ `[].last() // optional.none()`,
+ `[1, 2, 3].last() ? optional.of(3)`),
+ UnaryBinding(func(v ref.Val) ref.Val {
+ list := v.(traits.Lister)
+ sz := list.Size().(types.Int)
+ if sz == types.IntZero {
+ return types.OptionalNone
+ }
+ return types.OptionalOf(list.Get(types.Int(sz - 1)))
+ }),
+ ),
+ ))
+
+ opts = append(opts, Function("first",
+ FunctionDocs(`return the first value in a list if present, otherwise optional.none()`),
+ MemberOverload("list_first", []*Type{listTypeV}, optionalTypeV,
+ OverloadExamples(
+ `[].first() // optional.none()`,
+ `[1, 2, 3].first() ? optional.of(1)`),
+ UnaryBinding(func(v ref.Val) ref.Val {
+ list := v.(traits.Lister)
+ sz := list.Size().(types.Int)
+ if sz == types.IntZero {
+ return types.OptionalNone
+ }
+ return types.OptionalOf(list.Get(types.Int(0)))
+ }),
+ ),
+ ))
+
+ opts = append(opts, Function(optionalUnwrapFunc,
+ FunctionDocs(`convert a list of optional values to a list containing only value which are not optional.none()`),
+ Overload("optional_unwrap", []*Type{listOptionalTypeV}, listTypeV,
+ OverloadExamples(`optional.unwrap([optional.of(1), optional.none()]) // [1]`),
+ UnaryBinding(optUnwrap))))
+ opts = append(opts, Function(unwrapOptFunc,
+ FunctionDocs(`convert a list of optional values to a list containing only value which are not optional.none()`),
+ MemberOverload("optional_unwrapOpt", []*Type{listOptionalTypeV}, listTypeV,
+ OverloadExamples(`[optional.of(1), optional.none()].unwrapOpt() // [1]`),
+ UnaryBinding(optUnwrap))))
}
+
return opts
}
@@ -385,6 +595,11 @@ func (lib *optionalLib) ProgramOptions() []ProgramOption {
}
}
+// Version returns the current version of the library.
+func (lib *optionalLib) Version() uint32 {
+ return lib.version
+}
+
func optMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *Error) {
varIdent := args[0]
varName := ""
@@ -439,6 +654,23 @@ func optFlatMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Exp
), nil
}
+func optUnwrap(value ref.Val) ref.Val {
+ list := value.(traits.Lister)
+ var unwrappedList []ref.Val
+ iter := list.Iterator()
+ for iter.HasNext() == types.True {
+ val := iter.Next()
+ opt, isOpt := val.(*types.Optional)
+ if !isOpt {
+ return types.WrapErr(fmt.Errorf("value %v is not optional", val))
+ }
+ if opt.HasValue() {
+ unwrappedList = append(unwrappedList, opt.GetValue())
+ }
+ }
+ return types.DefaultTypeAdapter.NativeToValue(unwrappedList)
+}
+
func enableOptionalSyntax() EnvOption {
return func(e *Env) (*Env, error) {
e.prsrOpts = append(e.prsrOpts, parser.EnableOptionalSyntax(true))
@@ -541,250 +773,99 @@ func (opt *evalOptionalOrValue) Eval(ctx interpreter.Activation) ref.Val {
return opt.rhs.Eval(ctx)
}
-type timeUTCLibrary struct{}
+type timeLegacyLibrary struct{}
-func (timeUTCLibrary) CompileOptions() []EnvOption {
+func (timeLegacyLibrary) CompileOptions() []EnvOption {
return timeOverloadDeclarations
}
-func (timeUTCLibrary) ProgramOptions() []ProgramOption {
+func (timeLegacyLibrary) ProgramOptions() []ProgramOption {
return []ProgramOption{}
}
// Declarations and functions which enable using UTC on time.Time inputs when the timezone is unspecified
// in the CEL expression.
var (
- utcTZ = types.String("UTC")
-
timeOverloadDeclarations = []EnvOption{
- Function(overloads.TimeGetHours,
- MemberOverload(overloads.DurationToHours, []*Type{DurationType}, IntType,
- UnaryBinding(types.DurationGetHours))),
- Function(overloads.TimeGetMinutes,
- MemberOverload(overloads.DurationToMinutes, []*Type{DurationType}, IntType,
- UnaryBinding(types.DurationGetMinutes))),
- Function(overloads.TimeGetSeconds,
- MemberOverload(overloads.DurationToSeconds, []*Type{DurationType}, IntType,
- UnaryBinding(types.DurationGetSeconds))),
- Function(overloads.TimeGetMilliseconds,
- MemberOverload(overloads.DurationToMilliseconds, []*Type{DurationType}, IntType,
- UnaryBinding(types.DurationGetMilliseconds))),
Function(overloads.TimeGetFullYear,
MemberOverload(overloads.TimestampToYear, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetFullYear(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetFullYear, overloads.TimestampToYear, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToYearWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetFullYear),
- ),
),
Function(overloads.TimeGetMonth,
MemberOverload(overloads.TimestampToMonth, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetMonth(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetMonth, overloads.TimestampToMonth, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToMonthWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetMonth),
- ),
),
Function(overloads.TimeGetDayOfYear,
MemberOverload(overloads.TimestampToDayOfYear, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetDayOfYear(ts, utcTZ)
- }),
- ),
- MemberOverload(overloads.TimestampToDayOfYearWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(func(ts, tz ref.Val) ref.Val {
- return timestampGetDayOfYear(ts, tz)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetDayOfYear, overloads.TimestampToDayOfYear, []ref.Val{})
}),
),
),
Function(overloads.TimeGetDayOfMonth,
MemberOverload(overloads.TimestampToDayOfMonthZeroBased, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetDayOfMonthZeroBased(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetDayOfMonth, overloads.TimestampToDayOfMonthZeroBased, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToDayOfMonthZeroBasedWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetDayOfMonthZeroBased),
- ),
),
Function(overloads.TimeGetDate,
MemberOverload(overloads.TimestampToDayOfMonthOneBased, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetDayOfMonthOneBased(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetDate, overloads.TimestampToDayOfMonthOneBased, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToDayOfMonthOneBasedWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetDayOfMonthOneBased),
- ),
),
Function(overloads.TimeGetDayOfWeek,
MemberOverload(overloads.TimestampToDayOfWeek, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetDayOfWeek(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetDayOfWeek, overloads.TimestampToDayOfWeek, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToDayOfWeekWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetDayOfWeek),
- ),
),
Function(overloads.TimeGetHours,
MemberOverload(overloads.TimestampToHours, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetHours(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetHours, overloads.TimestampToHours, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToHoursWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetHours),
- ),
),
Function(overloads.TimeGetMinutes,
MemberOverload(overloads.TimestampToMinutes, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetMinutes(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetMinutes, overloads.TimestampToMinutes, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToMinutesWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetMinutes),
- ),
),
Function(overloads.TimeGetSeconds,
MemberOverload(overloads.TimestampToSeconds, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetSeconds(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetSeconds, overloads.TimestampToSeconds, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToSecondsWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetSeconds),
- ),
),
Function(overloads.TimeGetMilliseconds,
MemberOverload(overloads.TimestampToMilliseconds, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetMilliseconds(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetMilliseconds, overloads.TimestampToMilliseconds, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToMillisecondsWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetMilliseconds),
- ),
),
}
)
-
-func timestampGetFullYear(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Year())
-}
-
-func timestampGetMonth(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- // CEL spec indicates that the month should be 0-based, but the Time value
- // for Month() is 1-based.
- return types.Int(t.Month() - 1)
-}
-
-func timestampGetDayOfYear(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.YearDay() - 1)
-}
-
-func timestampGetDayOfMonthZeroBased(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Day() - 1)
-}
-
-func timestampGetDayOfMonthOneBased(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Day())
-}
-
-func timestampGetDayOfWeek(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Weekday())
-}
-
-func timestampGetHours(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Hour())
-}
-
-func timestampGetMinutes(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Minute())
-}
-
-func timestampGetSeconds(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Second())
-}
-
-func timestampGetMilliseconds(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Nanosecond() / 1000000)
-}
-
-func inTimeZone(ts, tz ref.Val) (time.Time, error) {
- t := ts.(types.Timestamp)
- val := string(tz.(types.String))
- ind := strings.Index(val, ":")
- if ind == -1 {
- loc, err := time.LoadLocation(val)
- if err != nil {
- return time.Time{}, err
- }
- return t.In(loc), nil
- }
-
- // If the input is not the name of a timezone (for example, 'US/Central'), it should be a numerical offset from UTC
- // in the format ^(+|-)(0[0-9]|1[0-4]):[0-5][0-9]$. The numerical input is parsed in terms of hours and minutes.
- hr, err := strconv.Atoi(string(val[0:ind]))
- if err != nil {
- return time.Time{}, err
- }
- min, err := strconv.Atoi(string(val[ind+1:]))
- if err != nil {
- return time.Time{}, err
- }
- var offset int
- if string(val[0]) == "-" {
- offset = hr*60 - min
- } else {
- offset = hr*60 + min
- }
- secondsEastOfUTC := int((time.Duration(offset) * time.Minute).Seconds())
- timezone := time.FixedZone("", secondsEastOfUTC)
- return t.In(timezone), nil
-}
diff --git a/vendor/github.com/google/cel-go/cel/macro.go b/vendor/github.com/google/cel-go/cel/macro.go
index 4db1fd57a..3d3c5be1b 100644
--- a/vendor/github.com/google/cel-go/cel/macro.go
+++ b/vendor/github.com/google/cel-go/cel/macro.go
@@ -142,24 +142,38 @@ type MacroExprHelper interface {
NewError(exprID int64, message string) *Error
}
+// MacroOpt defines a functional option for configuring macro behavior.
+type MacroOpt = parser.MacroOpt
+
+// MacroDocs configures a list of strings into a multiline description for the macro.
+func MacroDocs(docs ...string) MacroOpt {
+ return parser.MacroDocs(docs...)
+}
+
+// MacroExamples configures a list of examples, either as a string or common.MultilineString,
+// into an example set to be provided with the macro Documentation() call.
+func MacroExamples(examples ...string) MacroOpt {
+ return parser.MacroExamples(examples...)
+}
+
// GlobalMacro creates a Macro for a global function with the specified arg count.
-func GlobalMacro(function string, argCount int, factory MacroFactory) Macro {
- return parser.NewGlobalMacro(function, argCount, factory)
+func GlobalMacro(function string, argCount int, factory MacroFactory, opts ...MacroOpt) Macro {
+ return parser.NewGlobalMacro(function, argCount, factory, opts...)
}
// ReceiverMacro creates a Macro for a receiver function matching the specified arg count.
-func ReceiverMacro(function string, argCount int, factory MacroFactory) Macro {
- return parser.NewReceiverMacro(function, argCount, factory)
+func ReceiverMacro(function string, argCount int, factory MacroFactory, opts ...MacroOpt) Macro {
+ return parser.NewReceiverMacro(function, argCount, factory, opts...)
}
// GlobalVarArgMacro creates a Macro for a global function with a variable arg count.
-func GlobalVarArgMacro(function string, factory MacroFactory) Macro {
- return parser.NewGlobalVarArgMacro(function, factory)
+func GlobalVarArgMacro(function string, factory MacroFactory, opts ...MacroOpt) Macro {
+ return parser.NewGlobalVarArgMacro(function, factory, opts...)
}
// ReceiverVarArgMacro creates a Macro for a receiver function matching a variable arg count.
-func ReceiverVarArgMacro(function string, factory MacroFactory) Macro {
- return parser.NewReceiverVarArgMacro(function, factory)
+func ReceiverVarArgMacro(function string, factory MacroFactory, opts ...MacroOpt) Macro {
+ return parser.NewReceiverVarArgMacro(function, factory, opts...)
}
// NewGlobalMacro creates a Macro for a global function with the specified arg count.
diff --git a/vendor/github.com/google/cel-go/cel/options.go b/vendor/github.com/google/cel-go/cel/options.go
index 69c694263..fee67323c 100644
--- a/vendor/github.com/google/cel-go/cel/options.go
+++ b/vendor/github.com/google/cel-go/cel/options.go
@@ -15,6 +15,7 @@
package cel
import (
+ "errors"
"fmt"
"google.golang.org/protobuf/proto"
@@ -25,6 +26,8 @@ import (
"github.com/google/cel-go/checker"
"github.com/google/cel-go/common/containers"
+ "github.com/google/cel-go/common/decls"
+ "github.com/google/cel-go/common/env"
"github.com/google/cel-go/common/functions"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/pb"
@@ -65,8 +68,31 @@ const (
// Enable error generation when a presence test or optional field selection is
// performed on a primitive type.
featureEnableErrorOnBadPresenceTest
+
+ // Enable escape syntax for field identifiers (`).
+ featureIdentEscapeSyntax
)
+var featureIDsToNames = map[int]string{
+ featureEnableMacroCallTracking: "cel.feature.macro_call_tracking",
+ featureCrossTypeNumericComparisons: "cel.feature.cross_type_numeric_comparisons",
+ featureIdentEscapeSyntax: "cel.feature.backtick_escape_syntax",
+}
+
+func featureNameByID(id int) (string, bool) {
+ name, found := featureIDsToNames[id]
+ return name, found
+}
+
+func featureIDByName(name string) (int, bool) {
+ for id, n := range featureIDsToNames {
+ if n == name {
+ return id, true
+ }
+ }
+ return 0, false
+}
+
// EnvOption is a functional interface for configuring the environment.
type EnvOption func(e *Env) (*Env, error)
@@ -109,6 +135,8 @@ func CustomTypeProvider(provider any) EnvOption {
// Note: Declarations will by default be appended to the pre-existing declaration set configured
// for the environment. The NewEnv call builds on top of the standard CEL declarations. For a
// purely custom set of declarations use NewCustomEnv.
+//
+// Deprecated: use FunctionDecls and VariableDecls or FromConfig instead.
func Declarations(decls ...*exprpb.Decl) EnvOption {
declOpts := []EnvOption{}
var err error
@@ -376,7 +404,7 @@ type ProgramOption func(p *prog) (*prog, error)
// InterpretableDecorators can be used to inspect, alter, or replace the Program plan.
func CustomDecorator(dec interpreter.InterpretableDecorator) ProgramOption {
return func(p *prog) (*prog, error) {
- p.decorators = append(p.decorators, dec)
+ p.plannerOptions = append(p.plannerOptions, interpreter.CustomDecorator(dec))
return p, nil
}
}
@@ -398,10 +426,10 @@ func Functions(funcs ...*functions.Overload) ProgramOption {
// variables with the same name provided to the Eval() call. If Globals is used in a Library with
// a Lib EnvOption, vars may shadow variables provided by previously added libraries.
//
-// The vars value may either be an `interpreter.Activation` instance or a `map[string]any`.
+// The vars value may either be an `cel.Activation` instance or a `map[string]any`.
func Globals(vars any) ProgramOption {
return func(p *prog) (*prog, error) {
- defaultVars, err := interpreter.NewActivation(vars)
+ defaultVars, err := NewActivation(vars)
if err != nil {
return nil, err
}
@@ -423,6 +451,174 @@ func OptimizeRegex(regexOptimizations ...*interpreter.RegexOptimization) Program
}
}
+// ConfigOptionFactory declares a signature which accepts a configuration element, e.g. env.Extension
+// and optionally produces an EnvOption in response.
+//
+// If there are multiple ConfigOptionFactory values which could apply to the same configuration node
+// the first one that returns an EnvOption and a `true` response will be used, and the config node
+// will not be passed along to any other option factory.
+//
+// Only the *env.Extension type is provided at this time, but validators, optimizers, and other tuning
+// parameters may be supported in the future.
+type ConfigOptionFactory func(any) (EnvOption, bool)
+
+// FromConfig produces and applies a set of EnvOption values derived from an env.Config object.
+//
+// For configuration elements which refer to features outside of the `cel` package, an optional set of
+// ConfigOptionFactory values may be passed in to support the conversion from static configuration to
+// configured cel.Env value.
+//
+// Note: disabling the standard library will clear the EnvOptions values previously set for the
+// environment with the exception of propagating types and adapters over to the new environment.
+//
+// Note: to support custom types referenced in the configuration file, you must ensure that one of
+// the following options appears before the FromConfig option: Types, TypeDescs, or CustomTypeProvider
+// as the type provider configured at the time when the config is processed is the one used to derive
+// type references from the configuration.
+func FromConfig(config *env.Config, optFactories ...ConfigOptionFactory) EnvOption {
+ return func(e *Env) (*Env, error) {
+ if err := config.Validate(); err != nil {
+ return nil, err
+ }
+ opts, err := configToEnvOptions(config, e.CELTypeProvider(), optFactories)
+ if err != nil {
+ return nil, err
+ }
+ for _, o := range opts {
+ e, err = o(e)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return e, nil
+ }
+}
+
+// configToEnvOptions generates a set of EnvOption values (or error) based on a config, a type provider,
+// and an optional set of environment options.
+func configToEnvOptions(config *env.Config, provider types.Provider, optFactories []ConfigOptionFactory) ([]EnvOption, error) {
+ envOpts := []EnvOption{}
+ // Configure the standard lib subset.
+ if config.StdLib != nil {
+ envOpts = append(envOpts, func(e *Env) (*Env, error) {
+ if e.HasLibrary("cel.lib.std") {
+ return nil, errors.New("invalid subset of stdlib: create a custom env")
+ }
+ return e, nil
+ })
+ if !config.StdLib.Disabled {
+ envOpts = append(envOpts, StdLib(StdLibSubset(config.StdLib)))
+ }
+ } else {
+ envOpts = append(envOpts, StdLib())
+ }
+
+ // Configure the container
+ if config.Container != "" {
+ envOpts = append(envOpts, Container(config.Container))
+ }
+
+ // Configure abbreviations
+ for _, imp := range config.Imports {
+ envOpts = append(envOpts, Abbrevs(imp.Name))
+ }
+
+ // Configure the context variable declaration
+ if config.ContextVariable != nil {
+ typeName := config.ContextVariable.TypeName
+ if _, found := provider.FindStructType(typeName); !found {
+ return nil, fmt.Errorf("invalid context proto type: %q", typeName)
+ }
+ // Attempt to instantiate the proto in order to reflect to its descriptor
+ msg := provider.NewValue(typeName, map[string]ref.Val{})
+ pbMsg, ok := msg.Value().(proto.Message)
+ if !ok {
+ return nil, fmt.Errorf("unsupported context type: %T", msg.Value())
+ }
+ envOpts = append(envOpts, DeclareContextProto(pbMsg.ProtoReflect().Descriptor()))
+ }
+
+ // Configure variables
+ if len(config.Variables) != 0 {
+ vars := make([]*decls.VariableDecl, 0, len(config.Variables))
+ for _, v := range config.Variables {
+ vDef, err := v.AsCELVariable(provider)
+ if err != nil {
+ return nil, err
+ }
+ vars = append(vars, vDef)
+ }
+ envOpts = append(envOpts, VariableDecls(vars...))
+ }
+
+ // Configure functions
+ if len(config.Functions) != 0 {
+ funcs := make([]*decls.FunctionDecl, 0, len(config.Functions))
+ for _, f := range config.Functions {
+ fnDef, err := f.AsCELFunction(provider)
+ if err != nil {
+ return nil, err
+ }
+ funcs = append(funcs, fnDef)
+ }
+ envOpts = append(envOpts, FunctionDecls(funcs...))
+ }
+
+ // Configure features
+ for _, feat := range config.Features {
+ // Note, if a feature is not found, it is skipped as it is possible the feature
+ // is not intended to be supported publicly. In the future, a refinement of
+ // to this strategy to report unrecognized features and validators should probably
+ // be covered as a standard ConfigOptionFactory
+ if id, found := featureIDByName(feat.Name); found {
+ envOpts = append(envOpts, features(id, feat.Enabled))
+ }
+ }
+
+ // Configure validators
+ for _, val := range config.Validators {
+ if fac, found := astValidatorFactories[val.Name]; found {
+ envOpts = append(envOpts, func(e *Env) (*Env, error) {
+ validator, err := fac(val)
+ if err != nil {
+ return nil, fmt.Errorf("%w", err)
+ }
+ return ASTValidators(validator)(e)
+ })
+ } else if opt, handled := handleExtendedConfigOption(val, optFactories); handled {
+ envOpts = append(envOpts, opt)
+ }
+ // we don't error when the validator isn't found as it may be part
+ // of an extension library and enabled implicitly.
+ }
+
+ // Configure extensions
+ for _, ext := range config.Extensions {
+ // version number has been validated by the call to `Validate`
+ ver, _ := ext.VersionNumber()
+ if ext.Name == "optional" {
+ envOpts = append(envOpts, OptionalTypes(OptionalTypesVersion(ver)))
+ } else {
+ opt, handled := handleExtendedConfigOption(ext, optFactories)
+ if !handled {
+ return nil, fmt.Errorf("unrecognized extension: %s", ext.Name)
+ }
+ envOpts = append(envOpts, opt)
+ }
+ }
+
+ return envOpts, nil
+}
+
+func handleExtendedConfigOption(conf any, optFactories []ConfigOptionFactory) (EnvOption, bool) {
+ for _, optFac := range optFactories {
+ if opt, useOption := optFac(conf); useOption {
+ return opt, true
+ }
+ }
+ return nil, false
+}
+
// EvalOption indicates an evaluation option that may affect the evaluation behavior or information
// in the output result.
type EvalOption int
@@ -531,7 +727,7 @@ func fieldToCELType(field protoreflect.FieldDescriptor) (*Type, error) {
return nil, fmt.Errorf("field %s type %s not implemented", field.FullName(), field.Kind().String())
}
-func fieldToVariable(field protoreflect.FieldDescriptor) (EnvOption, error) {
+func fieldToVariable(field protoreflect.FieldDescriptor) (*decls.VariableDecl, error) {
name := string(field.Name())
if field.IsMap() {
mapKey := field.MapKey()
@@ -544,20 +740,20 @@ func fieldToVariable(field protoreflect.FieldDescriptor) (EnvOption, error) {
if err != nil {
return nil, err
}
- return Variable(name, MapType(keyType, valueType)), nil
+ return decls.NewVariable(name, MapType(keyType, valueType)), nil
}
if field.IsList() {
elemType, err := fieldToCELType(field)
if err != nil {
return nil, err
}
- return Variable(name, ListType(elemType)), nil
+ return decls.NewVariable(name, ListType(elemType)), nil
}
celType, err := fieldToCELType(field)
if err != nil {
return nil, err
}
- return Variable(name, celType), nil
+ return decls.NewVariable(name, celType), nil
}
// DeclareContextProto returns an option to extend CEL environment with declarations from the given context proto.
@@ -565,17 +761,25 @@ func fieldToVariable(field protoreflect.FieldDescriptor) (EnvOption, error) {
// https://github.com/google/cel-spec/blob/master/doc/langdef.md#evaluation-environment
func DeclareContextProto(descriptor protoreflect.MessageDescriptor) EnvOption {
return func(e *Env) (*Env, error) {
+ if e.contextProto != nil {
+ return nil, fmt.Errorf("context proto already declared as %q, got %q",
+ e.contextProto.FullName(), descriptor.FullName())
+ }
+ e.contextProto = descriptor
fields := descriptor.Fields()
+ vars := make([]*decls.VariableDecl, 0, fields.Len())
for i := 0; i < fields.Len(); i++ {
field := fields.Get(i)
variable, err := fieldToVariable(field)
if err != nil {
return nil, err
}
- e, err = variable(e)
- if err != nil {
- return nil, err
- }
+ vars = append(vars, variable)
+ }
+ var err error
+ e, err = VariableDecls(vars...)(e)
+ if err != nil {
+ return nil, err
}
return Types(dynamicpb.NewMessage(descriptor))(e)
}
@@ -585,7 +789,7 @@ func DeclareContextProto(descriptor protoreflect.MessageDescriptor) EnvOption {
//
// Consider using with `DeclareContextProto` to simplify variable type declarations and publishing when using
// protocol buffers.
-func ContextProtoVars(ctx proto.Message) (interpreter.Activation, error) {
+func ContextProtoVars(ctx proto.Message) (Activation, error) {
if ctx == nil || !ctx.ProtoReflect().IsValid() {
return interpreter.EmptyActivation(), nil
}
@@ -609,7 +813,7 @@ func ContextProtoVars(ctx proto.Message) (interpreter.Activation, error) {
}
vars[field.TextName()] = fieldVal
}
- return interpreter.NewActivation(vars)
+ return NewActivation(vars)
}
// EnableMacroCallTracking ensures that call expressions which are replaced by macros
@@ -618,6 +822,12 @@ func EnableMacroCallTracking() EnvOption {
return features(featureEnableMacroCallTracking, true)
}
+// EnableIdentifierEscapeSyntax enables identifier escaping (`) syntax for
+// fields.
+func EnableIdentifierEscapeSyntax() EnvOption {
+ return features(featureIdentEscapeSyntax, true)
+}
+
// CrossTypeNumericComparisons makes it possible to compare across numeric types, e.g. double < int
func CrossTypeNumericComparisons(enabled bool) EnvOption {
return features(featureCrossTypeNumericComparisons, enabled)
@@ -655,6 +865,15 @@ func ParserExpressionSizeLimit(limit int) EnvOption {
}
}
+// EnableHiddenAccumulatorName sets the parser to use the identifier '@result' for accumulators
+// which is not normally accessible from CEL source.
+func EnableHiddenAccumulatorName(enabled bool) EnvOption {
+ return func(e *Env) (*Env, error) {
+ e.prsrOpts = append(e.prsrOpts, parser.EnableHiddenAccumulatorName(enabled))
+ return e, nil
+ }
+}
+
func maybeInteropProvider(provider any) (types.Provider, error) {
switch p := provider.(type) {
case types.Provider:
diff --git a/vendor/github.com/google/cel-go/cel/program.go b/vendor/github.com/google/cel-go/cel/program.go
index 49bd53783..ec3869bdb 100644
--- a/vendor/github.com/google/cel-go/cel/program.go
+++ b/vendor/github.com/google/cel-go/cel/program.go
@@ -20,6 +20,7 @@ import (
"sync"
"github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/functions"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/interpreter"
@@ -29,7 +30,7 @@ import (
type Program interface {
// Eval returns the result of an evaluation of the Ast and environment against the input vars.
//
- // The vars value may either be an `interpreter.Activation` or a `map[string]any`.
+ // The vars value may either be an `Activation` or a `map[string]any`.
//
// If the `OptTrackState`, `OptTrackCost` or `OptExhaustiveEval` flags are used, the `details` response will
// be non-nil. Given this caveat on `details`, the return state from evaluation will be:
@@ -47,14 +48,39 @@ type Program interface {
// to support cancellation and timeouts. This method must be used in conjunction with the
// InterruptCheckFrequency() option for cancellation interrupts to be impact evaluation.
//
- // The vars value may either be an `interpreter.Activation` or `map[string]any`.
+ // The vars value may either be an `Activation` or `map[string]any`.
//
// The output contract for `ContextEval` is otherwise identical to the `Eval` method.
ContextEval(context.Context, any) (ref.Val, *EvalDetails, error)
}
+// Activation used to resolve identifiers by name and references by id.
+//
+// An Activation is the primary mechanism by which a caller supplies input into a CEL program.
+type Activation = interpreter.Activation
+
+// NewActivation returns an activation based on a map-based binding where the map keys are
+// expected to be qualified names used with ResolveName calls.
+//
+// The input `bindings` may either be of type `Activation` or `map[string]any`.
+//
+// Lazy bindings may be supplied within the map-based input in either of the following forms:
+// - func() any
+// - func() ref.Val
+//
+// The output of the lazy binding will overwrite the variable reference in the internal map.
+//
+// Values which are not represented as ref.Val types on input may be adapted to a ref.Val using
+// the types.Adapter configured in the environment.
+func NewActivation(bindings any) (Activation, error) {
+ return interpreter.NewActivation(bindings)
+}
+
+// PartialActivation extends the Activation interface with a set of unknown AttributePatterns.
+type PartialActivation = interpreter.PartialActivation
+
// NoVars returns an empty Activation.
-func NoVars() interpreter.Activation {
+func NoVars() Activation {
return interpreter.EmptyActivation()
}
@@ -64,10 +90,9 @@ func NoVars() interpreter.Activation {
// This method relies on manually configured sets of missing attribute patterns. For a method which
// infers the missing variables from the input and the configured environment, use Env.PartialVars().
//
-// The `vars` value may either be an interpreter.Activation or any valid input to the
-// interpreter.NewActivation call.
+// The `vars` value may either be an Activation or any valid input to the NewActivation call.
func PartialVars(vars any,
- unknowns ...*interpreter.AttributePattern) (interpreter.PartialActivation, error) {
+ unknowns ...*AttributePatternType) (PartialActivation, error) {
return interpreter.NewPartialActivation(vars, unknowns...)
}
@@ -84,12 +109,15 @@ func PartialVars(vars any,
// fully qualified variable name may be `ns.app.a`, `ns.a`, or `a` per the CEL namespace resolution
// rules. Pick the fully qualified variable name that makes sense within the container as the
// AttributePattern `varName` argument.
+func AttributePattern(varName string) *AttributePatternType {
+ return interpreter.NewAttributePattern(varName)
+}
+
+// AttributePatternType represents a top-level variable with an optional set of qualifier patterns.
//
// See the interpreter.AttributePattern and interpreter.AttributeQualifierPattern for more info
// about how to create and manipulate AttributePattern values.
-func AttributePattern(varName string) *interpreter.AttributePattern {
- return interpreter.NewAttributePattern(varName)
-}
+type AttributePatternType = interpreter.AttributePattern
// EvalDetails holds additional information observed during the Eval() call.
type EvalDetails struct {
@@ -120,37 +148,24 @@ func (ed *EvalDetails) ActualCost() *uint64 {
type prog struct {
*Env
evalOpts EvalOption
- defaultVars interpreter.Activation
+ defaultVars Activation
dispatcher interpreter.Dispatcher
interpreter interpreter.Interpreter
interruptCheckFrequency uint
// Intermediate state used to configure the InterpretableDecorator set provided
// to the initInterpretable call.
- decorators []interpreter.InterpretableDecorator
+ plannerOptions []interpreter.PlannerOption
regexOptimizations []*interpreter.RegexOptimization
// Interpretable configured from an Ast and aggregate decorator set based on program options.
interpretable interpreter.Interpretable
+ observable *interpreter.ObservableInterpretable
callCostEstimator interpreter.ActualCostEstimator
costOptions []interpreter.CostTrackerOption
costLimit *uint64
}
-func (p *prog) clone() *prog {
- costOptsCopy := make([]interpreter.CostTrackerOption, len(p.costOptions))
- copy(costOptsCopy, p.costOptions)
-
- return &prog{
- Env: p.Env,
- evalOpts: p.evalOpts,
- defaultVars: p.defaultVars,
- dispatcher: p.dispatcher,
- interpreter: p.interpreter,
- interruptCheckFrequency: p.interruptCheckFrequency,
- }
-}
-
// newProgram creates a program instance with an environment, an ast, and an optional list of
// ProgramOption values.
//
@@ -162,10 +177,10 @@ func newProgram(e *Env, a *ast.AST, opts []ProgramOption) (Program, error) {
// Ensure the default attribute factory is set after the adapter and provider are
// configured.
p := &prog{
- Env: e,
- decorators: []interpreter.InterpretableDecorator{},
- dispatcher: disp,
- costOptions: []interpreter.CostTrackerOption{},
+ Env: e,
+ plannerOptions: []interpreter.PlannerOption{},
+ dispatcher: disp,
+ costOptions: []interpreter.CostTrackerOption{},
}
// Configure the program via the ProgramOption values.
@@ -177,16 +192,25 @@ func newProgram(e *Env, a *ast.AST, opts []ProgramOption) (Program, error) {
}
}
- // Add the function bindings created via Function() options.
- for _, fn := range e.functions {
- bindings, err := fn.Bindings()
- if err != nil {
- return nil, err
- }
- err = disp.Add(bindings...)
- if err != nil {
- return nil, err
+ e.funcBindOnce.Do(func() {
+ var bindings []*functions.Overload
+ e.functionBindings = []*functions.Overload{}
+ for _, fn := range e.functions {
+ bindings, err = fn.Bindings()
+ if err != nil {
+ return
+ }
+ e.functionBindings = append(e.functionBindings, bindings...)
}
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ // Add the function bindings created via Function() options.
+ err = disp.Add(e.functionBindings...)
+ if err != nil {
+ return nil, err
}
// Set the attribute factory after the options have been set.
@@ -203,74 +227,71 @@ func newProgram(e *Env, a *ast.AST, opts []ProgramOption) (Program, error) {
p.interpreter = interp
// Translate the EvalOption flags into InterpretableDecorator instances.
- decorators := make([]interpreter.InterpretableDecorator, len(p.decorators))
- copy(decorators, p.decorators)
+ plannerOptions := make([]interpreter.PlannerOption, len(p.plannerOptions))
+ copy(plannerOptions, p.plannerOptions)
// Enable interrupt checking if there's a non-zero check frequency
if p.interruptCheckFrequency > 0 {
- decorators = append(decorators, interpreter.InterruptableEval())
+ plannerOptions = append(plannerOptions, interpreter.InterruptableEval())
}
// Enable constant folding first.
if p.evalOpts&OptOptimize == OptOptimize {
- decorators = append(decorators, interpreter.Optimize())
+ plannerOptions = append(plannerOptions, interpreter.Optimize())
p.regexOptimizations = append(p.regexOptimizations, interpreter.MatchesRegexOptimization)
}
// Enable regex compilation of constants immediately after folding constants.
if len(p.regexOptimizations) > 0 {
- decorators = append(decorators, interpreter.CompileRegexConstants(p.regexOptimizations...))
+ plannerOptions = append(plannerOptions, interpreter.CompileRegexConstants(p.regexOptimizations...))
}
// Enable exhaustive eval, state tracking and cost tracking last since they require a factory.
if p.evalOpts&(OptExhaustiveEval|OptTrackState|OptTrackCost) != 0 {
- factory := func(state interpreter.EvalState, costTracker *interpreter.CostTracker) (Program, error) {
- costTracker.Estimator = p.callCostEstimator
- costTracker.Limit = p.costLimit
- for _, costOpt := range p.costOptions {
- err := costOpt(costTracker)
- if err != nil {
- return nil, err
- }
- }
- // Limit capacity to guarantee a reallocation when calling 'append(decs, ...)' below. This
- // prevents the underlying memory from being shared between factory function calls causing
- // undesired mutations.
- decs := decorators[:len(decorators):len(decorators)]
- var observers []interpreter.EvalObserver
-
- if p.evalOpts&(OptExhaustiveEval|OptTrackState) != 0 {
- // EvalStateObserver is required for OptExhaustiveEval.
- observers = append(observers, interpreter.EvalStateObserver(state))
- }
- if p.evalOpts&OptTrackCost == OptTrackCost {
- observers = append(observers, interpreter.CostObserver(costTracker))
- }
-
- // Enable exhaustive eval over a basic observer since it offers a superset of features.
- if p.evalOpts&OptExhaustiveEval == OptExhaustiveEval {
- decs = append(decs, interpreter.ExhaustiveEval(), interpreter.Observe(observers...))
- } else if len(observers) > 0 {
- decs = append(decs, interpreter.Observe(observers...))
- }
-
- return p.clone().initInterpretable(a, decs)
+ costOptCount := len(p.costOptions)
+ if p.costLimit != nil {
+ costOptCount++
+ }
+ costOpts := make([]interpreter.CostTrackerOption, 0, costOptCount)
+ costOpts = append(costOpts, p.costOptions...)
+ if p.costLimit != nil {
+ costOpts = append(costOpts, interpreter.CostTrackerLimit(*p.costLimit))
+ }
+ trackerFactory := func() (*interpreter.CostTracker, error) {
+ return interpreter.NewCostTracker(p.callCostEstimator, costOpts...)
+ }
+ var observers []interpreter.PlannerOption
+ if p.evalOpts&(OptExhaustiveEval|OptTrackState) != 0 {
+ // EvalStateObserver is required for OptExhaustiveEval.
+ observers = append(observers, interpreter.EvalStateObserver())
+ }
+ if p.evalOpts&OptTrackCost == OptTrackCost {
+ observers = append(observers, interpreter.CostObserver(interpreter.CostTrackerFactory(trackerFactory)))
+ }
+ // Enable exhaustive eval over a basic observer since it offers a superset of features.
+ if p.evalOpts&OptExhaustiveEval == OptExhaustiveEval {
+ plannerOptions = append(plannerOptions,
+ append([]interpreter.PlannerOption{interpreter.ExhaustiveEval()}, observers...)...)
+ } else if len(observers) > 0 {
+ plannerOptions = append(plannerOptions, observers...)
}
- return newProgGen(factory)
}
- return p.initInterpretable(a, decorators)
+ return p.initInterpretable(a, plannerOptions)
}
-func (p *prog) initInterpretable(a *ast.AST, decs []interpreter.InterpretableDecorator) (*prog, error) {
+func (p *prog) initInterpretable(a *ast.AST, plannerOptions []interpreter.PlannerOption) (*prog, error) {
// When the AST has been exprAST it contains metadata that can be used to speed up program execution.
- interpretable, err := p.interpreter.NewInterpretable(a, decs...)
+ interpretable, err := p.interpreter.NewInterpretable(a, plannerOptions...)
if err != nil {
return nil, err
}
p.interpretable = interpretable
+ if oi, ok := interpretable.(*interpreter.ObservableInterpretable); ok {
+ p.observable = oi
+ }
return p, nil
}
// Eval implements the Program interface method.
-func (p *prog) Eval(input any) (v ref.Val, det *EvalDetails, err error) {
+func (p *prog) Eval(input any) (out ref.Val, det *EvalDetails, err error) {
// Configure error recovery for unexpected panics during evaluation. Note, the use of named
// return values makes it possible to modify the error response during the recovery
// function.
@@ -285,9 +306,9 @@ func (p *prog) Eval(input any) (v ref.Val, det *EvalDetails, err error) {
}
}()
// Build a hierarchical activation if there are default vars set.
- var vars interpreter.Activation
+ var vars Activation
switch v := input.(type) {
- case interpreter.Activation:
+ case Activation:
vars = v
case map[string]any:
vars = activationPool.Setup(v)
@@ -298,12 +319,24 @@ func (p *prog) Eval(input any) (v ref.Val, det *EvalDetails, err error) {
if p.defaultVars != nil {
vars = interpreter.NewHierarchicalActivation(p.defaultVars, vars)
}
- v = p.interpretable.Eval(vars)
+ if p.observable != nil {
+ det = &EvalDetails{}
+ out = p.observable.ObserveEval(vars, func(observed any) {
+ switch o := observed.(type) {
+ case interpreter.EvalState:
+ det.state = o
+ case *interpreter.CostTracker:
+ det.costTracker = o
+ }
+ })
+ } else {
+ out = p.interpretable.Eval(vars)
+ }
// The output of an internal Eval may have a value (`v`) that is a types.Err. This step
// translates the CEL value to a Go error response. This interface does not quite match the
// RPC signature which allows for multiple errors to be returned, but should be sufficient.
- if types.IsError(v) {
- err = v.(*types.Err)
+ if types.IsError(out) {
+ err = out.(*types.Err)
}
return
}
@@ -315,9 +348,9 @@ func (p *prog) ContextEval(ctx context.Context, input any) (ref.Val, *EvalDetail
}
// Configure the input, making sure to wrap Activation inputs in the special ctxActivation which
// exposes the #interrupted variable and manages rate-limited checks of the ctx.Done() state.
- var vars interpreter.Activation
+ var vars Activation
switch v := input.(type) {
- case interpreter.Activation:
+ case Activation:
vars = ctxActivationPool.Setup(v, ctx.Done(), p.interruptCheckFrequency)
defer ctxActivationPool.Put(vars)
case map[string]any:
@@ -331,90 +364,8 @@ func (p *prog) ContextEval(ctx context.Context, input any) (ref.Val, *EvalDetail
return p.Eval(vars)
}
-// progFactory is a helper alias for marking a program creation factory function.
-type progFactory func(interpreter.EvalState, *interpreter.CostTracker) (Program, error)
-
-// progGen holds a reference to a progFactory instance and implements the Program interface.
-type progGen struct {
- factory progFactory
-}
-
-// newProgGen tests the factory object by calling it once and returns a factory-based Program if
-// the test is successful.
-func newProgGen(factory progFactory) (Program, error) {
- // Test the factory to make sure that configuration errors are spotted at config
- tracker, err := interpreter.NewCostTracker(nil)
- if err != nil {
- return nil, err
- }
- _, err = factory(interpreter.NewEvalState(), tracker)
- if err != nil {
- return nil, err
- }
- return &progGen{factory: factory}, nil
-}
-
-// Eval implements the Program interface method.
-func (gen *progGen) Eval(input any) (ref.Val, *EvalDetails, error) {
- // The factory based Eval() differs from the standard evaluation model in that it generates a
- // new EvalState instance for each call to ensure that unique evaluations yield unique stateful
- // results.
- state := interpreter.NewEvalState()
- costTracker, err := interpreter.NewCostTracker(nil)
- if err != nil {
- return nil, nil, err
- }
- det := &EvalDetails{state: state, costTracker: costTracker}
-
- // Generate a new instance of the interpretable using the factory configured during the call to
- // newProgram(). It is incredibly unlikely that the factory call will generate an error given
- // the factory test performed within the Program() call.
- p, err := gen.factory(state, costTracker)
- if err != nil {
- return nil, det, err
- }
-
- // Evaluate the input, returning the result and the 'state' within EvalDetails.
- v, _, err := p.Eval(input)
- if err != nil {
- return v, det, err
- }
- return v, det, nil
-}
-
-// ContextEval implements the Program interface method.
-func (gen *progGen) ContextEval(ctx context.Context, input any) (ref.Val, *EvalDetails, error) {
- if ctx == nil {
- return nil, nil, fmt.Errorf("context can not be nil")
- }
- // The factory based Eval() differs from the standard evaluation model in that it generates a
- // new EvalState instance for each call to ensure that unique evaluations yield unique stateful
- // results.
- state := interpreter.NewEvalState()
- costTracker, err := interpreter.NewCostTracker(nil)
- if err != nil {
- return nil, nil, err
- }
- det := &EvalDetails{state: state, costTracker: costTracker}
-
- // Generate a new instance of the interpretable using the factory configured during the call to
- // newProgram(). It is incredibly unlikely that the factory call will generate an error given
- // the factory test performed within the Program() call.
- p, err := gen.factory(state, costTracker)
- if err != nil {
- return nil, det, err
- }
-
- // Evaluate the input, returning the result and the 'state' within EvalDetails.
- v, _, err := p.ContextEval(ctx, input)
- if err != nil {
- return v, det, err
- }
- return v, det, nil
-}
-
type ctxEvalActivation struct {
- parent interpreter.Activation
+ parent Activation
interrupt <-chan struct{}
interruptCheckCount uint
interruptCheckFrequency uint
@@ -438,10 +389,15 @@ func (a *ctxEvalActivation) ResolveName(name string) (any, bool) {
return a.parent.ResolveName(name)
}
-func (a *ctxEvalActivation) Parent() interpreter.Activation {
+func (a *ctxEvalActivation) Parent() Activation {
return a.parent
}
+func (a *ctxEvalActivation) AsPartialActivation() (interpreter.PartialActivation, bool) {
+ pa, ok := a.parent.(interpreter.PartialActivation)
+ return pa, ok
+}
+
func newCtxEvalActivationPool() *ctxEvalActivationPool {
return &ctxEvalActivationPool{
Pool: sync.Pool{
@@ -457,7 +413,7 @@ type ctxEvalActivationPool struct {
}
// Setup initializes a pooled Activation with the ability check for context.Context cancellation
-func (p *ctxEvalActivationPool) Setup(vars interpreter.Activation, done <-chan struct{}, interruptCheckRate uint) *ctxEvalActivation {
+func (p *ctxEvalActivationPool) Setup(vars Activation, done <-chan struct{}, interruptCheckRate uint) *ctxEvalActivation {
a := p.Pool.Get().(*ctxEvalActivation)
a.parent = vars
a.interrupt = done
@@ -506,8 +462,8 @@ func (a *evalActivation) ResolveName(name string) (any, bool) {
}
}
-// Parent implements the interpreter.Activation interface
-func (a *evalActivation) Parent() interpreter.Activation {
+// Parent implements the Activation interface
+func (a *evalActivation) Parent() Activation {
return nil
}
diff --git a/vendor/github.com/google/cel-go/cel/prompt.go b/vendor/github.com/google/cel-go/cel/prompt.go
new file mode 100644
index 000000000..929a26f91
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/prompt.go
@@ -0,0 +1,155 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cel
+
+import (
+ _ "embed"
+ "sort"
+ "strings"
+ "text/template"
+
+ "github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/operators"
+ "github.com/google/cel-go/common/overloads"
+)
+
+//go:embed templates/authoring.tmpl
+var authoringPrompt string
+
+// AuthoringPrompt creates a prompt template from a CEL environment for the purpose of AI-assisted authoring.
+func AuthoringPrompt(env *Env) (*Prompt, error) {
+ funcMap := template.FuncMap{
+ "split": func(str string) []string { return strings.Split(str, "\n") },
+ }
+ tmpl := template.New("cel").Funcs(funcMap)
+ tmpl, err := tmpl.Parse(authoringPrompt)
+ if err != nil {
+ return nil, err
+ }
+ return &Prompt{
+ Persona: defaultPersona,
+ FormatRules: defaultFormatRules,
+ GeneralUsage: defaultGeneralUsage,
+ tmpl: tmpl,
+ env: env,
+ }, nil
+}
+
+// Prompt represents the core components of an LLM prompt based on a CEL environment.
+//
+// All fields of the prompt may be overwritten / modified with support for rendering the
+// prompt to a human-readable string.
+type Prompt struct {
+ // Persona indicates something about the kind of user making the request
+ Persona string
+
+ // FormatRules indicate how the LLM should generate its output
+ FormatRules string
+
+ // GeneralUsage specifies additional context on how CEL should be used.
+ GeneralUsage string
+
+ // tmpl is the text template base-configuration for rendering text.
+ tmpl *template.Template
+
+ // env reference used to collect variables, functions, and macros available to the prompt.
+ env *Env
+}
+
+type promptInst struct {
+ *Prompt
+
+ Variables []*common.Doc
+ Macros []*common.Doc
+ Functions []*common.Doc
+ UserPrompt string
+}
+
+// Render renders the user prompt with the associated context from the prompt template
+// for use with LLM generators.
+func (p *Prompt) Render(userPrompt string) string {
+ var buffer strings.Builder
+ vars := make([]*common.Doc, len(p.env.Variables()))
+ for i, v := range p.env.Variables() {
+ vars[i] = v.Documentation()
+ }
+ sort.SliceStable(vars, func(i, j int) bool {
+ return vars[i].Name < vars[j].Name
+ })
+ macs := make([]*common.Doc, len(p.env.Macros()))
+ for i, m := range p.env.Macros() {
+ macs[i] = m.(common.Documentor).Documentation()
+ }
+ funcs := make([]*common.Doc, 0, len(p.env.Functions()))
+ for _, f := range p.env.Functions() {
+ if _, hidden := hiddenFunctions[f.Name()]; hidden {
+ continue
+ }
+ funcs = append(funcs, f.Documentation())
+ }
+ sort.SliceStable(funcs, func(i, j int) bool {
+ return funcs[i].Name < funcs[j].Name
+ })
+ inst := &promptInst{
+ Prompt: p,
+ Variables: vars,
+ Macros: macs,
+ Functions: funcs,
+ UserPrompt: userPrompt}
+ p.tmpl.Execute(&buffer, inst)
+ return buffer.String()
+}
+
+const (
+ defaultPersona = `You are a software engineer with expertise in networking and application security
+authoring boolean Common Expression Language (CEL) expressions to ensure firewall,
+networking, authentication, and data access is only permitted when all conditions
+are satisfied.`
+
+ defaultFormatRules = `Output your response as a CEL expression.
+
+Write the expression with the comment on the first line and the expression on the
+subsequent lines. Format the expression using 80-character line limits commonly
+found in C++ or Java code.`
+
+ defaultGeneralUsage = `CEL supports Protocol Buffer and JSON types, as well as simple types and aggregate types.
+
+Simple types include bool, bytes, double, int, string, and uint:
+
+* double literals must always include a decimal point: 1.0, 3.5, -2.2
+* uint literals must be positive values suffixed with a 'u': 42u
+* byte literals are strings prefixed with a 'b': b'1235'
+* string literals can use either single quotes or double quotes: 'hello', "world"
+* string literals can also be treated as raw strings that do not require any
+ escaping within the string by using the 'R' prefix: R"""quote: "hi" """
+
+Aggregate types include list and map:
+
+* list literals consist of zero or more values between brackets: "['a', 'b', 'c']"
+* map literal consist of colon-separated key-value pairs within braces: "{'key1': 1, 'key2': 2}"
+* Only int, uint, string, and bool types are valid map keys.
+* Maps containing HTTP headers must always use lower-cased string keys.
+
+Comments start with two-forward slashes followed by text and a newline.`
+)
+
+var (
+ hiddenFunctions = map[string]bool{
+ overloads.DeprecatedIn: true,
+ operators.OldIn: true,
+ operators.OldNotStrictlyFalse: true,
+ operators.NotStrictlyFalse: true,
+ }
+)
diff --git a/vendor/github.com/google/cel-go/cel/templates/authoring.tmpl b/vendor/github.com/google/cel-go/cel/templates/authoring.tmpl
new file mode 100644
index 000000000..d0b0133f1
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/templates/authoring.tmpl
@@ -0,0 +1,60 @@
+{{define "variable"}}{{.Name}} is a {{.Type}}{{if .Description}}
+
+{{range split .Description}} {{.}}
+{{end}}
+{{- end -}}
+{{- end -}}
+
+{{define "macro" -}}
+{{.Name}} macro{{if .Description}} - {{range split .Description}}{{.}} {{end}}
+{{end}}
+{{range .Children}}{{range split .Description}} {{.}}
+{{end}}
+{{- end -}}
+{{- end -}}
+
+{{define "overload" -}}
+{{if .Children}}{{range .Children}}{{range split .Description}} {{.}}
+{{end}}
+{{- end -}}
+{{else}} {{.Signature}}
+{{end}}
+{{- end -}}
+
+{{define "function" -}}
+{{.Name}}{{if .Description}} - {{range split .Description}}{{.}} {{end}}
+{{end}}
+{{range .Children}}{{template "overload" .}}{{end}}
+{{- end -}}
+
+{{.Persona}}
+
+{{.FormatRules}}
+
+{{if or .Variables .Macros .Functions -}}
+Only use the following variables, macros, and functions in expressions.
+{{if .Variables}}
+Variables:
+
+{{range .Variables}}* {{template "variable" .}}
+{{end -}}
+
+{{end -}}
+{{if .Macros}}
+Macros:
+
+{{range .Macros}}* {{template "macro" .}}
+{{end -}}
+
+{{end -}}
+{{if .Functions}}
+Functions:
+
+{{range .Functions}}* {{template "function" .}}
+{{end -}}
+
+{{end -}}
+{{- end -}}
+{{.GeneralUsage}}
+
+{{.UserPrompt}}
diff --git a/vendor/github.com/google/cel-go/cel/validator.go b/vendor/github.com/google/cel-go/cel/validator.go
index b50c67452..952f88f41 100644
--- a/vendor/github.com/google/cel-go/cel/validator.go
+++ b/vendor/github.com/google/cel-go/cel/validator.go
@@ -20,11 +20,16 @@ import (
"regexp"
"github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/env"
"github.com/google/cel-go/common/overloads"
)
const (
- homogeneousValidatorName = "cel.lib.std.validate.types.homogeneous"
+ durationValidatorName = "cel.validator.duration"
+ regexValidatorName = "cel.validator.matches"
+ timestampValidatorName = "cel.validator.timestamp"
+ homogeneousValidatorName = "cel.validator.homogeneous_literals"
+ nestingLimitValidatorName = "cel.validator.comprehension_nesting_limit"
// HomogeneousAggregateLiteralExemptFunctions is the ValidatorConfig key used to configure
// the set of function names which are exempt from homogeneous type checks. The expected type
@@ -36,6 +41,43 @@ const (
HomogeneousAggregateLiteralExemptFunctions = homogeneousValidatorName + ".exempt"
)
+var (
+ astValidatorFactories = map[string]ASTValidatorFactory{
+ nestingLimitValidatorName: func(val *env.Validator) (ASTValidator, error) {
+ if limit, found := val.ConfigValue("limit"); found {
+ // In case of protos, config value is of type by google.protobuf.Value, which numeric values are always a double.
+ if val, isDouble := limit.(float64); isDouble {
+ if val != float64(int64(val)) {
+ return nil, fmt.Errorf("invalid validator: %s, limit value is not a whole number: %v", nestingLimitValidatorName, limit)
+ }
+ return ValidateComprehensionNestingLimit(int(val)), nil
+ }
+
+ if val, isInt := limit.(int); isInt {
+ return ValidateComprehensionNestingLimit(val), nil
+ }
+ return nil, fmt.Errorf("invalid validator: %s unsupported limit type: %v", nestingLimitValidatorName, limit)
+ }
+ return nil, fmt.Errorf("invalid validator: %s missing limit", nestingLimitValidatorName)
+ },
+ durationValidatorName: func(*env.Validator) (ASTValidator, error) {
+ return ValidateDurationLiterals(), nil
+ },
+ regexValidatorName: func(*env.Validator) (ASTValidator, error) {
+ return ValidateRegexLiterals(), nil
+ },
+ timestampValidatorName: func(*env.Validator) (ASTValidator, error) {
+ return ValidateTimestampLiterals(), nil
+ },
+ homogeneousValidatorName: func(*env.Validator) (ASTValidator, error) {
+ return ValidateHomogeneousAggregateLiterals(), nil
+ },
+ }
+)
+
+// ASTValidatorFactory creates an ASTValidator as configured by the input map
+type ASTValidatorFactory func(*env.Validator) (ASTValidator, error)
+
// ASTValidators configures a set of ASTValidator instances into the target environment.
//
// Validators are applied in the order in which the are specified and are treated as singletons.
@@ -70,6 +112,18 @@ type ASTValidator interface {
Validate(*Env, ValidatorConfig, *ast.AST, *Issues)
}
+// ConfigurableASTValidator supports conversion of an object to an `env.Validator` instance used for
+// YAML serialization.
+type ConfigurableASTValidator interface {
+ // ToConfig converts the internal configuration of an ASTValidator into an env.Validator instance
+ // which minimally must include the validator name, but may also include a map[string]any config
+ // object to be serialized to YAML. The string keys represent the configuration parameter name,
+ // and the any value must mirror the internally supported type associated with the config key.
+ //
+ // Note: only primitive CEL types are supported by CEL validators at this time.
+ ToConfig() *env.Validator
+}
+
// ValidatorConfig provides an accessor method for querying validator configuration state.
type ValidatorConfig interface {
GetOrDefault(name string, value any) any
@@ -196,7 +250,12 @@ type formatValidator struct {
// Name returns the unique name of this function format validator.
func (v formatValidator) Name() string {
- return fmt.Sprintf("cel.lib.std.validate.functions.%s", v.funcName)
+ return fmt.Sprintf("cel.validator.%s", v.funcName)
+}
+
+// ToConfig converts the ASTValidator to an env.Validator specifying the validator name.
+func (v formatValidator) ToConfig() *env.Validator {
+ return env.NewValidator(v.Name())
}
// Validate searches the AST for uses of a given function name with a constant argument and performs a check
@@ -242,6 +301,11 @@ func (homogeneousAggregateLiteralValidator) Name() string {
return homogeneousValidatorName
}
+// ToConfig converts the ASTValidator to an env.Validator specifying the validator name.
+func (v homogeneousAggregateLiteralValidator) ToConfig() *env.Validator {
+ return env.NewValidator(v.Name())
+}
+
// Validate validates that all lists and map literals have homogeneous types, i.e. don't contain dyn types.
//
// This validator makes an exception for list and map literals which occur at any level of nesting within
@@ -336,10 +400,18 @@ type nestingLimitValidator struct {
limit int
}
+// Name returns the name of the nesting limit validator.
func (v nestingLimitValidator) Name() string {
- return "cel.lib.std.validate.comprehension_nesting_limit"
+ return nestingLimitValidatorName
+}
+
+// ToConfig converts the ASTValidator to an env.Validator specifying the validator name and the nesting limit
+// as an integer value: {"limit": int}
+func (v nestingLimitValidator) ToConfig() *env.Validator {
+ return env.NewValidator(v.Name()).SetConfig(map[string]any{"limit": v.limit})
}
+// Validate implements the ASTValidator interface method.
func (v nestingLimitValidator) Validate(e *Env, _ ValidatorConfig, a *ast.AST, iss *Issues) {
root := ast.NavigateAST(a)
comprehensions := ast.MatchDescendants(root, ast.KindMatcher(ast.ComprehensionKind))
diff --git a/vendor/github.com/google/cel-go/checker/checker.go b/vendor/github.com/google/cel-go/checker/checker.go
index 6824af7a5..0057c16cc 100644
--- a/vendor/github.com/google/cel-go/checker/checker.go
+++ b/vendor/github.com/google/cel-go/checker/checker.go
@@ -145,6 +145,17 @@ func (c *checker) checkSelect(e ast.Expr) {
func (c *checker) checkOptSelect(e ast.Expr) {
// Collect metadata related to the opt select call packaged by the parser.
call := e.AsCall()
+ if len(call.Args()) != 2 || call.IsMemberFunction() {
+ t := ""
+ if call.IsMemberFunction() {
+ t = " member call with"
+ }
+ c.errors.notAnOptionalFieldSelectionCall(e.ID(), c.location(e),
+ fmt.Sprintf(
+ "incorrect signature.%s argument count: %d", t, len(call.Args())))
+ return
+ }
+
operand := call.Args()[0]
field := call.Args()[1]
fieldName, isString := maybeUnwrapString(field)
diff --git a/vendor/github.com/google/cel-go/checker/cost.go b/vendor/github.com/google/cel-go/checker/cost.go
index 04244694d..5bc6318ed 100644
--- a/vendor/github.com/google/cel-go/checker/cost.go
+++ b/vendor/github.com/google/cel-go/checker/cost.go
@@ -28,15 +28,20 @@ import (
// CostEstimator estimates the sizes of variable length input data and the costs of functions.
type CostEstimator interface {
- // EstimateSize returns a SizeEstimate for the given AstNode, or nil if
- // the estimator has no estimate to provide. The size is equivalent to the result of the CEL `size()` function:
- // length of strings and bytes, number of map entries or number of list items.
- // EstimateSize is only called for AstNodes where
- // CEL does not know the size; EstimateSize is not called for values defined inline in CEL where the size
- // is already obvious to CEL.
+ // EstimateSize returns a SizeEstimate for the given AstNode, or nil if the estimator has no
+ // estimate to provide.
+ //
+ // The size is equivalent to the result of the CEL `size()` function:
+ // * Number of unicode characters in a string
+ // * Number of bytes in a sequence
+ // * Number of map entries or number of list items.
+ //
+ // EstimateSize is only called for AstNodes where CEL does not know the size; EstimateSize is not
+ // called for values defined inline in CEL where the size is already obvious to CEL.
EstimateSize(element AstNode) *SizeEstimate
- // EstimateCallCost returns the estimated cost of an invocation, or nil if
- // the estimator has no estimate to provide.
+
+ // EstimateCallCost returns the estimated cost of an invocation, or nil if the estimator has no
+ // estimate to provide.
EstimateCallCost(function, overloadID string, target *AstNode, args []AstNode) *CallEstimate
}
@@ -44,6 +49,7 @@ type CostEstimator interface {
// The ResultSize should only be provided if the call results in a map, list, string or bytes.
type CallEstimate struct {
CostEstimate
+
ResultSize *SizeEstimate
}
@@ -53,10 +59,13 @@ type AstNode interface {
// represent type directly reachable from the provided type declarations.
// The first path element is a variable. All subsequent path elements are one of: field name, '@items', '@keys', '@values'.
Path() []string
+
// Type returns the deduced type of the AstNode.
Type() *types.Type
+
// Expr returns the expression of the AstNode.
Expr() ast.Expr
+
// ComputedSize returns a size estimate of the AstNode derived from information available in the CEL expression.
// For constants and inline list and map declarations, the exact size is returned. For concatenated list, strings
// and bytes, the size is derived from the size estimates of the operands. nil is returned if there is no
@@ -84,36 +93,7 @@ func (e astNode) Expr() ast.Expr {
}
func (e astNode) ComputedSize() *SizeEstimate {
- if e.derivedSize != nil {
- return e.derivedSize
- }
- var v uint64
- switch e.expr.Kind() {
- case ast.LiteralKind:
- switch ck := e.expr.AsLiteral().(type) {
- case types.String:
- // converting to runes here is an O(n) operation, but
- // this is consistent with how size is computed at runtime,
- // and how the language definition defines string size
- v = uint64(len([]rune(ck)))
- case types.Bytes:
- v = uint64(len(ck))
- case types.Bool, types.Double, types.Duration,
- types.Int, types.Timestamp, types.Uint,
- types.Null:
- v = uint64(1)
- default:
- return nil
- }
- case ast.ListKind:
- v = uint64(e.expr.AsList().Size())
- case ast.MapKind:
- v = uint64(e.expr.AsMap().Size())
- default:
- return nil
- }
-
- return &SizeEstimate{Min: v, Max: v}
+ return e.derivedSize
}
// SizeEstimate represents an estimated size of a variable length string, bytes, map or list.
@@ -121,6 +101,16 @@ type SizeEstimate struct {
Min, Max uint64
}
+// UnknownSizeEstimate returns a size between 0 and max uint
+func UnknownSizeEstimate() SizeEstimate {
+ return unknownSizeEstimate
+}
+
+// FixedSizeEstimate returns a size estimate with a fixed min and max range.
+func FixedSizeEstimate(size uint64) SizeEstimate {
+ return SizeEstimate{Min: size, Max: size}
+}
+
// Add adds to another SizeEstimate and returns the sum.
// If add would result in an uint64 overflow, the result is math.MaxUint64.
func (se SizeEstimate) Add(sizeEstimate SizeEstimate) SizeEstimate {
@@ -175,12 +165,22 @@ type CostEstimate struct {
Min, Max uint64
}
+// UnknownCostEstimate returns a cost with an unknown impact.
+func UnknownCostEstimate() CostEstimate {
+ return unknownCostEstimate
+}
+
+// FixedCostEstimate returns a cost with a fixed min and max range.
+func FixedCostEstimate(cost uint64) CostEstimate {
+ return CostEstimate{Min: cost, Max: cost}
+}
+
// Add adds the costs and returns the sum.
// If add would result in an uint64 overflow for the min or max, the value is set to math.MaxUint64.
func (ce CostEstimate) Add(cost CostEstimate) CostEstimate {
return CostEstimate{
- addUint64NoOverflow(ce.Min, cost.Min),
- addUint64NoOverflow(ce.Max, cost.Max),
+ Min: addUint64NoOverflow(ce.Min, cost.Min),
+ Max: addUint64NoOverflow(ce.Max, cost.Max),
}
}
@@ -188,8 +188,8 @@ func (ce CostEstimate) Add(cost CostEstimate) CostEstimate {
// If multiply would result in an uint64 overflow, the result is math.MaxUint64.
func (ce CostEstimate) Multiply(cost CostEstimate) CostEstimate {
return CostEstimate{
- multiplyUint64NoOverflow(ce.Min, cost.Min),
- multiplyUint64NoOverflow(ce.Max, cost.Max),
+ Min: multiplyUint64NoOverflow(ce.Min, cost.Min),
+ Max: multiplyUint64NoOverflow(ce.Max, cost.Max),
}
}
@@ -197,8 +197,8 @@ func (ce CostEstimate) Multiply(cost CostEstimate) CostEstimate {
// nearest integer of the result, rounded up.
func (ce CostEstimate) MultiplyByCostFactor(costPerUnit float64) CostEstimate {
return CostEstimate{
- multiplyByCostFactor(ce.Min, costPerUnit),
- multiplyByCostFactor(ce.Max, costPerUnit),
+ Min: multiplyByCostFactor(ce.Min, costPerUnit),
+ Max: multiplyByCostFactor(ce.Max, costPerUnit),
}
}
@@ -245,49 +245,6 @@ func multiplyByCostFactor(x uint64, y float64) uint64 {
return uint64(ceil)
}
-var (
- selectAndIdentCost = CostEstimate{Min: common.SelectAndIdentCost, Max: common.SelectAndIdentCost}
- constCost = CostEstimate{Min: common.ConstCost, Max: common.ConstCost}
-
- createListBaseCost = CostEstimate{Min: common.ListCreateBaseCost, Max: common.ListCreateBaseCost}
- createMapBaseCost = CostEstimate{Min: common.MapCreateBaseCost, Max: common.MapCreateBaseCost}
- createMessageBaseCost = CostEstimate{Min: common.StructCreateBaseCost, Max: common.StructCreateBaseCost}
-)
-
-type coster struct {
- // exprPath maps from Expr Id to field path.
- exprPath map[int64][]string
- // iterRanges tracks the iterRange of each iterVar.
- iterRanges iterRangeScopes
- // computedSizes tracks the computed sizes of call results.
- computedSizes map[int64]SizeEstimate
- checkedAST *ast.AST
- estimator CostEstimator
- overloadEstimators map[string]FunctionEstimator
- // presenceTestCost will either be a zero or one based on whether has() macros count against cost computations.
- presenceTestCost CostEstimate
-}
-
-// Use a stack of iterVar -> iterRange Expr Ids to handle shadowed variable names.
-type iterRangeScopes map[string][]int64
-
-func (vs iterRangeScopes) push(varName string, expr ast.Expr) {
- vs[varName] = append(vs[varName], expr.ID())
-}
-
-func (vs iterRangeScopes) pop(varName string) {
- varStack := vs[varName]
- vs[varName] = varStack[:len(varStack)-1]
-}
-
-func (vs iterRangeScopes) peek(varName string) (int64, bool) {
- varStack := vs[varName]
- if len(varStack) > 0 {
- return varStack[len(varStack)-1], true
- }
- return 0, false
-}
-
// CostOption configures flags which affect cost computations.
type CostOption func(*coster) error
@@ -300,7 +257,7 @@ func PresenceTestHasCost(hasCost bool) CostOption {
c.presenceTestCost = selectAndIdentCost
return nil
}
- c.presenceTestCost = CostEstimate{Min: 0, Max: 0}
+ c.presenceTestCost = FixedCostEstimate(0)
return nil
}
}
@@ -325,10 +282,11 @@ func Cost(checked *ast.AST, estimator CostEstimator, opts ...CostOption) (CostEs
checkedAST: checked,
estimator: estimator,
overloadEstimators: map[string]FunctionEstimator{},
- exprPath: map[int64][]string{},
- iterRanges: map[string][]int64{},
+ exprPaths: map[int64][]string{},
+ localVars: make(scopes),
computedSizes: map[int64]SizeEstimate{},
- presenceTestCost: CostEstimate{Min: 1, Max: 1},
+ computedEntrySizes: map[int64]entrySizeEstimate{},
+ presenceTestCost: FixedCostEstimate(1),
}
for _, opt := range opts {
err := opt(c)
@@ -339,6 +297,165 @@ func Cost(checked *ast.AST, estimator CostEstimator, opts ...CostOption) (CostEs
return c.cost(checked.Expr()), nil
}
+type coster struct {
+ // exprPaths maps from Expr Id to field path.
+ exprPaths map[int64][]string
+ // localVars tracks the local and iteration variables assigned during evaluation.
+ localVars scopes
+ // computedSizes tracks the computed sizes of call results.
+ computedSizes map[int64]SizeEstimate
+ // computedEntrySizes tracks the size of list and map entries
+ computedEntrySizes map[int64]entrySizeEstimate
+
+ checkedAST *ast.AST
+ estimator CostEstimator
+ overloadEstimators map[string]FunctionEstimator
+ // presenceTestCost will either be a zero or one based on whether has() macros count against cost computations.
+ presenceTestCost CostEstimate
+}
+
+// entrySizeEstimate captures the container kind and associated key/index and value SizeEstimate values.
+//
+// An entrySizeEstimate only exists if both the key/index and the value have SizeEstimate values, otherwise
+// a nil entrySizeEstimate should be used.
+type entrySizeEstimate struct {
+ containerKind types.Kind
+ key SizeEstimate
+ val SizeEstimate
+}
+
+// container returns the container kind (list or map) of the entry.
+func (s *entrySizeEstimate) container() types.Kind {
+ if s == nil {
+ return types.UnknownKind
+ }
+ return s.containerKind
+}
+
+// keySize returns the SizeEstimate for the key if one exists.
+func (s *entrySizeEstimate) keySize() *SizeEstimate {
+ if s == nil {
+ return nil
+ }
+ return &s.key
+}
+
+// valSize returns the SizeEstimate for the value if one exists.
+func (s *entrySizeEstimate) valSize() *SizeEstimate {
+ if s == nil {
+ return nil
+ }
+ return &s.val
+}
+
+func (s *entrySizeEstimate) union(other *entrySizeEstimate) *entrySizeEstimate {
+ if s == nil || other == nil {
+ return nil
+ }
+ sk := s.key.Union(other.key)
+ sv := s.val.Union(other.val)
+ return &entrySizeEstimate{
+ containerKind: s.containerKind,
+ key: sk,
+ val: sv,
+ }
+}
+
+// localVar captures the local variable size and entrySize estimates if they exist for variables
+type localVar struct {
+ exprID int64
+ path []string
+ size *SizeEstimate
+ entrySize *entrySizeEstimate
+}
+
+// scopes is a stack of variable name to integer id stack to handle scopes created by cel.bind() like macros
+type scopes map[string][]*localVar
+
+func (s scopes) push(varName string, expr ast.Expr, path []string, size *SizeEstimate, entrySize *entrySizeEstimate) {
+ s[varName] = append(s[varName], &localVar{
+ exprID: expr.ID(),
+ path: path,
+ size: size,
+ entrySize: entrySize,
+ })
+}
+
+func (s scopes) pop(varName string) {
+ varStack := s[varName]
+ s[varName] = varStack[:len(varStack)-1]
+}
+
+func (s scopes) peek(varName string) (*localVar, bool) {
+ varStack := s[varName]
+ if len(varStack) > 0 {
+ return varStack[len(varStack)-1], true
+ }
+ return nil, false
+}
+
+func (c *coster) pushIterKey(varName string, rangeExpr ast.Expr) {
+ entrySize := c.computeEntrySize(rangeExpr)
+ size := entrySize.keySize()
+ path := c.getPath(rangeExpr)
+ container := entrySize.container()
+ if container == types.UnknownKind {
+ container = c.getType(rangeExpr).Kind()
+ }
+ subpath := "@keys"
+ if container == types.ListKind {
+ subpath = "@indices"
+ }
+ c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil)
+}
+
+func (c *coster) pushIterValue(varName string, rangeExpr ast.Expr) {
+ entrySize := c.computeEntrySize(rangeExpr)
+ size := entrySize.valSize()
+ path := c.getPath(rangeExpr)
+ container := entrySize.container()
+ if container == types.UnknownKind {
+ container = c.getType(rangeExpr).Kind()
+ }
+ subpath := "@values"
+ if container == types.ListKind {
+ subpath = "@items"
+ }
+ c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil)
+}
+
+func (c *coster) pushIterSingle(varName string, rangeExpr ast.Expr) {
+ entrySize := c.computeEntrySize(rangeExpr)
+ size := entrySize.keySize()
+ subpath := "@keys"
+ container := entrySize.container()
+ if container == types.UnknownKind {
+ container = c.getType(rangeExpr).Kind()
+ }
+ if container == types.ListKind {
+ size = entrySize.valSize()
+ subpath = "@items"
+ }
+ path := c.getPath(rangeExpr)
+ c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil)
+}
+
+func (c *coster) pushLocalVar(varName string, e ast.Expr) {
+ path := c.getPath(e)
+ // note: retrieve the entry size for the local variable based on the size of the binding expression
+ // since the binding expression could be a list or map, the entry size should also be propagated
+ entrySize := c.computeEntrySize(e)
+ c.localVars.push(varName, e, path, c.computeSize(e), entrySize)
+}
+
+func (c *coster) peekLocalVar(varName string) (*localVar, bool) {
+ return c.localVars.peek(varName)
+}
+
+func (c *coster) popLocalVar(varName string) {
+ c.localVars.pop(varName)
+}
+
func (c *coster) cost(e ast.Expr) CostEstimate {
if e == nil {
return CostEstimate{}
@@ -360,7 +477,11 @@ func (c *coster) cost(e ast.Expr) CostEstimate {
case ast.StructKind:
cost = c.costCreateStruct(e)
case ast.ComprehensionKind:
- cost = c.costComprehension(e)
+ if c.isBind(e) {
+ cost = c.costBind(e)
+ } else {
+ cost = c.costComprehension(e)
+ }
default:
return CostEstimate{}
}
@@ -370,17 +491,11 @@ func (c *coster) cost(e ast.Expr) CostEstimate {
func (c *coster) costIdent(e ast.Expr) CostEstimate {
identName := e.AsIdent()
// build and track the field path
- if iterRange, ok := c.iterRanges.peek(identName); ok {
- switch c.checkedAST.GetType(iterRange).Kind() {
- case types.ListKind:
- c.addPath(e, append(c.exprPath[iterRange], "@items"))
- case types.MapKind:
- c.addPath(e, append(c.exprPath[iterRange], "@keys"))
- }
+ if v, ok := c.peekLocalVar(identName); ok {
+ c.addPath(e, v.path)
} else {
c.addPath(e, []string{identName})
}
-
return selectAndIdentCost
}
@@ -405,14 +520,18 @@ func (c *coster) costSelect(e ast.Expr) CostEstimate {
// build and track the field path
c.addPath(e, append(c.getPath(sel.Operand()), sel.FieldName()))
-
return sum
}
func (c *coster) costCall(e ast.Expr) CostEstimate {
+ // Dyn is just a way to disable type-checking, so return the cost of 1 with the cost of the argument
+ if dynEstimate := c.maybeUnwrapDynCall(e); dynEstimate != nil {
+ return *dynEstimate
+ }
+
+ // Continue estimating the cost of all other calls.
call := e.AsCall()
args := call.Args()
-
var sum CostEstimate
argTypes := make([]AstNode, len(args))
@@ -426,16 +545,17 @@ func (c *coster) costCall(e ast.Expr) CostEstimate {
if len(overloadIDs) == 0 {
return CostEstimate{}
}
- var targetType AstNode
+ var targetType *AstNode
if call.IsMemberFunction() {
sum = sum.Add(c.cost(call.Target()))
- targetType = c.newAstNode(call.Target())
+ var t AstNode = c.newAstNode(call.Target())
+ targetType = &t
}
// Pick a cost estimate range that covers all the overload cost estimation ranges
fnCost := CostEstimate{Min: uint64(math.MaxUint64), Max: 0}
var resultSize *SizeEstimate
for _, overload := range overloadIDs {
- overloadCost := c.functionCost(call.FunctionName(), overload, &targetType, argTypes, argCosts)
+ overloadCost := c.functionCost(e, call.FunctionName(), overload, targetType, argTypes, argCosts)
fnCost = fnCost.Union(overloadCost.CostEstimate)
if overloadCost.ResultSize != nil {
if resultSize == nil {
@@ -449,37 +569,73 @@ func (c *coster) costCall(e ast.Expr) CostEstimate {
switch overload {
case overloads.IndexList:
if len(args) > 0 {
+ // note: assigning resultSize here could be redundant with the path-based lookup later
+ resultSize = c.computeEntrySize(args[0]).valSize()
c.addPath(e, append(c.getPath(args[0]), "@items"))
}
case overloads.IndexMap:
if len(args) > 0 {
+ resultSize = c.computeEntrySize(args[0]).valSize()
c.addPath(e, append(c.getPath(args[0]), "@values"))
}
}
+ if resultSize == nil {
+ resultSize = c.computeSize(e)
+ }
}
- if resultSize != nil {
- c.computedSizes[e.ID()] = *resultSize
- }
+ c.setSize(e, resultSize)
return sum.Add(fnCost)
}
+func (c *coster) maybeUnwrapDynCall(e ast.Expr) *CostEstimate {
+ call := e.AsCall()
+ if call.FunctionName() != "dyn" {
+ return nil
+ }
+ arg := call.Args()[0]
+ argCost := c.cost(arg)
+ c.copySizeEstimates(e, arg)
+ callCost := FixedCostEstimate(1).Add(argCost)
+ return &callCost
+}
+
func (c *coster) costCreateList(e ast.Expr) CostEstimate {
create := e.AsList()
var sum CostEstimate
+ itemSize := SizeEstimate{Min: math.MaxUint64, Max: 0}
+ if create.Size() == 0 {
+ itemSize.Min = 0
+ }
for _, e := range create.Elements() {
sum = sum.Add(c.cost(e))
+ is := c.sizeOrUnknown(e)
+ itemSize = itemSize.Union(is)
}
+ c.setEntrySize(e, &entrySizeEstimate{containerKind: types.ListKind, key: FixedSizeEstimate(1), val: itemSize})
return sum.Add(createListBaseCost)
}
func (c *coster) costCreateMap(e ast.Expr) CostEstimate {
mapVal := e.AsMap()
var sum CostEstimate
+ keySize := SizeEstimate{Min: math.MaxUint64, Max: 0}
+ valSize := SizeEstimate{Min: math.MaxUint64, Max: 0}
+ if mapVal.Size() == 0 {
+ valSize.Min = 0
+ keySize.Min = 0
+ }
for _, ent := range mapVal.Entries() {
entry := ent.AsMapEntry()
sum = sum.Add(c.cost(entry.Key()))
sum = sum.Add(c.cost(entry.Value()))
+ // Compute the key size range
+ ks := c.sizeOrUnknown(entry.Key())
+ keySize = keySize.Union(ks)
+ // Compute the value size range
+ vs := c.sizeOrUnknown(entry.Value())
+ valSize = valSize.Union(vs)
}
+ c.setEntrySize(e, &entrySizeEstimate{containerKind: types.MapKind, key: keySize, val: valSize})
return sum.Add(createMapBaseCost)
}
@@ -498,43 +654,76 @@ func (c *coster) costComprehension(e ast.Expr) CostEstimate {
var sum CostEstimate
sum = sum.Add(c.cost(comp.IterRange()))
sum = sum.Add(c.cost(comp.AccuInit()))
+ c.pushLocalVar(comp.AccuVar(), comp.AccuInit())
- // Track the iterRange of each IterVar for field path construction
- c.iterRanges.push(comp.IterVar(), comp.IterRange())
+ // Track the iterRange of each IterVar and AccuVar for field path construction
+ if comp.HasIterVar2() {
+ c.pushIterKey(comp.IterVar(), comp.IterRange())
+ c.pushIterValue(comp.IterVar2(), comp.IterRange())
+ } else {
+ c.pushIterSingle(comp.IterVar(), comp.IterRange())
+ }
+
+ // Determine the cost for each element in the loop
loopCost := c.cost(comp.LoopCondition())
stepCost := c.cost(comp.LoopStep())
- c.iterRanges.pop(comp.IterVar())
- sum = sum.Add(c.cost(comp.Result()))
- rangeCnt := c.sizeEstimate(c.newAstNode(comp.IterRange()))
- c.computedSizes[e.ID()] = rangeCnt
+ // Clear the intermediate variable tracking.
+ c.popLocalVar(comp.IterVar())
+ if comp.HasIterVar2() {
+ c.popLocalVar(comp.IterVar2())
+ }
+
+ // Determine the result cost.
+ sum = sum.Add(c.cost(comp.Result()))
+ c.localVars.pop(comp.AccuVar())
+ // Estimate the cost of the loop.
+ rangeCnt := c.sizeOrUnknown(comp.IterRange())
rangeCost := rangeCnt.MultiplyByCost(stepCost.Add(loopCost))
sum = sum.Add(rangeCost)
+ switch k := comp.AccuInit().Kind(); k {
+ case ast.LiteralKind:
+ c.setSize(e, c.computeSize(comp.AccuInit()))
+ case ast.ListKind, ast.MapKind:
+ c.setSize(e, &rangeCnt)
+ // For a step which produces a container value, it will have an entry size associated
+ // with its expression id.
+ if stepEntrySize := c.computeEntrySize(comp.LoopStep()); stepEntrySize != nil {
+ c.setEntrySize(e, stepEntrySize)
+ break
+ }
+ }
return sum
}
-func (c *coster) sizeEstimate(t AstNode) SizeEstimate {
- if l := t.ComputedSize(); l != nil {
- return *l
- }
- if l := c.estimator.EstimateSize(t); l != nil {
- return *l
- }
- // return an estimate of 1 for return types of set
- // lengths, since strings/bytes/more complex objects could be of
- // variable length
- if isScalar(t.Type()) {
- // TODO: since the logic for size estimation is split between
- // ComputedSize and isScalar, changing one will likely require changing
- // the other, so they should be merged in the future if possible
- return SizeEstimate{Min: 1, Max: 1}
- }
- return SizeEstimate{Min: 0, Max: math.MaxUint64}
+func (c *coster) isBind(e ast.Expr) bool {
+ comp := e.AsComprehension()
+ iterRange := comp.IterRange()
+ loopCond := comp.LoopCondition()
+ return iterRange.Kind() == ast.ListKind && iterRange.AsList().Size() == 0 &&
+ loopCond.Kind() == ast.LiteralKind && loopCond.AsLiteral() == types.False &&
+ comp.AccuVar() != parser.AccumulatorName
+}
+
+func (c *coster) costBind(e ast.Expr) CostEstimate {
+ comp := e.AsComprehension()
+ var sum CostEstimate
+ // Binds are lazily initialized, so we retain the cost of an empty iteration range.
+ sum = sum.Add(c.cost(comp.IterRange()))
+ sum = sum.Add(c.cost(comp.AccuInit()))
+
+ c.pushLocalVar(comp.AccuVar(), comp.AccuInit())
+ sum = sum.Add(c.cost(comp.Result()))
+ c.popLocalVar(comp.AccuVar())
+
+ // Associate the bind output size with the result size.
+ c.copySizeEstimates(e, comp.Result())
+ return sum
}
-func (c *coster) functionCost(function, overloadID string, target *AstNode, args []AstNode, argCosts []CostEstimate) CallEstimate {
+func (c *coster) functionCost(e ast.Expr, function, overloadID string, target *AstNode, args []AstNode, argCosts []CostEstimate) CallEstimate {
argCostSum := func() CostEstimate {
var sum CostEstimate
for _, a := range argCosts {
@@ -559,35 +748,42 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
case overloads.ExtFormatString:
if target != nil {
// ResultSize not calculated because we can't bound the max size.
- return CallEstimate{CostEstimate: c.sizeEstimate(*target).MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())}
+ return CallEstimate{
+ CostEstimate: c.sizeOrUnknown(*target).MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())}
}
case overloads.StringToBytes:
if len(args) == 1 {
- sz := c.sizeEstimate(args[0])
+ sz := c.sizeOrUnknown(args[0])
// ResultSize max is when each char converts to 4 bytes.
- return CallEstimate{CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), ResultSize: &SizeEstimate{Min: sz.Min, Max: sz.Max * 4}}
+ return CallEstimate{
+ CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()),
+ ResultSize: &SizeEstimate{Min: sz.Min, Max: sz.Max * 4}}
}
case overloads.BytesToString:
if len(args) == 1 {
- sz := c.sizeEstimate(args[0])
+ sz := c.sizeOrUnknown(args[0])
// ResultSize min is when 4 bytes convert to 1 char.
- return CallEstimate{CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), ResultSize: &SizeEstimate{Min: sz.Min / 4, Max: sz.Max}}
+ return CallEstimate{
+ CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()),
+ ResultSize: &SizeEstimate{Min: sz.Min / 4, Max: sz.Max}}
}
case overloads.ExtQuoteString:
if len(args) == 1 {
- sz := c.sizeEstimate(args[0])
+ sz := c.sizeOrUnknown(args[0])
// ResultSize max is when each char is escaped. 2 quote chars always added.
- return CallEstimate{CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), ResultSize: &SizeEstimate{Min: sz.Min + 2, Max: sz.Max*2 + 2}}
+ return CallEstimate{
+ CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()),
+ ResultSize: &SizeEstimate{Min: sz.Min + 2, Max: sz.Max*2 + 2}}
}
case overloads.StartsWithString, overloads.EndsWithString:
if len(args) == 1 {
- return CallEstimate{CostEstimate: c.sizeEstimate(args[0]).MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())}
+ return CallEstimate{CostEstimate: c.sizeOrUnknown(args[0]).MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())}
}
case overloads.InList:
// If a list is composed entirely of constant values this is O(1), but we don't account for that here.
// We just assume all list containment checks are O(n).
if len(args) == 2 {
- return CallEstimate{CostEstimate: c.sizeEstimate(args[1]).MultiplyByCostFactor(1).Add(argCostSum())}
+ return CallEstimate{CostEstimate: c.sizeOrUnknown(args[1]).MultiplyByCostFactor(1).Add(argCostSum())}
}
// O(nm) functions
case overloads.MatchesString:
@@ -595,19 +791,19 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
if target != nil && len(args) == 1 {
// Add one to string length for purposes of cost calculation to prevent product of string and regex to be 0
// in case where string is empty but regex is still expensive.
- strCost := c.sizeEstimate(*target).Add(SizeEstimate{Min: 1, Max: 1}).MultiplyByCostFactor(common.StringTraversalCostFactor)
+ strCost := c.sizeOrUnknown(*target).Add(SizeEstimate{Min: 1, Max: 1}).MultiplyByCostFactor(common.StringTraversalCostFactor)
// We don't know how many expressions are in the regex, just the string length (a huge
// improvement here would be to somehow get a count the number of expressions in the regex or
// how many states are in the regex state machine and use that to measure regex cost).
// For now, we're making a guess that each expression in a regex is typically at least 4 chars
// in length.
- regexCost := c.sizeEstimate(args[0]).MultiplyByCostFactor(common.RegexStringLengthCostFactor)
+ regexCost := c.sizeOrUnknown(args[0]).MultiplyByCostFactor(common.RegexStringLengthCostFactor)
return CallEstimate{CostEstimate: strCost.Multiply(regexCost).Add(argCostSum())}
}
case overloads.ContainsString:
if target != nil && len(args) == 1 {
- strCost := c.sizeEstimate(*target).MultiplyByCostFactor(common.StringTraversalCostFactor)
- substrCost := c.sizeEstimate(args[0]).MultiplyByCostFactor(common.StringTraversalCostFactor)
+ strCost := c.sizeOrUnknown(*target).MultiplyByCostFactor(common.StringTraversalCostFactor)
+ substrCost := c.sizeOrUnknown(args[0]).MultiplyByCostFactor(common.StringTraversalCostFactor)
return CallEstimate{CostEstimate: strCost.Multiply(substrCost).Add(argCostSum())}
}
case overloads.LogicalOr, overloads.LogicalAnd:
@@ -617,7 +813,9 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
argCost := CostEstimate{Min: lhs.Min, Max: lhs.Add(rhs).Max}
return CallEstimate{CostEstimate: argCost}
case overloads.Conditional:
- size := c.sizeEstimate(args[1]).Union(c.sizeEstimate(args[2]))
+ size := c.sizeOrUnknown(args[1]).Union(c.sizeOrUnknown(args[2]))
+ resultEntrySize := c.computeEntrySize(args[1].Expr()).union(c.computeEntrySize(args[2].Expr()))
+ c.setEntrySize(e, resultEntrySize)
conditionalCost := argCosts[0]
ifTrueCost := argCosts[1]
ifFalseCost := argCosts[2]
@@ -625,13 +823,19 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
return CallEstimate{CostEstimate: argCost, ResultSize: &size}
case overloads.AddString, overloads.AddBytes, overloads.AddList:
if len(args) == 2 {
- lhsSize := c.sizeEstimate(args[0])
- rhsSize := c.sizeEstimate(args[1])
+ lhsSize := c.sizeOrUnknown(args[0])
+ rhsSize := c.sizeOrUnknown(args[1])
resultSize := lhsSize.Add(rhsSize)
+ rhsEntrySize := c.computeEntrySize(args[0].Expr())
+ lhsEntrySize := c.computeEntrySize(args[1].Expr())
+ resultEntrySize := rhsEntrySize.union(lhsEntrySize)
+ if resultEntrySize != nil {
+ c.setEntrySize(e, resultEntrySize)
+ }
switch overloadID {
case overloads.AddList:
// list concatenation is O(1), but we handle it here to track size
- return CallEstimate{CostEstimate: CostEstimate{Min: 1, Max: 1}.Add(argCostSum()), ResultSize: &resultSize}
+ return CallEstimate{CostEstimate: FixedCostEstimate(1).Add(argCostSum()), ResultSize: &resultSize}
default:
return CallEstimate{CostEstimate: resultSize.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), ResultSize: &resultSize}
}
@@ -639,8 +843,8 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
case overloads.LessString, overloads.GreaterString, overloads.LessEqualsString, overloads.GreaterEqualsString,
overloads.LessBytes, overloads.GreaterBytes, overloads.LessEqualsBytes, overloads.GreaterEqualsBytes,
overloads.Equals, overloads.NotEquals:
- lhsCost := c.sizeEstimate(args[0])
- rhsCost := c.sizeEstimate(args[1])
+ lhsCost := c.sizeOrUnknown(args[0])
+ rhsCost := c.sizeOrUnknown(args[1])
min := uint64(0)
smallestMax := lhsCost.Max
if rhsCost.Max < smallestMax {
@@ -650,14 +854,16 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
min = 1
}
// equality of 2 scalar values results in a cost of 1
- return CallEstimate{CostEstimate: CostEstimate{Min: min, Max: smallestMax}.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())}
+ return CallEstimate{
+ CostEstimate: CostEstimate{Min: min, Max: smallestMax}.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()),
+ }
}
// O(1) functions
// See CostTracker.costCall for more details about O(1) cost calculations
// Benchmarks suggest that most of the other operations take +/- 50% of a base cost unit
// which on an Intel xeon 2.20GHz CPU is 50ns.
- return CallEstimate{CostEstimate: CostEstimate{Min: 1, Max: 1}.Add(argCostSum())}
+ return CallEstimate{CostEstimate: FixedCostEstimate(1).Add(argCostSum())}
}
func (c *coster) getType(e ast.Expr) *types.Type {
@@ -665,28 +871,145 @@ func (c *coster) getType(e ast.Expr) *types.Type {
}
func (c *coster) getPath(e ast.Expr) []string {
- return c.exprPath[e.ID()]
+ if e.Kind() == ast.IdentKind {
+ if v, found := c.peekLocalVar(e.AsIdent()); found {
+ return v.path[:]
+ }
+ }
+ return c.exprPaths[e.ID()][:]
}
func (c *coster) addPath(e ast.Expr, path []string) {
- c.exprPath[e.ID()] = path
+ c.exprPaths[e.ID()] = path
+}
+
+func isAccumulatorVar(name string) bool {
+ return name == parser.AccumulatorName || name == parser.HiddenAccumulatorName
}
func (c *coster) newAstNode(e ast.Expr) *astNode {
path := c.getPath(e)
- if len(path) > 0 && path[0] == parser.AccumulatorName {
+ if len(path) > 0 && isAccumulatorVar(path[0]) {
// only provide paths to root vars; omit accumulator vars
path = nil
}
- var derivedSize *SizeEstimate
- if size, ok := c.computedSizes[e.ID()]; ok {
- derivedSize = &size
- }
return &astNode{
path: path,
t: c.getType(e),
expr: e,
- derivedSize: derivedSize}
+ derivedSize: c.computeSize(e)}
+}
+
+func (c *coster) setSize(e ast.Expr, size *SizeEstimate) {
+ if size == nil {
+ return
+ }
+ // Store the computed size with the expression
+ c.computedSizes[e.ID()] = *size
+}
+
+func (c *coster) sizeOrUnknown(node any) SizeEstimate {
+ switch v := node.(type) {
+ case ast.Expr:
+ if sz := c.computeSize(v); sz != nil {
+ return *sz
+ }
+ case AstNode:
+ if sz := v.ComputedSize(); sz != nil {
+ return *sz
+ }
+ }
+ return UnknownSizeEstimate()
+}
+
+func (c *coster) copySizeEstimates(dst, src ast.Expr) {
+ c.setSize(dst, c.computeSize(src))
+ c.setEntrySize(dst, c.computeEntrySize(src))
+}
+
+func (c *coster) computeSize(e ast.Expr) *SizeEstimate {
+ if size, ok := c.computedSizes[e.ID()]; ok {
+ return &size
+ }
+ if size := computeExprSize(e); size != nil {
+ return size
+ }
+ // Ensure size estimates are computed first as users may choose to override the costs that
+ // CEL would otherwise ascribe to the type.
+ node := astNode{expr: e, path: c.getPath(e), t: c.getType(e)}
+ if size := c.estimator.EstimateSize(node); size != nil {
+ // storing the computed size should reduce calls to EstimateSize()
+ c.computedSizes[e.ID()] = *size
+ return size
+ }
+ if size := computeTypeSize(c.getType(e)); size != nil {
+ return size
+ }
+ if e.Kind() == ast.IdentKind {
+ varName := e.AsIdent()
+ if v, ok := c.peekLocalVar(varName); ok && v.size != nil {
+ return v.size
+ }
+ }
+ return nil
+}
+
+func (c *coster) setEntrySize(e ast.Expr, size *entrySizeEstimate) {
+ if size == nil {
+ return
+ }
+ c.computedEntrySizes[e.ID()] = *size
+}
+
+func (c *coster) computeEntrySize(e ast.Expr) *entrySizeEstimate {
+ if sz, found := c.computedEntrySizes[e.ID()]; found {
+ return &sz
+ }
+ if e.Kind() == ast.IdentKind {
+ varName := e.AsIdent()
+ if v, ok := c.peekLocalVar(varName); ok && v.entrySize != nil {
+ return v.entrySize
+ }
+ }
+ return nil
+}
+
+func computeExprSize(expr ast.Expr) *SizeEstimate {
+ var v uint64
+ switch expr.Kind() {
+ case ast.LiteralKind:
+ switch ck := expr.AsLiteral().(type) {
+ case types.String:
+ // converting to runes here is an O(n) operation, but
+ // this is consistent with how size is computed at runtime,
+ // and how the language definition defines string size
+ v = uint64(len([]rune(ck)))
+ case types.Bytes:
+ v = uint64(len(ck))
+ case types.Bool, types.Double, types.Duration,
+ types.Int, types.Timestamp, types.Uint,
+ types.Null:
+ v = uint64(1)
+ default:
+ return nil
+ }
+ case ast.ListKind:
+ v = uint64(expr.AsList().Size())
+ case ast.MapKind:
+ v = uint64(expr.AsMap().Size())
+ default:
+ return nil
+ }
+ cost := FixedSizeEstimate(v)
+ return &cost
+}
+
+func computeTypeSize(t *types.Type) *SizeEstimate {
+ if isScalar(t) {
+ cost := FixedSizeEstimate(1)
+ return &cost
+ }
+ return nil
}
// isScalar returns true if the given type is known to be of a constant size at
@@ -696,10 +1019,24 @@ func isScalar(t *types.Type) bool {
switch t.Kind() {
case types.BoolKind, types.DoubleKind, types.DurationKind, types.IntKind, types.TimestampKind, types.UintKind:
return true
+ case types.OpaqueKind:
+ if t.TypeName() == "optional_type" {
+ return isScalar(t.Parameters()[0])
+ }
}
return false
}
var (
doubleTwoTo64 = math.Ldexp(1.0, 64)
+
+ unknownSizeEstimate = SizeEstimate{Min: 0, Max: math.MaxUint64}
+ unknownCostEstimate = unknownSizeEstimate.MultiplyByCostFactor(1)
+
+ selectAndIdentCost = FixedCostEstimate(common.SelectAndIdentCost)
+ constCost = FixedCostEstimate(common.ConstCost)
+
+ createListBaseCost = FixedCostEstimate(common.ListCreateBaseCost)
+ createMapBaseCost = FixedCostEstimate(common.MapCreateBaseCost)
+ createMessageBaseCost = FixedCostEstimate(common.StructCreateBaseCost)
)
diff --git a/vendor/github.com/google/cel-go/checker/decls/decls.go b/vendor/github.com/google/cel-go/checker/decls/decls.go
index c0e5de469..e013d2c2b 100644
--- a/vendor/github.com/google/cel-go/checker/decls/decls.go
+++ b/vendor/github.com/google/cel-go/checker/decls/decls.go
@@ -91,6 +91,17 @@ func NewFunction(name string,
Overloads: overloads}}}
}
+// NewFunctionWithDoc creates a named function declaration with a description and one or more overloads.
+func NewFunctionWithDoc(name, doc string,
+ overloads ...*exprpb.Decl_FunctionDecl_Overload) *exprpb.Decl {
+ return &exprpb.Decl{
+ Name: name,
+ DeclKind: &exprpb.Decl_Function{
+ Function: &exprpb.Decl_FunctionDecl{
+ // Doc: desc,
+ Overloads: overloads}}}
+}
+
// NewIdent creates a named identifier declaration with an optional literal
// value.
//
@@ -98,28 +109,37 @@ func NewFunction(name string,
//
// Deprecated: Use NewVar or NewConst instead.
func NewIdent(name string, t *exprpb.Type, v *exprpb.Constant) *exprpb.Decl {
+ return newIdent(name, t, v, "")
+}
+
+func newIdent(name string, t *exprpb.Type, v *exprpb.Constant, desc string) *exprpb.Decl {
return &exprpb.Decl{
Name: name,
DeclKind: &exprpb.Decl_Ident{
Ident: &exprpb.Decl_IdentDecl{
Type: t,
- Value: v}}}
+ Value: v,
+ Doc: desc}}}
}
// NewConst creates a constant identifier with a CEL constant literal value.
func NewConst(name string, t *exprpb.Type, v *exprpb.Constant) *exprpb.Decl {
- return NewIdent(name, t, v)
+ return newIdent(name, t, v, "")
}
// NewVar creates a variable identifier.
func NewVar(name string, t *exprpb.Type) *exprpb.Decl {
- return NewIdent(name, t, nil)
+ return newIdent(name, t, nil, "")
+}
+
+// NewVarWithDoc creates a variable identifier with a type and a description string.
+func NewVarWithDoc(name string, t *exprpb.Type, desc string) *exprpb.Decl {
+ return newIdent(name, t, nil, desc)
}
// NewInstanceOverload creates a instance function overload contract.
// First element of argTypes is instance.
-func NewInstanceOverload(id string, argTypes []*exprpb.Type,
- resultType *exprpb.Type) *exprpb.Decl_FunctionDecl_Overload {
+func NewInstanceOverload(id string, argTypes []*exprpb.Type, resultType *exprpb.Type) *exprpb.Decl_FunctionDecl_Overload {
return &exprpb.Decl_FunctionDecl_Overload{
OverloadId: id,
ResultType: resultType,
@@ -154,8 +174,7 @@ func NewObjectType(typeName string) *exprpb.Type {
// NewOverload creates a function overload declaration which contains a unique
// overload id as well as the expected argument and result types. Overloads
// must be aggregated within a Function declaration.
-func NewOverload(id string, argTypes []*exprpb.Type,
- resultType *exprpb.Type) *exprpb.Decl_FunctionDecl_Overload {
+func NewOverload(id string, argTypes []*exprpb.Type, resultType *exprpb.Type) *exprpb.Decl_FunctionDecl_Overload {
return &exprpb.Decl_FunctionDecl_Overload{
OverloadId: id,
ResultType: resultType,
@@ -231,7 +250,5 @@ func NewWrapperType(wrapped *exprpb.Type) *exprpb.Type {
// TODO: return an error
panic("Wrapped type must be a primitive")
}
- return &exprpb.Type{
- TypeKind: &exprpb.Type_Wrapper{
- Wrapper: primitive}}
+ return &exprpb.Type{TypeKind: &exprpb.Type_Wrapper{Wrapper: primitive}}
}
diff --git a/vendor/github.com/google/cel-go/checker/errors.go b/vendor/github.com/google/cel-go/checker/errors.go
index 8b3bf0b8b..3535440ba 100644
--- a/vendor/github.com/google/cel-go/checker/errors.go
+++ b/vendor/github.com/google/cel-go/checker/errors.go
@@ -45,6 +45,10 @@ func (e *typeErrors) notAComprehensionRange(id int64, l common.Location, t *type
FormatCELType(t))
}
+func (e *typeErrors) notAnOptionalFieldSelectionCall(id int64, l common.Location, err string) {
+ e.errs.ReportErrorAtID(id, l, "unsupported optional field selection: %s", err)
+}
+
func (e *typeErrors) notAnOptionalFieldSelection(id int64, l common.Location, field ast.Expr) {
e.errs.ReportErrorAtID(id, l, "unsupported optional field selection: %v", field)
}
diff --git a/vendor/github.com/google/cel-go/common/BUILD.bazel b/vendor/github.com/google/cel-go/common/BUILD.bazel
index eef7f281b..1b1b7914d 100644
--- a/vendor/github.com/google/cel-go/common/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/BUILD.bazel
@@ -9,6 +9,7 @@ go_library(
name = "go_default_library",
srcs = [
"cost.go",
+ "doc.go",
"error.go",
"errors.go",
"location.go",
@@ -25,6 +26,7 @@ go_test(
name = "go_default_test",
size = "small",
srcs = [
+ "doc_test.go",
"errors_test.go",
"source_test.go",
],
diff --git a/vendor/github.com/google/cel-go/common/ast/ast.go b/vendor/github.com/google/cel-go/common/ast/ast.go
index b807669d4..62c09cfc6 100644
--- a/vendor/github.com/google/cel-go/common/ast/ast.go
+++ b/vendor/github.com/google/cel-go/common/ast/ast.go
@@ -160,6 +160,13 @@ func MaxID(a *AST) int64 {
return visitor.maxID + 1
}
+// Heights computes the heights of all AST expressions and returns a map from expression id to height.
+func Heights(a *AST) map[int64]int {
+ visitor := make(heightVisitor)
+ PostOrderVisit(a.Expr(), visitor)
+ return visitor
+}
+
// NewSourceInfo creates a simple SourceInfo object from an input common.Source value.
func NewSourceInfo(src common.Source) *SourceInfo {
var lineOffsets []int32
@@ -455,3 +462,74 @@ func (v *maxIDVisitor) VisitEntryExpr(e EntryExpr) {
v.maxID = e.ID()
}
}
+
+type heightVisitor map[int64]int
+
+// VisitExpr computes the height of a given node as the max height of its children plus one.
+//
+// Identifiers and literals are treated as having a height of zero.
+func (hv heightVisitor) VisitExpr(e Expr) {
+ // default includes IdentKind, LiteralKind
+ hv[e.ID()] = 0
+ switch e.Kind() {
+ case SelectKind:
+ hv[e.ID()] = 1 + hv[e.AsSelect().Operand().ID()]
+ case CallKind:
+ c := e.AsCall()
+ height := hv.maxHeight(c.Args()...)
+ if c.IsMemberFunction() {
+ tHeight := hv[c.Target().ID()]
+ if tHeight > height {
+ height = tHeight
+ }
+ }
+ hv[e.ID()] = 1 + height
+ case ListKind:
+ l := e.AsList()
+ hv[e.ID()] = 1 + hv.maxHeight(l.Elements()...)
+ case MapKind:
+ m := e.AsMap()
+ hv[e.ID()] = 1 + hv.maxEntryHeight(m.Entries()...)
+ case StructKind:
+ s := e.AsStruct()
+ hv[e.ID()] = 1 + hv.maxEntryHeight(s.Fields()...)
+ case ComprehensionKind:
+ comp := e.AsComprehension()
+ hv[e.ID()] = 1 + hv.maxHeight(comp.IterRange(), comp.AccuInit(), comp.LoopCondition(), comp.LoopStep(), comp.Result())
+ }
+}
+
+// VisitEntryExpr computes the max height of a map or struct entry and associates the height with the entry id.
+func (hv heightVisitor) VisitEntryExpr(e EntryExpr) {
+ hv[e.ID()] = 0
+ switch e.Kind() {
+ case MapEntryKind:
+ me := e.AsMapEntry()
+ hv[e.ID()] = hv.maxHeight(me.Value(), me.Key())
+ case StructFieldKind:
+ sf := e.AsStructField()
+ hv[e.ID()] = hv[sf.Value().ID()]
+ }
+}
+
+func (hv heightVisitor) maxHeight(exprs ...Expr) int {
+ max := 0
+ for _, e := range exprs {
+ h := hv[e.ID()]
+ if h > max {
+ max = h
+ }
+ }
+ return max
+}
+
+func (hv heightVisitor) maxEntryHeight(entries ...EntryExpr) int {
+ max := 0
+ for _, e := range entries {
+ h := hv[e.ID()]
+ if h > max {
+ max = h
+ }
+ }
+ return max
+}
diff --git a/vendor/github.com/google/cel-go/common/ast/factory.go b/vendor/github.com/google/cel-go/common/ast/factory.go
index 994806b79..d4dcde4d9 100644
--- a/vendor/github.com/google/cel-go/common/ast/factory.go
+++ b/vendor/github.com/google/cel-go/common/ast/factory.go
@@ -40,15 +40,18 @@ type ExprFactory interface {
NewIdent(id int64, name string) Expr
// NewAccuIdent creates an Expr value representing an accumulator identifier within a
- //comprehension.
+ // comprehension.
NewAccuIdent(id int64) Expr
+ // AccuIdentName reports the name of the accumulator variable to be used within a comprehension.
+ AccuIdentName() string
+
// NewLiteral creates an Expr value representing a literal value, such as a string or integer.
NewLiteral(id int64, value ref.Val) Expr
// NewList creates an Expr value representing a list literal expression with optional indices.
//
- // Optional indicies will typically be empty unless the CEL optional types are enabled.
+ // Optional indices will typically be empty unless the CEL optional types are enabled.
NewList(id int64, elems []Expr, optIndices []int32) Expr
// NewMap creates an Expr value representing a map literal expression
@@ -78,11 +81,23 @@ type ExprFactory interface {
isExprFactory()
}
-type baseExprFactory struct{}
+type baseExprFactory struct {
+ accumulatorName string
+}
// NewExprFactory creates an ExprFactory instance.
func NewExprFactory() ExprFactory {
- return &baseExprFactory{}
+ return &baseExprFactory{
+ "@result",
+ }
+}
+
+// NewExprFactoryWithAccumulator creates an ExprFactory instance with a custom
+// accumulator identifier name.
+func NewExprFactoryWithAccumulator(id string) ExprFactory {
+ return &baseExprFactory{
+ id,
+ }
}
func (fac *baseExprFactory) NewCall(id int64, function string, args ...Expr) Expr {
@@ -138,7 +153,11 @@ func (fac *baseExprFactory) NewIdent(id int64, name string) Expr {
}
func (fac *baseExprFactory) NewAccuIdent(id int64) Expr {
- return fac.NewIdent(id, "__result__")
+ return fac.NewIdent(id, fac.AccuIdentName())
+}
+
+func (fac *baseExprFactory) AccuIdentName() string {
+ return fac.accumulatorName
}
func (fac *baseExprFactory) NewLiteral(id int64, value ref.Val) Expr {
diff --git a/vendor/github.com/google/cel-go/common/ast/navigable.go b/vendor/github.com/google/cel-go/common/ast/navigable.go
index d7a90fb7c..13e5777b5 100644
--- a/vendor/github.com/google/cel-go/common/ast/navigable.go
+++ b/vendor/github.com/google/cel-go/common/ast/navigable.go
@@ -237,8 +237,13 @@ func visit(expr Expr, visitor Visitor, order visitOrder, depth, maxDepth int) {
case StructKind:
s := expr.AsStruct()
for _, f := range s.Fields() {
- visitor.VisitEntryExpr(f)
+ if order == preOrder {
+ visitor.VisitEntryExpr(f)
+ }
visit(f.AsStructField().Value(), visitor, order, depth+1, maxDepth)
+ if order == postOrder {
+ visitor.VisitEntryExpr(f)
+ }
}
}
if order == postOrder {
diff --git a/vendor/github.com/google/cel-go/common/containers/container.go b/vendor/github.com/google/cel-go/common/containers/container.go
index 3097a3f78..fc146b6fc 100644
--- a/vendor/github.com/google/cel-go/common/containers/container.go
+++ b/vendor/github.com/google/cel-go/common/containers/container.go
@@ -63,9 +63,9 @@ func (c *Container) Extend(opts ...ContainerOption) (*Container, error) {
}
// Copy the name and aliases of the existing container.
ext := &Container{name: c.Name()}
- if len(c.aliasSet()) > 0 {
- aliasSet := make(map[string]string, len(c.aliasSet()))
- for k, v := range c.aliasSet() {
+ if len(c.AliasSet()) > 0 {
+ aliasSet := make(map[string]string, len(c.AliasSet()))
+ for k, v := range c.AliasSet() {
aliasSet[k] = v
}
ext.aliases = aliasSet
@@ -133,8 +133,8 @@ func (c *Container) ResolveCandidateNames(name string) []string {
return append(candidates, name)
}
-// aliasSet returns the alias to fully-qualified name mapping stored in the container.
-func (c *Container) aliasSet() map[string]string {
+// AliasSet returns the alias to fully-qualified name mapping stored in the container.
+func (c *Container) AliasSet() map[string]string {
if c == nil || c.aliases == nil {
return noAliases
}
@@ -160,7 +160,7 @@ func (c *Container) findAlias(name string) (string, bool) {
simple = name[0:dot]
qualifier = name[dot:]
}
- alias, found := c.aliasSet()[simple]
+ alias, found := c.AliasSet()[simple]
if !found {
return "", false
}
@@ -264,7 +264,7 @@ func aliasAs(kind, qualifiedName, alias string) ContainerOption {
return nil, fmt.Errorf("%s must refer to a valid qualified name: %s",
kind, qualifiedName)
}
- aliasRef, found := c.aliasSet()[alias]
+ aliasRef, found := c.AliasSet()[alias]
if found {
return nil, fmt.Errorf(
"%s collides with existing reference: name=%s, %s=%s, existing=%s",
diff --git a/vendor/github.com/google/cel-go/common/debug/debug.go b/vendor/github.com/google/cel-go/common/debug/debug.go
index 25d2e3d71..75f5f0d63 100644
--- a/vendor/github.com/google/cel-go/common/debug/debug.go
+++ b/vendor/github.com/google/cel-go/common/debug/debug.go
@@ -257,7 +257,7 @@ func formatLiteral(c ref.Val) string {
case types.Bool:
return fmt.Sprintf("%t", v)
case types.Bytes:
- return fmt.Sprintf("b\"%s\"", string(v))
+ return fmt.Sprintf("b%s", strconv.Quote(string(v)))
case types.Double:
return fmt.Sprintf("%v", float64(v))
case types.Int:
diff --git a/vendor/github.com/google/cel-go/common/decls/BUILD.bazel b/vendor/github.com/google/cel-go/common/decls/BUILD.bazel
index 17791dce6..bd3f9ae70 100644
--- a/vendor/github.com/google/cel-go/common/decls/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/decls/BUILD.bazel
@@ -13,7 +13,9 @@ go_library(
importpath = "github.com/google/cel-go/common/decls",
deps = [
"//checker/decls:go_default_library",
+ "//common:go_default_library",
"//common/functions:go_default_library",
+ "//common/operators:go_default_library",
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
"//common/types/traits:go_default_library",
diff --git a/vendor/github.com/google/cel-go/common/decls/decls.go b/vendor/github.com/google/cel-go/common/decls/decls.go
index bfeb52c51..a4a51c3f2 100644
--- a/vendor/github.com/google/cel-go/common/decls/decls.go
+++ b/vendor/github.com/google/cel-go/common/decls/decls.go
@@ -20,7 +20,9 @@ import (
"strings"
chkdecls "github.com/google/cel-go/checker/decls"
+ "github.com/google/cel-go/common"
"github.com/google/cel-go/common/functions"
+ "github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
@@ -54,6 +56,7 @@ func NewFunction(name string, opts ...FunctionOpt) (*FunctionDecl, error) {
// overload instances.
type FunctionDecl struct {
name string
+ doc string
// overloads associated with the function name.
overloads map[string]*OverloadDecl
@@ -84,6 +87,26 @@ const (
declarationEnabled
)
+// Documentation generates documentation about the Function and its overloads as a common.Doc object.
+func (f *FunctionDecl) Documentation() *common.Doc {
+ if f == nil {
+ return nil
+ }
+ children := make([]*common.Doc, len(f.OverloadDecls()))
+ for i, o := range f.OverloadDecls() {
+ var examples []*common.Doc
+ for _, ex := range o.Examples() {
+ examples = append(examples, common.NewExampleDoc(ex))
+ }
+ od := common.NewOverloadDoc(o.ID(), formatSignature(f.Name(), o), examples...)
+ children[i] = od
+ }
+ return common.NewFunctionDoc(
+ f.Name(),
+ f.Description(),
+ children...)
+}
+
// Name returns the function name in human-readable terms, e.g. 'contains' of 'math.least'
func (f *FunctionDecl) Name() string {
if f == nil {
@@ -92,9 +115,22 @@ func (f *FunctionDecl) Name() string {
return f.name
}
+// Description provides an overview of the function's purpose.
+//
+// Usage examples should be included on specific overloads.
+func (f *FunctionDecl) Description() string {
+ if f == nil {
+ return ""
+ }
+ return f.doc
+}
+
// IsDeclarationDisabled indicates that the function implementation should be added to the dispatcher, but the
// declaration should not be exposed for use in expressions.
func (f *FunctionDecl) IsDeclarationDisabled() bool {
+ if f == nil {
+ return true
+ }
return f.state == declarationDisabled
}
@@ -107,8 +143,8 @@ func (f *FunctionDecl) Merge(other *FunctionDecl) (*FunctionDecl, error) {
if f == other {
return f, nil
}
- if f.Name() != other.Name() {
- return nil, fmt.Errorf("cannot merge unrelated functions. %s and %s", f.Name(), other.Name())
+ if f == nil || other == nil || f.Name() != other.Name() {
+ return nil, fmt.Errorf("cannot merge unrelated functions. %q and %q", f.Name(), other.Name())
}
merged := &FunctionDecl{
name: f.Name(),
@@ -120,12 +156,17 @@ func (f *FunctionDecl) Merge(other *FunctionDecl) (*FunctionDecl, error) {
disableTypeGuards: f.disableTypeGuards && other.disableTypeGuards,
// default to the current functions declaration state.
state: f.state,
+ doc: f.doc,
}
// If the other state indicates that the declaration should be explicitly enabled or
// disabled, then update the merged state with the most recent value.
if other.state != declarationStateUnset {
merged.state = other.state
}
+ // Allow for non-empty overrides of documentation
+ if len(other.doc) != 0 && f.doc != other.doc {
+ merged.doc = other.doc
+ }
// baseline copy of the overloads and their ordinals
copy(merged.overloadOrdinals, f.overloadOrdinals)
for oID, o := range f.overloads {
@@ -148,6 +189,70 @@ func (f *FunctionDecl) Merge(other *FunctionDecl) (*FunctionDecl, error) {
return merged, nil
}
+// FunctionSubsetter subsets a function declaration or returns nil and false if the function
+// subset was empty.
+type FunctionSubsetter func(fn *FunctionDecl) (*FunctionDecl, bool)
+
+// OverloadSelector selects an overload associated with a given function when it returns true.
+//
+// Used in combination with the Subset method.
+type OverloadSelector func(overload *OverloadDecl) bool
+
+// IncludeOverloads defines an OverloadSelector which allow-lists a set of overloads by their ids.
+func IncludeOverloads(overloadIDs ...string) OverloadSelector {
+ return func(overload *OverloadDecl) bool {
+ for _, oID := range overloadIDs {
+ if overload.id == oID {
+ return true
+ }
+ }
+ return false
+ }
+}
+
+// ExcludeOverloads defines an OverloadSelector which deny-lists a set of overloads by their ids.
+func ExcludeOverloads(overloadIDs ...string) OverloadSelector {
+ return func(overload *OverloadDecl) bool {
+ for _, oID := range overloadIDs {
+ if overload.id == oID {
+ return false
+ }
+ }
+ return true
+ }
+}
+
+// Subset returns a new function declaration which contains only the overloads with the specified IDs.
+// If the subset function contains no overloads, then nil is returned to indicate the function is not
+// functional.
+func (f *FunctionDecl) Subset(selector OverloadSelector) *FunctionDecl {
+ if f == nil {
+ return nil
+ }
+ overloads := make(map[string]*OverloadDecl)
+ overloadOrdinals := make([]string, 0, len(f.overloadOrdinals))
+ for _, oID := range f.overloadOrdinals {
+ overload := f.overloads[oID]
+ if selector(overload) {
+ overloads[oID] = overload
+ overloadOrdinals = append(overloadOrdinals, oID)
+ }
+ }
+ if len(overloads) == 0 {
+ return nil
+ }
+ subset := &FunctionDecl{
+ name: f.Name(),
+ doc: f.doc,
+ overloads: overloads,
+ singleton: f.singleton,
+ disableTypeGuards: f.disableTypeGuards,
+ state: f.state,
+ overloadOrdinals: overloadOrdinals,
+ }
+ return subset
+}
+
// AddOverload ensures that the new overload does not collide with an existing overload signature;
// however, if the function signatures are identical, the implementation may be rewritten as its
// difficult to compare functions by object identity.
@@ -155,6 +260,9 @@ func (f *FunctionDecl) AddOverload(overload *OverloadDecl) error {
if f == nil {
return fmt.Errorf("nil function cannot add overload: %s", overload.ID())
}
+ if overload == nil {
+ return fmt.Errorf("cannot add nil overload to funciton: %s", f.Name())
+ }
for oID, o := range f.overloads {
if oID != overload.ID() && o.SignatureOverlaps(overload) {
return fmt.Errorf("overload signature collision in function %s: %s collides with %s", f.Name(), oID, overload.ID())
@@ -165,10 +273,17 @@ func (f *FunctionDecl) AddOverload(overload *OverloadDecl) error {
if overload.hasBinding() {
f.overloads[oID] = overload
}
+ // Allow redefinition of the doc string.
+ if len(overload.doc) != 0 && o.doc != overload.doc {
+ o.doc = overload.doc
+ }
return nil
}
return fmt.Errorf("overload redefinition in function. %s: %s has multiple definitions", f.Name(), oID)
}
+ if overload.HasLateBinding() != o.HasLateBinding() {
+ return fmt.Errorf("overload with late binding cannot be added to function %s: cannot mix late and non-late bindings", f.Name())
+ }
}
f.overloadOrdinals = append(f.overloadOrdinals, overload.ID())
f.overloads[overload.ID()] = overload
@@ -177,8 +292,9 @@ func (f *FunctionDecl) AddOverload(overload *OverloadDecl) error {
// OverloadDecls returns the overload declarations in the order in which they were declared.
func (f *FunctionDecl) OverloadDecls() []*OverloadDecl {
+ var emptySet []*OverloadDecl
if f == nil {
- return []*OverloadDecl{}
+ return emptySet
}
overloads := make([]*OverloadDecl, 0, len(f.overloads))
for _, oID := range f.overloadOrdinals {
@@ -187,15 +303,31 @@ func (f *FunctionDecl) OverloadDecls() []*OverloadDecl {
return overloads
}
+// HasLateBinding returns true if the function has late bindings. A function cannot mix late bindings with other bindings.
+func (f *FunctionDecl) HasLateBinding() bool {
+ if f == nil {
+ return false
+ }
+ for _, oID := range f.overloadOrdinals {
+ if f.overloads[oID].HasLateBinding() {
+ return true
+ }
+ }
+ return false
+}
+
// Bindings produces a set of function bindings, if any are defined.
func (f *FunctionDecl) Bindings() ([]*functions.Overload, error) {
+ var emptySet []*functions.Overload
if f == nil {
- return []*functions.Overload{}, nil
+ return emptySet, nil
}
overloads := []*functions.Overload{}
nonStrict := false
+ hasLateBinding := false
for _, oID := range f.overloadOrdinals {
o := f.overloads[oID]
+ hasLateBinding = hasLateBinding || o.HasLateBinding()
if o.hasBinding() {
overload := &functions.Overload{
Operator: o.ID(),
@@ -213,6 +345,9 @@ func (f *FunctionDecl) Bindings() ([]*functions.Overload, error) {
if len(overloads) != 0 {
return nil, fmt.Errorf("singleton function incompatible with specialized overloads: %s", f.Name())
}
+ if hasLateBinding {
+ return nil, fmt.Errorf("singleton function incompatible with late bindings: %s", f.Name())
+ }
overloads = []*functions.Overload{
{
Operator: f.Name(),
@@ -298,6 +433,14 @@ func MaybeNoSuchOverload(funcName string, args ...ref.Val) ref.Val {
// FunctionOpt defines a functional option for mutating a function declaration.
type FunctionOpt func(*FunctionDecl) (*FunctionDecl, error)
+// FunctionDocs configures documentation from a list of strings separated by newlines.
+func FunctionDocs(docs ...string) FunctionOpt {
+ return func(fn *FunctionDecl) (*FunctionDecl, error) {
+ fn.doc = common.MultilineDescription(docs...)
+ return fn, nil
+ }
+}
+
// DisableTypeGuards disables automatically generated function invocation guards on direct overload calls.
// Type guards remain on during dynamic dispatch for parsed-only expressions.
func DisableTypeGuards(value bool) FunctionOpt {
@@ -450,9 +593,13 @@ func newOverloadInternal(overloadID string,
// implementation.
type OverloadDecl struct {
id string
+ doc string
argTypes []*types.Type
resultType *types.Type
isMemberFunction bool
+ // hasLateBinding indicates that the function has a binding which is not known at compile time.
+ // This is useful for functions which have side-effects or are not deterministically computable.
+ hasLateBinding bool
// nonStrict indicates that the function will accept error and unknown arguments as inputs.
nonStrict bool
// operandTrait indicates whether the member argument should have a specific type-trait.
@@ -469,6 +616,15 @@ type OverloadDecl struct {
functionOp functions.FunctionOp
}
+// Examples returns a list of string examples for the overload.
+func (o *OverloadDecl) Examples() []string {
+ var emptySet []string
+ if o == nil || len(o.doc) == 0 {
+ return emptySet
+ }
+ return common.ParseDescriptions(o.doc)
+}
+
// ID mirrors the overload signature and provides a unique id which may be referenced within the type-checker
// and interpreter to optimize performance.
//
@@ -508,6 +664,14 @@ func (o *OverloadDecl) IsNonStrict() bool {
return o.nonStrict
}
+// HasLateBinding returns whether the overload has a binding which is not known at compile time.
+func (o *OverloadDecl) HasLateBinding() bool {
+ if o == nil {
+ return false
+ }
+ return o.hasLateBinding
+}
+
// OperandTrait returns the trait mask of the first operand to the overload call, e.g.
// `traits.Indexer`
func (o *OverloadDecl) OperandTrait() int {
@@ -666,6 +830,14 @@ func matchOperandTrait(trait int, arg ref.Val) bool {
// OverloadOpt is a functional option for configuring a function overload.
type OverloadOpt func(*OverloadDecl) (*OverloadDecl, error)
+// OverloadExamples configures example expressions for the overload.
+func OverloadExamples(examples ...string) OverloadOpt {
+ return func(o *OverloadDecl) (*OverloadDecl, error) {
+ o.doc = common.MultilineDescription(examples...)
+ return o, nil
+ }
+}
+
// UnaryBinding provides the implementation of a unary overload. The provided function is protected by a runtime
// type-guard which ensures runtime type agreement between the overload signature and runtime argument types.
func UnaryBinding(binding functions.UnaryOp) OverloadOpt {
@@ -676,6 +848,9 @@ func UnaryBinding(binding functions.UnaryOp) OverloadOpt {
if len(o.ArgTypes()) != 1 {
return nil, fmt.Errorf("unary function bound to non-unary overload: %s", o.ID())
}
+ if o.hasLateBinding {
+ return nil, fmt.Errorf("overload already has a late binding: %s", o.ID())
+ }
o.unaryOp = binding
return o, nil
}
@@ -691,6 +866,9 @@ func BinaryBinding(binding functions.BinaryOp) OverloadOpt {
if len(o.ArgTypes()) != 2 {
return nil, fmt.Errorf("binary function bound to non-binary overload: %s", o.ID())
}
+ if o.hasLateBinding {
+ return nil, fmt.Errorf("overload already has a late binding: %s", o.ID())
+ }
o.binaryOp = binding
return o, nil
}
@@ -703,11 +881,26 @@ func FunctionBinding(binding functions.FunctionOp) OverloadOpt {
if o.hasBinding() {
return nil, fmt.Errorf("overload already has a binding: %s", o.ID())
}
+ if o.hasLateBinding {
+ return nil, fmt.Errorf("overload already has a late binding: %s", o.ID())
+ }
o.functionOp = binding
return o, nil
}
}
+// LateFunctionBinding indicates that the function has a binding which is not known at compile time.
+// This is useful for functions which have side-effects or are not deterministically computable.
+func LateFunctionBinding() OverloadOpt {
+ return func(o *OverloadDecl) (*OverloadDecl, error) {
+ if o.hasBinding() {
+ return nil, fmt.Errorf("overload already has a binding: %s", o.ID())
+ }
+ o.hasLateBinding = true
+ return o, nil
+ }
+}
+
// OverloadIsNonStrict enables the function to be called with error and unknown argument values.
//
// Note: do not use this option unless absoluately necessary as it should be an uncommon feature.
@@ -737,13 +930,27 @@ func NewVariable(name string, t *types.Type) *VariableDecl {
return &VariableDecl{name: name, varType: t}
}
+// NewVariableWithDoc creates a new variable declaration with usage documentation.
+func NewVariableWithDoc(name string, t *types.Type, doc string) *VariableDecl {
+ return &VariableDecl{name: name, varType: t, doc: doc}
+}
+
// VariableDecl defines a variable declaration which may optionally have a constant value.
type VariableDecl struct {
name string
+ doc string
varType *types.Type
value ref.Val
}
+// Documentation returns name, type, and description for the variable.
+func (v *VariableDecl) Documentation() *common.Doc {
+ if v == nil {
+ return nil
+ }
+ return common.NewVariableDoc(v.Name(), describeCELType(v.Type()), v.Description())
+}
+
// Name returns the fully-qualified variable name
func (v *VariableDecl) Name() string {
if v == nil {
@@ -752,6 +959,16 @@ func (v *VariableDecl) Name() string {
return v.name
}
+// Description returns the usage documentation for the variable, if set.
+//
+// Good usage instructions provide information about the valid formats, ranges, sizes for the variable type.
+func (v *VariableDecl) Description() string {
+ if v == nil {
+ return ""
+ }
+ return v.doc
+}
+
// Type returns the types.Type value associated with the variable.
func (v *VariableDecl) Type() *types.Type {
if v == nil {
@@ -793,7 +1010,7 @@ func variableDeclToExprDecl(v *VariableDecl) (*exprpb.Decl, error) {
if err != nil {
return nil, err
}
- return chkdecls.NewVar(v.Name(), varType), nil
+ return chkdecls.NewVarWithDoc(v.Name(), varType, v.doc), nil
}
// FunctionDeclToExprDecl converts a go-native function declaration into a protobuf-typed function declaration.
@@ -838,8 +1055,10 @@ func functionDeclToExprDecl(f *FunctionDecl) (*exprpb.Decl, error) {
overloads[i] = chkdecls.NewParameterizedOverload(oID, argTypes, resultType, params)
}
}
+ doc := common.MultilineDescription(o.Examples()...)
+ overloads[i].Doc = doc
}
- return chkdecls.NewFunction(f.Name(), overloads...), nil
+ return chkdecls.NewFunctionWithDoc(f.Name(), f.Description(), overloads...), nil
}
func collectParamNames(paramNames map[string]struct{}, arg *types.Type) {
@@ -851,6 +1070,60 @@ func collectParamNames(paramNames map[string]struct{}, arg *types.Type) {
}
}
+func formatSignature(fnName string, o *OverloadDecl) string {
+ if opName, isOperator := operators.FindReverse(fnName); isOperator {
+ if opName == "" {
+ opName = fnName
+ }
+ return formatOperator(opName, o)
+ }
+ return formatCall(fnName, o)
+}
+
+func formatOperator(opName string, o *OverloadDecl) string {
+ args := o.ArgTypes()
+ argTypes := make([]string, len(o.ArgTypes()))
+ for j, a := range args {
+ argTypes[j] = describeCELType(a)
+ }
+ ret := describeCELType(o.ResultType())
+ switch len(args) {
+ case 1:
+ return fmt.Sprintf("%s%s -> %s", opName, argTypes[0], ret)
+ case 2:
+ if opName == operators.Index {
+ return fmt.Sprintf("%s[%s] -> %s", argTypes[0], argTypes[1], ret)
+ }
+ return fmt.Sprintf("%s %s %s -> %s", argTypes[0], opName, argTypes[1], ret)
+ default:
+ if opName == operators.Conditional {
+ return fmt.Sprint("bool ? : -> ")
+ }
+ return formatCall(opName, o)
+ }
+}
+
+func formatCall(funcName string, o *OverloadDecl) string {
+ args := make([]string, len(o.ArgTypes()))
+ ret := describeCELType(o.ResultType())
+ for j, a := range o.ArgTypes() {
+ args[j] = describeCELType(a)
+ }
+ if o.IsMemberFunction() {
+ target := args[0]
+ args = args[1:]
+ return fmt.Sprintf("%s.%s(%s) -> %s", target, funcName, strings.Join(args, ", "), ret)
+ }
+ return fmt.Sprintf("%s(%s) -> %s", funcName, strings.Join(args, ", "), ret)
+}
+
+func describeCELType(t *types.Type) string {
+ if t.Kind() == types.TypeKind {
+ return "type"
+ }
+ return t.String()
+}
+
var (
- emptyArgs = []*types.Type{}
+ emptyArgs []*types.Type
)
diff --git a/vendor/github.com/google/cel-go/common/doc.go b/vendor/github.com/google/cel-go/common/doc.go
index 5362fdfe4..06eae3642 100644
--- a/vendor/github.com/google/cel-go/common/doc.go
+++ b/vendor/github.com/google/cel-go/common/doc.go
@@ -15,3 +15,157 @@
// Package common defines types and utilities common to expression parsing,
// checking, and interpretation
package common
+
+import (
+ "strings"
+ "unicode"
+)
+
+// DocKind indicates the type of documentation element.
+type DocKind int
+
+const (
+ // DocEnv represents environment variable documentation.
+ DocEnv DocKind = iota + 1
+ // DocFunction represents function documentation.
+ DocFunction
+ // DocOverload represents function overload documentation.
+ DocOverload
+ // DocVariable represents variable documentation.
+ DocVariable
+ // DocMacro represents macro documentation.
+ DocMacro
+ // DocExample represents example documentation.
+ DocExample
+)
+
+// Doc holds the documentation details for a specific program element like
+// a variable, function, macro, or example.
+type Doc struct {
+ // Kind specifies the type of documentation element (e.g., Function, Variable).
+ Kind DocKind
+
+ // Name is the identifier of the documented element (e.g., function name, variable name).
+ Name string
+
+ // Type is the data type associated with the element, primarily used for variables.
+ Type string
+
+ // Signature represents the function or overload signature.
+ Signature string
+
+ // Description holds the textual description of the element, potentially spanning multiple lines.
+ Description string
+
+ // Children holds nested documentation elements, such as overloads for a function
+ // or examples for a function/macro.
+ Children []*Doc
+}
+
+// MultilineDescription combines multiple lines into a newline separated string.
+func MultilineDescription(lines ...string) string {
+ return strings.Join(lines, "\n")
+}
+
+// ParseDescription takes a single string containing newline characters and splits
+// it into a multiline description. All empty lines will be skipped.
+//
+// Returns an empty string if the input string is empty.
+func ParseDescription(doc string) string {
+ var lines []string
+ if len(doc) != 0 {
+ // Split the input string by newline characters.
+ for _, line := range strings.Split(doc, "\n") {
+ l := strings.TrimRightFunc(line, unicode.IsSpace)
+ if len(l) == 0 {
+ continue
+ }
+ lines = append(lines, l)
+ }
+ }
+ // Return an empty slice if the input is empty.
+ return MultilineDescription(lines...)
+}
+
+// ParseDescriptions splits a documentation string into multiple multi-line description
+// sections, using blank lines as delimiters.
+func ParseDescriptions(doc string) []string {
+ var examples []string
+ if len(doc) != 0 {
+ lines := strings.Split(doc, "\n")
+ lineStart := 0
+ for i, l := range lines {
+ // Trim trailing whitespace to identify effectively blank lines.
+ l = strings.TrimRightFunc(l, unicode.IsSpace)
+ // If a line is blank, it marks the end of the current section.
+ if len(l) == 0 {
+ // Start the next section after the blank line.
+ ex := lines[lineStart:i]
+ if len(ex) != 0 {
+ examples = append(examples, MultilineDescription(ex...))
+ }
+ lineStart = i + 1
+ }
+ }
+ // Append the last section if it wasn't terminated by a blank line.
+ if lineStart < len(lines) {
+ examples = append(examples, MultilineDescription(lines[lineStart:]...))
+ }
+ }
+ return examples
+}
+
+// NewVariableDoc creates a new Doc struct specifically for documenting a variable.
+func NewVariableDoc(name, celType, description string) *Doc {
+ return &Doc{
+ Kind: DocVariable,
+ Name: name,
+ Type: celType,
+ Description: ParseDescription(description),
+ }
+}
+
+// NewFunctionDoc creates a new Doc struct for documenting a function.
+func NewFunctionDoc(name, description string, overloads ...*Doc) *Doc {
+ return &Doc{
+ Kind: DocFunction,
+ Name: name,
+ Description: ParseDescription(description),
+ Children: overloads,
+ }
+}
+
+// NewOverloadDoc creates a new Doc struct for a function example.
+func NewOverloadDoc(id, signature string, examples ...*Doc) *Doc {
+ return &Doc{
+ Kind: DocOverload,
+ Name: id,
+ Signature: signature,
+ Children: examples,
+ }
+}
+
+// NewMacroDoc creates a new Doc struct for documenting a macro.
+func NewMacroDoc(name, description string, examples ...*Doc) *Doc {
+ return &Doc{
+ Kind: DocMacro,
+ Name: name,
+ Description: ParseDescription(description),
+ Children: examples,
+ }
+}
+
+// NewExampleDoc creates a new Doc struct specifically for holding an example.
+func NewExampleDoc(ex string) *Doc {
+ return &Doc{
+ Kind: DocExample,
+ Description: ex,
+ }
+}
+
+// Documentor is an interface for types that can provide their own documentation.
+type Documentor interface {
+ // Documentation returns the documentation coded by the DocKind to assist
+ // with text formatting.
+ Documentation() *Doc
+}
diff --git a/vendor/github.com/google/cel-go/common/env/BUILD.bazel b/vendor/github.com/google/cel-go/common/env/BUILD.bazel
new file mode 100644
index 000000000..aebe1e544
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/env/BUILD.bazel
@@ -0,0 +1,50 @@
+# Copyright 2025 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+package(
+ default_visibility = ["//visibility:public"],
+ licenses = ["notice"], # Apache 2.0
+)
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "env.go",
+ ],
+ importpath = "github.com/google/cel-go/common/env",
+ deps = [
+ "//common:go_default_library",
+ "//common/decls:go_default_library",
+ "//common/types:go_default_library",
+ ],
+)
+
+go_test(
+ name = "go_default_test",
+ size = "small",
+ srcs = [
+ "env_test.go",
+ ],
+ data = glob(["testdata/**"]),
+ embed = [":go_default_library"],
+ deps = [
+ "//common/decls:go_default_library",
+ "//common/operators:go_default_library",
+ "//common/overloads:go_default_library",
+ "//common/types:go_default_library",
+ "@in_gopkg_yaml_v3//:go_default_library",
+ ],
+)
diff --git a/vendor/github.com/google/cel-go/common/env/env.go b/vendor/github.com/google/cel-go/common/env/env.go
new file mode 100644
index 000000000..d848860c2
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/env/env.go
@@ -0,0 +1,887 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package env provides a representation of a CEL environment.
+package env
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "strconv"
+ "strings"
+
+ "github.com/google/cel-go/common/decls"
+ "github.com/google/cel-go/common/types"
+)
+
+// NewConfig creates an instance of a YAML serializable CEL environment configuration.
+func NewConfig(name string) *Config {
+ return &Config{
+ Name: name,
+ }
+}
+
+// Config represents a serializable form of the CEL environment configuration.
+//
+// Note: custom validations, feature flags, and performance tuning parameters are not (yet)
+// considered part of the core CEL environment configuration and should be managed separately
+// until a common convention for such settings is developed.
+type Config struct {
+ Name string `yaml:"name,omitempty"`
+ Description string `yaml:"description,omitempty"`
+ Container string `yaml:"container,omitempty"`
+ Imports []*Import `yaml:"imports,omitempty"`
+ StdLib *LibrarySubset `yaml:"stdlib,omitempty"`
+ Extensions []*Extension `yaml:"extensions,omitempty"`
+ ContextVariable *ContextVariable `yaml:"context_variable,omitempty"`
+ Variables []*Variable `yaml:"variables,omitempty"`
+ Functions []*Function `yaml:"functions,omitempty"`
+ Validators []*Validator `yaml:"validators,omitempty"`
+ Features []*Feature `yaml:"features,omitempty"`
+}
+
+// Validate validates the whole configuration is well-formed.
+func (c *Config) Validate() error {
+ if c == nil {
+ return nil
+ }
+ var errs []error
+ for _, imp := range c.Imports {
+ if err := imp.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ if err := c.StdLib.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ for _, ext := range c.Extensions {
+ if err := ext.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ if err := c.ContextVariable.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ if c.ContextVariable != nil && len(c.Variables) != 0 {
+ errs = append(errs, errors.New("invalid config: either context variable or variables may be set, but not both"))
+ }
+ for _, v := range c.Variables {
+ if err := v.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ for _, fn := range c.Functions {
+ if err := fn.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ for _, feat := range c.Features {
+ if err := feat.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ for _, val := range c.Validators {
+ if err := val.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ return errors.Join(errs...)
+}
+
+// SetContainer configures the container name for this configuration.
+func (c *Config) SetContainer(container string) *Config {
+ c.Container = container
+ return c
+}
+
+// AddVariableDecls adds one or more variables to the config, converting them to serializable values first.
+//
+// VariableDecl inputs are expected to be well-formed.
+func (c *Config) AddVariableDecls(vars ...*decls.VariableDecl) *Config {
+ convVars := make([]*Variable, len(vars))
+ for i, v := range vars {
+ if v == nil {
+ continue
+ }
+ cv := NewVariable(v.Name(), SerializeTypeDesc(v.Type()))
+ cv.Description = v.Description()
+ convVars[i] = cv
+ }
+ return c.AddVariables(convVars...)
+}
+
+// AddVariables adds one or more vairables to the config.
+func (c *Config) AddVariables(vars ...*Variable) *Config {
+ c.Variables = append(c.Variables, vars...)
+ return c
+}
+
+// SetContextVariable configures the ContextVariable for this configuration.
+func (c *Config) SetContextVariable(ctx *ContextVariable) *Config {
+ c.ContextVariable = ctx
+ return c
+}
+
+// AddFunctionDecls adds one or more functions to the config, converting them to serializable values first.
+//
+// FunctionDecl inputs are expected to be well-formed.
+func (c *Config) AddFunctionDecls(funcs ...*decls.FunctionDecl) *Config {
+ convFuncs := make([]*Function, len(funcs))
+ for i, fn := range funcs {
+ if fn == nil {
+ continue
+ }
+ overloads := make([]*Overload, 0, len(fn.OverloadDecls()))
+ for _, o := range fn.OverloadDecls() {
+ overloadID := o.ID()
+ args := make([]*TypeDesc, 0, len(o.ArgTypes()))
+ for _, a := range o.ArgTypes() {
+ args = append(args, SerializeTypeDesc(a))
+ }
+ ret := SerializeTypeDesc(o.ResultType())
+ var overload *Overload
+ if o.IsMemberFunction() {
+ overload = NewMemberOverload(overloadID, args[0], args[1:], ret)
+ } else {
+ overload = NewOverload(overloadID, args, ret)
+ }
+ exampleCount := len(o.Examples())
+ if exampleCount > 0 {
+ overload.Examples = o.Examples()
+ }
+ overloads = append(overloads, overload)
+ }
+ cf := NewFunction(fn.Name(), overloads...)
+ cf.Description = fn.Description()
+ convFuncs[i] = cf
+ }
+ return c.AddFunctions(convFuncs...)
+}
+
+// AddFunctions adds one or more functions to the config.
+func (c *Config) AddFunctions(funcs ...*Function) *Config {
+ c.Functions = append(c.Functions, funcs...)
+ return c
+}
+
+// SetStdLib configures the LibrarySubset for the standard library.
+func (c *Config) SetStdLib(subset *LibrarySubset) *Config {
+ c.StdLib = subset
+ return c
+}
+
+// AddImports appends a set of imports to the config.
+func (c *Config) AddImports(imps ...*Import) *Config {
+ c.Imports = append(c.Imports, imps...)
+ return c
+}
+
+// AddExtensions appends a set of extensions to the config.
+func (c *Config) AddExtensions(exts ...*Extension) *Config {
+ c.Extensions = append(c.Extensions, exts...)
+ return c
+}
+
+// AddValidators appends one or more validators to the config.
+func (c *Config) AddValidators(vals ...*Validator) *Config {
+ c.Validators = append(c.Validators, vals...)
+ return c
+}
+
+// AddFeatures appends one or more features to the config.
+func (c *Config) AddFeatures(feats ...*Feature) *Config {
+ c.Features = append(c.Features, feats...)
+ return c
+}
+
+// NewImport returns a serializable import value from the qualified type name.
+func NewImport(name string) *Import {
+ return &Import{Name: name}
+}
+
+// Import represents a type name that will be appreviated by its simple name using
+// the cel.Abbrevs() option.
+type Import struct {
+ Name string `yaml:"name"`
+}
+
+// Validate validates the import configuration is well-formed.
+func (imp *Import) Validate() error {
+ if imp == nil {
+ return errors.New("invalid import: nil")
+ }
+ if imp.Name == "" {
+ return errors.New("invalid import: missing type name")
+ }
+ return nil
+}
+
+// NewVariable returns a serializable variable from a name and type definition
+func NewVariable(name string, t *TypeDesc) *Variable {
+ return NewVariableWithDoc(name, t, "")
+}
+
+// NewVariableWithDoc returns a serializable variable from a name, type definition, and doc string.
+func NewVariableWithDoc(name string, t *TypeDesc, doc string) *Variable {
+ return &Variable{Name: name, TypeDesc: t, Description: doc}
+}
+
+// Variable represents a typed variable declaration which will be published via the
+// cel.VariableDecls() option.
+type Variable struct {
+ Name string `yaml:"name"`
+ Description string `yaml:"description,omitempty"`
+
+ // Type represents the type declaration for the variable.
+ //
+ // Deprecated: use the embedded *TypeDesc fields directly.
+ Type *TypeDesc `yaml:"type,omitempty"`
+
+ // TypeDesc is an embedded set of fields allowing for the specification of the Variable type.
+ *TypeDesc `yaml:",inline"`
+}
+
+// Validate validates the variable configuration is well-formed.
+func (v *Variable) Validate() error {
+ if v == nil {
+ return errors.New("invalid variable: nil")
+ }
+ if v.Name == "" {
+ return errors.New("invalid variable: missing variable name")
+ }
+ if err := v.GetType().Validate(); err != nil {
+ return fmt.Errorf("invalid variable %q: %w", v.Name, err)
+ }
+ return nil
+}
+
+// GetType returns the variable type description.
+//
+// Note, if both the embedded TypeDesc and the field Type are non-nil, the embedded TypeDesc will
+// take precedence.
+func (v *Variable) GetType() *TypeDesc {
+ if v == nil {
+ return nil
+ }
+ if v.TypeDesc != nil {
+ return v.TypeDesc
+ }
+ if v.Type != nil {
+ return v.Type
+ }
+ return nil
+}
+
+// AsCELVariable converts the serializable form of the Variable into a CEL environment declaration.
+func (v *Variable) AsCELVariable(tp types.Provider) (*decls.VariableDecl, error) {
+ if err := v.Validate(); err != nil {
+ return nil, err
+ }
+ t, err := v.GetType().AsCELType(tp)
+ if err != nil {
+ return nil, fmt.Errorf("invalid variable %q: %w", v.Name, err)
+ }
+ return decls.NewVariableWithDoc(v.Name, t, v.Description), nil
+}
+
+// NewContextVariable returns a serializable context variable with a specific type name.
+func NewContextVariable(typeName string) *ContextVariable {
+ return &ContextVariable{TypeName: typeName}
+}
+
+// ContextVariable represents a structured message whose fields are to be treated as the top-level
+// variable identifiers within CEL expressions.
+type ContextVariable struct {
+ // TypeName represents the fully qualified typename of the context variable.
+ // Currently, only protobuf types are supported.
+ TypeName string `yaml:"type_name"`
+}
+
+// Validate validates the context-variable configuration is well-formed.
+func (ctx *ContextVariable) Validate() error {
+ if ctx == nil {
+ return nil
+ }
+ if ctx.TypeName == "" {
+ return errors.New("invalid context variable: missing type name")
+ }
+ return nil
+}
+
+// NewFunction creates a serializable function and overload set.
+func NewFunction(name string, overloads ...*Overload) *Function {
+ return &Function{Name: name, Overloads: overloads}
+}
+
+// NewFunctionWithDoc creates a serializable function and overload set.
+func NewFunctionWithDoc(name, doc string, overloads ...*Overload) *Function {
+ return &Function{Name: name, Description: doc, Overloads: overloads}
+}
+
+// Function represents the serializable format of a function and its overloads.
+type Function struct {
+ Name string `yaml:"name"`
+ Description string `yaml:"description,omitempty"`
+ Overloads []*Overload `yaml:"overloads,omitempty"`
+}
+
+// Validate validates the function configuration is well-formed.
+func (fn *Function) Validate() error {
+ if fn == nil {
+ return errors.New("invalid function: nil")
+ }
+ if fn.Name == "" {
+ return errors.New("invalid function: missing function name")
+ }
+ if len(fn.Overloads) == 0 {
+ return fmt.Errorf("invalid function %q: missing overloads", fn.Name)
+ }
+ var errs []error
+ for _, o := range fn.Overloads {
+ if err := o.Validate(); err != nil {
+ errs = append(errs, fmt.Errorf("invalid function %q: %w", fn.Name, err))
+ }
+ }
+ return errors.Join(errs...)
+}
+
+// AsCELFunction converts the serializable form of the Function into CEL environment declaration.
+func (fn *Function) AsCELFunction(tp types.Provider) (*decls.FunctionDecl, error) {
+ if err := fn.Validate(); err != nil {
+ return nil, err
+ }
+ opts := make([]decls.FunctionOpt, 0, len(fn.Overloads)+1)
+ for _, o := range fn.Overloads {
+ opt, err := o.AsFunctionOption(tp)
+ opts = append(opts, opt)
+ if err != nil {
+ return nil, fmt.Errorf("invalid function %q: %w", fn.Name, err)
+ }
+ }
+ if len(fn.Description) != 0 {
+ opts = append(opts, decls.FunctionDocs(fn.Description))
+ }
+ return decls.NewFunction(fn.Name, opts...)
+}
+
+// NewOverload returns a new serializable representation of a global overload.
+func NewOverload(id string, args []*TypeDesc, ret *TypeDesc, examples ...string) *Overload {
+ return &Overload{ID: id, Args: args, Return: ret, Examples: examples}
+}
+
+// NewMemberOverload returns a new serializable representation of a member (receiver) overload.
+func NewMemberOverload(id string, target *TypeDesc, args []*TypeDesc, ret *TypeDesc, examples ...string) *Overload {
+ return &Overload{ID: id, Target: target, Args: args, Return: ret, Examples: examples}
+}
+
+// Overload represents the serializable format of a function overload.
+type Overload struct {
+ ID string `yaml:"id"`
+ Examples []string `yaml:"examples,omitempty"`
+ Target *TypeDesc `yaml:"target,omitempty"`
+ Args []*TypeDesc `yaml:"args,omitempty"`
+ Return *TypeDesc `yaml:"return,omitempty"`
+}
+
+// Validate validates the overload configuration is well-formed.
+func (od *Overload) Validate() error {
+ if od == nil {
+ return errors.New("invalid overload: nil")
+ }
+ if od.ID == "" {
+ return errors.New("invalid overload: missing overload id")
+ }
+ var errs []error
+ if od.Target != nil {
+ if err := od.Target.Validate(); err != nil {
+ errs = append(errs, fmt.Errorf("invalid overload %q target: %w", od.ID, err))
+ }
+ }
+ for i, arg := range od.Args {
+ if err := arg.Validate(); err != nil {
+ errs = append(errs, fmt.Errorf("invalid overload %q arg[%d]: %w", od.ID, i, err))
+ }
+ }
+ if err := od.Return.Validate(); err != nil {
+ errs = append(errs, fmt.Errorf("invalid overload %q return: %w", od.ID, err))
+ }
+ return errors.Join(errs...)
+}
+
+// AsFunctionOption converts the serializable form of the Overload into a function declaration option.
+func (od *Overload) AsFunctionOption(tp types.Provider) (decls.FunctionOpt, error) {
+ if err := od.Validate(); err != nil {
+ return nil, err
+ }
+ args := make([]*types.Type, len(od.Args))
+ var err error
+ var errs []error
+ for i, a := range od.Args {
+ args[i], err = a.AsCELType(tp)
+ if err != nil {
+ errs = append(errs, err)
+ }
+ }
+ result, err := od.Return.AsCELType(tp)
+ if err != nil {
+ errs = append(errs, err)
+ }
+ if od.Target != nil {
+ t, err := od.Target.AsCELType(tp)
+ if err != nil {
+ return nil, errors.Join(append(errs, err)...)
+ }
+ args = append([]*types.Type{t}, args...)
+ return decls.MemberOverload(od.ID, args, result), nil
+ }
+ if len(errs) != 0 {
+ return nil, errors.Join(errs...)
+ }
+ return decls.Overload(od.ID, args, result, decls.OverloadExamples(od.Examples...)), nil
+}
+
+// NewExtension creates a serializable Extension from a name and version string.
+func NewExtension(name string, version uint32) *Extension {
+ versionString := "latest"
+ if version < math.MaxUint32 {
+ versionString = strconv.FormatUint(uint64(version), 10)
+ }
+ return &Extension{
+ Name: name,
+ Version: versionString,
+ }
+}
+
+// Extension represents a named and optionally versioned extension library configured in the environment.
+type Extension struct {
+ // Name is either the LibraryName() or some short-hand simple identifier which is understood by the config-handler.
+ Name string `yaml:"name"`
+
+ // Version may either be an unsigned long value or the string 'latest'. If empty, the value is treated as '0'.
+ Version string `yaml:"version,omitempty"`
+}
+
+// Validate validates the extension configuration is well-formed.
+func (e *Extension) Validate() error {
+ _, err := e.VersionNumber()
+ return err
+}
+
+// VersionNumber returns the parsed version string, or an error if the version cannot be parsed.
+func (e *Extension) VersionNumber() (uint32, error) {
+ if e == nil {
+ return 0, fmt.Errorf("invalid extension: nil")
+ }
+ if e.Name == "" {
+ return 0, fmt.Errorf("invalid extension: missing name")
+ }
+ if e.Version == "latest" {
+ return math.MaxUint32, nil
+ }
+ if e.Version == "" {
+ return 0, nil
+ }
+ ver, err := strconv.ParseUint(e.Version, 10, 32)
+ if err != nil {
+ return 0, fmt.Errorf("invalid extension %q version: %w", e.Name, err)
+ }
+ return uint32(ver), nil
+}
+
+// NewLibrarySubset returns an empty library subsetting config which permits all library features.
+func NewLibrarySubset() *LibrarySubset {
+ return &LibrarySubset{}
+}
+
+// LibrarySubset indicates a subset of the macros and function supported by a subsettable library.
+type LibrarySubset struct {
+ // Disabled indicates whether the library has been disabled, typically only used for
+ // default-enabled libraries like stdlib.
+ Disabled bool `yaml:"disabled,omitempty"`
+
+ // DisableMacros disables macros for the given library.
+ DisableMacros bool `yaml:"disable_macros,omitempty"`
+
+ // IncludeMacros specifies a set of macro function names to include in the subset.
+ IncludeMacros []string `yaml:"include_macros,omitempty"`
+
+ // ExcludeMacros specifies a set of macro function names to exclude from the subset.
+ // Note: if IncludeMacros is non-empty, then ExcludeFunctions is ignored.
+ ExcludeMacros []string `yaml:"exclude_macros,omitempty"`
+
+ // IncludeFunctions specifies a set of functions to include in the subset.
+ //
+ // Note: the overloads specified in the subset need only specify their ID.
+ // Note: if IncludeFunctions is non-empty, then ExcludeFunctions is ignored.
+ IncludeFunctions []*Function `yaml:"include_functions,omitempty"`
+
+ // ExcludeFunctions specifies the set of functions to exclude from the subset.
+ //
+ // Note: the overloads specified in the subset need only specify their ID.
+ ExcludeFunctions []*Function `yaml:"exclude_functions,omitempty"`
+}
+
+// Validate validates the library configuration is well-formed.
+//
+// For example, setting both the IncludeMacros and ExcludeMacros together could be confusing
+// and create a broken expectation, likewise for IncludeFunctions and ExcludeFunctions.
+func (lib *LibrarySubset) Validate() error {
+ if lib == nil {
+ return nil
+ }
+ var errs []error
+ if len(lib.IncludeMacros) != 0 && len(lib.ExcludeMacros) != 0 {
+ errs = append(errs, errors.New("invalid subset: cannot both include and exclude macros"))
+ }
+ if len(lib.IncludeFunctions) != 0 && len(lib.ExcludeFunctions) != 0 {
+ errs = append(errs, errors.New("invalid subset: cannot both include and exclude functions"))
+ }
+ return errors.Join(errs...)
+}
+
+// SubsetFunction produces a function declaration which matches the supported subset, or nil
+// if the function is not supported by the LibrarySubset.
+//
+// For IncludeFunctions, if the function does not specify a set of overloads to include, the
+// whole function definition is included. If overloads are set, then a new function which
+// includes only the specified overloads is produced.
+//
+// For ExcludeFunctions, if the function does not specify a set of overloads to exclude, the
+// whole function definition is excluded. If overloads are set, then a new function which
+// includes only the permitted overloads is produced.
+func (lib *LibrarySubset) SubsetFunction(fn *decls.FunctionDecl) (*decls.FunctionDecl, bool) {
+ // When lib is null, it should indicate that all values are included in the subset.
+ if lib == nil {
+ return fn, true
+ }
+ if lib.Disabled {
+ return nil, false
+ }
+ if len(lib.IncludeFunctions) != 0 {
+ for _, include := range lib.IncludeFunctions {
+ if include.Name != fn.Name() {
+ continue
+ }
+ if len(include.Overloads) == 0 {
+ return fn, true
+ }
+ overloadIDs := make([]string, len(include.Overloads))
+ for i, o := range include.Overloads {
+ overloadIDs[i] = o.ID
+ }
+ return fn.Subset(decls.IncludeOverloads(overloadIDs...)), true
+ }
+ return nil, false
+ }
+ if len(lib.ExcludeFunctions) != 0 {
+ for _, exclude := range lib.ExcludeFunctions {
+ if exclude.Name != fn.Name() {
+ continue
+ }
+ if len(exclude.Overloads) == 0 {
+ return nil, false
+ }
+ overloadIDs := make([]string, len(exclude.Overloads))
+ for i, o := range exclude.Overloads {
+ overloadIDs[i] = o.ID
+ }
+ return fn.Subset(decls.ExcludeOverloads(overloadIDs...)), true
+ }
+ return fn, true
+ }
+ return fn, true
+}
+
+// SubsetMacro indicates whether the macro function should be included in the library subset.
+func (lib *LibrarySubset) SubsetMacro(macroFunction string) bool {
+ // When lib is null, it should indicate that all values are included in the subset.
+ if lib == nil {
+ return true
+ }
+ if lib.Disabled || lib.DisableMacros {
+ return false
+ }
+ if len(lib.IncludeMacros) != 0 {
+ for _, name := range lib.IncludeMacros {
+ if name == macroFunction {
+ return true
+ }
+ }
+ return false
+ }
+ if len(lib.ExcludeMacros) != 0 {
+ for _, name := range lib.ExcludeMacros {
+ if name == macroFunction {
+ return false
+ }
+ }
+ return true
+ }
+ return true
+}
+
+// SetDisabled disables or enables the library.
+func (lib *LibrarySubset) SetDisabled(value bool) *LibrarySubset {
+ lib.Disabled = value
+ return lib
+}
+
+// SetDisableMacros disables the macros for the library.
+func (lib *LibrarySubset) SetDisableMacros(value bool) *LibrarySubset {
+ lib.DisableMacros = value
+ return lib
+}
+
+// AddIncludedMacros allow-lists one or more macros by function name.
+//
+// Note, this option will override any excluded macros.
+func (lib *LibrarySubset) AddIncludedMacros(macros ...string) *LibrarySubset {
+ lib.IncludeMacros = append(lib.IncludeMacros, macros...)
+ return lib
+}
+
+// AddExcludedMacros deny-lists one or more macros by function name.
+func (lib *LibrarySubset) AddExcludedMacros(macros ...string) *LibrarySubset {
+ lib.ExcludeMacros = append(lib.ExcludeMacros, macros...)
+ return lib
+}
+
+// AddIncludedFunctions allow-lists one or more functions from the subset.
+//
+// Note, this option will override any excluded functions.
+func (lib *LibrarySubset) AddIncludedFunctions(funcs ...*Function) *LibrarySubset {
+ lib.IncludeFunctions = append(lib.IncludeFunctions, funcs...)
+ return lib
+}
+
+// AddExcludedFunctions deny-lists one or more functions from the subset.
+func (lib *LibrarySubset) AddExcludedFunctions(funcs ...*Function) *LibrarySubset {
+ lib.ExcludeFunctions = append(lib.ExcludeFunctions, funcs...)
+ return lib
+}
+
+// NewValidator returns a named Validator instance.
+func NewValidator(name string) *Validator {
+ return &Validator{Name: name}
+}
+
+// Validator represents a named validator with an optional map-based configuration object.
+//
+// Note: the map-keys must directly correspond to the internal representation of the original
+// validator, and should only use primitive scalar types as values at this time.
+type Validator struct {
+ Name string `yaml:"name"`
+ Config map[string]any `yaml:"config,omitempty"`
+}
+
+// Validate validates the configuration of the validator object.
+func (v *Validator) Validate() error {
+ if v == nil {
+ return errors.New("invalid validator: nil")
+ }
+ if v.Name == "" {
+ return errors.New("invalid validator: missing name")
+ }
+ return nil
+}
+
+// SetConfig sets the set of map key-value pairs associated with this validator's configuration.
+func (v *Validator) SetConfig(config map[string]any) *Validator {
+ v.Config = config
+ return v
+}
+
+// ConfigValue retrieves the value associated with the config key name, if one exists.
+func (v *Validator) ConfigValue(name string) (any, bool) {
+ if v == nil {
+ return nil, false
+ }
+ value, found := v.Config[name]
+ return value, found
+}
+
+// NewFeature creates a new feature flag with a boolean enablement flag.
+func NewFeature(name string, enabled bool) *Feature {
+ return &Feature{Name: name, Enabled: enabled}
+}
+
+// Feature represents a named boolean feature flag supported by CEL.
+type Feature struct {
+ Name string `yaml:"name"`
+ Enabled bool `yaml:"enabled"`
+}
+
+// Validate validates whether the feature is well-configured.
+func (feat *Feature) Validate() error {
+ if feat == nil {
+ return errors.New("invalid feature: nil")
+ }
+ if feat.Name == "" {
+ return errors.New("invalid feature: missing name")
+ }
+ return nil
+}
+
+// NewTypeDesc describes a simple or complex type with parameters.
+func NewTypeDesc(typeName string, params ...*TypeDesc) *TypeDesc {
+ return &TypeDesc{TypeName: typeName, Params: params}
+}
+
+// NewTypeParam describe a type-param type.
+func NewTypeParam(paramName string) *TypeDesc {
+ return &TypeDesc{TypeName: paramName, IsTypeParam: true}
+}
+
+// TypeDesc represents the serializable format of a CEL *types.Type value.
+type TypeDesc struct {
+ TypeName string `yaml:"type_name"`
+ Params []*TypeDesc `yaml:"params,omitempty"`
+ IsTypeParam bool `yaml:"is_type_param,omitempty"`
+}
+
+// String implements the strings.Stringer interface method.
+func (td *TypeDesc) String() string {
+ ps := make([]string, len(td.Params))
+ for i, p := range td.Params {
+ ps[i] = p.String()
+ }
+ typeName := td.TypeName
+ if len(ps) != 0 {
+ typeName = fmt.Sprintf("%s(%s)", typeName, strings.Join(ps, ","))
+ }
+ return typeName
+}
+
+// Validate validates the type configuration is well-formed.
+func (td *TypeDesc) Validate() error {
+ if td == nil {
+ return errors.New("invalid type: nil")
+ }
+ if td.TypeName == "" {
+ return errors.New("invalid type: missing type name")
+ }
+ if td.IsTypeParam && len(td.Params) != 0 {
+ return errors.New("invalid type: param type cannot have parameters")
+ }
+ switch td.TypeName {
+ case "list":
+ if len(td.Params) != 1 {
+ return fmt.Errorf("invalid type: list expects 1 parameter, got %d", len(td.Params))
+ }
+ return td.Params[0].Validate()
+ case "map":
+ if len(td.Params) != 2 {
+ return fmt.Errorf("invalid type: map expects 2 parameters, got %d", len(td.Params))
+ }
+ if err := td.Params[0].Validate(); err != nil {
+ return err
+ }
+ if err := td.Params[1].Validate(); err != nil {
+ return err
+ }
+ case "optional_type":
+ if len(td.Params) != 1 {
+ return fmt.Errorf("invalid type: optional_type expects 1 parameter, got %d", len(td.Params))
+ }
+ return td.Params[0].Validate()
+ default:
+ }
+ return nil
+}
+
+// AsCELType converts the serializable object to a *types.Type value.
+func (td *TypeDesc) AsCELType(tp types.Provider) (*types.Type, error) {
+ err := td.Validate()
+ if err != nil {
+ return nil, err
+ }
+ switch td.TypeName {
+ case "dyn":
+ return types.DynType, nil
+ case "map":
+ kt, err := td.Params[0].AsCELType(tp)
+ if err != nil {
+ return nil, err
+ }
+ vt, err := td.Params[1].AsCELType(tp)
+ if err != nil {
+ return nil, err
+ }
+ return types.NewMapType(kt, vt), nil
+ case "list":
+ et, err := td.Params[0].AsCELType(tp)
+ if err != nil {
+ return nil, err
+ }
+ return types.NewListType(et), nil
+ case "optional_type":
+ et, err := td.Params[0].AsCELType(tp)
+ if err != nil {
+ return nil, err
+ }
+ return types.NewOptionalType(et), nil
+ default:
+ if td.IsTypeParam {
+ return types.NewTypeParamType(td.TypeName), nil
+ }
+ if msgType, found := tp.FindStructType(td.TypeName); found {
+ // First parameter is the type name.
+ return msgType.Parameters()[0], nil
+ }
+ t, found := tp.FindIdent(td.TypeName)
+ if !found {
+ return nil, fmt.Errorf("undefined type name: %q", td.TypeName)
+ }
+ _, ok := t.(*types.Type)
+ if ok && len(td.Params) == 0 {
+ return t.(*types.Type), nil
+ }
+ params := make([]*types.Type, len(td.Params))
+ for i, p := range td.Params {
+ params[i], err = p.AsCELType(tp)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return types.NewOpaqueType(td.TypeName, params...), nil
+ }
+}
+
+// SerializeTypeDesc converts a CEL native *types.Type to a serializable TypeDesc.
+func SerializeTypeDesc(t *types.Type) *TypeDesc {
+ typeName := t.TypeName()
+ if t.Kind() == types.TypeParamKind {
+ return NewTypeParam(typeName)
+ }
+ if t != types.NullType && t.IsAssignableType(types.NullType) {
+ if wrapperTypeName, found := wrapperTypes[t.Kind()]; found {
+ return NewTypeDesc(wrapperTypeName)
+ }
+ }
+ var params []*TypeDesc
+ for _, p := range t.Parameters() {
+ params = append(params, SerializeTypeDesc(p))
+ }
+ return NewTypeDesc(typeName, params...)
+}
+
+var wrapperTypes = map[types.Kind]string{
+ types.BoolKind: "google.protobuf.BoolValue",
+ types.BytesKind: "google.protobuf.BytesValue",
+ types.DoubleKind: "google.protobuf.DoubleValue",
+ types.IntKind: "google.protobuf.Int64Value",
+ types.StringKind: "google.protobuf.StringValue",
+ types.UintKind: "google.protobuf.UInt64Value",
+}
diff --git a/vendor/github.com/google/cel-go/common/errors.go b/vendor/github.com/google/cel-go/common/errors.go
index 895706833..c8865df8c 100644
--- a/vendor/github.com/google/cel-go/common/errors.go
+++ b/vendor/github.com/google/cel-go/common/errors.go
@@ -46,6 +46,11 @@ func (e *Errors) ReportError(l Location, format string, args ...any) {
e.ReportErrorAtID(0, l, format, args...)
}
+// ReportErrorString records an error at a source location.
+func (e *Errors) ReportErrorString(l Location, message string) {
+ e.ReportErrorAtID(0, l, "%s", message)
+}
+
// ReportErrorAtID records an error at a source location and expression id.
func (e *Errors) ReportErrorAtID(id int64, l Location, format string, args ...any) {
e.numErrors++
diff --git a/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel b/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel
index b55f45215..124dbea81 100644
--- a/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel
@@ -12,6 +12,7 @@ go_library(
],
importpath = "github.com/google/cel-go/common/stdlib",
deps = [
+ "//common:go_default_library",
"//common/decls:go_default_library",
"//common/functions:go_default_library",
"//common/operators:go_default_library",
diff --git a/vendor/github.com/google/cel-go/common/stdlib/standard.go b/vendor/github.com/google/cel-go/common/stdlib/standard.go
index 1550c1786..4040a4f5c 100644
--- a/vendor/github.com/google/cel-go/common/stdlib/standard.go
+++ b/vendor/github.com/google/cel-go/common/stdlib/standard.go
@@ -16,6 +16,11 @@
package stdlib
import (
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/google/cel-go/common"
"github.com/google/cel-go/common/decls"
"github.com/google/cel-go/common/functions"
"github.com/google/cel-go/common/operators"
@@ -28,6 +33,7 @@ import (
var (
stdFunctions []*decls.FunctionDecl
stdTypes []*decls.VariableDecl
+ utcTZ = types.String("UTC")
)
func init() {
@@ -55,19 +61,49 @@ func init() {
// Logical operators. Special-cased within the interpreter.
// Note, the singleton binding prevents extensions from overriding the operator behavior.
function(operators.Conditional,
+ decls.FunctionDocs(
+ `The ternary operator tests a boolean predicate and returns the left-hand side `+
+ `(truthy) expression if true, or the right-hand side (falsy) expression if false`),
decls.Overload(overloads.Conditional, argTypes(types.BoolType, paramA, paramA), paramA,
- decls.OverloadIsNonStrict()),
+ decls.OverloadIsNonStrict(),
+ decls.OverloadExamples(
+ `'hello'.contains('lo') ? 'hi' : 'bye' // 'hi'`,
+ `32 % 3 == 0 ? 'divisible' : 'not divisible' // 'not divisible'`)),
decls.SingletonFunctionBinding(noFunctionOverrides)),
+
function(operators.LogicalAnd,
+ decls.FunctionDocs(
+ `logically AND two boolean values. Errors and unknown values`,
+ `are valid inputs and will not halt evaluation.`),
decls.Overload(overloads.LogicalAnd, argTypes(types.BoolType, types.BoolType), types.BoolType,
- decls.OverloadIsNonStrict()),
+ decls.OverloadIsNonStrict(),
+ decls.OverloadExamples(
+ `true && true // true`,
+ `true && false // false`,
+ `error && true // error`,
+ `error && false // false`)),
decls.SingletonBinaryBinding(noBinaryOverrides)),
+
function(operators.LogicalOr,
+ decls.FunctionDocs(
+ `logically OR two boolean values. Errors and unknown values`,
+ `are valid inputs and will not halt evaluation.`),
decls.Overload(overloads.LogicalOr, argTypes(types.BoolType, types.BoolType), types.BoolType,
- decls.OverloadIsNonStrict()),
+ decls.OverloadIsNonStrict(),
+ decls.OverloadExamples(
+ `true || false // true`,
+ `false || false // false`,
+ `error || true // true`,
+ `error || error // true`)),
decls.SingletonBinaryBinding(noBinaryOverrides)),
+
function(operators.LogicalNot,
- decls.Overload(overloads.LogicalNot, argTypes(types.BoolType), types.BoolType),
+ decls.FunctionDocs(`logically negate a boolean value.`),
+ decls.Overload(overloads.LogicalNot, argTypes(types.BoolType), types.BoolType,
+ decls.OverloadExamples(
+ `!true // false`,
+ `!false // true`,
+ `!error // error`)),
decls.SingletonUnaryBinding(func(val ref.Val) ref.Val {
b, ok := val.(types.Bool)
if !ok {
@@ -90,66 +126,104 @@ func init() {
// Equality / inequality. Special-cased in the interpreter
function(operators.Equals,
- decls.Overload(overloads.Equals, argTypes(paramA, paramA), types.BoolType),
+ decls.FunctionDocs(`compare two values of the same type for equality`),
+ decls.Overload(overloads.Equals, argTypes(paramA, paramA), types.BoolType,
+ decls.OverloadExamples(
+ `1 == 1 // true`,
+ `'hello' == 'world' // false`,
+ `bytes('hello') == b'hello' // true`,
+ `duration('1h') == duration('60m') // true`,
+ `dyn(3.0) == 3 // true`)),
decls.SingletonBinaryBinding(noBinaryOverrides)),
function(operators.NotEquals,
- decls.Overload(overloads.NotEquals, argTypes(paramA, paramA), types.BoolType),
+ decls.FunctionDocs(`compare two values of the same type for inequality`),
+ decls.Overload(overloads.NotEquals, argTypes(paramA, paramA), types.BoolType,
+ decls.OverloadExamples(
+ `1 != 2 // true`,
+ `"a" != "a" // false`,
+ `3.0 != 3.1 // true`)),
decls.SingletonBinaryBinding(noBinaryOverrides)),
// Mathematical operators
function(operators.Add,
+ decls.FunctionDocs(
+ `adds two numeric values or concatenates two strings, bytes,`,
+ `or lists.`),
decls.Overload(overloads.AddBytes,
- argTypes(types.BytesType, types.BytesType), types.BytesType),
+ argTypes(types.BytesType, types.BytesType), types.BytesType,
+ decls.OverloadExamples(`b'hi' + bytes('ya') // b'hiya'`)),
decls.Overload(overloads.AddDouble,
- argTypes(types.DoubleType, types.DoubleType), types.DoubleType),
+ argTypes(types.DoubleType, types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`3.14 + 1.59 // 4.73`)),
decls.Overload(overloads.AddDurationDuration,
- argTypes(types.DurationType, types.DurationType), types.DurationType),
+ argTypes(types.DurationType, types.DurationType), types.DurationType,
+ decls.OverloadExamples(`duration('1m') + duration('1s') // duration('1m1s')`)),
decls.Overload(overloads.AddDurationTimestamp,
- argTypes(types.DurationType, types.TimestampType), types.TimestampType),
+ argTypes(types.DurationType, types.TimestampType), types.TimestampType,
+ decls.OverloadExamples(`duration('24h') + timestamp('2023-01-01T00:00:00Z') // timestamp('2023-01-02T00:00:00Z')`)),
decls.Overload(overloads.AddTimestampDuration,
- argTypes(types.TimestampType, types.DurationType), types.TimestampType),
+ argTypes(types.TimestampType, types.DurationType), types.TimestampType,
+ decls.OverloadExamples(`timestamp('2023-01-01T00:00:00Z') + duration('24h1m2s') // timestamp('2023-01-02T00:01:02Z')`)),
decls.Overload(overloads.AddInt64,
- argTypes(types.IntType, types.IntType), types.IntType),
+ argTypes(types.IntType, types.IntType), types.IntType,
+ decls.OverloadExamples(`1 + 2 // 3`)),
decls.Overload(overloads.AddList,
- argTypes(listOfA, listOfA), listOfA),
+ argTypes(listOfA, listOfA), listOfA,
+ decls.OverloadExamples(`[1] + [2, 3] // [1, 2, 3]`)),
decls.Overload(overloads.AddString,
- argTypes(types.StringType, types.StringType), types.StringType),
+ argTypes(types.StringType, types.StringType), types.StringType,
+ decls.OverloadExamples(`"Hello, " + "world!" // "Hello, world!"`)),
decls.Overload(overloads.AddUint64,
- argTypes(types.UintType, types.UintType), types.UintType),
+ argTypes(types.UintType, types.UintType), types.UintType,
+ decls.OverloadExamples(`22u + 33u // 55u`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Adder).Add(rhs)
}, traits.AdderType)),
function(operators.Divide,
+ decls.FunctionDocs(`divide two numbers`),
decls.Overload(overloads.DivideDouble,
- argTypes(types.DoubleType, types.DoubleType), types.DoubleType),
+ argTypes(types.DoubleType, types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`7.0 / 2.0 // 3.5`)),
decls.Overload(overloads.DivideInt64,
- argTypes(types.IntType, types.IntType), types.IntType),
+ argTypes(types.IntType, types.IntType), types.IntType,
+ decls.OverloadExamples(`10 / 2 // 5`)),
decls.Overload(overloads.DivideUint64,
- argTypes(types.UintType, types.UintType), types.UintType),
+ argTypes(types.UintType, types.UintType), types.UintType,
+ decls.OverloadExamples(`42u / 2u // 21u`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Divider).Divide(rhs)
}, traits.DividerType)),
function(operators.Modulo,
+ decls.FunctionDocs(`compute the modulus of one integer into another`),
decls.Overload(overloads.ModuloInt64,
- argTypes(types.IntType, types.IntType), types.IntType),
+ argTypes(types.IntType, types.IntType), types.IntType,
+ decls.OverloadExamples(`3 % 2 // 1`)),
decls.Overload(overloads.ModuloUint64,
- argTypes(types.UintType, types.UintType), types.UintType),
+ argTypes(types.UintType, types.UintType), types.UintType,
+ decls.OverloadExamples(`6u % 3u // 0u`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Modder).Modulo(rhs)
}, traits.ModderType)),
function(operators.Multiply,
+ decls.FunctionDocs(`multiply two numbers`),
decls.Overload(overloads.MultiplyDouble,
- argTypes(types.DoubleType, types.DoubleType), types.DoubleType),
+ argTypes(types.DoubleType, types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`3.5 * 40.0 // 140.0`)),
decls.Overload(overloads.MultiplyInt64,
- argTypes(types.IntType, types.IntType), types.IntType),
+ argTypes(types.IntType, types.IntType), types.IntType,
+ decls.OverloadExamples(`-2 * 6 // -12`)),
decls.Overload(overloads.MultiplyUint64,
- argTypes(types.UintType, types.UintType), types.UintType),
+ argTypes(types.UintType, types.UintType), types.UintType,
+ decls.OverloadExamples(`13u * 3u // 39u`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Multiplier).Multiply(rhs)
}, traits.MultiplierType)),
function(operators.Negate,
- decls.Overload(overloads.NegateDouble, argTypes(types.DoubleType), types.DoubleType),
- decls.Overload(overloads.NegateInt64, argTypes(types.IntType), types.IntType),
+ decls.FunctionDocs(`negate a numeric value`),
+ decls.Overload(overloads.NegateDouble, argTypes(types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`-(3.14) // -3.14`)),
+ decls.Overload(overloads.NegateInt64, argTypes(types.IntType), types.IntType,
+ decls.OverloadExamples(`-(5) // -5`)),
decls.SingletonUnaryBinding(func(val ref.Val) ref.Val {
if types.IsBool(val) {
return types.MaybeNoSuchOverloadErr(val)
@@ -157,18 +231,32 @@ func init() {
return val.(traits.Negater).Negate()
}, traits.NegatorType)),
function(operators.Subtract,
+ decls.FunctionDocs(`subtract two numbers, or two time-related values`),
decls.Overload(overloads.SubtractDouble,
- argTypes(types.DoubleType, types.DoubleType), types.DoubleType),
+ argTypes(types.DoubleType, types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`10.5 - 2.0 // 8.5`)),
decls.Overload(overloads.SubtractDurationDuration,
- argTypes(types.DurationType, types.DurationType), types.DurationType),
+ argTypes(types.DurationType, types.DurationType), types.DurationType,
+ decls.OverloadExamples(`duration('1m') - duration('1s') // duration('59s')`)),
decls.Overload(overloads.SubtractInt64,
- argTypes(types.IntType, types.IntType), types.IntType),
+ argTypes(types.IntType, types.IntType), types.IntType,
+ decls.OverloadExamples(`5 - 3 // 2`)),
decls.Overload(overloads.SubtractTimestampDuration,
- argTypes(types.TimestampType, types.DurationType), types.TimestampType),
+ argTypes(types.TimestampType, types.DurationType), types.TimestampType,
+ decls.OverloadExamples(common.MultilineDescription(
+ `timestamp('2023-01-10T12:00:00Z')`,
+ ` - duration('12h') // timestamp('2023-01-10T00:00:00Z')`))),
decls.Overload(overloads.SubtractTimestampTimestamp,
- argTypes(types.TimestampType, types.TimestampType), types.DurationType),
+ argTypes(types.TimestampType, types.TimestampType), types.DurationType,
+ decls.OverloadExamples(common.MultilineDescription(
+ `timestamp('2023-01-10T12:00:00Z')`,
+ ` - timestamp('2023-01-10T00:00:00Z') // duration('12h')`))),
decls.Overload(overloads.SubtractUint64,
- argTypes(types.UintType, types.UintType), types.UintType),
+ argTypes(types.UintType, types.UintType), types.UintType,
+ decls.OverloadExamples(common.MultilineDescription(
+ `// the subtraction result must be positive, otherwise an overflow`,
+ `// error is generated.`,
+ `42u - 3u // 39u`))),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Subtractor).Subtract(rhs)
}, traits.SubtractorType)),
@@ -176,34 +264,51 @@ func init() {
// Relations operators
function(operators.Less,
+ decls.FunctionDocs(
+ `compare two values and return true if the first value is`,
+ `less than the second`),
decls.Overload(overloads.LessBool,
- argTypes(types.BoolType, types.BoolType), types.BoolType),
+ argTypes(types.BoolType, types.BoolType), types.BoolType,
+ decls.OverloadExamples(`false < true // true`)),
decls.Overload(overloads.LessInt64,
- argTypes(types.IntType, types.IntType), types.BoolType),
+ argTypes(types.IntType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`-2 < 3 // true`, `1 < 0 // false`)),
decls.Overload(overloads.LessInt64Double,
- argTypes(types.IntType, types.DoubleType), types.BoolType),
+ argTypes(types.IntType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`1 < 1.1 // true`)),
decls.Overload(overloads.LessInt64Uint64,
- argTypes(types.IntType, types.UintType), types.BoolType),
+ argTypes(types.IntType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`1 < 2u // true`)),
decls.Overload(overloads.LessUint64,
- argTypes(types.UintType, types.UintType), types.BoolType),
+ argTypes(types.UintType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`1u < 2u // true`)),
decls.Overload(overloads.LessUint64Double,
- argTypes(types.UintType, types.DoubleType), types.BoolType),
+ argTypes(types.UintType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`1u < 0.9 // false`)),
decls.Overload(overloads.LessUint64Int64,
- argTypes(types.UintType, types.IntType), types.BoolType),
+ argTypes(types.UintType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`1u < 23 // true`, `1u < -1 // false`)),
decls.Overload(overloads.LessDouble,
- argTypes(types.DoubleType, types.DoubleType), types.BoolType),
+ argTypes(types.DoubleType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2.0 < 2.4 // true`)),
decls.Overload(overloads.LessDoubleInt64,
- argTypes(types.DoubleType, types.IntType), types.BoolType),
+ argTypes(types.DoubleType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`2.1 < 3 // true`)),
decls.Overload(overloads.LessDoubleUint64,
- argTypes(types.DoubleType, types.UintType), types.BoolType),
+ argTypes(types.DoubleType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2.3 < 2u // false`, `-1.0 < 1u // true`)),
decls.Overload(overloads.LessString,
- argTypes(types.StringType, types.StringType), types.BoolType),
+ argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(`'a' < 'b' // true`, `'cat' < 'cab' // false`)),
decls.Overload(overloads.LessBytes,
- argTypes(types.BytesType, types.BytesType), types.BoolType),
+ argTypes(types.BytesType, types.BytesType), types.BoolType,
+ decls.OverloadExamples(`b'hello' < b'world' // true`)),
decls.Overload(overloads.LessTimestamp,
- argTypes(types.TimestampType, types.TimestampType), types.BoolType),
+ argTypes(types.TimestampType, types.TimestampType), types.BoolType,
+ decls.OverloadExamples(`timestamp('2001-01-01T02:03:04Z') < timestamp('2002-02-02T02:03:04Z') // true`)),
decls.Overload(overloads.LessDuration,
- argTypes(types.DurationType, types.DurationType), types.BoolType),
+ argTypes(types.DurationType, types.DurationType), types.BoolType,
+ decls.OverloadExamples(`duration('1ms') < duration('1s') // true`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
cmp := lhs.(traits.Comparer).Compare(rhs)
if cmp == types.IntNegOne {
@@ -216,34 +321,51 @@ func init() {
}, traits.ComparerType)),
function(operators.LessEquals,
+ decls.FunctionDocs(
+ `compare two values and return true if the first value is`,
+ `less than or equal to the second`),
decls.Overload(overloads.LessEqualsBool,
- argTypes(types.BoolType, types.BoolType), types.BoolType),
+ argTypes(types.BoolType, types.BoolType), types.BoolType,
+ decls.OverloadExamples(`false <= true // true`)),
decls.Overload(overloads.LessEqualsInt64,
- argTypes(types.IntType, types.IntType), types.BoolType),
+ argTypes(types.IntType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`-2 <= 3 // true`)),
decls.Overload(overloads.LessEqualsInt64Double,
- argTypes(types.IntType, types.DoubleType), types.BoolType),
+ argTypes(types.IntType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`1 <= 1.1 // true`)),
decls.Overload(overloads.LessEqualsInt64Uint64,
- argTypes(types.IntType, types.UintType), types.BoolType),
+ argTypes(types.IntType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`1 <= 2u // true`, `-1 <= 0u // true`)),
decls.Overload(overloads.LessEqualsUint64,
- argTypes(types.UintType, types.UintType), types.BoolType),
+ argTypes(types.UintType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`1u <= 2u // true`)),
decls.Overload(overloads.LessEqualsUint64Double,
- argTypes(types.UintType, types.DoubleType), types.BoolType),
+ argTypes(types.UintType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`1u <= 1.0 // true`, `1u <= 1.1 // true`)),
decls.Overload(overloads.LessEqualsUint64Int64,
- argTypes(types.UintType, types.IntType), types.BoolType),
+ argTypes(types.UintType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`1u <= 23 // true`)),
decls.Overload(overloads.LessEqualsDouble,
- argTypes(types.DoubleType, types.DoubleType), types.BoolType),
+ argTypes(types.DoubleType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2.0 <= 2.4 // true`)),
decls.Overload(overloads.LessEqualsDoubleInt64,
- argTypes(types.DoubleType, types.IntType), types.BoolType),
+ argTypes(types.DoubleType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`2.1 <= 3 // true`)),
decls.Overload(overloads.LessEqualsDoubleUint64,
- argTypes(types.DoubleType, types.UintType), types.BoolType),
+ argTypes(types.DoubleType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2.0 <= 2u // true`, `-1.0 <= 1u // true`)),
decls.Overload(overloads.LessEqualsString,
- argTypes(types.StringType, types.StringType), types.BoolType),
+ argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(`'a' <= 'b' // true`, `'a' <= 'a' // true`, `'cat' <= 'cab' // false`)),
decls.Overload(overloads.LessEqualsBytes,
- argTypes(types.BytesType, types.BytesType), types.BoolType),
+ argTypes(types.BytesType, types.BytesType), types.BoolType,
+ decls.OverloadExamples(`b'hello' <= b'world' // true`)),
decls.Overload(overloads.LessEqualsTimestamp,
- argTypes(types.TimestampType, types.TimestampType), types.BoolType),
+ argTypes(types.TimestampType, types.TimestampType), types.BoolType,
+ decls.OverloadExamples(`timestamp('2001-01-01T02:03:04Z') <= timestamp('2002-02-02T02:03:04Z') // true`)),
decls.Overload(overloads.LessEqualsDuration,
- argTypes(types.DurationType, types.DurationType), types.BoolType),
+ argTypes(types.DurationType, types.DurationType), types.BoolType,
+ decls.OverloadExamples(`duration('1ms') <= duration('1s') // true`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
cmp := lhs.(traits.Comparer).Compare(rhs)
if cmp == types.IntNegOne || cmp == types.IntZero {
@@ -256,34 +378,51 @@ func init() {
}, traits.ComparerType)),
function(operators.Greater,
+ decls.FunctionDocs(
+ `compare two values and return true if the first value is`,
+ `greater than the second`),
decls.Overload(overloads.GreaterBool,
- argTypes(types.BoolType, types.BoolType), types.BoolType),
+ argTypes(types.BoolType, types.BoolType), types.BoolType,
+ decls.OverloadExamples(`true > false // true`)),
decls.Overload(overloads.GreaterInt64,
- argTypes(types.IntType, types.IntType), types.BoolType),
+ argTypes(types.IntType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`3 > -2 // true`)),
decls.Overload(overloads.GreaterInt64Double,
- argTypes(types.IntType, types.DoubleType), types.BoolType),
+ argTypes(types.IntType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2 > 1.1 // true`)),
decls.Overload(overloads.GreaterInt64Uint64,
- argTypes(types.IntType, types.UintType), types.BoolType),
+ argTypes(types.IntType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`3 > 2u // true`)),
decls.Overload(overloads.GreaterUint64,
- argTypes(types.UintType, types.UintType), types.BoolType),
+ argTypes(types.UintType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2u > 1u // true`)),
decls.Overload(overloads.GreaterUint64Double,
- argTypes(types.UintType, types.DoubleType), types.BoolType),
+ argTypes(types.UintType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2u > 1.9 // true`)),
decls.Overload(overloads.GreaterUint64Int64,
- argTypes(types.UintType, types.IntType), types.BoolType),
+ argTypes(types.UintType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`23u > 1 // true`, `0u > -1 // true`)),
decls.Overload(overloads.GreaterDouble,
- argTypes(types.DoubleType, types.DoubleType), types.BoolType),
+ argTypes(types.DoubleType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2.4 > 2.0 // true`)),
decls.Overload(overloads.GreaterDoubleInt64,
- argTypes(types.DoubleType, types.IntType), types.BoolType),
+ argTypes(types.DoubleType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`3.1 > 3 // true`, `3.0 > 3 // false`)),
decls.Overload(overloads.GreaterDoubleUint64,
- argTypes(types.DoubleType, types.UintType), types.BoolType),
+ argTypes(types.DoubleType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2.3 > 2u // true`)),
decls.Overload(overloads.GreaterString,
- argTypes(types.StringType, types.StringType), types.BoolType),
+ argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(`'b' > 'a' // true`)),
decls.Overload(overloads.GreaterBytes,
- argTypes(types.BytesType, types.BytesType), types.BoolType),
+ argTypes(types.BytesType, types.BytesType), types.BoolType,
+ decls.OverloadExamples(`b'world' > b'hello' // true`)),
decls.Overload(overloads.GreaterTimestamp,
- argTypes(types.TimestampType, types.TimestampType), types.BoolType),
+ argTypes(types.TimestampType, types.TimestampType), types.BoolType,
+ decls.OverloadExamples(`timestamp('2002-02-02T02:03:04Z') > timestamp('2001-01-01T02:03:04Z') // true`)),
decls.Overload(overloads.GreaterDuration,
- argTypes(types.DurationType, types.DurationType), types.BoolType),
+ argTypes(types.DurationType, types.DurationType), types.BoolType,
+ decls.OverloadExamples(`duration('1ms') > duration('1us') // true`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
cmp := lhs.(traits.Comparer).Compare(rhs)
if cmp == types.IntOne {
@@ -296,34 +435,51 @@ func init() {
}, traits.ComparerType)),
function(operators.GreaterEquals,
+ decls.FunctionDocs(
+ `compare two values and return true if the first value is`,
+ `greater than or equal to the second`),
decls.Overload(overloads.GreaterEqualsBool,
- argTypes(types.BoolType, types.BoolType), types.BoolType),
+ argTypes(types.BoolType, types.BoolType), types.BoolType,
+ decls.OverloadExamples(`true >= false // true`)),
decls.Overload(overloads.GreaterEqualsInt64,
- argTypes(types.IntType, types.IntType), types.BoolType),
+ argTypes(types.IntType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`3 >= -2 // true`)),
decls.Overload(overloads.GreaterEqualsInt64Double,
- argTypes(types.IntType, types.DoubleType), types.BoolType),
+ argTypes(types.IntType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2 >= 1.1 // true`, `1 >= 1.0 // true`)),
decls.Overload(overloads.GreaterEqualsInt64Uint64,
- argTypes(types.IntType, types.UintType), types.BoolType),
+ argTypes(types.IntType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`3 >= 2u // true`)),
decls.Overload(overloads.GreaterEqualsUint64,
- argTypes(types.UintType, types.UintType), types.BoolType),
+ argTypes(types.UintType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2u >= 1u // true`)),
decls.Overload(overloads.GreaterEqualsUint64Double,
- argTypes(types.UintType, types.DoubleType), types.BoolType),
+ argTypes(types.UintType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2u >= 1.9 // true`)),
decls.Overload(overloads.GreaterEqualsUint64Int64,
- argTypes(types.UintType, types.IntType), types.BoolType),
+ argTypes(types.UintType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`23u >= 1 // true`, `1u >= 1 // true`)),
decls.Overload(overloads.GreaterEqualsDouble,
- argTypes(types.DoubleType, types.DoubleType), types.BoolType),
+ argTypes(types.DoubleType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2.4 >= 2.0 // true`)),
decls.Overload(overloads.GreaterEqualsDoubleInt64,
- argTypes(types.DoubleType, types.IntType), types.BoolType),
+ argTypes(types.DoubleType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`3.1 >= 3 // true`)),
decls.Overload(overloads.GreaterEqualsDoubleUint64,
- argTypes(types.DoubleType, types.UintType), types.BoolType),
+ argTypes(types.DoubleType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2.3 >= 2u // true`)),
decls.Overload(overloads.GreaterEqualsString,
- argTypes(types.StringType, types.StringType), types.BoolType),
+ argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(`'b' >= 'a' // true`)),
decls.Overload(overloads.GreaterEqualsBytes,
- argTypes(types.BytesType, types.BytesType), types.BoolType),
+ argTypes(types.BytesType, types.BytesType), types.BoolType,
+ decls.OverloadExamples(`b'world' >= b'hello' // true`)),
decls.Overload(overloads.GreaterEqualsTimestamp,
- argTypes(types.TimestampType, types.TimestampType), types.BoolType),
+ argTypes(types.TimestampType, types.TimestampType), types.BoolType,
+ decls.OverloadExamples(`timestamp('2001-01-01T02:03:04Z') >= timestamp('2001-01-01T02:03:04Z') // true`)),
decls.Overload(overloads.GreaterEqualsDuration,
- argTypes(types.DurationType, types.DurationType), types.BoolType),
+ argTypes(types.DurationType, types.DurationType), types.BoolType,
+ decls.OverloadExamples(`duration('60s') >= duration('1m') // true`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
cmp := lhs.(traits.Comparer).Compare(rhs)
if cmp == types.IntOne || cmp == types.IntZero {
@@ -337,16 +493,28 @@ func init() {
// Indexing
function(operators.Index,
- decls.Overload(overloads.IndexList, argTypes(listOfA, types.IntType), paramA),
- decls.Overload(overloads.IndexMap, argTypes(mapOfAB, paramA), paramB),
+ decls.FunctionDocs(`select a value from a list by index, or value from a map by key`),
+ decls.Overload(overloads.IndexList, argTypes(listOfA, types.IntType), paramA,
+ decls.OverloadExamples(`[1, 2, 3][1] // 2`)),
+ decls.Overload(overloads.IndexMap, argTypes(mapOfAB, paramA), paramB,
+ decls.OverloadExamples(
+ `{'key': 'value'}['key'] // 'value'`,
+ `{'key': 'value'}['missing'] // error`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Indexer).Get(rhs)
}, traits.IndexerType)),
// Collections operators
function(operators.In,
- decls.Overload(overloads.InList, argTypes(paramA, listOfA), types.BoolType),
- decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType),
+ decls.FunctionDocs(`test whether a value exists in a list, or a key exists in a map`),
+ decls.Overload(overloads.InList, argTypes(paramA, listOfA), types.BoolType,
+ decls.OverloadExamples(
+ `2 in [1, 2, 3] // true`,
+ `"a" in ["b", "c"] // false`)),
+ decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType,
+ decls.OverloadExamples(
+ `'key1' in {'key1': 'value1', 'key2': 'value2'} // true`,
+ `3 in {1: "one", 2: "two"} // false`)),
decls.SingletonBinaryBinding(inAggregate)),
function(operators.OldIn,
decls.DisableDeclaration(true), // safe deprecation
@@ -359,209 +527,364 @@ func init() {
decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType),
decls.SingletonBinaryBinding(inAggregate)),
function(overloads.Size,
- decls.Overload(overloads.SizeBytes, argTypes(types.BytesType), types.IntType),
- decls.MemberOverload(overloads.SizeBytesInst, argTypes(types.BytesType), types.IntType),
- decls.Overload(overloads.SizeList, argTypes(listOfA), types.IntType),
- decls.MemberOverload(overloads.SizeListInst, argTypes(listOfA), types.IntType),
- decls.Overload(overloads.SizeMap, argTypes(mapOfAB), types.IntType),
- decls.MemberOverload(overloads.SizeMapInst, argTypes(mapOfAB), types.IntType),
- decls.Overload(overloads.SizeString, argTypes(types.StringType), types.IntType),
- decls.MemberOverload(overloads.SizeStringInst, argTypes(types.StringType), types.IntType),
+ decls.FunctionDocs(
+ `compute the size of a list or map, the number of characters in a string,`,
+ `or the number of bytes in a sequence`),
+ decls.Overload(overloads.SizeBytes, argTypes(types.BytesType), types.IntType,
+ decls.OverloadExamples(`size(b'123') // 3`)),
+ decls.MemberOverload(overloads.SizeBytesInst, argTypes(types.BytesType), types.IntType,
+ decls.OverloadExamples(`b'123'.size() // 3`)),
+ decls.Overload(overloads.SizeList, argTypes(listOfA), types.IntType,
+ decls.OverloadExamples(`size([1, 2, 3]) // 3`)),
+ decls.MemberOverload(overloads.SizeListInst, argTypes(listOfA), types.IntType,
+ decls.OverloadExamples(`[1, 2, 3].size() // 3`)),
+ decls.Overload(overloads.SizeMap, argTypes(mapOfAB), types.IntType,
+ decls.OverloadExamples(`size({'a': 1, 'b': 2}) // 2`)),
+ decls.MemberOverload(overloads.SizeMapInst, argTypes(mapOfAB), types.IntType,
+ decls.OverloadExamples(`{'a': 1, 'b': 2}.size() // 2`)),
+ decls.Overload(overloads.SizeString, argTypes(types.StringType), types.IntType,
+ decls.OverloadExamples(`size('hello') // 5`)),
+ decls.MemberOverload(overloads.SizeStringInst, argTypes(types.StringType), types.IntType,
+ decls.OverloadExamples(`'hello'.size() // 5`)),
decls.SingletonUnaryBinding(func(val ref.Val) ref.Val {
return val.(traits.Sizer).Size()
}, traits.SizerType)),
// Type conversions
function(overloads.TypeConvertType,
- decls.Overload(overloads.TypeConvertType, argTypes(paramA), types.NewTypeTypeWithParam(paramA)),
+ decls.FunctionDocs(`convert a value to its type identifier`),
+ decls.Overload(overloads.TypeConvertType, argTypes(paramA), types.NewTypeTypeWithParam(paramA),
+ decls.OverloadExamples(
+ `type(1) // int`,
+ `type('hello') // string`,
+ `type(int) // type`,
+ `type(type) // type`)),
decls.SingletonUnaryBinding(convertToType(types.TypeType))),
// Bool conversions
function(overloads.TypeConvertBool,
+ decls.FunctionDocs(`convert a value to a boolean`),
decls.Overload(overloads.BoolToBool, argTypes(types.BoolType), types.BoolType,
+
+ decls.OverloadExamples(`bool(true) // true`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.StringToBool, argTypes(types.StringType), types.BoolType,
+
+ decls.OverloadExamples(`bool('true') // true`, `bool('false') // false`),
decls.UnaryBinding(convertToType(types.BoolType)))),
// Bytes conversions
function(overloads.TypeConvertBytes,
+ decls.FunctionDocs(`convert a value to bytes`),
decls.Overload(overloads.BytesToBytes, argTypes(types.BytesType), types.BytesType,
+ decls.OverloadExamples(`bytes(b'abc') // b'abc'`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.StringToBytes, argTypes(types.StringType), types.BytesType,
+ decls.OverloadExamples(`bytes('hello') // b'hello'`),
decls.UnaryBinding(convertToType(types.BytesType)))),
// Double conversions
function(overloads.TypeConvertDouble,
+ decls.FunctionDocs(`convert a value to a double`),
decls.Overload(overloads.DoubleToDouble, argTypes(types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`double(1.23) // 1.23`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.IntToDouble, argTypes(types.IntType), types.DoubleType,
+ decls.OverloadExamples(`double(123) // 123.0`),
decls.UnaryBinding(convertToType(types.DoubleType))),
decls.Overload(overloads.StringToDouble, argTypes(types.StringType), types.DoubleType,
+ decls.OverloadExamples(`double('1.23') // 1.23`),
decls.UnaryBinding(convertToType(types.DoubleType))),
decls.Overload(overloads.UintToDouble, argTypes(types.UintType), types.DoubleType,
+ decls.OverloadExamples(`double(123u) // 123.0`),
decls.UnaryBinding(convertToType(types.DoubleType)))),
// Duration conversions
function(overloads.TypeConvertDuration,
+ decls.FunctionDocs(`convert a value to a google.protobuf.Duration`),
decls.Overload(overloads.DurationToDuration, argTypes(types.DurationType), types.DurationType,
+ decls.OverloadExamples(`duration(duration('1s')) // duration('1s')`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.IntToDuration, argTypes(types.IntType), types.DurationType,
decls.UnaryBinding(convertToType(types.DurationType))),
decls.Overload(overloads.StringToDuration, argTypes(types.StringType), types.DurationType,
+ decls.OverloadExamples(`duration('1h2m3s') // duration('3723s')`),
decls.UnaryBinding(convertToType(types.DurationType)))),
// Dyn conversions
function(overloads.TypeConvertDyn,
- decls.Overload(overloads.ToDyn, argTypes(paramA), types.DynType),
+ decls.FunctionDocs(`indicate that the type is dynamic for type-checking purposes`),
+ decls.Overload(overloads.ToDyn, argTypes(paramA), types.DynType,
+ decls.OverloadExamples(`dyn(1) // 1`)),
decls.SingletonUnaryBinding(identity)),
// Int conversions
function(overloads.TypeConvertInt,
+ decls.FunctionDocs(`convert a value to an int`),
decls.Overload(overloads.IntToInt, argTypes(types.IntType), types.IntType,
+ decls.OverloadExamples(`int(123) // 123`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.DoubleToInt, argTypes(types.DoubleType), types.IntType,
+ decls.OverloadExamples(`int(123.45) // 123`),
decls.UnaryBinding(convertToType(types.IntType))),
decls.Overload(overloads.DurationToInt, argTypes(types.DurationType), types.IntType,
- decls.UnaryBinding(convertToType(types.IntType))),
+ decls.OverloadExamples(`int(duration('1s')) // 1000000000`),
+ decls.UnaryBinding(convertToType(types.IntType))), // Duration to nanoseconds
decls.Overload(overloads.StringToInt, argTypes(types.StringType), types.IntType,
+ decls.OverloadExamples(`int('123') // 123`, `int('-456') // -456`),
decls.UnaryBinding(convertToType(types.IntType))),
decls.Overload(overloads.TimestampToInt, argTypes(types.TimestampType), types.IntType,
- decls.UnaryBinding(convertToType(types.IntType))),
+ decls.OverloadExamples(`int(timestamp('1970-01-01T00:00:01Z')) // 1`),
+ decls.UnaryBinding(convertToType(types.IntType))), // Timestamp to epoch seconds
decls.Overload(overloads.UintToInt, argTypes(types.UintType), types.IntType,
- decls.UnaryBinding(convertToType(types.IntType))),
- ),
+ decls.OverloadExamples(`int(123u) // 123`),
+ decls.UnaryBinding(convertToType(types.IntType)))),
// String conversions
function(overloads.TypeConvertString,
+ decls.FunctionDocs(`convert a value to a string`),
decls.Overload(overloads.StringToString, argTypes(types.StringType), types.StringType,
+ decls.OverloadExamples(`string('hello') // 'hello'`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.BoolToString, argTypes(types.BoolType), types.StringType,
+ decls.OverloadExamples(`string(true) // 'true'`),
decls.UnaryBinding(convertToType(types.StringType))),
decls.Overload(overloads.BytesToString, argTypes(types.BytesType), types.StringType,
+ decls.OverloadExamples(`string(b'hello') // 'hello'`),
decls.UnaryBinding(convertToType(types.StringType))),
decls.Overload(overloads.DoubleToString, argTypes(types.DoubleType), types.StringType,
- decls.UnaryBinding(convertToType(types.StringType))),
+ decls.UnaryBinding(convertToType(types.StringType)),
+ decls.OverloadExamples(`string(-1.23e4) // '-12300'`)),
decls.Overload(overloads.DurationToString, argTypes(types.DurationType), types.StringType,
+ decls.OverloadExamples(`string(duration('1h30m')) // '5400s'`),
decls.UnaryBinding(convertToType(types.StringType))),
decls.Overload(overloads.IntToString, argTypes(types.IntType), types.StringType,
+ decls.OverloadExamples(`string(-123) // '-123'`),
decls.UnaryBinding(convertToType(types.StringType))),
decls.Overload(overloads.TimestampToString, argTypes(types.TimestampType), types.StringType,
+ decls.OverloadExamples(`string(timestamp('1970-01-01T00:00:00Z')) // '1970-01-01T00:00:00Z'`),
decls.UnaryBinding(convertToType(types.StringType))),
decls.Overload(overloads.UintToString, argTypes(types.UintType), types.StringType,
+ decls.OverloadExamples(`string(123u) // '123'`),
decls.UnaryBinding(convertToType(types.StringType)))),
// Timestamp conversions
function(overloads.TypeConvertTimestamp,
+ decls.FunctionDocs(`convert a value to a google.protobuf.Timestamp`),
decls.Overload(overloads.TimestampToTimestamp, argTypes(types.TimestampType), types.TimestampType,
+ decls.OverloadExamples(`timestamp(timestamp('2023-01-01T00:00:00Z')) // timestamp('2023-01-01T00:00:00Z')`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.IntToTimestamp, argTypes(types.IntType), types.TimestampType,
+ decls.OverloadExamples(`timestamp(1) // timestamp('1970-01-01T00:00:01Z')`), // Epoch seconds to Timestamp
decls.UnaryBinding(convertToType(types.TimestampType))),
decls.Overload(overloads.StringToTimestamp, argTypes(types.StringType), types.TimestampType,
+ decls.OverloadExamples(`timestamp('2025-01-01T12:34:56Z') // timestamp('2025-01-01T12:34:56Z')`),
decls.UnaryBinding(convertToType(types.TimestampType)))),
// Uint conversions
function(overloads.TypeConvertUint,
+ decls.FunctionDocs(`convert a value to a uint`),
decls.Overload(overloads.UintToUint, argTypes(types.UintType), types.UintType,
+ decls.OverloadExamples(`uint(123u) // 123u`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.DoubleToUint, argTypes(types.DoubleType), types.UintType,
+ decls.OverloadExamples(`uint(123.45) // 123u`),
decls.UnaryBinding(convertToType(types.UintType))),
decls.Overload(overloads.IntToUint, argTypes(types.IntType), types.UintType,
+ decls.OverloadExamples(`uint(123) // 123u`),
decls.UnaryBinding(convertToType(types.UintType))),
decls.Overload(overloads.StringToUint, argTypes(types.StringType), types.UintType,
+ decls.OverloadExamples(`uint('123') // 123u`),
decls.UnaryBinding(convertToType(types.UintType)))),
// String functions
function(overloads.Contains,
+ decls.FunctionDocs(`test whether a string contains a substring`),
decls.MemberOverload(overloads.ContainsString,
argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(
+ `'hello world'.contains('o w') // true`,
+ `'hello world'.contains('goodbye') // false`),
decls.BinaryBinding(types.StringContains)),
decls.DisableTypeGuards(true)),
function(overloads.EndsWith,
+ decls.FunctionDocs(`test whether a string ends with a substring suffix`),
decls.MemberOverload(overloads.EndsWithString,
argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(
+ `'hello world'.endsWith('world') // true`,
+ `'hello world'.endsWith('hello') // false`),
decls.BinaryBinding(types.StringEndsWith)),
decls.DisableTypeGuards(true)),
function(overloads.StartsWith,
+ decls.FunctionDocs(`test whether a string starts with a substring prefix`),
decls.MemberOverload(overloads.StartsWithString,
argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(
+ `'hello world'.startsWith('hello') // true`,
+ `'hello world'.startsWith('world') // false`),
decls.BinaryBinding(types.StringStartsWith)),
decls.DisableTypeGuards(true)),
function(overloads.Matches,
- decls.Overload(overloads.Matches, argTypes(types.StringType, types.StringType), types.BoolType),
+ decls.FunctionDocs(`test whether a string matches an RE2 regular expression`),
+ decls.Overload(overloads.Matches, argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(
+ `matches('123-456', '^[0-9]+(-[0-9]+)?$') // true`,
+ `matches('hello', '^h.*o$') // true`)),
decls.MemberOverload(overloads.MatchesString,
- argTypes(types.StringType, types.StringType), types.BoolType),
+ argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(
+ `'123-456'.matches('^[0-9]+(-[0-9]+)?$') // true`,
+ `'hello'.matches('^h.*o$') // true`)),
decls.SingletonBinaryBinding(func(str, pat ref.Val) ref.Val {
return str.(traits.Matcher).Match(pat)
}, traits.MatcherType)),
// Timestamp / duration functions
function(overloads.TimeGetFullYear,
+ decls.FunctionDocs(`get the 0-based full year from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToYear,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getFullYear() // 2023`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetFullYear(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToYearWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-01-01T05:30:00Z').getFullYear('-08:00') // 2022`),
+ decls.BinaryBinding(timestampGetFullYear))),
function(overloads.TimeGetMonth,
+ decls.FunctionDocs(`get the 0-based month from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToMonth,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMonth() // 6`), // July is month 6
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetMonth(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToMonthWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-01-01T05:30:00Z').getMonth('America/Los_Angeles') // 11`), // December is month 11
+ decls.BinaryBinding(timestampGetMonth))),
function(overloads.TimeGetDayOfYear,
+ decls.FunctionDocs(`get the 0-based day of the year from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToDayOfYear,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-01-02T00:00:00Z').getDayOfYear() // 1`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetDayOfYear(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToDayOfYearWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-01-01T05:00:00Z').getDayOfYear('America/Los_Angeles') // 364`),
+ decls.BinaryBinding(timestampGetDayOfYear))),
function(overloads.TimeGetDayOfMonth,
+ decls.FunctionDocs(`get the 0-based day of the month from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToDayOfMonthZeroBased,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getDayOfMonth() // 13`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetDayOfMonthZeroBased(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToDayOfMonthZeroBasedWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-01T05:00:00Z').getDayOfMonth('America/Los_Angeles') // 29`),
+ decls.BinaryBinding(timestampGetDayOfMonthZeroBased))),
function(overloads.TimeGetDate,
+ decls.FunctionDocs(`get the 1-based day of the month from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToDayOfMonthOneBased,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getDate() // 14`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetDayOfMonthOneBased(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToDayOfMonthOneBasedWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-01T05:00:00Z').getDate('America/Los_Angeles') // 30`),
+ decls.BinaryBinding(timestampGetDayOfMonthOneBased))),
function(overloads.TimeGetDayOfWeek,
+ decls.FunctionDocs(`get the 0-based day of the week from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToDayOfWeek,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getDayOfWeek() // 5`), // Friday is day 5
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetDayOfWeek(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToDayOfWeekWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-16T05:00:00Z').getDayOfWeek('America/Los_Angeles') // 6`), // Saturday is day 6
+ decls.BinaryBinding(timestampGetDayOfWeek))),
function(overloads.TimeGetHours,
+ decls.FunctionDocs(`get the hours portion from a timestamp, or convert a duration to hours`),
decls.MemberOverload(overloads.TimestampToHours,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getHours() // 10`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetHours(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToHoursWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getHours('America/Los_Angeles') // 2`),
+ decls.BinaryBinding(timestampGetHours)),
decls.MemberOverload(overloads.DurationToHours,
- argTypes(types.DurationType), types.IntType)),
+ argTypes(types.DurationType), types.IntType,
+ decls.OverloadExamples(`duration('3723s').getHours() // 1`),
+ decls.UnaryBinding(types.DurationGetHours))),
function(overloads.TimeGetMinutes,
+ decls.FunctionDocs(`get the minutes portion from a timestamp, or convert a duration to minutes`),
decls.MemberOverload(overloads.TimestampToMinutes,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMinutes() // 30`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetMinutes(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToMinutesWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMinutes('America/Los_Angeles') // 30`),
+ decls.BinaryBinding(timestampGetMinutes)),
decls.MemberOverload(overloads.DurationToMinutes,
- argTypes(types.DurationType), types.IntType)),
+ argTypes(types.DurationType), types.IntType,
+ decls.OverloadExamples(`duration('3723s').getMinutes() // 62`),
+ decls.UnaryBinding(types.DurationGetMinutes))),
function(overloads.TimeGetSeconds,
+ decls.FunctionDocs(`get the seconds portion from a timestamp, or convert a duration to seconds`),
decls.MemberOverload(overloads.TimestampToSeconds,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getSeconds() // 45`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetSeconds(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToSecondsWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getSeconds('America/Los_Angeles') // 45`),
+ decls.BinaryBinding(timestampGetSeconds)),
decls.MemberOverload(overloads.DurationToSeconds,
- argTypes(types.DurationType), types.IntType)),
+ argTypes(types.DurationType), types.IntType,
+ decls.OverloadExamples(`duration('3723.456s').getSeconds() // 3723`),
+ decls.UnaryBinding(types.DurationGetSeconds))),
function(overloads.TimeGetMilliseconds,
+ decls.FunctionDocs(`get the milliseconds portion from a timestamp`),
decls.MemberOverload(overloads.TimestampToMilliseconds,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMilliseconds() // 123`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetMilliseconds(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToMillisecondsWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMilliseconds('America/Los_Angeles') // 123`),
+ decls.BinaryBinding(timestampGetMilliseconds)),
decls.MemberOverload(overloads.DurationToMilliseconds,
- argTypes(types.DurationType), types.IntType)),
+ argTypes(types.DurationType), types.IntType,
+ decls.UnaryBinding(types.DurationGetMilliseconds))),
}
}
@@ -618,3 +941,118 @@ func convertToType(t ref.Type) functions.UnaryOp {
return val.ConvertToType(t)
}
}
+
+func timestampGetFullYear(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Year())
+}
+
+func timestampGetMonth(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ // CEL spec indicates that the month should be 0-based, but the Time value
+ // for Month() is 1-based.
+ return types.Int(t.Month() - 1)
+}
+
+func timestampGetDayOfYear(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.YearDay() - 1)
+}
+
+func timestampGetDayOfMonthZeroBased(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Day() - 1)
+}
+
+func timestampGetDayOfMonthOneBased(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Day())
+}
+
+func timestampGetDayOfWeek(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Weekday())
+}
+
+func timestampGetHours(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Hour())
+}
+
+func timestampGetMinutes(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Minute())
+}
+
+func timestampGetSeconds(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Second())
+}
+
+func timestampGetMilliseconds(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Nanosecond() / 1000000)
+}
+
+func inTimeZone(ts, tz ref.Val) (time.Time, error) {
+ t := ts.(types.Timestamp)
+ val := string(tz.(types.String))
+ ind := strings.Index(val, ":")
+ if ind == -1 {
+ loc, err := time.LoadLocation(val)
+ if err != nil {
+ return time.Time{}, err
+ }
+ return t.In(loc), nil
+ }
+
+ // If the input is not the name of a timezone (for example, 'US/Central'), it should be a numerical offset from UTC
+ // in the format ^(+|-)(0[0-9]|1[0-4]):[0-5][0-9]$. The numerical input is parsed in terms of hours and minutes.
+ hr, err := strconv.Atoi(string(val[0:ind]))
+ if err != nil {
+ return time.Time{}, err
+ }
+ min, err := strconv.Atoi(string(val[ind+1:]))
+ if err != nil {
+ return time.Time{}, err
+ }
+ var offset int
+ if string(val[0]) == "-" {
+ offset = hr*60 - min
+ } else {
+ offset = hr*60 + min
+ }
+ secondsEastOfUTC := int((time.Duration(offset) * time.Minute).Seconds())
+ timezone := time.FixedZone("", secondsEastOfUTC)
+ return t.In(timezone), nil
+}
diff --git a/vendor/github.com/google/cel-go/common/types/BUILD.bazel b/vendor/github.com/google/cel-go/common/types/BUILD.bazel
index 8f010fae4..7082bc755 100644
--- a/vendor/github.com/google/cel-go/common/types/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/types/BUILD.bazel
@@ -18,6 +18,7 @@ go_library(
"int.go",
"iterator.go",
"json_value.go",
+ "format.go",
"list.go",
"map.go",
"null.go",
diff --git a/vendor/github.com/google/cel-go/common/types/bool.go b/vendor/github.com/google/cel-go/common/types/bool.go
index 565734f3f..1f9e10739 100644
--- a/vendor/github.com/google/cel-go/common/types/bool.go
+++ b/vendor/github.com/google/cel-go/common/types/bool.go
@@ -18,6 +18,7 @@ import (
"fmt"
"reflect"
"strconv"
+ "strings"
"github.com/google/cel-go/common/types/ref"
@@ -128,6 +129,14 @@ func (b Bool) Value() any {
return bool(b)
}
+func (b Bool) format(sb *strings.Builder) {
+ if b {
+ sb.WriteString("true")
+ } else {
+ sb.WriteString("false")
+ }
+}
+
// IsBool returns whether the input ref.Val or ref.Type is equal to BoolType.
func IsBool(elem ref.Val) bool {
switch v := elem.(type) {
diff --git a/vendor/github.com/google/cel-go/common/types/bytes.go b/vendor/github.com/google/cel-go/common/types/bytes.go
index 7e813e291..b59e1fc20 100644
--- a/vendor/github.com/google/cel-go/common/types/bytes.go
+++ b/vendor/github.com/google/cel-go/common/types/bytes.go
@@ -19,6 +19,7 @@ import (
"encoding/base64"
"fmt"
"reflect"
+ "strings"
"unicode/utf8"
"github.com/google/cel-go/common/types/ref"
@@ -138,3 +139,17 @@ func (b Bytes) Type() ref.Type {
func (b Bytes) Value() any {
return []byte(b)
}
+
+func (b Bytes) format(sb *strings.Builder) {
+ fmt.Fprintf(sb, "b\"%s\"", bytesToOctets([]byte(b)))
+}
+
+// bytesToOctets converts byte sequences to a string using a three digit octal encoded value
+// per byte.
+func bytesToOctets(byteVal []byte) string {
+ var b strings.Builder
+ for _, c := range byteVal {
+ fmt.Fprintf(&b, "\\%03o", c)
+ }
+ return b.String()
+}
diff --git a/vendor/github.com/google/cel-go/common/types/double.go b/vendor/github.com/google/cel-go/common/types/double.go
index 027e78978..1e7de9d6e 100644
--- a/vendor/github.com/google/cel-go/common/types/double.go
+++ b/vendor/github.com/google/cel-go/common/types/double.go
@@ -18,6 +18,8 @@ import (
"fmt"
"math"
"reflect"
+ "strconv"
+ "strings"
"github.com/google/cel-go/common/types/ref"
@@ -209,3 +211,23 @@ func (d Double) Type() ref.Type {
func (d Double) Value() any {
return float64(d)
}
+
+func (d Double) format(sb *strings.Builder) {
+ if math.IsNaN(float64(d)) {
+ sb.WriteString(`double("NaN")`)
+ return
+ }
+ if math.IsInf(float64(d), -1) {
+ sb.WriteString(`double("-Infinity")`)
+ return
+ }
+ if math.IsInf(float64(d), 1) {
+ sb.WriteString(`double("Infinity")`)
+ return
+ }
+ s := strconv.FormatFloat(float64(d), 'f', -1, 64)
+ sb.WriteString(s)
+ if !strings.ContainsRune(s, '.') {
+ sb.WriteString(".0")
+ }
+}
diff --git a/vendor/github.com/google/cel-go/common/types/duration.go b/vendor/github.com/google/cel-go/common/types/duration.go
index 596e56d6b..be58d567e 100644
--- a/vendor/github.com/google/cel-go/common/types/duration.go
+++ b/vendor/github.com/google/cel-go/common/types/duration.go
@@ -18,6 +18,7 @@ import (
"fmt"
"reflect"
"strconv"
+ "strings"
"time"
"github.com/google/cel-go/common/overloads"
@@ -185,6 +186,10 @@ func (d Duration) Value() any {
return d.Duration
}
+func (d Duration) format(sb *strings.Builder) {
+ fmt.Fprintf(sb, `duration("%ss")`, strconv.FormatFloat(d.Seconds(), 'f', -1, 64))
+}
+
// DurationGetHours returns the duration in hours.
func DurationGetHours(val ref.Val) ref.Val {
dur, ok := val.(Duration)
diff --git a/vendor/github.com/google/cel-go/common/types/err.go b/vendor/github.com/google/cel-go/common/types/err.go
index 9c9d9e21e..17ab1a95e 100644
--- a/vendor/github.com/google/cel-go/common/types/err.go
+++ b/vendor/github.com/google/cel-go/common/types/err.go
@@ -62,6 +62,12 @@ func NewErr(format string, args ...any) ref.Val {
return &Err{error: fmt.Errorf(format, args...)}
}
+// NewErrFromString creates a new Err with the provided message.
+// TODO: Audit the use of this function and standardize the error messages and codes.
+func NewErrFromString(message string) ref.Val {
+ return &Err{error: errors.New(message)}
+}
+
// NewErrWithNodeID creates a new Err described by the format string and args.
// TODO: Audit the use of this function and standardize the error messages and codes.
func NewErrWithNodeID(id int64, format string, args ...any) ref.Val {
diff --git a/vendor/github.com/google/cel-go/common/types/format.go b/vendor/github.com/google/cel-go/common/types/format.go
new file mode 100644
index 000000000..174a2bd04
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/types/format.go
@@ -0,0 +1,42 @@
+package types
+
+import (
+ "fmt"
+ "strings"
+
+ "github.com/google/cel-go/common/types/ref"
+ "github.com/google/cel-go/common/types/traits"
+)
+
+type formattable interface {
+ format(*strings.Builder)
+}
+
+// Format formats the value as a string. The result is only intended for human consumption and ignores errors.
+// Do not depend on the output being stable. It may change at any time.
+func Format(val ref.Val) string {
+ var sb strings.Builder
+ formatTo(&sb, val)
+ return sb.String()
+}
+
+func formatTo(sb *strings.Builder, val ref.Val) {
+ if fmtable, ok := val.(formattable); ok {
+ fmtable.format(sb)
+ return
+ }
+ // All of the builtins implement formattable. Try to deal with traits.
+ if l, ok := val.(traits.Lister); ok {
+ formatList(l, sb)
+ return
+ }
+ if m, ok := val.(traits.Mapper); ok {
+ formatMap(m, sb)
+ return
+ }
+ // This could be an error, unknown, opaque or object.
+ // Unfortunately we have no consistent way of inspecting
+ // opaque and object. So we just fallback to fmt.Stringer
+ // and hope it is relavent.
+ fmt.Fprintf(sb, "%s", val)
+}
diff --git a/vendor/github.com/google/cel-go/common/types/int.go b/vendor/github.com/google/cel-go/common/types/int.go
index 0ae9507c3..0ac1997b7 100644
--- a/vendor/github.com/google/cel-go/common/types/int.go
+++ b/vendor/github.com/google/cel-go/common/types/int.go
@@ -19,6 +19,7 @@ import (
"math"
"reflect"
"strconv"
+ "strings"
"time"
"github.com/google/cel-go/common/types/ref"
@@ -290,6 +291,10 @@ func (i Int) Value() any {
return int64(i)
}
+func (i Int) format(sb *strings.Builder) {
+ sb.WriteString(strconv.FormatInt(int64(i), 10))
+}
+
// isJSONSafe indicates whether the int is safely representable as a floating point value in JSON.
func (i Int) isJSONSafe() bool {
return i >= minIntJSON && i <= maxIntJSON
diff --git a/vendor/github.com/google/cel-go/common/types/list.go b/vendor/github.com/google/cel-go/common/types/list.go
index ca47d39fe..8c023f891 100644
--- a/vendor/github.com/google/cel-go/common/types/list.go
+++ b/vendor/github.com/google/cel-go/common/types/list.go
@@ -243,7 +243,7 @@ func (l *baseList) Equal(other ref.Val) ref.Val {
func (l *baseList) Get(index ref.Val) ref.Val {
ind, err := IndexOrError(index)
if err != nil {
- return ValOrErr(index, err.Error())
+ return ValOrErr(index, "%v", err)
}
if ind < 0 || ind >= l.size {
return NewErr("index '%d' out of range in list size '%d'", ind, l.Size())
@@ -299,6 +299,22 @@ func (l *baseList) String() string {
return sb.String()
}
+func formatList(l traits.Lister, sb *strings.Builder) {
+ sb.WriteString("[")
+ n, _ := l.Size().(Int)
+ for i := 0; i < int(n); i++ {
+ formatTo(sb, l.Get(Int(i)))
+ if i != int(n)-1 {
+ sb.WriteString(", ")
+ }
+ }
+ sb.WriteString("]")
+}
+
+func (l *baseList) format(sb *strings.Builder) {
+ formatList(l, sb)
+}
+
// mutableList aggregates values into its internal storage. For use with internal CEL variables only.
type mutableList struct {
*baseList
@@ -427,7 +443,7 @@ func (l *concatList) Equal(other ref.Val) ref.Val {
func (l *concatList) Get(index ref.Val) ref.Val {
ind, err := IndexOrError(index)
if err != nil {
- return ValOrErr(index, err.Error())
+ return ValOrErr(index, "%v", err)
}
i := Int(ind)
if i < l.prevList.Size().(Int) {
diff --git a/vendor/github.com/google/cel-go/common/types/map.go b/vendor/github.com/google/cel-go/common/types/map.go
index cb6cce78b..b33096197 100644
--- a/vendor/github.com/google/cel-go/common/types/map.go
+++ b/vendor/github.com/google/cel-go/common/types/map.go
@@ -17,6 +17,7 @@ package types
import (
"fmt"
"reflect"
+ "sort"
"strings"
"github.com/stoewer/go-strcase"
@@ -318,6 +319,41 @@ func (m *baseMap) String() string {
return sb.String()
}
+type baseMapEntry struct {
+ key string
+ val string
+}
+
+func formatMap(m traits.Mapper, sb *strings.Builder) {
+ it := m.Iterator()
+ var ents []baseMapEntry
+ if s, ok := m.Size().(Int); ok {
+ ents = make([]baseMapEntry, 0, int(s))
+ }
+ for it.HasNext() == True {
+ k := it.Next()
+ v, _ := m.Find(k)
+ ents = append(ents, baseMapEntry{Format(k), Format(v)})
+ }
+ sort.SliceStable(ents, func(i, j int) bool {
+ return ents[i].key < ents[j].key
+ })
+ sb.WriteString("{")
+ for i, ent := range ents {
+ if i > 0 {
+ sb.WriteString(", ")
+ }
+ sb.WriteString(ent.key)
+ sb.WriteString(": ")
+ sb.WriteString(ent.val)
+ }
+ sb.WriteString("}")
+}
+
+func (m *baseMap) format(sb *strings.Builder) {
+ formatMap(m, sb)
+}
+
// Type implements the ref.Val interface method.
func (m *baseMap) Type() ref.Type {
return MapType
diff --git a/vendor/github.com/google/cel-go/common/types/null.go b/vendor/github.com/google/cel-go/common/types/null.go
index 36514ff20..2c0297fe6 100644
--- a/vendor/github.com/google/cel-go/common/types/null.go
+++ b/vendor/github.com/google/cel-go/common/types/null.go
@@ -17,6 +17,7 @@ package types
import (
"fmt"
"reflect"
+ "strings"
"google.golang.org/protobuf/proto"
@@ -117,3 +118,7 @@ func (n Null) Type() ref.Type {
func (n Null) Value() any {
return structpb.NullValue_NULL_VALUE
}
+
+func (n Null) format(sb *strings.Builder) {
+ sb.WriteString("null")
+}
diff --git a/vendor/github.com/google/cel-go/common/types/object.go b/vendor/github.com/google/cel-go/common/types/object.go
index 8ba0af9fb..776f6954a 100644
--- a/vendor/github.com/google/cel-go/common/types/object.go
+++ b/vendor/github.com/google/cel-go/common/types/object.go
@@ -17,9 +17,12 @@ package types
import (
"fmt"
"reflect"
+ "sort"
+ "strings"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
+ "google.golang.org/protobuf/reflect/protoreflect"
"github.com/google/cel-go/common/types/pb"
"github.com/google/cel-go/common/types/ref"
@@ -151,7 +154,7 @@ func (o *protoObj) Get(index ref.Val) ref.Val {
}
fv, err := fd.GetFrom(o.value)
if err != nil {
- return NewErr(err.Error())
+ return NewErrFromString(err.Error())
}
return o.NativeToValue(fv)
}
@@ -163,3 +166,29 @@ func (o *protoObj) Type() ref.Type {
func (o *protoObj) Value() any {
return o.value
}
+
+type protoObjField struct {
+ fd protoreflect.FieldDescriptor
+ v protoreflect.Value
+}
+
+func (o *protoObj) format(sb *strings.Builder) {
+ var fields []protoreflect.FieldDescriptor
+ o.value.ProtoReflect().Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
+ fields = append(fields, fd)
+ return true
+ })
+ sort.SliceStable(fields, func(i, j int) bool {
+ return fields[i].Number() < fields[j].Number()
+ })
+ sb.WriteString(o.Type().TypeName())
+ sb.WriteString("{")
+ for i, field := range fields {
+ if i > 0 {
+ sb.WriteString(", ")
+ }
+ sb.WriteString(fmt.Sprintf("%s: ", field.Name()))
+ formatTo(sb, o.Get(String(field.Name())))
+ }
+ sb.WriteString("}")
+}
diff --git a/vendor/github.com/google/cel-go/common/types/optional.go b/vendor/github.com/google/cel-go/common/types/optional.go
index 97845a740..b8685ebf5 100644
--- a/vendor/github.com/google/cel-go/common/types/optional.go
+++ b/vendor/github.com/google/cel-go/common/types/optional.go
@@ -18,6 +18,7 @@ import (
"errors"
"fmt"
"reflect"
+ "strings"
"github.com/google/cel-go/common/types/ref"
)
@@ -94,6 +95,16 @@ func (o *Optional) String() string {
return "optional.none()"
}
+func (o *Optional) format(sb *strings.Builder) {
+ if o.HasValue() {
+ sb.WriteString(`optional.of(`)
+ formatTo(sb, o.GetValue())
+ sb.WriteString(`)`)
+ } else {
+ sb.WriteString("optional.none()")
+ }
+}
+
// Type implements the ref.Val interface method.
func (o *Optional) Type() ref.Type {
return OptionalType
diff --git a/vendor/github.com/google/cel-go/common/types/pb/type.go b/vendor/github.com/google/cel-go/common/types/pb/type.go
index bdd474c95..171494f07 100644
--- a/vendor/github.com/google/cel-go/common/types/pb/type.go
+++ b/vendor/github.com/google/cel-go/common/types/pb/type.go
@@ -472,7 +472,7 @@ func unwrap(desc description, msg proto.Message) (any, bool, error) {
}
return v.GetValue(), true, nil
}
- return msg, false, nil
+ return unwrapDynamic(desc, msg.ProtoReflect())
}
// unwrapDynamic unwraps a reflected protobuf Message value.
diff --git a/vendor/github.com/google/cel-go/common/types/string.go b/vendor/github.com/google/cel-go/common/types/string.go
index 3a93743f2..8aad4701c 100644
--- a/vendor/github.com/google/cel-go/common/types/string.go
+++ b/vendor/github.com/google/cel-go/common/types/string.go
@@ -186,6 +186,10 @@ func (s String) Value() any {
return string(s)
}
+func (s String) format(sb *strings.Builder) {
+ sb.WriteString(strconv.Quote(string(s)))
+}
+
// StringContains returns whether the string contains a substring.
func StringContains(s, sub ref.Val) ref.Val {
str, ok := s.(String)
diff --git a/vendor/github.com/google/cel-go/common/types/timestamp.go b/vendor/github.com/google/cel-go/common/types/timestamp.go
index 33acdea8e..f7be58591 100644
--- a/vendor/github.com/google/cel-go/common/types/timestamp.go
+++ b/vendor/github.com/google/cel-go/common/types/timestamp.go
@@ -179,6 +179,10 @@ func (t Timestamp) Value() any {
return t.Time
}
+func (t Timestamp) format(sb *strings.Builder) {
+ fmt.Fprintf(sb, `timestamp("%s")`, t.Time.UTC().Format(time.RFC3339Nano))
+}
+
var (
timestampValueType = reflect.TypeOf(&tpb.Timestamp{})
diff --git a/vendor/github.com/google/cel-go/common/types/types.go b/vendor/github.com/google/cel-go/common/types/types.go
index 1c5b6c40c..78c77a9b5 100644
--- a/vendor/github.com/google/cel-go/common/types/types.go
+++ b/vendor/github.com/google/cel-go/common/types/types.go
@@ -164,9 +164,9 @@ var (
traits.SubtractorType,
}
// ListType represents the runtime list type.
- ListType = NewListType(nil)
+ ListType = NewListType(DynType)
// MapType represents the runtime map type.
- MapType = NewMapType(nil, nil)
+ MapType = NewMapType(DynType, DynType)
// NullType represents the type of a null value.
NullType = &Type{
kind: NullTypeKind,
@@ -376,6 +376,10 @@ func (t *Type) TypeName() string {
return t.runtimeTypeName
}
+func (t *Type) format(sb *strings.Builder) {
+ sb.WriteString(t.TypeName())
+}
+
// WithTraits creates a copy of the current Type and sets the trait mask to the traits parameter.
//
// This method should be used with Opaque types where the type acts like a container, e.g. vector.
@@ -395,6 +399,9 @@ func (t *Type) WithTraits(traits int) *Type {
// String returns a human-readable definition of the type name.
func (t *Type) String() string {
+ if t.Kind() == TypeParamKind {
+ return fmt.Sprintf("<%s>", t.DeclaredTypeName())
+ }
if len(t.Parameters()) == 0 {
return t.DeclaredTypeName()
}
@@ -768,6 +775,19 @@ func ProtoAsType(t *celpb.Type) (*Type, error) {
}
}
+// TypeToProto converts from a CEL-native type representation to canonical CEL celpb.Type protobuf type.
+func TypeToProto(t *Type) (*celpb.Type, error) {
+ exprType, err := TypeToExprType(t)
+ if err != nil {
+ return nil, err
+ }
+ var pbtype celpb.Type
+ if err = convertProto(exprType, &pbtype); err != nil {
+ return nil, err
+ }
+ return &pbtype, nil
+}
+
func maybeWrapper(t *Type, pbType *exprpb.Type) *exprpb.Type {
if t.IsAssignableType(NullType) {
return chkdecls.NewWrapperType(pbType)
diff --git a/vendor/github.com/google/cel-go/common/types/uint.go b/vendor/github.com/google/cel-go/common/types/uint.go
index 6d74f30d8..a93405a13 100644
--- a/vendor/github.com/google/cel-go/common/types/uint.go
+++ b/vendor/github.com/google/cel-go/common/types/uint.go
@@ -19,6 +19,7 @@ import (
"math"
"reflect"
"strconv"
+ "strings"
"github.com/google/cel-go/common/types/ref"
@@ -250,6 +251,11 @@ func (i Uint) Value() any {
return uint64(i)
}
+func (i Uint) format(sb *strings.Builder) {
+ sb.WriteString(strconv.FormatUint(uint64(i), 10))
+ sb.WriteString("u")
+}
+
// isJSONSafe indicates whether the uint is safely representable as a floating point value in JSON.
func (i Uint) isJSONSafe() bool {
return i <= maxIntJSON
diff --git a/vendor/github.com/google/cel-go/ext/BUILD.bazel b/vendor/github.com/google/cel-go/ext/BUILD.bazel
index b764fa1f5..ef4f4ec3d 100644
--- a/vendor/github.com/google/cel-go/ext/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/ext/BUILD.bazel
@@ -10,12 +10,15 @@ go_library(
"bindings.go",
"comprehensions.go",
"encoders.go",
+ "extension_option_factory.go",
"formatting.go",
+ "formatting_v2.go",
"guards.go",
"lists.go",
"math.go",
"native.go",
"protos.go",
+ "regex.go",
"sets.go",
"strings.go",
],
@@ -24,10 +27,12 @@ go_library(
deps = [
"//cel:go_default_library",
"//checker:go_default_library",
+ "//common:go_default_library",
"//common/ast:go_default_library",
"//common/decls:go_default_library",
- "//common/overloads:go_default_library",
+ "//common/env:go_default_library",
"//common/operators:go_default_library",
+ "//common/overloads:go_default_library",
"//common/types:go_default_library",
"//common/types/pb:go_default_library",
"//common/types/ref:go_default_library",
@@ -48,11 +53,15 @@ go_test(
srcs = [
"bindings_test.go",
"comprehensions_test.go",
- "encoders_test.go",
+ "encoders_test.go",
+ "extension_option_factory_test.go",
+ "formatting_test.go",
+ "formatting_v2_test.go",
"lists_test.go",
"math_test.go",
"native_test.go",
"protos_test.go",
+ "regex_test.go",
"sets_test.go",
"strings_test.go",
],
@@ -62,14 +71,16 @@ go_test(
deps = [
"//cel:go_default_library",
"//checker:go_default_library",
+ "//common:go_default_library",
+ "//common/env:go_default_library",
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
"//common/types/traits:go_default_library",
"//test:go_default_library",
"//test/proto2pb:go_default_library",
"//test/proto3pb:go_default_library",
+ "@org_golang_google_protobuf//encoding/protojson:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//types/known/wrapperspb:go_default_library",
- "@org_golang_google_protobuf//encoding/protojson:go_default_library",
],
)
diff --git a/vendor/github.com/google/cel-go/ext/README.md b/vendor/github.com/google/cel-go/ext/README.md
index 07e544d0d..41ae6a314 100644
--- a/vendor/github.com/google/cel-go/ext/README.md
+++ b/vendor/github.com/google/cel-go/ext/README.md
@@ -11,7 +11,7 @@ in expressions.
### Cel.Bind
Binds a simple identifier to an initialization expression which may be used
-in a subsequenct result expression. Bindings may also be nested within each
+in a subsequent result expression. Bindings may also be nested within each
other.
cel.bind(, , )
@@ -29,7 +29,7 @@ Local bindings are not guaranteed to be evaluated before use.
## Encoders
-Encoding utilies for marshalling data into standardized representations.
+Encoding utilities for marshalling data into standardized representations.
### Base64.Decode
@@ -356,6 +356,23 @@ Examples:
math.isFinite(0.0/0.0) // returns false
math.isFinite(1.2) // returns true
+### Math.Sqrt
+
+Introduced at version: 2
+
+Returns the square root of the given input as double
+Throws error for negative or non-numeric inputs
+
+ math.sqrt() ->
+ math.sqrt() ->
+ math.sqrt() ->
+
+Examples:
+
+ math.sqrt(81) // returns 9.0
+ math.sqrt(985.25) // returns 31.388692231439016
+ math.sqrt(-15) // returns NaN
+
## Protos
Protos configure extended macros and functions for proto manipulation.
@@ -395,7 +412,7 @@ zero-based.
### Distinct
-**Introduced in version 2**
+**Introduced in version 2 (cost support in version 3)**
Returns the distinct elements of a list.
@@ -409,7 +426,7 @@ Examples:
### Flatten
-**Introduced in version 1**
+**Introduced in version 1 (cost support in version 3)**
Flattens a list recursively.
If an optional depth is provided, the list is flattened to a the specificied level.
@@ -428,7 +445,7 @@ Examples:
### Range
-**Introduced in version 2**
+**Introduced in version 2 (cost support in version 3)**
Returns a list of integers from 0 to n-1.
@@ -441,7 +458,7 @@ Examples:
### Reverse
-**Introduced in version 2**
+**Introduced in version 2 (cost support in version 3)**
Returns the elements of a list in reverse order.
@@ -454,6 +471,7 @@ Examples:
### Slice
+**Introduced in version 0 (cost support in version 3)**
Returns a new sub-list using the indexes provided.
@@ -466,7 +484,7 @@ Examples:
### Sort
-**Introduced in version 2**
+**Introduced in version 2 (cost support in version 3)**
Sorts a list with comparable elements. If the element type is not comparable
or the element types are not the same, the function will produce an error.
@@ -483,7 +501,7 @@ Examples:
### SortBy
-**Introduced in version 2**
+**Introduced in version 2 (cost support in version 3)**
Sorts a list by a key value, i.e., the order is determined by the result of
an expression applied to each element of the list.
@@ -500,6 +518,36 @@ Examples:
].sortBy(e, e.score).map(e, e.name)
== ["bar", "foo", "baz"]
+### Last
+
+**Introduced in the OptionalTypes library version 2**
+
+Returns an optional with the last value from the list or `optional.None` if the
+list is empty.
+
+ .last() ->
+
+Examples:
+
+ [1, 2, 3].last().value() == 3
+ [].last().orValue('test') == 'test'
+
+This is syntactic sugar for list[list.size()-1].
+
+### First
+
+**Introduced in the OptionalTypes library version 2**
+
+Returns an optional with the first value from the list or `optional.None` if the
+list is empty.
+
+ .first() ->
+
+Examples:
+
+ [1, 2, 3].first().value() == 1
+ [].first().orValue('test') == 'test'
+
## Sets
Sets provides set relationship tests.
diff --git a/vendor/github.com/google/cel-go/ext/bindings.go b/vendor/github.com/google/cel-go/ext/bindings.go
index 50cf4fb3d..63942b85c 100644
--- a/vendor/github.com/google/cel-go/ext/bindings.go
+++ b/vendor/github.com/google/cel-go/ext/bindings.go
@@ -149,7 +149,7 @@ type blockValidationExemption struct{}
// Name returns the name of the validator.
func (blockValidationExemption) Name() string {
- return "cel.lib.ext.validate.functions.cel.block"
+ return "cel.validator.cel_block"
}
// Configure implements the ASTValidatorConfigurer interface and augments the list of functions to skip
@@ -224,7 +224,7 @@ func (b *dynamicBlock) ID() int64 {
}
// Eval implements the Interpretable interface method.
-func (b *dynamicBlock) Eval(activation interpreter.Activation) ref.Val {
+func (b *dynamicBlock) Eval(activation cel.Activation) ref.Val {
sa := b.slotActivationPool.Get().(*dynamicSlotActivation)
sa.Activation = activation
defer b.clearSlots(sa)
@@ -242,7 +242,7 @@ type slotVal struct {
}
type dynamicSlotActivation struct {
- interpreter.Activation
+ cel.Activation
slotExprs []interpreter.Interpretable
slotCount int
slotVals []*slotVal
@@ -295,13 +295,13 @@ func (b *constantBlock) ID() int64 {
// Eval implements the interpreter.Interpretable interface method, and will proxy @index prefixed variable
// lookups into a set of constant slots determined from the plan step.
-func (b *constantBlock) Eval(activation interpreter.Activation) ref.Val {
+func (b *constantBlock) Eval(activation cel.Activation) ref.Val {
vars := constantSlotActivation{Activation: activation, slots: b.slots, slotCount: b.slotCount}
return b.expr.Eval(vars)
}
type constantSlotActivation struct {
- interpreter.Activation
+ cel.Activation
slots traits.Lister
slotCount int
}
diff --git a/vendor/github.com/google/cel-go/ext/comprehensions.go b/vendor/github.com/google/cel-go/ext/comprehensions.go
index 1428558d8..f08d8f9da 100644
--- a/vendor/github.com/google/cel-go/ext/comprehensions.go
+++ b/vendor/github.com/google/cel-go/ext/comprehensions.go
@@ -16,6 +16,7 @@ package ext
import (
"fmt"
+ "math"
"github.com/google/cel-go/cel"
"github.com/google/cel-go/common/ast"
@@ -159,19 +160,36 @@ const (
//
// {'greeting': 'aloha', 'farewell': 'aloha'}
// .transformMapEntry(keyVar, valueVar, {valueVar: keyVar}) // error, duplicate key
-func TwoVarComprehensions() cel.EnvOption {
- return cel.Lib(compreV2Lib{})
+func TwoVarComprehensions(options ...TwoVarComprehensionsOption) cel.EnvOption {
+ l := &compreV2Lib{version: math.MaxUint32}
+ for _, o := range options {
+ l = o(l)
+ }
+ return cel.Lib(l)
+}
+
+// TwoVarComprehensionsOption declares a functional operator for configuring two-variable comprehensions.
+type TwoVarComprehensionsOption func(*compreV2Lib) *compreV2Lib
+
+// TwoVarComprehensionsVersion sets the library version for two-variable comprehensions.
+func TwoVarComprehensionsVersion(version uint32) TwoVarComprehensionsOption {
+ return func(lib *compreV2Lib) *compreV2Lib {
+ lib.version = version
+ return lib
+ }
}
-type compreV2Lib struct{}
+type compreV2Lib struct {
+ version uint32
+}
// LibraryName implements that SingletonLibrary interface method.
-func (compreV2Lib) LibraryName() string {
+func (*compreV2Lib) LibraryName() string {
return "cel.lib.ext.comprev2"
}
// CompileOptions implements the cel.Library interface method.
-func (compreV2Lib) CompileOptions() []cel.EnvOption {
+func (*compreV2Lib) CompileOptions() []cel.EnvOption {
kType := cel.TypeParamType("K")
vType := cel.TypeParamType("V")
mapKVType := cel.MapType(kType, vType)
@@ -217,7 +235,7 @@ func (compreV2Lib) CompileOptions() []cel.EnvOption {
}
// ProgramOptions implements the cel.Library interface method
-func (compreV2Lib) ProgramOptions() []cel.ProgramOption {
+func (*compreV2Lib) ProgramOptions() []cel.ProgramOption {
return []cel.ProgramOption{}
}
@@ -231,7 +249,7 @@ func quantifierAll(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (
target,
iterVar1,
iterVar2,
- parser.AccumulatorName,
+ mef.AccuIdentName(),
/*accuInit=*/ mef.NewLiteral(types.True),
/*condition=*/ mef.NewCall(operators.NotStrictlyFalse, mef.NewAccuIdent()),
/*step=*/ mef.NewCall(operators.LogicalAnd, mef.NewAccuIdent(), args[2]),
@@ -249,7 +267,7 @@ func quantifierExists(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr
target,
iterVar1,
iterVar2,
- parser.AccumulatorName,
+ mef.AccuIdentName(),
/*accuInit=*/ mef.NewLiteral(types.False),
/*condition=*/ mef.NewCall(operators.NotStrictlyFalse, mef.NewCall(operators.LogicalNot, mef.NewAccuIdent())),
/*step=*/ mef.NewCall(operators.LogicalOr, mef.NewAccuIdent(), args[2]),
@@ -267,7 +285,7 @@ func quantifierExistsOne(mef cel.MacroExprFactory, target ast.Expr, args []ast.E
target,
iterVar1,
iterVar2,
- parser.AccumulatorName,
+ mef.AccuIdentName(),
/*accuInit=*/ mef.NewLiteral(types.Int(0)),
/*condition=*/ mef.NewLiteral(types.True),
/*step=*/ mef.NewCall(operators.Conditional, args[2],
@@ -293,10 +311,10 @@ func transformList(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (
transform = args[2]
}
- // __result__ = __result__ + [transform]
+ // accumulator = accumulator + [transform]
step := mef.NewCall(operators.Add, mef.NewAccuIdent(), mef.NewList(transform))
if filter != nil {
- // __result__ = (filter) ? __result__ + [transform] : __result__
+ // accumulator = (filter) ? accumulator + [transform] : accumulator
step = mef.NewCall(operators.Conditional, filter, step, mef.NewAccuIdent())
}
@@ -304,7 +322,7 @@ func transformList(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (
target,
iterVar1,
iterVar2,
- parser.AccumulatorName,
+ mef.AccuIdentName(),
/*accuInit=*/ mef.NewList(),
/*condition=*/ mef.NewLiteral(types.True),
step,
@@ -328,17 +346,17 @@ func transformMap(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (a
transform = args[2]
}
- // __result__ = cel.@mapInsert(__result__, iterVar1, transform)
+ // accumulator = cel.@mapInsert(accumulator, iterVar1, transform)
step := mef.NewCall(mapInsert, mef.NewAccuIdent(), mef.NewIdent(iterVar1), transform)
if filter != nil {
- // __result__ = (filter) ? cel.@mapInsert(__result__, iterVar1, transform) : __result__
+ // accumulator = (filter) ? cel.@mapInsert(accumulator, iterVar1, transform) : accumulator
step = mef.NewCall(operators.Conditional, filter, step, mef.NewAccuIdent())
}
return mef.NewComprehensionTwoVar(
target,
iterVar1,
iterVar2,
- parser.AccumulatorName,
+ mef.AccuIdentName(),
/*accuInit=*/ mef.NewMap(),
/*condition=*/ mef.NewLiteral(types.True),
step,
@@ -362,17 +380,17 @@ func transformMapEntry(mef cel.MacroExprFactory, target ast.Expr, args []ast.Exp
transform = args[2]
}
- // __result__ = cel.@mapInsert(__result__, transform)
+ // accumulator = cel.@mapInsert(accumulator, transform)
step := mef.NewCall(mapInsert, mef.NewAccuIdent(), transform)
if filter != nil {
- // __result__ = (filter) ? cel.@mapInsert(__result__, transform) : __result__
+ // accumulator = (filter) ? cel.@mapInsert(accumulator, transform) : accumulator
step = mef.NewCall(operators.Conditional, filter, step, mef.NewAccuIdent())
}
return mef.NewComprehensionTwoVar(
target,
iterVar1,
iterVar2,
- parser.AccumulatorName,
+ mef.AccuIdentName(),
/*accuInit=*/ mef.NewMap(),
/*condition=*/ mef.NewLiteral(types.True),
step,
@@ -392,10 +410,10 @@ func extractIterVars(mef cel.MacroExprFactory, arg0, arg1 ast.Expr) (string, str
if iterVar1 == iterVar2 {
return "", "", mef.NewError(arg1.ID(), fmt.Sprintf("duplicate variable name: %s", iterVar1))
}
- if iterVar1 == parser.AccumulatorName {
+ if iterVar1 == mef.AccuIdentName() || iterVar1 == parser.AccumulatorName {
return "", "", mef.NewError(arg0.ID(), "iteration variable overwrites accumulator variable")
}
- if iterVar2 == parser.AccumulatorName {
+ if iterVar2 == mef.AccuIdentName() || iterVar2 == parser.AccumulatorName {
return "", "", mef.NewError(arg1.ID(), "iteration variable overwrites accumulator variable")
}
return iterVar1, iterVar2, nil
diff --git a/vendor/github.com/google/cel-go/ext/encoders.go b/vendor/github.com/google/cel-go/ext/encoders.go
index ac04b1a7b..731c3d095 100644
--- a/vendor/github.com/google/cel-go/ext/encoders.go
+++ b/vendor/github.com/google/cel-go/ext/encoders.go
@@ -16,6 +16,7 @@ package ext
import (
"encoding/base64"
+ "math"
"github.com/google/cel-go/cel"
"github.com/google/cel-go/common/types"
@@ -47,17 +48,34 @@ import (
// Examples:
//
// base64.encode(b'hello') // return b'aGVsbG8='
-func Encoders() cel.EnvOption {
- return cel.Lib(encoderLib{})
+func Encoders(options ...EncodersOption) cel.EnvOption {
+ l := &encoderLib{version: math.MaxUint32}
+ for _, o := range options {
+ l = o(l)
+ }
+ return cel.Lib(l)
+}
+
+// EncodersOption declares a functional operator for configuring encoder extensions.
+type EncodersOption func(*encoderLib) *encoderLib
+
+// EncodersVersion sets the library version for encoder extensions.
+func EncodersVersion(version uint32) EncodersOption {
+ return func(lib *encoderLib) *encoderLib {
+ lib.version = version
+ return lib
+ }
}
-type encoderLib struct{}
+type encoderLib struct {
+ version uint32
+}
-func (encoderLib) LibraryName() string {
+func (*encoderLib) LibraryName() string {
return "cel.lib.ext.encoders"
}
-func (encoderLib) CompileOptions() []cel.EnvOption {
+func (*encoderLib) CompileOptions() []cel.EnvOption {
return []cel.EnvOption{
cel.Function("base64.decode",
cel.Overload("base64_decode_string", []*cel.Type{cel.StringType}, cel.BytesType,
@@ -74,7 +92,7 @@ func (encoderLib) CompileOptions() []cel.EnvOption {
}
}
-func (encoderLib) ProgramOptions() []cel.ProgramOption {
+func (*encoderLib) ProgramOptions() []cel.ProgramOption {
return []cel.ProgramOption{}
}
diff --git a/vendor/github.com/google/cel-go/ext/extension_option_factory.go b/vendor/github.com/google/cel-go/ext/extension_option_factory.go
new file mode 100644
index 000000000..cebf0d760
--- /dev/null
+++ b/vendor/github.com/google/cel-go/ext/extension_option_factory.go
@@ -0,0 +1,75 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ext
+
+import (
+ "fmt"
+
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/env"
+)
+
+// ExtensionOptionFactory converts an ExtensionConfig value to a CEL environment option.
+func ExtensionOptionFactory(configElement any) (cel.EnvOption, bool) {
+ ext, isExtension := configElement.(*env.Extension)
+ if !isExtension {
+ return nil, false
+ }
+ fac, found := extFactories[ext.Name]
+ if !found {
+ return nil, false
+ }
+ // If the version is 'latest', set the version value to the max uint.
+ ver, err := ext.VersionNumber()
+ if err != nil {
+ return func(*cel.Env) (*cel.Env, error) {
+ return nil, fmt.Errorf("invalid extension version: %s - %s", ext.Name, ext.Version)
+ }, true
+ }
+ return fac(ver), true
+}
+
+// extensionFactory accepts a version and produces a CEL environment associated with the versioned extension.
+type extensionFactory func(uint32) cel.EnvOption
+
+var extFactories = map[string]extensionFactory{
+ "bindings": func(version uint32) cel.EnvOption {
+ return Bindings(BindingsVersion(version))
+ },
+ "encoders": func(version uint32) cel.EnvOption {
+ return Encoders(EncodersVersion(version))
+ },
+ "lists": func(version uint32) cel.EnvOption {
+ return Lists(ListsVersion(version))
+ },
+ "math": func(version uint32) cel.EnvOption {
+ return Math(MathVersion(version))
+ },
+ "protos": func(version uint32) cel.EnvOption {
+ return Protos(ProtosVersion(version))
+ },
+ "sets": func(version uint32) cel.EnvOption {
+ return Sets(SetsVersion(version))
+ },
+ "strings": func(version uint32) cel.EnvOption {
+ return Strings(StringsVersion(version))
+ },
+ "two-var-comprehensions": func(version uint32) cel.EnvOption {
+ return TwoVarComprehensions(TwoVarComprehensionsVersion(version))
+ },
+ "regex": func(version uint32) cel.EnvOption {
+ return Regex(RegexVersion(version))
+ },
+}
diff --git a/vendor/github.com/google/cel-go/ext/formatting.go b/vendor/github.com/google/cel-go/ext/formatting.go
index dbff613b2..111184b73 100644
--- a/vendor/github.com/google/cel-go/ext/formatting.go
+++ b/vendor/github.com/google/cel-go/ext/formatting.go
@@ -268,14 +268,17 @@ func makeMatcher(locale string) (language.Matcher, error) {
type stringFormatter struct{}
+// String implements formatStringInterpolator.String.
func (c *stringFormatter) String(arg ref.Val, locale string) (string, error) {
return FormatString(arg, locale)
}
+// Decimal implements formatStringInterpolator.Decimal.
func (c *stringFormatter) Decimal(arg ref.Val, locale string) (string, error) {
return formatDecimal(arg, locale)
}
+// Fixed implements formatStringInterpolator.Fixed.
func (c *stringFormatter) Fixed(precision *int) func(ref.Val, string) (string, error) {
if precision == nil {
precision = new(int)
@@ -307,6 +310,7 @@ func (c *stringFormatter) Fixed(precision *int) func(ref.Val, string) (string, e
}
}
+// Scientific implements formatStringInterpolator.Scientific.
func (c *stringFormatter) Scientific(precision *int) func(ref.Val, string) (string, error) {
if precision == nil {
precision = new(int)
@@ -337,6 +341,7 @@ func (c *stringFormatter) Scientific(precision *int) func(ref.Val, string) (stri
}
}
+// Binary implements formatStringInterpolator.Binary.
func (c *stringFormatter) Binary(arg ref.Val, locale string) (string, error) {
switch arg.Type() {
case types.IntType:
@@ -358,6 +363,7 @@ func (c *stringFormatter) Binary(arg ref.Val, locale string) (string, error) {
}
}
+// Hex implements formatStringInterpolator.Hex.
func (c *stringFormatter) Hex(useUpper bool) func(ref.Val, string) (string, error) {
return func(arg ref.Val, locale string) (string, error) {
fmtStr := "%x"
@@ -388,6 +394,7 @@ func (c *stringFormatter) Hex(useUpper bool) func(ref.Val, string) (string, erro
}
}
+// Octal implements formatStringInterpolator.Octal.
func (c *stringFormatter) Octal(arg ref.Val, locale string) (string, error) {
switch arg.Type() {
case types.IntType:
@@ -407,7 +414,7 @@ type stringFormatValidator struct{}
// Name returns the name of the validator.
func (stringFormatValidator) Name() string {
- return "cel.lib.ext.validate.functions.string.format"
+ return "cel.validator.string_format"
}
// Configure implements the ASTValidatorConfigurer interface and augments the list of functions to skip
@@ -434,7 +441,7 @@ func (stringFormatValidator) Validate(env *cel.Env, _ cel.ValidatorConfig, a *as
// use a placeholder locale, since locale doesn't affect syntax
_, err := parseFormatString(formatStr, formatCheck, formatCheck, "en_US")
if err != nil {
- iss.ReportErrorAtID(getErrorExprID(e.ID(), err), err.Error())
+ iss.ReportErrorAtID(getErrorExprID(e.ID(), err), "%v", err)
continue
}
seenArgs := formatCheck.argsRequested
@@ -504,6 +511,7 @@ type stringFormatChecker struct {
ast *ast.AST
}
+// String implements formatStringInterpolator.String.
func (c *stringFormatChecker) String(arg ref.Val, locale string) (string, error) {
formatArg := c.args[c.currArgIndex]
valid, badID := c.verifyString(formatArg)
@@ -513,6 +521,7 @@ func (c *stringFormatChecker) String(arg ref.Val, locale string) (string, error)
return "", nil
}
+// Decimal implements formatStringInterpolator.Decimal.
func (c *stringFormatChecker) Decimal(arg ref.Val, locale string) (string, error) {
id := c.args[c.currArgIndex].ID()
valid := c.verifyTypeOneOf(id, types.IntType, types.UintType)
@@ -522,6 +531,7 @@ func (c *stringFormatChecker) Decimal(arg ref.Val, locale string) (string, error
return "", nil
}
+// Fixed implements formatStringInterpolator.Fixed.
func (c *stringFormatChecker) Fixed(precision *int) func(ref.Val, string) (string, error) {
return func(arg ref.Val, locale string) (string, error) {
id := c.args[c.currArgIndex].ID()
@@ -534,6 +544,7 @@ func (c *stringFormatChecker) Fixed(precision *int) func(ref.Val, string) (strin
}
}
+// Scientific implements formatStringInterpolator.Scientific.
func (c *stringFormatChecker) Scientific(precision *int) func(ref.Val, string) (string, error) {
return func(arg ref.Val, locale string) (string, error) {
id := c.args[c.currArgIndex].ID()
@@ -545,6 +556,7 @@ func (c *stringFormatChecker) Scientific(precision *int) func(ref.Val, string) (
}
}
+// Binary implements formatStringInterpolator.Binary.
func (c *stringFormatChecker) Binary(arg ref.Val, locale string) (string, error) {
id := c.args[c.currArgIndex].ID()
valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.BoolType)
@@ -554,6 +566,7 @@ func (c *stringFormatChecker) Binary(arg ref.Val, locale string) (string, error)
return "", nil
}
+// Hex implements formatStringInterpolator.Hex.
func (c *stringFormatChecker) Hex(useUpper bool) func(ref.Val, string) (string, error) {
return func(arg ref.Val, locale string) (string, error) {
id := c.args[c.currArgIndex].ID()
@@ -565,6 +578,7 @@ func (c *stringFormatChecker) Hex(useUpper bool) func(ref.Val, string) (string,
}
}
+// Octal implements formatStringInterpolator.Octal.
func (c *stringFormatChecker) Octal(arg ref.Val, locale string) (string, error) {
id := c.args[c.currArgIndex].ID()
valid := c.verifyTypeOneOf(id, types.IntType, types.UintType)
@@ -574,6 +588,7 @@ func (c *stringFormatChecker) Octal(arg ref.Val, locale string) (string, error)
return "", nil
}
+// Arg implements formatListArgs.Arg.
func (c *stringFormatChecker) Arg(index int64) (ref.Val, error) {
c.argsRequested++
c.currArgIndex = index
@@ -582,6 +597,7 @@ func (c *stringFormatChecker) Arg(index int64) (ref.Val, error) {
return types.Int(0), nil
}
+// Size implements formatListArgs.Size.
func (c *stringFormatChecker) Size() int64 {
return int64(len(c.args))
}
@@ -686,10 +702,12 @@ func newFormatError(id int64, msg string, args ...any) error {
}
}
+// Error implements error.
func (e formatError) Error() string {
return e.msg
}
+// Is implements errors.Is.
func (e formatError) Is(target error) bool {
return e.msg == target.Error()
}
@@ -699,6 +717,7 @@ type stringArgList struct {
args traits.Lister
}
+// Arg implements formatListArgs.Arg.
func (c *stringArgList) Arg(index int64) (ref.Val, error) {
if index >= c.args.Size().Value().(int64) {
return nil, fmt.Errorf("index %d out of range", index)
@@ -706,6 +725,7 @@ func (c *stringArgList) Arg(index int64) (ref.Val, error) {
return c.args.Get(types.Int(index)), nil
}
+// Size implements formatListArgs.Size.
func (c *stringArgList) Size() int64 {
return c.args.Size().Value().(int64)
}
@@ -887,14 +907,17 @@ func newParseFormatError(msg string, wrapped error) error {
return parseFormatError{msg: msg, wrapped: wrapped}
}
+// Error implements error.
func (e parseFormatError) Error() string {
return fmt.Sprintf("%s: %s", e.msg, e.wrapped.Error())
}
+// Is implements errors.Is.
func (e parseFormatError) Is(target error) bool {
return e.Error() == target.Error()
}
+// Is implements errors.Unwrap.
func (e parseFormatError) Unwrap() error {
return e.wrapped
}
diff --git a/vendor/github.com/google/cel-go/ext/formatting_v2.go b/vendor/github.com/google/cel-go/ext/formatting_v2.go
new file mode 100644
index 000000000..ca8efbc4e
--- /dev/null
+++ b/vendor/github.com/google/cel-go/ext/formatting_v2.go
@@ -0,0 +1,788 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ext
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "sort"
+ "strconv"
+ "strings"
+ "time"
+ "unicode"
+
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+ "github.com/google/cel-go/common/types/traits"
+)
+
+type clauseImplV2 func(ref.Val) (string, error)
+
+type appendingFormatterV2 struct {
+ buf []byte
+}
+
+type formattedMapEntryV2 struct {
+ key string
+ val string
+}
+
+func (af *appendingFormatterV2) format(arg ref.Val) error {
+ switch arg.Type() {
+ case types.BoolType:
+ argBool, ok := arg.Value().(bool)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.BoolType)
+ }
+ af.buf = strconv.AppendBool(af.buf, argBool)
+ return nil
+ case types.IntType:
+ argInt, ok := arg.Value().(int64)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType)
+ }
+ af.buf = strconv.AppendInt(af.buf, argInt, 10)
+ return nil
+ case types.UintType:
+ argUint, ok := arg.Value().(uint64)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType)
+ }
+ af.buf = strconv.AppendUint(af.buf, argUint, 10)
+ return nil
+ case types.DoubleType:
+ argDbl, ok := arg.Value().(float64)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.DoubleType)
+ }
+ if math.IsNaN(argDbl) {
+ af.buf = append(af.buf, "NaN"...)
+ return nil
+ }
+ if math.IsInf(argDbl, -1) {
+ af.buf = append(af.buf, "-Infinity"...)
+ return nil
+ }
+ if math.IsInf(argDbl, 1) {
+ af.buf = append(af.buf, "Infinity"...)
+ return nil
+ }
+ af.buf = strconv.AppendFloat(af.buf, argDbl, 'f', -1, 64)
+ return nil
+ case types.BytesType:
+ argBytes, ok := arg.Value().([]byte)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.BytesType)
+ }
+ af.buf = append(af.buf, argBytes...)
+ return nil
+ case types.StringType:
+ argStr, ok := arg.Value().(string)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.StringType)
+ }
+ af.buf = append(af.buf, argStr...)
+ return nil
+ case types.DurationType:
+ argDur, ok := arg.Value().(time.Duration)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.DurationType)
+ }
+ af.buf = strconv.AppendFloat(af.buf, argDur.Seconds(), 'f', -1, 64)
+ af.buf = append(af.buf, "s"...)
+ return nil
+ case types.TimestampType:
+ argTime, ok := arg.Value().(time.Time)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.TimestampType)
+ }
+ af.buf = argTime.UTC().AppendFormat(af.buf, time.RFC3339Nano)
+ return nil
+ case types.NullType:
+ af.buf = append(af.buf, "null"...)
+ return nil
+ case types.TypeType:
+ argType, ok := arg.Value().(string)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.TypeType)
+ }
+ af.buf = append(af.buf, argType...)
+ return nil
+ case types.ListType:
+ argList, ok := arg.(traits.Lister)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.ListType)
+ }
+ argIter := argList.Iterator()
+ af.buf = append(af.buf, "["...)
+ if argIter.HasNext() == types.True {
+ if err := af.format(argIter.Next()); err != nil {
+ return err
+ }
+ for argIter.HasNext() == types.True {
+ af.buf = append(af.buf, ", "...)
+ if err := af.format(argIter.Next()); err != nil {
+ return err
+ }
+ }
+ }
+ af.buf = append(af.buf, "]"...)
+ return nil
+ case types.MapType:
+ argMap, ok := arg.(traits.Mapper)
+ if !ok {
+ return fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.MapType)
+ }
+ argIter := argMap.Iterator()
+ ents := []formattedMapEntryV2{}
+ for argIter.HasNext() == types.True {
+ key := argIter.Next()
+ val, ok := argMap.Find(key)
+ if !ok {
+ return fmt.Errorf("key missing from map: '%s'", key)
+ }
+ keyStr, err := formatStringV2(key)
+ if err != nil {
+ return err
+ }
+ valStr, err := formatStringV2(val)
+ if err != nil {
+ return err
+ }
+ ents = append(ents, formattedMapEntryV2{keyStr, valStr})
+ }
+ sort.SliceStable(ents, func(x, y int) bool {
+ return ents[x].key < ents[y].key
+ })
+ af.buf = append(af.buf, "{"...)
+ for i, e := range ents {
+ if i > 0 {
+ af.buf = append(af.buf, ", "...)
+ }
+ af.buf = append(af.buf, e.key...)
+ af.buf = append(af.buf, ": "...)
+ af.buf = append(af.buf, e.val...)
+ }
+ af.buf = append(af.buf, "}"...)
+ return nil
+ default:
+ return stringFormatErrorV2(runtimeID, arg.Type().TypeName())
+ }
+}
+
+func formatStringV2(arg ref.Val) (string, error) {
+ var fmter appendingFormatterV2
+ if err := fmter.format(arg); err != nil {
+ return "", err
+ }
+ return string(fmter.buf), nil
+}
+
+type stringFormatterV2 struct{}
+
+// String implements formatStringInterpolatorV2.String.
+func (c *stringFormatterV2) String(arg ref.Val) (string, error) {
+ return formatStringV2(arg)
+}
+
+// Decimal implements formatStringInterpolatorV2.Decimal.
+func (c *stringFormatterV2) Decimal(arg ref.Val) (string, error) {
+ switch arg.Type() {
+ case types.IntType:
+ argInt, ok := arg.Value().(int64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType)
+ }
+ return strconv.FormatInt(argInt, 10), nil
+ case types.UintType:
+ argUint, ok := arg.Value().(uint64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType)
+ }
+ return strconv.FormatUint(argUint, 10), nil
+ case types.DoubleType:
+ argDbl, ok := arg.Value().(float64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.DoubleType)
+ }
+ if math.IsNaN(argDbl) {
+ return "NaN", nil
+ }
+ if math.IsInf(argDbl, -1) {
+ return "-Infinity", nil
+ }
+ if math.IsInf(argDbl, 1) {
+ return "Infinity", nil
+ }
+ return strconv.FormatFloat(argDbl, 'f', -1, 64), nil
+ default:
+ return "", decimalFormatErrorV2(runtimeID, arg.Type().TypeName())
+ }
+}
+
+// Fixed implements formatStringInterpolatorV2.Fixed.
+func (c *stringFormatterV2) Fixed(precision int) func(ref.Val) (string, error) {
+ return func(arg ref.Val) (string, error) {
+ fmtStr := fmt.Sprintf("%%.%df", precision)
+ switch arg.Type() {
+ case types.IntType:
+ argInt, ok := arg.Value().(int64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType)
+ }
+ return fmt.Sprintf(fmtStr, argInt), nil
+ case types.UintType:
+ argUint, ok := arg.Value().(uint64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType)
+ }
+ return fmt.Sprintf(fmtStr, argUint), nil
+ case types.DoubleType:
+ argDbl, ok := arg.Value().(float64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.DoubleType)
+ }
+ if math.IsNaN(argDbl) {
+ return "NaN", nil
+ }
+ if math.IsInf(argDbl, -1) {
+ return "-Infinity", nil
+ }
+ if math.IsInf(argDbl, 1) {
+ return "Infinity", nil
+ }
+ return fmt.Sprintf(fmtStr, argDbl), nil
+ default:
+ return "", fixedPointFormatErrorV2(runtimeID, arg.Type().TypeName())
+ }
+ }
+}
+
+// Scientific implements formatStringInterpolatorV2.Scientific.
+func (c *stringFormatterV2) Scientific(precision int) func(ref.Val) (string, error) {
+ return func(arg ref.Val) (string, error) {
+ fmtStr := fmt.Sprintf("%%1.%de", precision)
+ switch arg.Type() {
+ case types.IntType:
+ argInt, ok := arg.Value().(int64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType)
+ }
+ return fmt.Sprintf(fmtStr, argInt), nil
+ case types.UintType:
+ argUint, ok := arg.Value().(uint64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType)
+ }
+ return fmt.Sprintf(fmtStr, argUint), nil
+ case types.DoubleType:
+ argDbl, ok := arg.Value().(float64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.DoubleType)
+ }
+ if math.IsNaN(argDbl) {
+ return "NaN", nil
+ }
+ if math.IsInf(argDbl, -1) {
+ return "-Infinity", nil
+ }
+ if math.IsInf(argDbl, 1) {
+ return "Infinity", nil
+ }
+ return fmt.Sprintf(fmtStr, argDbl), nil
+ default:
+ return "", scientificFormatErrorV2(runtimeID, arg.Type().TypeName())
+ }
+ }
+}
+
+// Binary implements formatStringInterpolatorV2.Binary.
+func (c *stringFormatterV2) Binary(arg ref.Val) (string, error) {
+ switch arg.Type() {
+ case types.BoolType:
+ argBool, ok := arg.Value().(bool)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.BoolType)
+ }
+ if argBool {
+ return "1", nil
+ }
+ return "0", nil
+ case types.IntType:
+ argInt, ok := arg.Value().(int64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType)
+ }
+ return strconv.FormatInt(argInt, 2), nil
+ case types.UintType:
+ argUint, ok := arg.Value().(uint64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType)
+ }
+ return strconv.FormatUint(argUint, 2), nil
+ default:
+ return "", binaryFormatErrorV2(runtimeID, arg.Type().TypeName())
+ }
+}
+
+// Hex implements formatStringInterpolatorV2.Hex.
+func (c *stringFormatterV2) Hex(useUpper bool) func(ref.Val) (string, error) {
+ return func(arg ref.Val) (string, error) {
+ var fmtStr string
+ if useUpper {
+ fmtStr = "%X"
+ } else {
+ fmtStr = "%x"
+ }
+ switch arg.Type() {
+ case types.IntType:
+ argInt, ok := arg.Value().(int64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType)
+ }
+ return fmt.Sprintf(fmtStr, argInt), nil
+ case types.UintType:
+ argUint, ok := arg.Value().(uint64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType)
+ }
+ return fmt.Sprintf(fmtStr, argUint), nil
+ case types.StringType:
+ argStr, ok := arg.Value().(string)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.StringType)
+ }
+ return fmt.Sprintf(fmtStr, argStr), nil
+ case types.BytesType:
+ argBytes, ok := arg.Value().([]byte)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.BytesType)
+ }
+ return fmt.Sprintf(fmtStr, argBytes), nil
+ default:
+ return "", hexFormatErrorV2(runtimeID, arg.Type().TypeName())
+ }
+ }
+}
+
+// Octal implements formatStringInterpolatorV2.Octal.
+func (c *stringFormatterV2) Octal(arg ref.Val) (string, error) {
+ switch arg.Type() {
+ case types.IntType:
+ argInt, ok := arg.Value().(int64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.IntType)
+ }
+ return strconv.FormatInt(argInt, 8), nil
+ case types.UintType:
+ argUint, ok := arg.Value().(uint64)
+ if !ok {
+ return "", fmt.Errorf("type conversion error from '%s' to '%s'", arg.Type(), types.UintType)
+ }
+ return strconv.FormatUint(argUint, 8), nil
+ default:
+ return "", octalFormatErrorV2(runtimeID, arg.Type().TypeName())
+ }
+}
+
+// stringFormatValidatorV2 implements the cel.ASTValidator interface allowing for static validation
+// of string.format calls.
+type stringFormatValidatorV2 struct{}
+
+// Name returns the name of the validator.
+func (stringFormatValidatorV2) Name() string {
+ return "cel.validator.string_format"
+}
+
+// Configure implements the ASTValidatorConfigurer interface and augments the list of functions to skip
+// during homogeneous aggregate literal type-checks.
+func (stringFormatValidatorV2) Configure(config cel.MutableValidatorConfig) error {
+ functions := config.GetOrDefault(cel.HomogeneousAggregateLiteralExemptFunctions, []string{}).([]string)
+ functions = append(functions, "format")
+ return config.Set(cel.HomogeneousAggregateLiteralExemptFunctions, functions)
+}
+
+// Validate parses all literal format strings and type checks the format clause against the argument
+// at the corresponding ordinal within the list literal argument to the function, if one is specified.
+func (stringFormatValidatorV2) Validate(env *cel.Env, _ cel.ValidatorConfig, a *ast.AST, iss *cel.Issues) {
+ root := ast.NavigateAST(a)
+ formatCallExprs := ast.MatchDescendants(root, matchConstantFormatStringWithListLiteralArgs(a))
+ for _, e := range formatCallExprs {
+ call := e.AsCall()
+ formatStr := call.Target().AsLiteral().Value().(string)
+ args := call.Args()[0].AsList().Elements()
+ formatCheck := &stringFormatCheckerV2{
+ args: args,
+ ast: a,
+ }
+ // use a placeholder locale, since locale doesn't affect syntax
+ _, err := parseFormatStringV2(formatStr, formatCheck, formatCheck)
+ if err != nil {
+ iss.ReportErrorAtID(getErrorExprID(e.ID(), err), "%v", err)
+ continue
+ }
+ seenArgs := formatCheck.argsRequested
+ if len(args) > seenArgs {
+ iss.ReportErrorAtID(e.ID(),
+ "too many arguments supplied to string.format (expected %d, got %d)", seenArgs, len(args))
+ }
+ }
+}
+
+// stringFormatCheckerV2 implements the formatStringInterpolater interface
+type stringFormatCheckerV2 struct {
+ args []ast.Expr
+ argsRequested int
+ currArgIndex int64
+ ast *ast.AST
+}
+
+// String implements formatStringInterpolatorV2.String.
+func (c *stringFormatCheckerV2) String(arg ref.Val) (string, error) {
+ formatArg := c.args[c.currArgIndex]
+ valid, badID := c.verifyString(formatArg)
+ if !valid {
+ return "", stringFormatErrorV2(badID, c.typeOf(badID).TypeName())
+ }
+ return "", nil
+}
+
+// Decimal implements formatStringInterpolatorV2.Decimal.
+func (c *stringFormatCheckerV2) Decimal(arg ref.Val) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.DoubleType)
+ if !valid {
+ return "", decimalFormatErrorV2(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+}
+
+// Fixed implements formatStringInterpolatorV2.Fixed.
+func (c *stringFormatCheckerV2) Fixed(precision int) func(ref.Val) (string, error) {
+ return func(arg ref.Val) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.DoubleType)
+ if !valid {
+ return "", fixedPointFormatErrorV2(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+ }
+}
+
+// Scientific implements formatStringInterpolatorV2.Scientific.
+func (c *stringFormatCheckerV2) Scientific(precision int) func(ref.Val) (string, error) {
+ return func(arg ref.Val) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.DoubleType)
+ if !valid {
+ return "", scientificFormatErrorV2(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+ }
+}
+
+// Binary implements formatStringInterpolatorV2.Binary.
+func (c *stringFormatCheckerV2) Binary(arg ref.Val) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.BoolType, types.IntType, types.UintType)
+ if !valid {
+ return "", binaryFormatErrorV2(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+}
+
+// Hex implements formatStringInterpolatorV2.Hex.
+func (c *stringFormatCheckerV2) Hex(useUpper bool) func(ref.Val) (string, error) {
+ return func(arg ref.Val) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.StringType, types.BytesType)
+ if !valid {
+ return "", hexFormatErrorV2(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+ }
+}
+
+// Octal implements formatStringInterpolatorV2.Octal.
+func (c *stringFormatCheckerV2) Octal(arg ref.Val) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType)
+ if !valid {
+ return "", octalFormatErrorV2(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+}
+
+// Arg implements formatListArgs.Arg.
+func (c *stringFormatCheckerV2) Arg(index int64) (ref.Val, error) {
+ c.argsRequested++
+ c.currArgIndex = index
+ // return a dummy value - this is immediately passed to back to us
+ // through one of the FormatCallback functions, so anything will do
+ return types.Int(0), nil
+}
+
+// Size implements formatListArgs.Size.
+func (c *stringFormatCheckerV2) Size() int64 {
+ return int64(len(c.args))
+}
+
+func (c *stringFormatCheckerV2) typeOf(id int64) *cel.Type {
+ return c.ast.GetType(id)
+}
+
+func (c *stringFormatCheckerV2) verifyTypeOneOf(id int64, validTypes ...*cel.Type) bool {
+ t := c.typeOf(id)
+ if t == cel.DynType {
+ return true
+ }
+ for _, vt := range validTypes {
+ // Only check runtime type compatibility without delving deeper into parameterized types
+ if t.Kind() == vt.Kind() {
+ return true
+ }
+ }
+ return false
+}
+
+func (c *stringFormatCheckerV2) verifyString(sub ast.Expr) (bool, int64) {
+ paramA := cel.TypeParamType("A")
+ paramB := cel.TypeParamType("B")
+ subVerified := c.verifyTypeOneOf(sub.ID(),
+ cel.ListType(paramA), cel.MapType(paramA, paramB),
+ cel.IntType, cel.UintType, cel.DoubleType, cel.BoolType, cel.StringType,
+ cel.TimestampType, cel.BytesType, cel.DurationType, cel.TypeType, cel.NullType)
+ if !subVerified {
+ return false, sub.ID()
+ }
+ switch sub.Kind() {
+ case ast.ListKind:
+ for _, e := range sub.AsList().Elements() {
+ // recursively verify if we're dealing with a list/map
+ verified, id := c.verifyString(e)
+ if !verified {
+ return false, id
+ }
+ }
+ return true, sub.ID()
+ case ast.MapKind:
+ for _, e := range sub.AsMap().Entries() {
+ // recursively verify if we're dealing with a list/map
+ entry := e.AsMapEntry()
+ verified, id := c.verifyString(entry.Key())
+ if !verified {
+ return false, id
+ }
+ verified, id = c.verifyString(entry.Value())
+ if !verified {
+ return false, id
+ }
+ }
+ return true, sub.ID()
+ default:
+ return true, sub.ID()
+ }
+}
+
+// helper routines for reporting common errors during string formatting static validation and
+// runtime execution.
+
+func binaryFormatErrorV2(id int64, badType string) error {
+ return newFormatError(id, "only ints, uints, and bools can be formatted as binary, was given %s", badType)
+}
+
+func decimalFormatErrorV2(id int64, badType string) error {
+ return newFormatError(id, "decimal clause can only be used on ints, uints, and doubles, was given %s", badType)
+}
+
+func fixedPointFormatErrorV2(id int64, badType string) error {
+ return newFormatError(id, "fixed-point clause can only be used on ints, uints, and doubles, was given %s", badType)
+}
+
+func hexFormatErrorV2(id int64, badType string) error {
+ return newFormatError(id, "only ints, uints, bytes, and strings can be formatted as hex, was given %s", badType)
+}
+
+func octalFormatErrorV2(id int64, badType string) error {
+ return newFormatError(id, "octal clause can only be used on ints and uints, was given %s", badType)
+}
+
+func scientificFormatErrorV2(id int64, badType string) error {
+ return newFormatError(id, "scientific clause can only be used on ints, uints, and doubles, was given %s", badType)
+}
+
+func stringFormatErrorV2(id int64, badType string) error {
+ return newFormatError(id, "string clause can only be used on strings, bools, bytes, ints, doubles, maps, lists, types, durations, and timestamps, was given %s", badType)
+}
+
+// formatStringInterpolatorV2 is an interface that allows user-defined behavior
+// for formatting clause implementations, as well as argument retrieval.
+// Each function is expected to support the appropriate types as laid out in
+// the string.format documentation, and to return an error if given an inappropriate type.
+type formatStringInterpolatorV2 interface {
+ // String takes a ref.Val and a string representing the current locale identifier
+ // and returns the Val formatted as a string, or an error if one occurred.
+ String(ref.Val) (string, error)
+
+ // Decimal takes a ref.Val and a string representing the current locale identifier
+ // and returns the Val formatted as a decimal integer, or an error if one occurred.
+ Decimal(ref.Val) (string, error)
+
+ // Fixed takes an int pointer representing precision (or nil if none was given) and
+ // returns a function operating in a similar manner to String and Decimal, taking a
+ // ref.Val and locale and returning the appropriate string. A closure is returned
+ // so precision can be set without needing an additional function call/configuration.
+ Fixed(int) func(ref.Val) (string, error)
+
+ // Scientific functions identically to Fixed, except the string returned from the closure
+ // is expected to be in scientific notation.
+ Scientific(int) func(ref.Val) (string, error)
+
+ // Binary takes a ref.Val and a string representing the current locale identifier
+ // and returns the Val formatted as a binary integer, or an error if one occurred.
+ Binary(ref.Val) (string, error)
+
+ // Hex takes a boolean that, if true, indicates the hex string output by the returned
+ // closure should use uppercase letters for A-F.
+ Hex(bool) func(ref.Val) (string, error)
+
+ // Octal takes a ref.Val and a string representing the current locale identifier and
+ // returns the Val formatted in octal, or an error if one occurred.
+ Octal(ref.Val) (string, error)
+}
+
+// parseFormatString formats a string according to the string.format syntax, taking the clause implementations
+// from the provided FormatCallback and the args from the given FormatList.
+func parseFormatStringV2(formatStr string, callback formatStringInterpolatorV2, list formatListArgs) (string, error) {
+ i := 0
+ argIndex := 0
+ var builtStr strings.Builder
+ for i < len(formatStr) {
+ if formatStr[i] == '%' {
+ if i+1 < len(formatStr) && formatStr[i+1] == '%' {
+ err := builtStr.WriteByte('%')
+ if err != nil {
+ return "", fmt.Errorf("error writing format string: %w", err)
+ }
+ i += 2
+ continue
+ } else {
+ argAny, err := list.Arg(int64(argIndex))
+ if err != nil {
+ return "", err
+ }
+ if i+1 >= len(formatStr) {
+ return "", errors.New("unexpected end of string")
+ }
+ if int64(argIndex) >= list.Size() {
+ return "", fmt.Errorf("index %d out of range", argIndex)
+ }
+ numRead, val, refErr := parseAndFormatClauseV2(formatStr[i:], argAny, callback, list)
+ if refErr != nil {
+ return "", refErr
+ }
+ _, err = builtStr.WriteString(val)
+ if err != nil {
+ return "", fmt.Errorf("error writing format string: %w", err)
+ }
+ i += numRead
+ argIndex++
+ }
+ } else {
+ err := builtStr.WriteByte(formatStr[i])
+ if err != nil {
+ return "", fmt.Errorf("error writing format string: %w", err)
+ }
+ i++
+ }
+ }
+ return builtStr.String(), nil
+}
+
+// parseAndFormatClause parses the format clause at the start of the given string with val, and returns
+// how many characters were consumed and the substituted string form of val, or an error if one occurred.
+func parseAndFormatClauseV2(formatStr string, val ref.Val, callback formatStringInterpolatorV2, list formatListArgs) (int, string, error) {
+ i := 1
+ read, formatter, err := parseFormattingClauseV2(formatStr[i:], callback)
+ i += read
+ if err != nil {
+ return -1, "", newParseFormatError("could not parse formatting clause", err)
+ }
+
+ valStr, err := formatter(val)
+ if err != nil {
+ return -1, "", newParseFormatError("error during formatting", err)
+ }
+ return i, valStr, nil
+}
+
+func parseFormattingClauseV2(formatStr string, callback formatStringInterpolatorV2) (int, clauseImplV2, error) {
+ i := 0
+ read, precision, err := parsePrecisionV2(formatStr[i:])
+ i += read
+ if err != nil {
+ return -1, nil, fmt.Errorf("error while parsing precision: %w", err)
+ }
+ r := rune(formatStr[i])
+ i++
+ switch r {
+ case 's':
+ return i, callback.String, nil
+ case 'd':
+ return i, callback.Decimal, nil
+ case 'f':
+ return i, callback.Fixed(precision), nil
+ case 'e':
+ return i, callback.Scientific(precision), nil
+ case 'b':
+ return i, callback.Binary, nil
+ case 'x', 'X':
+ return i, callback.Hex(unicode.IsUpper(r)), nil
+ case 'o':
+ return i, callback.Octal, nil
+ default:
+ return -1, nil, fmt.Errorf("unrecognized formatting clause \"%c\"", r)
+ }
+}
+
+func parsePrecisionV2(formatStr string) (int, int, error) {
+ i := 0
+ if formatStr[i] != '.' {
+ return i, defaultPrecision, nil
+ }
+ i++
+ var buffer strings.Builder
+ for {
+ if i >= len(formatStr) {
+ return -1, -1, errors.New("could not find end of precision specifier")
+ }
+ if !isASCIIDigit(rune(formatStr[i])) {
+ break
+ }
+ buffer.WriteByte(formatStr[i])
+ i++
+ }
+ precision, err := strconv.Atoi(buffer.String())
+ if err != nil {
+ return -1, -1, fmt.Errorf("error while converting precision to integer: %w", err)
+ }
+ if precision < 0 {
+ return -1, -1, fmt.Errorf("negative precision: %d", precision)
+ }
+ return i, precision, nil
+}
diff --git a/vendor/github.com/google/cel-go/ext/guards.go b/vendor/github.com/google/cel-go/ext/guards.go
index ccede289f..1461c0416 100644
--- a/vendor/github.com/google/cel-go/ext/guards.go
+++ b/vendor/github.com/google/cel-go/ext/guards.go
@@ -24,28 +24,28 @@ import (
func intOrError(i int64, err error) ref.Val {
if err != nil {
- return types.NewErr(err.Error())
+ return types.NewErrFromString(err.Error())
}
return types.Int(i)
}
func bytesOrError(bytes []byte, err error) ref.Val {
if err != nil {
- return types.NewErr(err.Error())
+ return types.NewErrFromString(err.Error())
}
return types.Bytes(bytes)
}
func stringOrError(str string, err error) ref.Val {
if err != nil {
- return types.NewErr(err.Error())
+ return types.NewErrFromString(err.Error())
}
return types.String(str)
}
func listStringOrError(strs []string, err error) ref.Val {
if err != nil {
- return types.NewErr(err.Error())
+ return types.NewErrFromString(err.Error())
}
return types.DefaultTypeAdapter.NativeToValue(strs)
}
diff --git a/vendor/github.com/google/cel-go/ext/lists.go b/vendor/github.com/google/cel-go/ext/lists.go
index d0b90ea92..b27ddf22f 100644
--- a/vendor/github.com/google/cel-go/ext/lists.go
+++ b/vendor/github.com/google/cel-go/ext/lists.go
@@ -20,11 +20,14 @@ import (
"sort"
"github.com/google/cel-go/cel"
+ "github.com/google/cel-go/checker"
+ "github.com/google/cel-go/common"
"github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/decls"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
+ "github.com/google/cel-go/interpreter"
"github.com/google/cel-go/parser"
)
@@ -44,7 +47,7 @@ var comparableTypes = []*cel.Type{
//
// # Distinct
//
-// Introduced in version: 2
+// Introduced in version: 2 (cost support in version 3)
//
// Returns the distinct elements of a list.
//
@@ -58,7 +61,7 @@ var comparableTypes = []*cel.Type{
//
// # Range
//
-// Introduced in version: 2
+// Introduced in version: 2 (cost support in version 3)
//
// Returns a list of integers from 0 to n-1.
//
@@ -70,7 +73,7 @@ var comparableTypes = []*cel.Type{
//
// # Reverse
//
-// Introduced in version: 2
+// Introduced in version: 2 (cost support in version 3)
//
// Returns the elements of a list in reverse order.
//
@@ -82,6 +85,8 @@ var comparableTypes = []*cel.Type{
//
// # Slice
//
+// Introduced in version: 0 (cost support in version 3)
+//
// Returns a new sub-list using the indexes provided.
//
// .slice(, ) ->
@@ -93,12 +98,14 @@ var comparableTypes = []*cel.Type{
//
// # Flatten
//
+// Introduced in version: 1 (cost support in version 3)
+//
// Flattens a list recursively.
-// If an optional depth is provided, the list is flattened to a the specificied level.
+// If an optional depth is provided, the list is flattened to a the specified level.
// A negative depth value will result in an error.
//
-// .flatten() ->
-// .flatten(, ) ->
+// .flatten() ->
+// .flatten() ->
//
// Examples:
//
@@ -110,7 +117,7 @@ var comparableTypes = []*cel.Type{
//
// # Sort
//
-// Introduced in version: 2
+// Introduced in version: 2 (cost support in version 3)
//
// Sorts a list with comparable elements. If the element type is not comparable
// or the element types are not the same, the function will produce an error.
@@ -127,6 +134,8 @@ var comparableTypes = []*cel.Type{
//
// # SortBy
//
+// Introduced in version: 2 (cost support in version 3)
+//
// Sorts a list by a key value, i.e., the order is determined by the result of
// an expression applied to each element of the list.
// The output of the key expression must be a comparable type, otherwise the
@@ -134,7 +143,7 @@ var comparableTypes = []*cel.Type{
//
// .sortBy(, ) ->
// keyExpr returns a value in {int, uint, double, bool, duration, timestamp, string, bytes}
-
+//
// Examples:
//
// [
@@ -143,15 +152,11 @@ var comparableTypes = []*cel.Type{
// Player { name: "baz", score: 1000 },
// ].sortBy(e, e.score).map(e, e.name)
// == ["bar", "foo", "baz"]
-
func Lists(options ...ListsOption) cel.EnvOption {
- l := &listsLib{
- version: math.MaxUint32,
- }
+ l := &listsLib{version: math.MaxUint32}
for _, o := range options {
l = o(l)
}
-
return cel.Lib(l)
}
@@ -211,9 +216,10 @@ func (lib listsLib) CompileOptions() []cel.EnvOption {
cel.MemberOverload("list_flatten",
[]*cel.Type{listListType}, listType,
cel.UnaryBinding(func(arg ref.Val) ref.Val {
+ // double-check as type-guards disabled
list, ok := arg.(traits.Lister)
if !ok {
- return types.MaybeNoSuchOverloadErr(arg)
+ return types.ValOrErr(arg, "no such overload: %v.flatten()", arg.Type())
}
flatList, err := flatten(list, 1)
if err != nil {
@@ -226,13 +232,14 @@ func (lib listsLib) CompileOptions() []cel.EnvOption {
cel.MemberOverload("list_flatten_int",
[]*cel.Type{listDyn, types.IntType}, listDyn,
cel.BinaryBinding(func(arg1, arg2 ref.Val) ref.Val {
+ // double-check as type-guards disabled
list, ok := arg1.(traits.Lister)
if !ok {
- return types.MaybeNoSuchOverloadErr(arg1)
+ return types.ValOrErr(arg1, "no such overload: %v.flatten(%v)", arg1.Type(), arg2.Type())
}
depth, ok := arg2.(types.Int)
if !ok {
- return types.MaybeNoSuchOverloadErr(arg2)
+ return types.ValOrErr(arg1, "no such overload: %v.flatten(%v)", arg1.Type(), arg2.Type())
}
flatList, err := flatten(list, int64(depth))
if err != nil {
@@ -260,10 +267,8 @@ func (lib listsLib) CompileOptions() []cel.EnvOption {
}),
cel.SingletonUnaryBinding(
func(arg ref.Val) ref.Val {
- list, ok := arg.(traits.Lister)
- if !ok {
- return types.MaybeNoSuchOverloadErr(arg)
- }
+ // validated by type-guards
+ list := arg.(traits.Lister)
sorted, err := sortList(list)
if err != nil {
return types.WrapErr(err)
@@ -287,15 +292,10 @@ func (lib listsLib) CompileOptions() []cel.EnvOption {
)
}),
cel.SingletonBinaryBinding(
- func(arg1 ref.Val, arg2 ref.Val) ref.Val {
- list, ok := arg1.(traits.Lister)
- if !ok {
- return types.MaybeNoSuchOverloadErr(arg1)
- }
- keys, ok := arg2.(traits.Lister)
- if !ok {
- return types.MaybeNoSuchOverloadErr(arg2)
- }
+ func(arg1, arg2 ref.Val) ref.Val {
+ // validated by type-guards
+ list := arg1.(traits.Lister)
+ keys := arg2.(traits.Lister)
sorted, err := sortListByAssociatedKeys(list, keys)
if err != nil {
return types.WrapErr(err)
@@ -312,9 +312,8 @@ func (lib listsLib) CompileOptions() []cel.EnvOption {
opts = append(opts, cel.Function("lists.range",
cel.Overload("lists_range",
[]*cel.Type{cel.IntType}, cel.ListType(cel.IntType),
- cel.FunctionBinding(func(args ...ref.Val) ref.Val {
- n := args[0].(types.Int)
- result, err := genRange(n)
+ cel.UnaryBinding(func(n ref.Val) ref.Val {
+ result, err := genRange(n.(types.Int))
if err != nil {
return types.WrapErr(err)
}
@@ -325,9 +324,8 @@ func (lib listsLib) CompileOptions() []cel.EnvOption {
opts = append(opts, cel.Function("reverse",
cel.MemberOverload("list_reverse",
[]*cel.Type{listType}, listType,
- cel.FunctionBinding(func(args ...ref.Val) ref.Val {
- list := args[0].(traits.Lister)
- result, err := reverseList(list)
+ cel.UnaryBinding(func(list ref.Val) ref.Val {
+ result, err := reverseList(list.(traits.Lister))
if err != nil {
return types.WrapErr(err)
}
@@ -348,13 +346,61 @@ func (lib listsLib) CompileOptions() []cel.EnvOption {
),
))
}
+ if lib.version >= 3 {
+ estimators := []checker.CostOption{
+ checker.OverloadCostEstimate("list_slice", estimateListSlice),
+ checker.OverloadCostEstimate("list_flatten", estimateListFlatten),
+ checker.OverloadCostEstimate("list_flatten_int", estimateListFlatten),
+ checker.OverloadCostEstimate("lists_range", estimateListsRange),
+ checker.OverloadCostEstimate("list_reverse", estimateListReverse),
+ checker.OverloadCostEstimate("list_distinct", estimateListDistinct),
+ }
+ for _, t := range comparableTypes {
+ estimators = append(estimators,
+ checker.OverloadCostEstimate(
+ fmt.Sprintf("list_%s_sort", t.TypeName()),
+ estimateListSort(t),
+ ),
+ checker.OverloadCostEstimate(
+ fmt.Sprintf("list_%s_sortByAssociatedKeys", t.TypeName()),
+ estimateListSortBy(t),
+ ),
+ )
+ }
+ opts = append(opts, cel.CostEstimatorOptions(estimators...))
+ }
return opts
}
// ProgramOptions implements the Library interface method.
-func (listsLib) ProgramOptions() []cel.ProgramOption {
- return []cel.ProgramOption{}
+func (lib *listsLib) ProgramOptions() []cel.ProgramOption {
+ var opts []cel.ProgramOption
+ if lib.version >= 3 {
+ // TODO: Add cost trackers for list operations
+ trackers := []interpreter.CostTrackerOption{
+ interpreter.OverloadCostTracker("list_slice", trackListOutputSize),
+ interpreter.OverloadCostTracker("list_flatten", trackListFlatten),
+ interpreter.OverloadCostTracker("list_flatten_int", trackListFlatten),
+ interpreter.OverloadCostTracker("lists_range", trackListOutputSize),
+ interpreter.OverloadCostTracker("list_reverse", trackListOutputSize),
+ interpreter.OverloadCostTracker("list_distinct", trackListDistinct),
+ }
+ for _, t := range comparableTypes {
+ trackers = append(trackers,
+ interpreter.OverloadCostTracker(
+ fmt.Sprintf("list_%s_sort", t.TypeName()),
+ trackListSort,
+ ),
+ interpreter.OverloadCostTracker(
+ fmt.Sprintf("list_%s_sortByAssociatedKeys", t.TypeName()),
+ trackListSortBy,
+ ),
+ )
+ }
+ opts = append(opts, cel.CostTrackerOptions(trackers...))
+ }
+ return opts
}
func genRange(n types.Int) (ref.Val, error) {
@@ -459,20 +505,24 @@ func sortListByAssociatedKeys(list, keys traits.Lister) (ref.Val, error) {
sortedIndices := make([]ref.Val, 0, listLength)
for i := types.IntZero; i < listLength; i++ {
- if keys.Get(i).Type() != elem.Type() {
- return nil, fmt.Errorf("list elements must have the same type")
- }
sortedIndices = append(sortedIndices, i)
}
+ var err error
sort.Slice(sortedIndices, func(i, j int) bool {
iKey := keys.Get(sortedIndices[i])
jKey := keys.Get(sortedIndices[j])
+ if iKey.Type() != elem.Type() || jKey.Type() != elem.Type() {
+ err = fmt.Errorf("list elements must have the same type")
+ return false
+ }
return iKey.(traits.Comparer).Compare(jKey) == types.IntNegOne
})
+ if err != nil {
+ return nil, err
+ }
sorted := make([]ref.Val, 0, listLength)
-
for _, sortedIdx := range sortedIndices {
sorted = append(sorted, list.Get(sortedIdx))
}
@@ -498,8 +548,9 @@ func sortByMacro(meh cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (as
if targetKind != ast.ListKind &&
targetKind != ast.SelectKind &&
targetKind != ast.IdentKind &&
- targetKind != ast.ComprehensionKind && targetKind != ast.CallKind {
- return nil, meh.NewError(target.ID(), fmt.Sprintf("sortBy can only be applied to a list, identifier, comprehension, call or select expression"))
+ targetKind != ast.ComprehensionKind &&
+ targetKind != ast.CallKind {
+ return nil, meh.NewError(target.ID(), "sortBy can only be applied to a list, identifier, comprehension, call or select expression")
}
mapCompr, err := parser.MakeMap(meh, meh.Copy(varIdent), args)
@@ -558,3 +609,171 @@ func templatedOverloads(types []*cel.Type, template func(t *cel.Type) cel.Functi
}
return overloads
}
+
+// estimateListSlice computes an O(n) slice operation with a cost factor of 1.
+func estimateListSlice(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
+ if target == nil || len(args) != 2 {
+ return nil
+ }
+ sz := estimateSize(estimator, *target)
+ start := nodeAsIntValue(args[0], 0)
+ end := nodeAsIntValue(args[1], sz.Max)
+ return estimateAllocatingListCall(1, checker.FixedSizeEstimate(end-start))
+}
+
+// estimateListsRange computes an O(n) range operation with a cost factor of 1.
+func estimateListsRange(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
+ if target != nil || len(args) != 1 {
+ return nil
+ }
+ return estimateAllocatingListCall(1, checker.FixedSizeEstimate(nodeAsIntValue(args[0], math.MaxUint)))
+}
+
+// estimateListReverse computes an O(n) reverse operation with a cost factor of 1.
+func estimateListReverse(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
+ if target == nil || len(args) != 0 {
+ return nil
+ }
+ return estimateAllocatingListCall(1, estimateSize(estimator, *target))
+}
+
+// estimateListFlatten computes an O(n) flatten operation with a cost factor proportional to the flatten depth.
+func estimateListFlatten(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
+ if target == nil || len(args) > 1 {
+ return nil
+ }
+ depth := uint64(1)
+ if len(args) == 1 {
+ depth = nodeAsIntValue(args[0], math.MaxUint)
+ }
+ return estimateAllocatingListCall(float64(depth), estimateSize(estimator, *target))
+}
+
+// Compute an O(n^2) with a cost factor of 2, equivalent to sets.contains with a result list
+// which can vary in size from 1 element to the original list size.
+func estimateListDistinct(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
+ if target == nil || len(args) != 0 {
+ return nil
+ }
+ sz := estimateSize(estimator, *target)
+ costFactor := 2.0
+ return estimateAllocatingListCall(costFactor, sz.Multiply(sz))
+}
+
+// estimateListSort computes an O(n^2) sort operation with a cost factor of 2 for the equality
+// operations against the elements in the list against themselves which occur during the sort computation.
+func estimateListSort(t *types.Type) checker.FunctionEstimator {
+ return func(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
+ if target == nil || len(args) != 0 {
+ return nil
+ }
+ return estimateListSortCost(estimator, *target, t)
+ }
+}
+
+// estimateListSortBy computes an O(n^2) sort operation with a cost factor of 2 for the equality
+// operations against the sort index list which occur during the sort computation.
+func estimateListSortBy(u *types.Type) checker.FunctionEstimator {
+ return func(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
+ if target == nil || len(args) != 1 {
+ return nil
+ }
+ // Estimate the size of the list used as the sort index
+ return estimateListSortCost(estimator, args[0], u)
+ }
+}
+
+// estimateListSortCost estimates an O(n^2) sort operation with a cost factor of 2 for the equality
+// operations which occur during the sort computation.
+func estimateListSortCost(estimator checker.CostEstimator, node checker.AstNode, elemType *types.Type) *checker.CallEstimate {
+ sz := estimateSize(estimator, node)
+ costFactor := 2.0
+ switch elemType {
+ case types.StringType, types.BytesType:
+ costFactor += common.StringTraversalCostFactor
+ }
+ return estimateAllocatingListCall(costFactor, sz.Multiply(sz))
+}
+
+// estimateAllocatingListCall computes cost as a function of the size of the result list with a
+// baseline cost for the call dispatch and the associated list allocation.
+func estimateAllocatingListCall(costFactor float64, listSize checker.SizeEstimate) *checker.CallEstimate {
+ return estimateListCall(costFactor, listSize, true)
+}
+
+// estimateListCall computes cost as a function of the size of the target list and whether the
+// call allocates memory.
+func estimateListCall(costFactor float64, listSize checker.SizeEstimate, allocates bool) *checker.CallEstimate {
+ cost := listSize.MultiplyByCostFactor(costFactor).Add(callCostEstimate)
+ if allocates {
+ cost = cost.Add(checker.FixedCostEstimate(common.ListCreateBaseCost))
+ }
+ return &checker.CallEstimate{CostEstimate: cost, ResultSize: &listSize}
+}
+
+// trackListOutputSize computes cost as a function of the size of the result list.
+func trackListOutputSize(_ []ref.Val, result ref.Val) *uint64 {
+ return trackAllocatingListCall(1, actualSize(result))
+}
+
+// trackListFlatten computes cost as a function of the size of the result list and the depth of
+// the flatten operation.
+func trackListFlatten(args []ref.Val, _ ref.Val) *uint64 {
+ depth := 1.0
+ if len(args) == 2 {
+ depth = float64(args[1].(types.Int))
+ }
+ inputSize := actualSize(args[0])
+ return trackAllocatingListCall(depth, inputSize)
+}
+
+// trackListDistinct computes costs as a worst-case O(n^2) operation over the input list.
+func trackListDistinct(args []ref.Val, _ ref.Val) *uint64 {
+ return trackListSelfCompare(args[0].(traits.Lister))
+}
+
+// trackListSort computes costs as a worst-case O(n^2) operation over the input list.
+func trackListSort(args []ref.Val, result ref.Val) *uint64 {
+ return trackListSelfCompare(args[0].(traits.Lister))
+}
+
+// trackListSortBy computes costs as a worst-case O(n^2) operation over the sort index list.
+func trackListSortBy(args []ref.Val, result ref.Val) *uint64 {
+ return trackListSelfCompare(args[1].(traits.Lister))
+}
+
+// trackListSelfCompare computes costs as a worst-case O(n^2) operation over the input list.
+func trackListSelfCompare(l traits.Lister) *uint64 {
+ sz := actualSize(l)
+ costFactor := 2.0
+ if sz == 0 {
+ return trackAllocatingListCall(costFactor, 0)
+ }
+ elem := l.Get(types.IntZero)
+ if elem.Type() == types.StringType || elem.Type() == types.BytesType {
+ costFactor += common.StringTraversalCostFactor
+ }
+ return trackAllocatingListCall(costFactor, sz*sz)
+}
+
+// trackAllocatingListCall computes costs as a function of the size of the result list with a baseline cost
+// for the call dispatch and the associated list allocation.
+func trackAllocatingListCall(costFactor float64, size uint64) *uint64 {
+ cost := uint64(float64(size)*costFactor) + callCost + common.ListCreateBaseCost
+ return &cost
+}
+
+func nodeAsIntValue(node checker.AstNode, defaultVal uint64) uint64 {
+ if node.Expr().Kind() != ast.LiteralKind {
+ return defaultVal
+ }
+ lit := node.Expr().AsLiteral()
+ if lit.Type() != types.IntType {
+ return defaultVal
+ }
+ val := lit.(types.Int)
+ if val < types.IntZero {
+ return 0
+ }
+ return uint64(lit.(types.Int))
+}
diff --git a/vendor/github.com/google/cel-go/ext/math.go b/vendor/github.com/google/cel-go/ext/math.go
index 250246db1..6df8e3773 100644
--- a/vendor/github.com/google/cel-go/ext/math.go
+++ b/vendor/github.com/google/cel-go/ext/math.go
@@ -325,6 +325,23 @@ import (
//
// math.isFinite(0.0/0.0) // returns false
// math.isFinite(1.2) // returns true
+//
+// # Math.Sqrt
+//
+// Introduced at version: 2
+//
+// Returns the square root of the given input as double
+// Throws error for negative or non-numeric inputs
+//
+// math.sqrt() ->
+// math.sqrt() ->
+// math.sqrt() ->
+//
+// Examples:
+//
+// math.sqrt(81) // returns 9.0
+// math.sqrt(985.25) // returns 31.388692231439016
+// math.sqrt(-15) // returns NaN
func Math(options ...MathOption) cel.EnvOption {
m := &mathLib{version: math.MaxUint32}
for _, o := range options {
@@ -357,6 +374,9 @@ const (
absFunc = "math.abs"
signFunc = "math.sign"
+ // SquareRoot function
+ sqrtFunc = "math.sqrt"
+
// Bitwise functions
bitAndFunc = "math.bitAnd"
bitOrFunc = "math.bitOr"
@@ -548,6 +568,18 @@ func (lib *mathLib) CompileOptions() []cel.EnvOption {
),
)
}
+ if lib.version >= 2 {
+ opts = append(opts,
+ cel.Function(sqrtFunc,
+ cel.Overload("math_sqrt_double", []*cel.Type{cel.DoubleType}, cel.DoubleType,
+ cel.UnaryBinding(sqrt)),
+ cel.Overload("math_sqrt_int", []*cel.Type{cel.IntType}, cel.DoubleType,
+ cel.UnaryBinding(sqrt)),
+ cel.Overload("math_sqrt_uint", []*cel.Type{cel.UintType}, cel.DoubleType,
+ cel.UnaryBinding(sqrt)),
+ ),
+ )
+ }
return opts
}
@@ -691,6 +723,21 @@ func sign(val ref.Val) ref.Val {
}
}
+
+func sqrt(val ref.Val) ref.Val {
+ switch v := val.(type) {
+ case types.Double:
+ return types.Double(math.Sqrt(float64(v)))
+ case types.Int:
+ return types.Double(math.Sqrt(float64(v)))
+ case types.Uint:
+ return types.Double(math.Sqrt(float64(v)))
+ default:
+ return types.NewErr("no such overload: sqrt")
+ }
+}
+
+
func bitAndPairInt(first, second ref.Val) ref.Val {
l := first.(types.Int)
r := second.(types.Int)
diff --git a/vendor/github.com/google/cel-go/ext/native.go b/vendor/github.com/google/cel-go/ext/native.go
index 36ab4a7ae..ceaa274b7 100644
--- a/vendor/github.com/google/cel-go/ext/native.go
+++ b/vendor/github.com/google/cel-go/ext/native.go
@@ -17,6 +17,7 @@ package ext
import (
"errors"
"fmt"
+ "math"
"reflect"
"strings"
"time"
@@ -80,7 +81,7 @@ var (
// the time that it is invoked.
//
// There is also the possibility to rename the fields of native structs by setting the `cel` tag
-// for fields you want to override. In order to enable this feature, pass in the `EnableStructTag`
+// for fields you want to override. In order to enable this feature, pass in the `ParseStructTags(true)`
// option. Here is an example to see it in action:
//
// ```go
@@ -98,7 +99,9 @@ var (
func NativeTypes(args ...any) cel.EnvOption {
return func(env *cel.Env) (*cel.Env, error) {
nativeTypes := make([]any, 0, len(args))
- tpOptions := nativeTypeOptions{}
+ tpOptions := nativeTypeOptions{
+ version: math.MaxUint32,
+ }
for _, v := range args {
switch v := v.(type) {
@@ -128,6 +131,14 @@ func NativeTypes(args ...any) cel.EnvOption {
// NativeTypesOption is a functional interface for configuring handling of native types.
type NativeTypesOption func(*nativeTypeOptions) error
+// NativeTypesVersion sets the native types version support for native extensions functions.
+func NativeTypesVersion(version uint32) NativeTypesOption {
+ return func(opts *nativeTypeOptions) error {
+ opts.version = version
+ return nil
+ }
+}
+
// NativeTypesFieldNameHandler is a handler for mapping a reflect.StructField to a CEL field name.
// This can be used to override the default Go struct field to CEL field name mapping.
type NativeTypesFieldNameHandler = func(field reflect.StructField) string
@@ -158,6 +169,9 @@ type nativeTypeOptions struct {
// This is most commonly used for switching to parsing based off the struct field tag,
// such as "cel" or "json".
fieldNameHandler NativeTypesFieldNameHandler
+
+ // version is the native types library version.
+ version uint32
}
// ParseStructTags configures if native types field names should be overridable by CEL struct tags.
@@ -329,7 +343,7 @@ func (tp *nativeTypeProvider) NewValue(typeName string, fields map[string]ref.Va
}
fieldVal, err := val.ConvertToNative(refFieldDef.Type)
if err != nil {
- return types.NewErr(err.Error())
+ return types.NewErrFromString(err.Error())
}
refField := refVal.FieldByIndex(refFieldDef.Index)
refFieldVal := reflect.ValueOf(fieldVal)
@@ -436,7 +450,7 @@ func convertToCelType(refType reflect.Type) (*cel.Type, bool) {
func (tp *nativeTypeProvider) newNativeObject(val any, refValue reflect.Value) ref.Val {
valType, err := newNativeType(tp.options.fieldNameHandler, refValue.Type())
if err != nil {
- return types.NewErr(err.Error())
+ return types.NewErrFromString(err.Error())
}
return &nativeObj{
Adapter: tp,
@@ -595,7 +609,8 @@ func newNativeTypes(fieldNameHandler NativeTypesFieldNameHandler, rawType reflec
var iterateStructMembers func(reflect.Type)
iterateStructMembers = func(t reflect.Type) {
if k := t.Kind(); k == reflect.Pointer || k == reflect.Slice || k == reflect.Array || k == reflect.Map {
- t = t.Elem()
+ iterateStructMembers(t.Elem())
+ return
}
if t.Kind() != reflect.Struct {
return
diff --git a/vendor/github.com/google/cel-go/ext/protos.go b/vendor/github.com/google/cel-go/ext/protos.go
index 68796f60a..b09db25b0 100644
--- a/vendor/github.com/google/cel-go/ext/protos.go
+++ b/vendor/github.com/google/cel-go/ext/protos.go
@@ -15,6 +15,8 @@
package ext
import (
+ "math"
+
"github.com/google/cel-go/cel"
"github.com/google/cel-go/common/ast"
)
@@ -49,8 +51,23 @@ import (
// Examples:
//
// proto.hasExt(msg, google.expr.proto2.test.int32_ext) // returns true || false
-func Protos() cel.EnvOption {
- return cel.Lib(protoLib{})
+func Protos(options ...ProtosOption) cel.EnvOption {
+ l := &protoLib{version: math.MaxUint32}
+ for _, o := range options {
+ l = o(l)
+ }
+ return cel.Lib(l)
+}
+
+// ProtosOption declares a functional operator for configuring protobuf utilities.
+type ProtosOption func(*protoLib) *protoLib
+
+// ProtosVersion sets the library version for extensions for protobuf utilities.
+func ProtosVersion(version uint32) ProtosOption {
+ return func(lib *protoLib) *protoLib {
+ lib.version = version
+ return lib
+ }
}
var (
@@ -59,7 +76,9 @@ var (
getExtension = "getExt"
)
-type protoLib struct{}
+type protoLib struct {
+ version uint32
+}
// LibraryName implements the SingletonLibrary interface method.
func (protoLib) LibraryName() string {
diff --git a/vendor/github.com/google/cel-go/ext/regex.go b/vendor/github.com/google/cel-go/ext/regex.go
new file mode 100644
index 000000000..1a66f65d0
--- /dev/null
+++ b/vendor/github.com/google/cel-go/ext/regex.go
@@ -0,0 +1,332 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ext
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "regexp"
+ "strconv"
+ "strings"
+
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+)
+
+const (
+ regexReplace = "regex.replace"
+ regexExtract = "regex.extract"
+ regexExtractAll = "regex.extractAll"
+)
+
+// Regex returns a cel.EnvOption to configure extended functions for regular
+// expression operations.
+//
+// Note: all functions use the 'regex' namespace. If you are
+// currently using a variable named 'regex', the functions will likely work as
+// intended, however there is some chance for collision.
+//
+// This library depends on the CEL optional type. Please ensure that the
+// cel.OptionalTypes() is enabled when using regex extensions.
+//
+// # Replace
+//
+// The `regex.replace` function replaces all non-overlapping substring of a regex
+// pattern in the target string with a replacement string. Optionally, you can
+// limit the number of replacements by providing a count argument. When the count
+// is a negative number, the function acts as replace all. Only numeric (\N)
+// capture group references are supported in the replacement string, with
+// validation for correctness. Backslashed-escaped digits (\1 to \9) within the
+// replacement argument can be used to insert text matching the corresponding
+// parenthesized group in the regexp pattern. An error will be thrown for invalid
+// regex or replace string.
+//
+// regex.replace(target: string, pattern: string, replacement: string) -> string
+// regex.replace(target: string, pattern: string, replacement: string, count: int) -> string
+//
+// Examples:
+//
+// regex.replace('hello world hello', 'hello', 'hi') == 'hi world hi'
+// regex.replace('banana', 'a', 'x', 0) == 'banana'
+// regex.replace('banana', 'a', 'x', 1) == 'bxnana'
+// regex.replace('banana', 'a', 'x', 2) == 'bxnxna'
+// regex.replace('banana', 'a', 'x', -12) == 'bxnxnx'
+// regex.replace('foo bar', '(fo)o (ba)r', r'\2 \1') == 'ba fo'
+// regex.replace('test', '(.)', r'\2') \\ Runtime Error invalid replace string
+// regex.replace('foo bar', '(', '$2 $1') \\ Runtime Error invalid regex string
+// regex.replace('id=123', r'id=(?P\d+)', r'value: \values') \\ Runtime Error invalid replace string
+//
+// # Extract
+//
+// The `regex.extract` function returns the first match of a regex pattern in a
+// string. If no match is found, it returns an optional none value. An error will
+// be thrown for invalid regex or for multiple capture groups.
+//
+// regex.extract(target: string, pattern: string) -> optional
+//
+// Examples:
+//
+// regex.extract('hello world', 'hello(.*)') == optional.of(' world')
+// regex.extract('item-A, item-B', 'item-(\\w+)') == optional.of('A')
+// regex.extract('HELLO', 'hello') == optional.empty()
+// regex.extract('testuser@testdomain', '(.*)@([^.]*)') // Runtime Error multiple capture group
+//
+// # Extract All
+//
+// The `regex.extractAll` function returns a list of all matches of a regex
+// pattern in a target string. If no matches are found, it returns an empty list. An error will
+// be thrown for invalid regex or for multiple capture groups.
+//
+// regex.extractAll(target: string, pattern: string) -> list
+//
+// Examples:
+//
+// regex.extractAll('id:123, id:456', 'id:\\d+') == ['id:123', 'id:456']
+// regex.extractAll('id:123, id:456', 'assa') == []
+// regex.extractAll('testuser@testdomain', '(.*)@([^.]*)') // Runtime Error multiple capture group
+func Regex(options ...RegexOptions) cel.EnvOption {
+ s := ®exLib{
+ version: math.MaxUint32,
+ }
+ for _, o := range options {
+ s = o(s)
+ }
+ return cel.Lib(s)
+}
+
+// RegexOptions declares a functional operator for configuring regex extension.
+type RegexOptions func(*regexLib) *regexLib
+
+// RegexVersion configures the version of the Regex library definitions to use. See [Regex] for supported values.
+func RegexVersion(version uint32) RegexOptions {
+ return func(lib *regexLib) *regexLib {
+ lib.version = version
+ return lib
+ }
+}
+
+type regexLib struct {
+ version uint32
+}
+
+// LibraryName implements that SingletonLibrary interface method.
+func (r *regexLib) LibraryName() string {
+ return "cel.lib.ext.regex"
+}
+
+// CompileOptions implements the cel.Library interface method.
+func (r *regexLib) CompileOptions() []cel.EnvOption {
+ optionalTypesEnabled := func(env *cel.Env) (*cel.Env, error) {
+ if !env.HasLibrary("cel.lib.optional") {
+ return nil, errors.New("regex library requires the optional library")
+ }
+ return env, nil
+ }
+ opts := []cel.EnvOption{
+ cel.Function(regexExtract,
+ cel.Overload("regex_extract_string_string", []*cel.Type{cel.StringType, cel.StringType}, cel.OptionalType(cel.StringType),
+ cel.BinaryBinding(extract))),
+
+ cel.Function(regexExtractAll,
+ cel.Overload("regex_extractAll_string_string", []*cel.Type{cel.StringType, cel.StringType}, cel.ListType(cel.StringType),
+ cel.BinaryBinding(extractAll))),
+
+ cel.Function(regexReplace,
+ cel.Overload("regex_replace_string_string_string", []*cel.Type{cel.StringType, cel.StringType, cel.StringType}, cel.StringType,
+ cel.FunctionBinding(regReplace)),
+ cel.Overload("regex_replace_string_string_string_int", []*cel.Type{cel.StringType, cel.StringType, cel.StringType, cel.IntType}, cel.StringType,
+ cel.FunctionBinding((regReplaceN))),
+ ),
+ cel.EnvOption(optionalTypesEnabled),
+ }
+ return opts
+}
+
+// ProgramOptions implements the cel.Library interface method
+func (r *regexLib) ProgramOptions() []cel.ProgramOption {
+ return []cel.ProgramOption{}
+}
+
+func compileRegex(regexStr string) (*regexp.Regexp, error) {
+ re, err := regexp.Compile(regexStr)
+ if err != nil {
+ return nil, fmt.Errorf("given regex is invalid: %w", err)
+ }
+ return re, nil
+}
+
+func regReplace(args ...ref.Val) ref.Val {
+ target := args[0].(types.String)
+ regexStr := args[1].(types.String)
+ replaceStr := args[2].(types.String)
+
+ return regReplaceN(target, regexStr, replaceStr, types.Int(-1))
+}
+
+func regReplaceN(args ...ref.Val) ref.Val {
+ target := string(args[0].(types.String))
+ regexStr := string(args[1].(types.String))
+ replaceStr := string(args[2].(types.String))
+ replaceCount := int64(args[3].(types.Int))
+
+ if replaceCount == 0 {
+ return types.String(target)
+ }
+
+ if replaceCount > math.MaxInt32 {
+ return types.NewErr("integer overflow")
+ }
+
+ // If replaceCount is negative, just do a replaceAll.
+ if replaceCount < 0 {
+ replaceCount = -1
+ }
+
+ re, err := regexp.Compile(regexStr)
+ if err != nil {
+ return types.WrapErr(err)
+ }
+
+ var resultBuilder strings.Builder
+ var lastIndex int
+ counter := int64(0)
+
+ matches := re.FindAllStringSubmatchIndex(target, -1)
+
+ for _, match := range matches {
+ if replaceCount != -1 && counter >= replaceCount {
+ break
+ }
+
+ processedReplacement, err := replaceStrValidator(target, re, match, replaceStr)
+ if err != nil {
+ return types.WrapErr(err)
+ }
+
+ resultBuilder.WriteString(target[lastIndex:match[0]])
+ resultBuilder.WriteString(processedReplacement)
+ lastIndex = match[1]
+ counter++
+ }
+
+ resultBuilder.WriteString(target[lastIndex:])
+ return types.String(resultBuilder.String())
+}
+
+func replaceStrValidator(target string, re *regexp.Regexp, match []int, replacement string) (string, error) {
+ groupCount := re.NumSubexp()
+ var sb strings.Builder
+ runes := []rune(replacement)
+
+ for i := 0; i < len(runes); i++ {
+ c := runes[i]
+
+ if c != '\\' {
+ sb.WriteRune(c)
+ continue
+ }
+
+ if i+1 >= len(runes) {
+ return "", fmt.Errorf("invalid replacement string: '%s' \\ not allowed at end", replacement)
+ }
+
+ i++
+ nextChar := runes[i]
+
+ if nextChar == '\\' {
+ sb.WriteRune('\\')
+ continue
+ }
+
+ groupNum, err := strconv.Atoi(string(nextChar))
+ if err != nil {
+ return "", fmt.Errorf("invalid replacement string: '%s' \\ must be followed by a digit or \\", replacement)
+ }
+
+ if groupNum > groupCount {
+ return "", fmt.Errorf("replacement string references group %d but regex has only %d group(s)", groupNum, groupCount)
+ }
+
+ if match[2*groupNum] != -1 {
+ sb.WriteString(target[match[2*groupNum]:match[2*groupNum+1]])
+ }
+ }
+ return sb.String(), nil
+}
+
+func extract(target, regexStr ref.Val) ref.Val {
+ t := string(target.(types.String))
+ r := string(regexStr.(types.String))
+ re, err := compileRegex(r)
+ if err != nil {
+ return types.WrapErr(err)
+ }
+
+ if len(re.SubexpNames())-1 > 1 {
+ return types.WrapErr(fmt.Errorf("regular expression has more than one capturing group: %q", r))
+ }
+
+ matches := re.FindStringSubmatch(t)
+ if len(matches) == 0 {
+ return types.OptionalNone
+ }
+
+ // If there is a capturing group, return the first match; otherwise, return the whole match.
+ if len(matches) > 1 {
+ capturedGroup := matches[1]
+ // If optional group is empty, return OptionalNone.
+ if capturedGroup == "" {
+ return types.OptionalNone
+ }
+ return types.OptionalOf(types.String(capturedGroup))
+ }
+ return types.OptionalOf(types.String(matches[0]))
+}
+
+func extractAll(target, regexStr ref.Val) ref.Val {
+ t := string(target.(types.String))
+ r := string(regexStr.(types.String))
+ re, err := compileRegex(r)
+ if err != nil {
+ return types.WrapErr(err)
+ }
+
+ groupCount := len(re.SubexpNames()) - 1
+ if groupCount > 1 {
+ return types.WrapErr(fmt.Errorf("regular expression has more than one capturing group: %q", r))
+ }
+
+ matches := re.FindAllStringSubmatch(t, -1)
+ result := make([]string, 0, len(matches))
+ if len(matches) == 0 {
+ return types.NewStringList(types.DefaultTypeAdapter, result)
+ }
+
+ if groupCount != 1 {
+ for _, match := range matches {
+ result = append(result, match[0])
+ }
+ return types.NewStringList(types.DefaultTypeAdapter, result)
+ }
+
+ for _, match := range matches {
+ if match[1] != "" {
+ result = append(result, match[1])
+ }
+ }
+ return types.NewStringList(types.DefaultTypeAdapter, result)
+}
diff --git a/vendor/github.com/google/cel-go/ext/sets.go b/vendor/github.com/google/cel-go/ext/sets.go
index 7e9416655..ecac4bf9d 100644
--- a/vendor/github.com/google/cel-go/ext/sets.go
+++ b/vendor/github.com/google/cel-go/ext/sets.go
@@ -77,11 +77,28 @@ import (
// sets.intersects([1], []) // false
// sets.intersects([1], [1, 2]) // true
// sets.intersects([[1], [2, 3]], [[1, 2], [2, 3.0]]) // true
-func Sets() cel.EnvOption {
- return cel.Lib(setsLib{})
+func Sets(options ...SetsOption) cel.EnvOption {
+ l := &setsLib{}
+ for _, o := range options {
+ l = o(l)
+ }
+ return cel.Lib(l)
+}
+
+// SetsOption declares a functional operator for configuring set extensions.
+type SetsOption func(*setsLib) *setsLib
+
+// SetsVersion sets the library version for set extensions.
+func SetsVersion(version uint32) SetsOption {
+ return func(lib *setsLib) *setsLib {
+ lib.version = version
+ return lib
+ }
}
-type setsLib struct{}
+type setsLib struct {
+ version uint32
+}
// LibraryName implements the SingletonLibrary interface method.
func (setsLib) LibraryName() string {
@@ -219,13 +236,13 @@ func setsEquivalent(listA, listB ref.Val) ref.Val {
func estimateSetsCost(costFactor float64) checker.FunctionEstimator {
return func(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
- if len(args) == 2 {
- arg0Size := estimateSize(estimator, args[0])
- arg1Size := estimateSize(estimator, args[1])
- costEstimate := arg0Size.Multiply(arg1Size).MultiplyByCostFactor(costFactor).Add(callCostEstimate)
- return &checker.CallEstimate{CostEstimate: costEstimate}
+ if len(args) != 2 {
+ return nil
}
- return nil
+ arg0Size := estimateSize(estimator, args[0])
+ arg1Size := estimateSize(estimator, args[1])
+ costEstimate := arg0Size.Multiply(arg1Size).MultiplyByCostFactor(costFactor).Add(callCostEstimate)
+ return &checker.CallEstimate{CostEstimate: costEstimate}
}
}
@@ -256,6 +273,6 @@ func actualSize(value ref.Val) uint64 {
}
var (
- callCostEstimate = checker.CostEstimate{Min: 1, Max: 1}
+ callCostEstimate = checker.FixedCostEstimate(1)
callCost = uint64(1)
)
diff --git a/vendor/github.com/google/cel-go/ext/strings.go b/vendor/github.com/google/cel-go/ext/strings.go
index 2e590a4c5..de65421f6 100644
--- a/vendor/github.com/google/cel-go/ext/strings.go
+++ b/vendor/github.com/google/cel-go/ext/strings.go
@@ -286,10 +286,15 @@ const (
//
// 'gums'.reverse() // returns 'smug'
// 'John Smith'.reverse() // returns 'htimS nhoJ'
+//
+// Introduced at version: 4
+//
+// Formatting updated to adhere to https://github.com/google/cel-spec/blob/master/doc/extensions/strings.md.
+//
+// .format() ->
func Strings(options ...StringsOption) cel.EnvOption {
s := &stringLib{
- version: math.MaxUint32,
- validateFormat: true,
+ version: math.MaxUint32,
}
for _, o := range options {
s = o(s)
@@ -298,9 +303,8 @@ func Strings(options ...StringsOption) cel.EnvOption {
}
type stringLib struct {
- locale string
- version uint32
- validateFormat bool
+ locale string
+ version uint32
}
// LibraryName implements the SingletonLibrary interface method.
@@ -314,6 +318,8 @@ type StringsOption func(*stringLib) *stringLib
// StringsLocale configures the library with the given locale. The locale tag will
// be checked for validity at the time that EnvOptions are configured. If this option
// is not passed, string.format will behave as if en_US was passed as the locale.
+//
+// If StringsVersion is greater than or equal to 4, this option is ignored.
func StringsLocale(locale string) StringsOption {
return func(sl *stringLib) *stringLib {
sl.locale = locale
@@ -340,10 +346,9 @@ func StringsVersion(version uint32) StringsOption {
// StringsValidateFormatCalls validates type-checked ASTs to ensure that string.format() calls have
// valid formatting clauses and valid argument types for each clause.
//
-// Enabled by default.
+// Deprecated
func StringsValidateFormatCalls(value bool) StringsOption {
return func(s *stringLib) *stringLib {
- s.validateFormat = value
return s
}
}
@@ -351,7 +356,7 @@ func StringsValidateFormatCalls(value bool) StringsOption {
// CompileOptions implements the Library interface method.
func (lib *stringLib) CompileOptions() []cel.EnvOption {
formatLocale := "en_US"
- if lib.locale != "" {
+ if lib.version < 4 && lib.locale != "" {
// ensure locale is properly-formed if set
_, err := language.Parse(lib.locale)
if err != nil {
@@ -466,21 +471,29 @@ func (lib *stringLib) CompileOptions() []cel.EnvOption {
}))),
}
if lib.version >= 1 {
- opts = append(opts, cel.Function("format",
- cel.MemberOverload("string_format", []*cel.Type{cel.StringType, cel.ListType(cel.DynType)}, cel.StringType,
- cel.FunctionBinding(func(args ...ref.Val) ref.Val {
- s := string(args[0].(types.String))
- formatArgs := args[1].(traits.Lister)
- return stringOrError(parseFormatString(s, &stringFormatter{}, &stringArgList{formatArgs}, formatLocale))
- }))),
+ if lib.version >= 4 {
+ opts = append(opts, cel.Function("format",
+ cel.MemberOverload("string_format", []*cel.Type{cel.StringType, cel.ListType(cel.DynType)}, cel.StringType,
+ cel.FunctionBinding(func(args ...ref.Val) ref.Val {
+ s := string(args[0].(types.String))
+ formatArgs := args[1].(traits.Lister)
+ return stringOrError(parseFormatStringV2(s, &stringFormatterV2{}, &stringArgList{formatArgs}))
+ }))))
+ } else {
+ opts = append(opts, cel.Function("format",
+ cel.MemberOverload("string_format", []*cel.Type{cel.StringType, cel.ListType(cel.DynType)}, cel.StringType,
+ cel.FunctionBinding(func(args ...ref.Val) ref.Val {
+ s := string(args[0].(types.String))
+ formatArgs := args[1].(traits.Lister)
+ return stringOrError(parseFormatString(s, &stringFormatter{}, &stringArgList{formatArgs}, formatLocale))
+ }))))
+ }
+ opts = append(opts,
cel.Function("strings.quote", cel.Overload("strings_quote", []*cel.Type{cel.StringType}, cel.StringType,
cel.UnaryBinding(func(str ref.Val) ref.Val {
s := str.(types.String)
return stringOrError(quote(string(s)))
- }))),
-
- cel.ASTValidators(stringFormatValidator{}))
-
+ }))))
}
if lib.version >= 2 {
opts = append(opts,
@@ -529,8 +542,12 @@ func (lib *stringLib) CompileOptions() []cel.EnvOption {
}))),
)
}
- if lib.validateFormat {
- opts = append(opts, cel.ASTValidators(stringFormatValidator{}))
+ if lib.version >= 1 {
+ if lib.version >= 4 {
+ opts = append(opts, cel.ASTValidators(stringFormatValidatorV2{}))
+ } else {
+ opts = append(opts, cel.ASTValidators(stringFormatValidator{}))
+ }
}
return opts
}
@@ -590,6 +607,10 @@ func lastIndexOf(str, substr string) (int64, error) {
if substr == "" {
return int64(len(runes)), nil
}
+
+ if len(str) < len(substr) {
+ return -1, nil
+ }
return lastIndexOfOffset(str, substr, int64(len(runes)-1))
}
diff --git a/vendor/github.com/google/cel-go/interpreter/activation.go b/vendor/github.com/google/cel-go/interpreter/activation.go
index 1577f3590..dd40619ee 100644
--- a/vendor/github.com/google/cel-go/interpreter/activation.go
+++ b/vendor/github.com/google/cel-go/interpreter/activation.go
@@ -156,6 +156,12 @@ type PartialActivation interface {
UnknownAttributePatterns() []*AttributePattern
}
+// partialActivationConverter indicates whether an Activation implementation supports conversion to a PartialActivation
+type partialActivationConverter interface {
+ // AsPartialActivation converts the current activation to a PartialActivation
+ AsPartialActivation() (PartialActivation, bool)
+}
+
// partActivation is the default implementations of the PartialActivation interface.
type partActivation struct {
Activation
@@ -166,3 +172,21 @@ type partActivation struct {
func (a *partActivation) UnknownAttributePatterns() []*AttributePattern {
return a.unknowns
}
+
+// AsPartialActivation returns the partActivation as a PartialActivation interface.
+func (a *partActivation) AsPartialActivation() (PartialActivation, bool) {
+ return a, true
+}
+
+// AsPartialActivation walks the activation hierarchy and returns the first PartialActivation, if found.
+func AsPartialActivation(vars Activation) (PartialActivation, bool) {
+ // Only internal activation instances may implement this interface
+ if pv, ok := vars.(partialActivationConverter); ok {
+ return pv.AsPartialActivation()
+ }
+ // Since Activations may be hierarchical, test whether a parent converts to a PartialActivation
+ if vars.Parent() != nil {
+ return AsPartialActivation(vars.Parent())
+ }
+ return nil, false
+}
diff --git a/vendor/github.com/google/cel-go/interpreter/attribute_patterns.go b/vendor/github.com/google/cel-go/interpreter/attribute_patterns.go
index 8f19bde7e..7d0759e37 100644
--- a/vendor/github.com/google/cel-go/interpreter/attribute_patterns.go
+++ b/vendor/github.com/google/cel-go/interpreter/attribute_patterns.go
@@ -358,7 +358,7 @@ func (m *attributeMatcher) AddQualifier(qual Qualifier) (Attribute, error) {
func (m *attributeMatcher) Resolve(vars Activation) (any, error) {
id := m.NamespacedAttribute.ID()
// Bug in how partial activation is resolved, should search parents as well.
- partial, isPartial := toPartialActivation(vars)
+ partial, isPartial := AsPartialActivation(vars)
if isPartial {
unk, err := m.fac.matchesUnknownPatterns(
partial,
@@ -384,14 +384,3 @@ func (m *attributeMatcher) Qualify(vars Activation, obj any) (any, error) {
func (m *attributeMatcher) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) {
return attrQualifyIfPresent(m.fac, vars, obj, m, presenceOnly)
}
-
-func toPartialActivation(vars Activation) (PartialActivation, bool) {
- pv, ok := vars.(PartialActivation)
- if ok {
- return pv, true
- }
- if vars.Parent() != nil {
- return toPartialActivation(vars.Parent())
- }
- return nil, false
-}
diff --git a/vendor/github.com/google/cel-go/interpreter/interpretable.go b/vendor/github.com/google/cel-go/interpreter/interpretable.go
index ebc432e9d..96b5a8ffc 100644
--- a/vendor/github.com/google/cel-go/interpreter/interpretable.go
+++ b/vendor/github.com/google/cel-go/interpreter/interpretable.go
@@ -109,6 +109,47 @@ type InterpretableConstructor interface {
Type() ref.Type
}
+// ObservableInterpretable is an Interpretable which supports stateful observation, such as tracing
+// or cost-tracking.
+type ObservableInterpretable struct {
+ Interpretable
+ observers []StatefulObserver
+}
+
+// ID implements the Interpretable method to get the expression id associated with the step.
+func (oi *ObservableInterpretable) ID() int64 {
+ return oi.Interpretable.ID()
+}
+
+// Eval proxies to the ObserveEval method while invoking a no-op callback to report the observations.
+func (oi *ObservableInterpretable) Eval(vars Activation) ref.Val {
+ return oi.ObserveEval(vars, func(any) {})
+}
+
+// ObserveEval evaluates an interpretable and performs per-evaluation state-tracking.
+//
+// This method is concurrency safe and the expectation is that the observer function will use
+// a switch statement to determine the type of the state which has been reported back from the call.
+func (oi *ObservableInterpretable) ObserveEval(vars Activation, observer func(any)) ref.Val {
+ var err error
+ // Initialize the state needed for the observers to function.
+ for _, obs := range oi.observers {
+ vars, err = obs.InitState(vars)
+ if err != nil {
+ return types.WrapErr(err)
+ }
+ // Provide an initial reference to the state to ensure state is available
+ // even in cases of interrupting errors generated during evaluation.
+ observer(obs.GetState(vars))
+ }
+ result := oi.Interpretable.Eval(vars)
+ // Get the state which needs to be reported back as having been observed.
+ for _, obs := range oi.observers {
+ observer(obs.GetState(vars))
+ }
+ return result
+}
+
// Core Interpretable implementations used during the program planning phase.
type evalTestOnly struct {
@@ -156,9 +197,6 @@ func (q *testOnlyQualifier) Qualify(vars Activation, obj any) (any, error) {
if unk, isUnk := out.(types.Unknown); isUnk {
return unk, nil
}
- if opt, isOpt := out.(types.Optional); isOpt {
- return opt.HasValue(), nil
- }
return present, nil
}
@@ -762,6 +800,9 @@ func (fold *evalFold) Eval(ctx Activation) ref.Val {
defer releaseFolder(f)
foldRange := fold.iterRange.Eval(ctx)
+ if types.IsUnknownOrError(foldRange) {
+ return foldRange
+ }
if fold.iterVar2 != "" {
var foldable traits.Foldable
switch r := foldRange.(type) {
@@ -819,9 +860,9 @@ type evalWatch struct {
}
// Eval implements the Interpretable interface method.
-func (e *evalWatch) Eval(ctx Activation) ref.Val {
- val := e.Interpretable.Eval(ctx)
- e.observer(e.ID(), e.Interpretable, val)
+func (e *evalWatch) Eval(vars Activation) ref.Val {
+ val := e.Interpretable.Eval(vars)
+ e.observer(vars, e.ID(), e.Interpretable, val)
return val
}
@@ -880,7 +921,7 @@ func (e *evalWatchAttr) AddQualifier(q Qualifier) (Attribute, error) {
// Eval implements the Interpretable interface method.
func (e *evalWatchAttr) Eval(vars Activation) ref.Val {
val := e.InterpretableAttribute.Eval(vars)
- e.observer(e.ID(), e.InterpretableAttribute, val)
+ e.observer(vars, e.ID(), e.InterpretableAttribute, val)
return val
}
@@ -901,7 +942,7 @@ func (e *evalWatchConstQual) Qualify(vars Activation, obj any) (any, error) {
} else {
val = e.adapter.NativeToValue(out)
}
- e.observer(e.ID(), e.ConstantQualifier, val)
+ e.observer(vars, e.ID(), e.ConstantQualifier, val)
return out, err
}
@@ -917,7 +958,7 @@ func (e *evalWatchConstQual) QualifyIfPresent(vars Activation, obj any, presence
val = types.Bool(present)
}
if present || presenceOnly {
- e.observer(e.ID(), e.ConstantQualifier, val)
+ e.observer(vars, e.ID(), e.ConstantQualifier, val)
}
return out, present, err
}
@@ -944,7 +985,7 @@ func (e *evalWatchAttrQual) Qualify(vars Activation, obj any) (any, error) {
} else {
val = e.adapter.NativeToValue(out)
}
- e.observer(e.ID(), e.Attribute, val)
+ e.observer(vars, e.ID(), e.Attribute, val)
return out, err
}
@@ -960,7 +1001,7 @@ func (e *evalWatchAttrQual) QualifyIfPresent(vars Activation, obj any, presenceO
val = types.Bool(present)
}
if present || presenceOnly {
- e.observer(e.ID(), e.Attribute, val)
+ e.observer(vars, e.ID(), e.Attribute, val)
}
return out, present, err
}
@@ -981,7 +1022,7 @@ func (e *evalWatchQual) Qualify(vars Activation, obj any) (any, error) {
} else {
val = e.adapter.NativeToValue(out)
}
- e.observer(e.ID(), e.Qualifier, val)
+ e.observer(vars, e.ID(), e.Qualifier, val)
return out, err
}
@@ -997,7 +1038,7 @@ func (e *evalWatchQual) QualifyIfPresent(vars Activation, obj any, presenceOnly
val = types.Bool(present)
}
if present || presenceOnly {
- e.observer(e.ID(), e.Qualifier, val)
+ e.observer(vars, e.ID(), e.Qualifier, val)
}
return out, present, err
}
@@ -1011,7 +1052,7 @@ type evalWatchConst struct {
// Eval implements the Interpretable interface method.
func (e *evalWatchConst) Eval(vars Activation) ref.Val {
val := e.Value()
- e.observer(e.ID(), e.InterpretableConst, val)
+ e.observer(vars, e.ID(), e.InterpretableConst, val)
return val
}
@@ -1184,13 +1225,13 @@ func (a *evalAttr) Eval(ctx Activation) ref.Val {
}
// Qualify proxies to the Attribute's Qualify method.
-func (a *evalAttr) Qualify(ctx Activation, obj any) (any, error) {
- return a.attr.Qualify(ctx, obj)
+func (a *evalAttr) Qualify(vars Activation, obj any) (any, error) {
+ return a.attr.Qualify(vars, obj)
}
// QualifyIfPresent proxies to the Attribute's QualifyIfPresent method.
-func (a *evalAttr) QualifyIfPresent(ctx Activation, obj any, presenceOnly bool) (any, bool, error) {
- return a.attr.QualifyIfPresent(ctx, obj, presenceOnly)
+func (a *evalAttr) QualifyIfPresent(vars Activation, obj any, presenceOnly bool) (any, bool, error) {
+ return a.attr.QualifyIfPresent(vars, obj, presenceOnly)
}
func (a *evalAttr) IsOptional() bool {
@@ -1223,9 +1264,9 @@ func (c *evalWatchConstructor) ID() int64 {
}
// Eval implements the Interpretable Eval function.
-func (c *evalWatchConstructor) Eval(ctx Activation) ref.Val {
- val := c.constructor.Eval(ctx)
- c.observer(c.ID(), c.constructor, val)
+func (c *evalWatchConstructor) Eval(vars Activation) ref.Val {
+ val := c.constructor.Eval(vars)
+ c.observer(vars, c.ID(), c.constructor, val)
return val
}
@@ -1241,7 +1282,7 @@ func invalidOptionalElementInit(value ref.Val) ref.Val {
func newFolder(eval *evalFold, ctx Activation) *folder {
f := folderPool.Get().(*folder)
f.evalFold = eval
- f.Activation = ctx
+ f.activation = ctx
return f
}
@@ -1262,7 +1303,7 @@ func releaseFolder(f *folder) {
// cel.bind or cel.@block.
type folder struct {
*evalFold
- Activation
+ activation Activation
// fold state objects.
accuVal ref.Val
@@ -1290,7 +1331,7 @@ func (f *folder) foldIterable(iterable traits.Iterable) ref.Val {
// Update the accumulation value and check for eval interuption.
f.accuVal = f.step.Eval(f)
f.initialized = true
- if f.interruptable && checkInterrupt(f.Activation) {
+ if f.interruptable && checkInterrupt(f.activation) {
f.interrupted = true
return f.evalResult()
}
@@ -1316,7 +1357,7 @@ func (f *folder) FoldEntry(key, val any) bool {
// Update the accumulation value and check for eval interuption.
f.accuVal = f.step.Eval(f)
f.initialized = true
- if f.interruptable && checkInterrupt(f.Activation) {
+ if f.interruptable && checkInterrupt(f.activation) {
f.interrupted = true
return false
}
@@ -1330,7 +1371,7 @@ func (f *folder) ResolveName(name string) (any, bool) {
if name == f.accuVar {
if !f.initialized {
f.initialized = true
- initVal := f.accu.Eval(f.Activation)
+ initVal := f.accu.Eval(f.activation)
if !f.exhaustive {
if l, isList := initVal.(traits.Lister); isList && l.Size() == types.IntZero {
initVal = types.NewMutableList(f.adapter)
@@ -1355,7 +1396,32 @@ func (f *folder) ResolveName(name string) (any, bool) {
return f.iterVar2Val, true
}
}
- return f.Activation.ResolveName(name)
+ return f.activation.ResolveName(name)
+}
+
+// Parent returns the activation embedded into the folder.
+func (f *folder) Parent() Activation {
+ return f.activation
+}
+
+// UnknownAttributePatterns implements the PartialActivation interface returning the unknown patterns
+// if they were provided to the input activation, or an empty set if the proxied activation is not partial.
+func (f *folder) UnknownAttributePatterns() []*AttributePattern {
+ if pv, ok := f.activation.(partialActivationConverter); ok {
+ if partial, isPartial := pv.AsPartialActivation(); isPartial {
+ return partial.UnknownAttributePatterns()
+ }
+ }
+ return []*AttributePattern{}
+}
+
+func (f *folder) AsPartialActivation() (PartialActivation, bool) {
+ if pv, ok := f.activation.(partialActivationConverter); ok {
+ if _, isPartial := pv.AsPartialActivation(); isPartial {
+ return f, true
+ }
+ }
+ return nil, false
}
// evalResult computes the final result of the fold after all entries have been folded and accumulated.
@@ -1381,7 +1447,7 @@ func (f *folder) evalResult() ref.Val {
// reset clears any state associated with folder evaluation.
func (f *folder) reset() {
f.evalFold = nil
- f.Activation = nil
+ f.activation = nil
f.accuVal = nil
f.iterVar1Val = nil
f.iterVar2Val = nil
diff --git a/vendor/github.com/google/cel-go/interpreter/interpreter.go b/vendor/github.com/google/cel-go/interpreter/interpreter.go
index 0aca74d88..be57e7439 100644
--- a/vendor/github.com/google/cel-go/interpreter/interpreter.go
+++ b/vendor/github.com/google/cel-go/interpreter/interpreter.go
@@ -18,36 +18,41 @@
package interpreter
import (
+ "errors"
+
"github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/containers"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
)
+// PlannerOption configures the program plan options during interpretable setup.
+type PlannerOption func(*planner) (*planner, error)
+
// Interpreter generates a new Interpretable from a checked or unchecked expression.
type Interpreter interface {
// NewInterpretable creates an Interpretable from a checked expression and an
- // optional list of InterpretableDecorator values.
- NewInterpretable(exprAST *ast.AST, decorators ...InterpretableDecorator) (Interpretable, error)
+ // optional list of PlannerOption values.
+ NewInterpretable(exprAST *ast.AST, opts ...PlannerOption) (Interpretable, error)
}
// EvalObserver is a functional interface that accepts an expression id and an observed value.
// The id identifies the expression that was evaluated, the programStep is the Interpretable or Qualifier that
// was evaluated and value is the result of the evaluation.
-type EvalObserver func(id int64, programStep any, value ref.Val)
+type EvalObserver func(vars Activation, id int64, programStep any, value ref.Val)
-// Observe constructs a decorator that calls all the provided observers in order after evaluating each Interpretable
-// or Qualifier during program evaluation.
-func Observe(observers ...EvalObserver) InterpretableDecorator {
- if len(observers) == 1 {
- return decObserveEval(observers[0])
- }
- observeFn := func(id int64, programStep any, val ref.Val) {
- for _, observer := range observers {
- observer(id, programStep, val)
- }
- }
- return decObserveEval(observeFn)
+// StatefulObserver observes evaluation while tracking or utilizing stateful behavior.
+type StatefulObserver interface {
+ // InitState configures stateful metadata on the activation.
+ InitState(Activation) (Activation, error)
+
+ // GetState retrieves the stateful metadata from the activation.
+ GetState(Activation) any
+
+ // Observe passes the activation and relevant evaluation metadata to the observer.
+ // The observe method is expected to do the equivalent of GetState(vars) in order
+ // to find the metadata that needs to be updated upon invocation.
+ Observe(vars Activation, id int64, programStep any, value ref.Val)
}
// EvalCancelledError represents a cancelled program evaluation operation.
@@ -73,24 +78,110 @@ const (
CostLimitExceeded
)
-// TODO: Replace all usages of TrackState with EvalStateObserver
+// evalStateOption configures the evalStateFactory behavior.
+type evalStateOption func(*evalStateFactory) *evalStateFactory
+
+// EvalStateFactory configures the EvalState generator to be used by the EvalStateObserver.
+func EvalStateFactory(factory func() EvalState) evalStateOption {
+ return func(fac *evalStateFactory) *evalStateFactory {
+ fac.factory = factory
+ return fac
+ }
+}
+
+// EvalStateObserver provides an observer which records the value associated with the given expression id.
+// EvalState must be provided to the observer.
+func EvalStateObserver(opts ...evalStateOption) PlannerOption {
+ et := &evalStateFactory{factory: NewEvalState}
+ for _, o := range opts {
+ et = o(et)
+ }
+ return func(p *planner) (*planner, error) {
+ if et.factory == nil {
+ return nil, errors.New("eval state factory not configured")
+ }
+ p.observers = append(p.observers, et)
+ p.decorators = append(p.decorators, decObserveEval(et.Observe))
+ return p, nil
+ }
+}
+
+// evalStateConverter identifies an object which is convertible to an EvalState instance.
+type evalStateConverter interface {
+ asEvalState() EvalState
+}
+
+// evalStateActivation hides state in the Activation in a manner not accessible to expressions.
+type evalStateActivation struct {
+ vars Activation
+ state EvalState
+}
+
+// ResolveName proxies variable lookups to the backing activation.
+func (esa evalStateActivation) ResolveName(name string) (any, bool) {
+ return esa.vars.ResolveName(name)
+}
+
+// Parent proxies parent lookups to the backing activation.
+func (esa evalStateActivation) Parent() Activation {
+ return esa.vars
+}
+
+// AsPartialActivation supports conversion to a partial activation in order to detect unknown attributes.
+func (esa evalStateActivation) AsPartialActivation() (PartialActivation, bool) {
+ return AsPartialActivation(esa.vars)
+}
-// TrackState decorates each expression node with an observer which records the value
-// associated with the given expression id. EvalState must be provided to the decorator.
-// This decorator is not thread-safe, and the EvalState must be reset between Eval()
-// calls.
-// DEPRECATED: Please use EvalStateObserver instead. It composes gracefully with additional observers.
-func TrackState(state EvalState) InterpretableDecorator {
- return Observe(EvalStateObserver(state))
+// asEvalState implements the evalStateConverter method.
+func (esa evalStateActivation) asEvalState() EvalState {
+ return esa.state
}
-// EvalStateObserver provides an observer which records the value
-// associated with the given expression id. EvalState must be provided to the observer.
-// This decorator is not thread-safe, and the EvalState must be reset between Eval()
-// calls.
-func EvalStateObserver(state EvalState) EvalObserver {
- return func(id int64, programStep any, val ref.Val) {
- state.SetValue(id, val)
+// asEvalState walks the Activation hierarchy and returns the first EvalState found, if present.
+func asEvalState(vars Activation) (EvalState, bool) {
+ if conv, ok := vars.(evalStateConverter); ok {
+ return conv.asEvalState(), true
+ }
+ if vars.Parent() != nil {
+ return asEvalState(vars.Parent())
+ }
+ return nil, false
+}
+
+// evalStateFactory holds a reference to a factory function that produces an EvalState instance.
+type evalStateFactory struct {
+ factory func() EvalState
+}
+
+// InitState produces an EvalState instance and bundles it into the Activation in a way which is
+// not visible to expression evaluation.
+func (et *evalStateFactory) InitState(vars Activation) (Activation, error) {
+ state := et.factory()
+ return evalStateActivation{vars: vars, state: state}, nil
+}
+
+// GetState extracts the EvalState from the Activation.
+func (et *evalStateFactory) GetState(vars Activation) any {
+ if state, found := asEvalState(vars); found {
+ return state
+ }
+ return nil
+}
+
+// Observe records the evaluation state for a given expression node and program step.
+func (et *evalStateFactory) Observe(vars Activation, id int64, programStep any, val ref.Val) {
+ state, found := asEvalState(vars)
+ if !found {
+ return
+ }
+ state.SetValue(id, val)
+}
+
+// CustomDecorator configures a custom interpretable decorator for the program.
+func CustomDecorator(dec InterpretableDecorator) PlannerOption {
+ return func(p *planner) (*planner, error) {
+ p.decorators = append(p.decorators, dec)
+ return p, nil
}
}
@@ -99,11 +190,8 @@ func EvalStateObserver(state EvalState) EvalObserver {
// insight into the evaluation state of the entire expression. EvalState must be
// provided to the decorator. This decorator is not thread-safe, and the EvalState
// must be reset between Eval() calls.
-func ExhaustiveEval() InterpretableDecorator {
- ex := decDisableShortcircuits()
- return func(i Interpretable) (Interpretable, error) {
- return ex(i)
- }
+func ExhaustiveEval() PlannerOption {
+ return CustomDecorator(decDisableShortcircuits())
}
// InterruptableEval annotates comprehension loops with information that indicates they
@@ -111,14 +199,14 @@ func ExhaustiveEval() InterpretableDecorator {
//
// The custom activation is currently managed higher up in the stack within the 'cel' package
// and should not require any custom support on behalf of callers.
-func InterruptableEval() InterpretableDecorator {
- return decInterruptFolds()
+func InterruptableEval() PlannerOption {
+ return CustomDecorator(decInterruptFolds())
}
// Optimize will pre-compute operations such as list and map construction and optimize
// call arguments to set membership tests. The set of optimizations will increase over time.
-func Optimize() InterpretableDecorator {
- return decOptimize()
+func Optimize() PlannerOption {
+ return CustomDecorator(decOptimize())
}
// RegexOptimization provides a way to replace an InterpretableCall for a regex function when the
@@ -142,8 +230,8 @@ type RegexOptimization struct {
// CompileRegexConstants compiles regex pattern string constants at program creation time and reports any regex pattern
// compile errors.
-func CompileRegexConstants(regexOptimizations ...*RegexOptimization) InterpretableDecorator {
- return decRegexOptimizer(regexOptimizations...)
+func CompileRegexConstants(regexOptimizations ...*RegexOptimization) PlannerOption {
+ return CustomDecorator(decRegexOptimizer(regexOptimizations...))
}
type exprInterpreter struct {
@@ -172,14 +260,14 @@ func NewInterpreter(dispatcher Dispatcher,
// NewIntepretable implements the Interpreter interface method.
func (i *exprInterpreter) NewInterpretable(
checked *ast.AST,
- decorators ...InterpretableDecorator) (Interpretable, error) {
- p := newPlanner(
- i.dispatcher,
- i.provider,
- i.adapter,
- i.attrFactory,
- i.container,
- checked,
- decorators...)
+ opts ...PlannerOption) (Interpretable, error) {
+ p := newPlanner(i.dispatcher, i.provider, i.adapter, i.attrFactory, i.container, checked)
+ var err error
+ for _, o := range opts {
+ p, err = o(p)
+ if err != nil {
+ return nil, err
+ }
+ }
return p.Plan(checked.Expr())
}
diff --git a/vendor/github.com/google/cel-go/interpreter/planner.go b/vendor/github.com/google/cel-go/interpreter/planner.go
index f0fd4eaf9..f0e0d4305 100644
--- a/vendor/github.com/google/cel-go/interpreter/planner.go
+++ b/vendor/github.com/google/cel-go/interpreter/planner.go
@@ -25,12 +25,6 @@ import (
"github.com/google/cel-go/common/types"
)
-// interpretablePlanner creates an Interpretable evaluation plan from a proto Expr value.
-type interpretablePlanner interface {
- // Plan generates an Interpretable value (or error) from the input proto Expr.
- Plan(expr ast.Expr) (Interpretable, error)
-}
-
// newPlanner creates an interpretablePlanner which references a Dispatcher, TypeProvider,
// TypeAdapter, Container, and CheckedExpr value. These pieces of data are used to resolve
// functions, types, and namespaced identifiers at plan time rather than at runtime since
@@ -40,8 +34,7 @@ func newPlanner(disp Dispatcher,
adapter types.Adapter,
attrFactory AttributeFactory,
cont *containers.Container,
- exprAST *ast.AST,
- decorators ...InterpretableDecorator) interpretablePlanner {
+ exprAST *ast.AST) *planner {
return &planner{
disp: disp,
provider: provider,
@@ -50,7 +43,8 @@ func newPlanner(disp Dispatcher,
container: cont,
refMap: exprAST.ReferenceMap(),
typeMap: exprAST.TypeMap(),
- decorators: decorators,
+ decorators: make([]InterpretableDecorator, 0),
+ observers: make([]StatefulObserver, 0),
}
}
@@ -64,6 +58,7 @@ type planner struct {
refMap map[int64]*ast.ReferenceInfo
typeMap map[int64]*types.Type
decorators []InterpretableDecorator
+ observers []StatefulObserver
}
// Plan implements the interpretablePlanner interface. This implementation of the Plan method also
@@ -72,6 +67,17 @@ type planner struct {
// such as state-tracking, expression re-write, and possibly efficient thread-safe memoization of
// repeated expressions.
func (p *planner) Plan(expr ast.Expr) (Interpretable, error) {
+ i, err := p.plan(expr)
+ if err != nil {
+ return nil, err
+ }
+ if len(p.observers) == 0 {
+ return i, nil
+ }
+ return &ObservableInterpretable{Interpretable: i, observers: p.observers}, nil
+}
+
+func (p *planner) plan(expr ast.Expr) (Interpretable, error) {
switch expr.Kind() {
case ast.CallKind:
return p.decorate(p.planCall(expr))
@@ -161,7 +167,7 @@ func (p *planner) planSelect(expr ast.Expr) (Interpretable, error) {
sel := expr.AsSelect()
// Plan the operand evaluation.
- op, err := p.Plan(sel.Operand())
+ op, err := p.plan(sel.Operand())
if err != nil {
return nil, err
}
@@ -220,14 +226,14 @@ func (p *planner) planCall(expr ast.Expr) (Interpretable, error) {
args := make([]Interpretable, argCount)
if target != nil {
- arg, err := p.Plan(target)
+ arg, err := p.plan(target)
if err != nil {
return nil, err
}
args[0] = arg
}
for i, argExpr := range call.Args() {
- arg, err := p.Plan(argExpr)
+ arg, err := p.plan(argExpr)
if err != nil {
return nil, err
}
@@ -496,7 +502,7 @@ func (p *planner) planCreateList(expr ast.Expr) (Interpretable, error) {
}
elems := make([]Interpretable, len(elements))
for i, elem := range elements {
- elemVal, err := p.Plan(elem)
+ elemVal, err := p.plan(elem)
if err != nil {
return nil, err
}
@@ -521,13 +527,13 @@ func (p *planner) planCreateMap(expr ast.Expr) (Interpretable, error) {
hasOptionals := false
for i, e := range entries {
entry := e.AsMapEntry()
- keyVal, err := p.Plan(entry.Key())
+ keyVal, err := p.plan(entry.Key())
if err != nil {
return nil, err
}
keys[i] = keyVal
- valVal, err := p.Plan(entry.Value())
+ valVal, err := p.plan(entry.Value())
if err != nil {
return nil, err
}
@@ -560,7 +566,7 @@ func (p *planner) planCreateStruct(expr ast.Expr) (Interpretable, error) {
for i, f := range objFields {
field := f.AsStructField()
fields[i] = field.Name()
- val, err := p.Plan(field.Value())
+ val, err := p.plan(field.Value())
if err != nil {
return nil, err
}
@@ -582,23 +588,23 @@ func (p *planner) planCreateStruct(expr ast.Expr) (Interpretable, error) {
// planComprehension generates an Interpretable fold operation.
func (p *planner) planComprehension(expr ast.Expr) (Interpretable, error) {
fold := expr.AsComprehension()
- accu, err := p.Plan(fold.AccuInit())
+ accu, err := p.plan(fold.AccuInit())
if err != nil {
return nil, err
}
- iterRange, err := p.Plan(fold.IterRange())
+ iterRange, err := p.plan(fold.IterRange())
if err != nil {
return nil, err
}
- cond, err := p.Plan(fold.LoopCondition())
+ cond, err := p.plan(fold.LoopCondition())
if err != nil {
return nil, err
}
- step, err := p.Plan(fold.LoopStep())
+ step, err := p.plan(fold.LoopStep())
if err != nil {
return nil, err
}
- result, err := p.Plan(fold.Result())
+ result, err := p.plan(fold.Result())
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/google/cel-go/interpreter/prune.go b/vendor/github.com/google/cel-go/interpreter/prune.go
index 410d80dc4..1662c1c1b 100644
--- a/vendor/github.com/google/cel-go/interpreter/prune.go
+++ b/vendor/github.com/google/cel-go/interpreter/prune.go
@@ -88,7 +88,7 @@ func PruneAst(expr ast.Expr, macroCalls map[int64]ast.Expr, state EvalState) *as
func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (ast.Expr, bool) {
switch v := val.(type) {
- case types.Bool, types.Bytes, types.Double, types.Int, types.Null, types.String, types.Uint:
+ case types.Bool, types.Bytes, types.Double, types.Int, types.Null, types.String, types.Uint, *types.Optional:
p.state.SetValue(id, val)
return p.NewLiteral(id, val), true
case types.Duration:
@@ -281,13 +281,29 @@ func (p *astPruner) prune(node ast.Expr) (ast.Expr, bool) {
}
if macro, found := p.macroCalls[node.ID()]; found {
// Ensure that intermediate values for the comprehension are cleared during pruning
+ pruneMacroCall := node.Kind() != ast.UnspecifiedExprKind
if node.Kind() == ast.ComprehensionKind {
- compre := node.AsComprehension()
- visit(macro, clearIterVarVisitor(compre.IterVar(), p.state))
+ // Only prune cel.bind() calls since the variables of the comprehension are all
+ // visible to the user, so there's no chance of an incorrect value being observed
+ // as a result of looking at intermediate computations within a comprehension.
+ pruneMacroCall = isCelBindMacro(macro)
}
- // prune the expression in terms of the macro call instead of the expanded form.
- if newMacro, pruned := p.prune(macro); pruned {
- p.macroCalls[node.ID()] = newMacro
+ if pruneMacroCall {
+ // prune the expression in terms of the macro call instead of the expanded form when
+ // dealing with macro call tracking references.
+ if newMacro, pruned := p.prune(macro); pruned {
+ p.macroCalls[node.ID()] = newMacro
+ }
+ } else {
+ // Otherwise just prune the macro target in keeping with the pruning behavior of the
+ // comprehensions later in the call graph.
+ macroCall := macro.AsCall()
+ if macroCall.Target() != nil {
+ if newTarget, pruned := p.prune(macroCall.Target()); pruned {
+ macro = p.NewMemberCall(macro.ID(), macroCall.FunctionName(), newTarget, macroCall.Args()...)
+ p.macroCalls[node.ID()] = macro
+ }
+ }
}
}
@@ -421,6 +437,19 @@ func (p *astPruner) prune(node ast.Expr) (ast.Expr, bool) {
// the last iteration of the comprehension and not each step in the evaluation which
// means that the any residuals computed in between might be inaccurate.
if newRange, pruned := p.maybePrune(compre.IterRange()); pruned {
+ if compre.HasIterVar2() {
+ return p.NewComprehensionTwoVar(
+ node.ID(),
+ newRange,
+ compre.IterVar(),
+ compre.IterVar2(),
+ compre.AccuVar(),
+ compre.AccuInit(),
+ compre.LoopCondition(),
+ compre.LoopStep(),
+ compre.Result(),
+ ), true
+ }
return p.NewComprehension(
node.ID(),
newRange,
@@ -468,16 +497,6 @@ func getMaxID(expr ast.Expr) int64 {
return maxID
}
-func clearIterVarVisitor(varName string, state EvalState) astVisitor {
- return astVisitor{
- visitExpr: func(e ast.Expr) {
- if e.Kind() == ast.IdentKind && e.AsIdent() == varName {
- state.SetValue(e.ID(), nil)
- }
- },
- }
-}
-
func maxIDVisitor(maxID *int64) astVisitor {
return astVisitor{
visitExpr: func(e ast.Expr) {
@@ -541,3 +560,15 @@ func visit(expr ast.Expr, visitor astVisitor) {
}
}
}
+
+func isCelBindMacro(macro ast.Expr) bool {
+ if macro.Kind() != ast.CallKind {
+ return false
+ }
+ macroCall := macro.AsCall()
+ target := macroCall.Target()
+ return macroCall.FunctionName() == "bind" &&
+ macroCall.IsMemberFunction() &&
+ target.Kind() == ast.IdentKind &&
+ target.AsIdent() == "cel"
+}
diff --git a/vendor/github.com/google/cel-go/interpreter/runtimecost.go b/vendor/github.com/google/cel-go/interpreter/runtimecost.go
index b9b307c15..6c44cd798 100644
--- a/vendor/github.com/google/cel-go/interpreter/runtimecost.go
+++ b/vendor/github.com/google/cel-go/interpreter/runtimecost.go
@@ -15,6 +15,7 @@
package interpreter
import (
+ "errors"
"math"
"github.com/google/cel-go/common"
@@ -34,78 +35,172 @@ type ActualCostEstimator interface {
CallCost(function, overloadID string, args []ref.Val, result ref.Val) *uint64
}
+// costTrackPlanOption modifies the cost tracking factory associatied with the CostObserver
+type costTrackPlanOption func(*costTrackerFactory) *costTrackerFactory
+
+// CostTrackerFactory configures the factory method to generate a new cost-tracker per-evaluation.
+func CostTrackerFactory(factory func() (*CostTracker, error)) costTrackPlanOption {
+ return func(fac *costTrackerFactory) *costTrackerFactory {
+ fac.factory = factory
+ return fac
+ }
+}
+
// CostObserver provides an observer that tracks runtime cost.
-func CostObserver(tracker *CostTracker) EvalObserver {
- observer := func(id int64, programStep any, val ref.Val) {
- switch t := programStep.(type) {
- case ConstantQualifier:
- // TODO: Push identifiers on to the stack before observing constant qualifiers that apply to them
- // and enable the below pop. Once enabled this can case can be collapsed into the Qualifier case.
- tracker.cost++
- case InterpretableConst:
- // zero cost
- case InterpretableAttribute:
- switch a := t.Attr().(type) {
- case *conditionalAttribute:
- // Ternary has no direct cost. All cost is from the conditional and the true/false branch expressions.
- tracker.stack.drop(a.falsy.ID(), a.truthy.ID(), a.expr.ID())
- default:
- tracker.stack.drop(t.Attr().ID())
- tracker.cost += common.SelectAndIdentCost
- }
- if !tracker.presenceTestHasCost {
- if _, isTestOnly := programStep.(*evalTestOnly); isTestOnly {
- tracker.cost -= common.SelectAndIdentCost
- }
- }
- case *evalExhaustiveConditional:
- // Ternary has no direct cost. All cost is from the conditional and the true/false branch expressions.
- tracker.stack.drop(t.attr.falsy.ID(), t.attr.truthy.ID(), t.attr.expr.ID())
+func CostObserver(opts ...costTrackPlanOption) PlannerOption {
+ ct := &costTrackerFactory{}
+ for _, o := range opts {
+ ct = o(ct)
+ }
+ return func(p *planner) (*planner, error) {
+ if ct.factory == nil {
+ return nil, errors.New("cost tracker factory not configured")
+ }
+ p.observers = append(p.observers, ct)
+ p.decorators = append(p.decorators, decObserveEval(ct.Observe))
+ return p, nil
+ }
+}
- // While the field names are identical, the boolean operation eval structs do not share an interface and so
- // must be handled individually.
- case *evalOr:
- for _, term := range t.terms {
- tracker.stack.drop(term.ID())
- }
- case *evalAnd:
- for _, term := range t.terms {
- tracker.stack.drop(term.ID())
- }
- case *evalExhaustiveOr:
- for _, term := range t.terms {
- tracker.stack.drop(term.ID())
- }
- case *evalExhaustiveAnd:
- for _, term := range t.terms {
- tracker.stack.drop(term.ID())
- }
- case *evalFold:
- tracker.stack.drop(t.iterRange.ID())
- case Qualifier:
- tracker.cost++
- case InterpretableCall:
- if argVals, ok := tracker.stack.dropArgs(t.Args()); ok {
- tracker.cost += tracker.costCall(t, argVals, val)
- }
- case InterpretableConstructor:
- tracker.stack.dropArgs(t.InitVals())
- switch t.Type() {
- case types.ListType:
- tracker.cost += common.ListCreateBaseCost
- case types.MapType:
- tracker.cost += common.MapCreateBaseCost
- default:
- tracker.cost += common.StructCreateBaseCost
+// costTrackerConverter identifies an object which is convertible to a CostTracker instance.
+type costTrackerConverter interface {
+ asCostTracker() *CostTracker
+}
+
+// costTrackActivation hides state in the Activation in a manner not accessible to expressions.
+type costTrackActivation struct {
+ vars Activation
+ costTracker *CostTracker
+}
+
+// ResolveName proxies variable lookups to the backing activation.
+func (cta costTrackActivation) ResolveName(name string) (any, bool) {
+ return cta.vars.ResolveName(name)
+}
+
+// Parent proxies parent lookups to the backing activation.
+func (cta costTrackActivation) Parent() Activation {
+ return cta.vars
+}
+
+// AsPartialActivation supports conversion to a partial activation in order to detect unknown attributes.
+func (cta costTrackActivation) AsPartialActivation() (PartialActivation, bool) {
+ return AsPartialActivation(cta.vars)
+}
+
+// asCostTracker implements the costTrackerConverter method.
+func (cta costTrackActivation) asCostTracker() *CostTracker {
+ return cta.costTracker
+}
+
+// asCostTracker walks the Activation hierarchy and returns the first cost tracker found, if present.
+func asCostTracker(vars Activation) (*CostTracker, bool) {
+ if conv, ok := vars.(costTrackerConverter); ok {
+ return conv.asCostTracker(), true
+ }
+ if vars.Parent() != nil {
+ return asCostTracker(vars.Parent())
+ }
+ return nil, false
+}
+
+// costTrackerFactory holds a factory for producing new CostTracker instances on each Eval call.
+type costTrackerFactory struct {
+ factory func() (*CostTracker, error)
+}
+
+// InitState produces a CostTracker and bundles it into an Activation in a way which is not visible
+// to expression evaluation.
+func (ct *costTrackerFactory) InitState(vars Activation) (Activation, error) {
+ tracker, err := ct.factory()
+ if err != nil {
+ return nil, err
+ }
+ return costTrackActivation{vars: vars, costTracker: tracker}, nil
+}
+
+// GetState extracts the CostTracker from the Activation.
+func (ct *costTrackerFactory) GetState(vars Activation) any {
+ if tracker, found := asCostTracker(vars); found {
+ return tracker
+ }
+ return nil
+}
+
+// Observe computes the incremental cost of each step and records it into the CostTracker associated
+// with the evaluation.
+func (ct *costTrackerFactory) Observe(vars Activation, id int64, programStep any, val ref.Val) {
+ tracker, found := asCostTracker(vars)
+ if !found {
+ return
+ }
+ switch t := programStep.(type) {
+ case ConstantQualifier:
+ // TODO: Push identifiers on to the stack before observing constant qualifiers that apply to them
+ // and enable the below pop. Once enabled this can case can be collapsed into the Qualifier case.
+ tracker.cost++
+ case InterpretableConst:
+ // zero cost
+ case InterpretableAttribute:
+ switch a := t.Attr().(type) {
+ case *conditionalAttribute:
+ // Ternary has no direct cost. All cost is from the conditional and the true/false branch expressions.
+ tracker.stack.drop(a.falsy.ID(), a.truthy.ID(), a.expr.ID())
+ default:
+ tracker.stack.drop(t.Attr().ID())
+ tracker.cost += common.SelectAndIdentCost
+ }
+ if !tracker.presenceTestHasCost {
+ if _, isTestOnly := programStep.(*evalTestOnly); isTestOnly {
+ tracker.cost -= common.SelectAndIdentCost
}
}
- tracker.stack.push(val, id)
+ case *evalExhaustiveConditional:
+ // Ternary has no direct cost. All cost is from the conditional and the true/false branch expressions.
+ tracker.stack.drop(t.attr.falsy.ID(), t.attr.truthy.ID(), t.attr.expr.ID())
- if tracker.Limit != nil && tracker.cost > *tracker.Limit {
- panic(EvalCancelledError{Cause: CostLimitExceeded, Message: "operation cancelled: actual cost limit exceeded"})
+ // While the field names are identical, the boolean operation eval structs do not share an interface and so
+ // must be handled individually.
+ case *evalOr:
+ for _, term := range t.terms {
+ tracker.stack.drop(term.ID())
+ }
+ case *evalAnd:
+ for _, term := range t.terms {
+ tracker.stack.drop(term.ID())
+ }
+ case *evalExhaustiveOr:
+ for _, term := range t.terms {
+ tracker.stack.drop(term.ID())
+ }
+ case *evalExhaustiveAnd:
+ for _, term := range t.terms {
+ tracker.stack.drop(term.ID())
+ }
+ case *evalFold:
+ tracker.stack.drop(t.iterRange.ID())
+ case Qualifier:
+ tracker.cost++
+ case InterpretableCall:
+ if argVals, ok := tracker.stack.dropArgs(t.Args()); ok {
+ tracker.cost += tracker.costCall(t, argVals, val)
+ }
+ case InterpretableConstructor:
+ tracker.stack.dropArgs(t.InitVals())
+ switch t.Type() {
+ case types.ListType:
+ tracker.cost += common.ListCreateBaseCost
+ case types.MapType:
+ tracker.cost += common.MapCreateBaseCost
+ default:
+ tracker.cost += common.StructCreateBaseCost
}
}
- return observer
+ tracker.stack.push(val, id)
+
+ if tracker.Limit != nil && tracker.cost > *tracker.Limit {
+ panic(EvalCancelledError{Cause: CostLimitExceeded, Message: "operation cancelled: actual cost limit exceeded"})
+ }
}
// CostTrackerOption configures the behavior of CostTracker objects.
@@ -198,20 +293,20 @@ func (c *CostTracker) costCall(call InterpretableCall, args []ref.Val, result re
switch call.OverloadID() {
// O(n) functions
case overloads.StartsWithString, overloads.EndsWithString, overloads.StringToBytes, overloads.BytesToString, overloads.ExtQuoteString, overloads.ExtFormatString:
- cost += uint64(math.Ceil(float64(c.actualSize(args[0])) * common.StringTraversalCostFactor))
+ cost += uint64(math.Ceil(float64(actualSize(args[0])) * common.StringTraversalCostFactor))
case overloads.InList:
// If a list is composed entirely of constant values this is O(1), but we don't account for that here.
// We just assume all list containment checks are O(n).
- cost += c.actualSize(args[1])
+ cost += actualSize(args[1])
// O(min(m, n)) functions
case overloads.LessString, overloads.GreaterString, overloads.LessEqualsString, overloads.GreaterEqualsString,
overloads.LessBytes, overloads.GreaterBytes, overloads.LessEqualsBytes, overloads.GreaterEqualsBytes,
overloads.Equals, overloads.NotEquals:
// When we check the equality of 2 scalar values (e.g. 2 integers, 2 floating-point numbers, 2 booleans etc.),
- // the CostTracker.actualSize() function by definition returns 1 for each operand, resulting in an overall cost
+ // the CostTracker.ActualSize() function by definition returns 1 for each operand, resulting in an overall cost
// of 1.
- lhsSize := c.actualSize(args[0])
- rhsSize := c.actualSize(args[1])
+ lhsSize := actualSize(args[0])
+ rhsSize := actualSize(args[1])
minSize := lhsSize
if rhsSize < minSize {
minSize = rhsSize
@@ -220,23 +315,23 @@ func (c *CostTracker) costCall(call InterpretableCall, args []ref.Val, result re
// O(m+n) functions
case overloads.AddString, overloads.AddBytes:
// In the worst case scenario, we would need to reallocate a new backing store and copy both operands over.
- cost += uint64(math.Ceil(float64(c.actualSize(args[0])+c.actualSize(args[1])) * common.StringTraversalCostFactor))
+ cost += uint64(math.Ceil(float64(actualSize(args[0])+actualSize(args[1])) * common.StringTraversalCostFactor))
// O(nm) functions
case overloads.MatchesString:
// https://swtch.com/~rsc/regexp/regexp1.html applies to RE2 implementation supported by CEL
// Add one to string length for purposes of cost calculation to prevent product of string and regex to be 0
// in case where string is empty but regex is still expensive.
- strCost := uint64(math.Ceil((1.0 + float64(c.actualSize(args[0]))) * common.StringTraversalCostFactor))
+ strCost := uint64(math.Ceil((1.0 + float64(actualSize(args[0]))) * common.StringTraversalCostFactor))
// We don't know how many expressions are in the regex, just the string length (a huge
// improvement here would be to somehow get a count the number of expressions in the regex or
// how many states are in the regex state machine and use that to measure regex cost).
// For now, we're making a guess that each expression in a regex is typically at least 4 chars
// in length.
- regexCost := uint64(math.Ceil(float64(c.actualSize(args[1])) * common.RegexStringLengthCostFactor))
+ regexCost := uint64(math.Ceil(float64(actualSize(args[1])) * common.RegexStringLengthCostFactor))
cost += strCost * regexCost
case overloads.ContainsString:
- strCost := uint64(math.Ceil(float64(c.actualSize(args[0])) * common.StringTraversalCostFactor))
- substrCost := uint64(math.Ceil(float64(c.actualSize(args[1])) * common.StringTraversalCostFactor))
+ strCost := uint64(math.Ceil(float64(actualSize(args[0])) * common.StringTraversalCostFactor))
+ substrCost := uint64(math.Ceil(float64(actualSize(args[1])) * common.StringTraversalCostFactor))
cost += strCost * substrCost
default:
@@ -253,11 +348,15 @@ func (c *CostTracker) costCall(call InterpretableCall, args []ref.Val, result re
return cost
}
-// actualSize returns the size of value
-func (c *CostTracker) actualSize(value ref.Val) uint64 {
+// actualSize returns the size of the value for all traits.Sizer values, a fixed size for all proto-based
+// objects, and a size of 1 for all other value types.
+func actualSize(value ref.Val) uint64 {
if sz, ok := value.(traits.Sizer); ok {
return uint64(sz.Size().(types.Int))
}
+ if opt, ok := value.(*types.Optional); ok && opt.HasValue() {
+ return actualSize(opt.GetValue())
+ }
return 1
}
diff --git a/vendor/github.com/google/cel-go/parser/errors.go b/vendor/github.com/google/cel-go/parser/errors.go
index 93ae7a3ad..c3cec01a8 100644
--- a/vendor/github.com/google/cel-go/parser/errors.go
+++ b/vendor/github.com/google/cel-go/parser/errors.go
@@ -15,8 +15,6 @@
package parser
import (
- "fmt"
-
"github.com/google/cel-go/common"
)
@@ -31,11 +29,11 @@ func (e *parseErrors) errorCount() int {
}
func (e *parseErrors) internalError(message string) {
- e.errs.ReportErrorAtID(0, common.NoLocation, message)
+ e.errs.ReportErrorAtID(0, common.NoLocation, "%s", message)
}
func (e *parseErrors) syntaxError(l common.Location, message string) {
- e.errs.ReportErrorAtID(0, l, fmt.Sprintf("Syntax error: %s", message))
+ e.errs.ReportErrorAtID(0, l, "Syntax error: %s", message)
}
func (e *parseErrors) reportErrorAtID(id int64, l common.Location, message string, args ...any) {
diff --git a/vendor/github.com/google/cel-go/parser/gen/CEL.g4 b/vendor/github.com/google/cel-go/parser/gen/CEL.g4
index b011da803..ee53a844b 100644
--- a/vendor/github.com/google/cel-go/parser/gen/CEL.g4
+++ b/vendor/github.com/google/cel-go/parser/gen/CEL.g4
@@ -52,13 +52,14 @@ unary
member
: primary # PrimaryExpr
- | member op='.' (opt='?')? id=IDENTIFIER # Select
+ | member op='.' (opt='?')? id=escapeIdent # Select
| member op='.' id=IDENTIFIER open='(' args=exprList? ')' # MemberCall
| member op='[' (opt='?')? index=expr ']' # Index
;
primary
- : leadingDot='.'? id=IDENTIFIER (op='(' args=exprList? ')')? # IdentOrGlobalCall
+ : leadingDot='.'? id=IDENTIFIER # Ident
+ | leadingDot='.'? id=IDENTIFIER (op='(' args=exprList? ')') # GlobalCall
| '(' e=expr ')' # Nested
| op='[' elems=listInit? ','? ']' # CreateList
| op='{' entries=mapInitializerList? ','? '}' # CreateStruct
@@ -80,13 +81,18 @@ fieldInitializerList
;
optField
- : (opt='?')? IDENTIFIER
+ : (opt='?')? escapeIdent
;
mapInitializerList
: keys+=optExpr cols+=':' values+=expr (',' keys+=optExpr cols+=':' values+=expr)*
;
+escapeIdent
+ : id=IDENTIFIER # SimpleIdentifier
+ | id=ESC_IDENTIFIER # EscapedIdentifier
+;
+
optExpr
: (opt='?')? e=expr
;
@@ -198,3 +204,4 @@ STRING
BYTES : ('b' | 'B') STRING;
IDENTIFIER : (LETTER | '_') ( LETTER | DIGIT | '_')*;
+ESC_IDENTIFIER : '`' (LETTER | DIGIT | '_' | '.' | '-' | '/' | ' ')+ '`';
\ No newline at end of file
diff --git a/vendor/github.com/google/cel-go/parser/gen/CEL.interp b/vendor/github.com/google/cel-go/parser/gen/CEL.interp
index 75b8bb3e2..e085bab57 100644
--- a/vendor/github.com/google/cel-go/parser/gen/CEL.interp
+++ b/vendor/github.com/google/cel-go/parser/gen/CEL.interp
@@ -36,6 +36,7 @@ null
null
null
null
+null
token symbolic names:
null
@@ -75,6 +76,7 @@ NUM_UINT
STRING
BYTES
IDENTIFIER
+ESC_IDENTIFIER
rule names:
start
@@ -91,9 +93,10 @@ listInit
fieldInitializerList
optField
mapInitializerList
+escapeIdent
optExpr
literal
atn:
-[4, 1, 36, 251, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 42, 8, 1, 1, 2, 1, 2, 1, 2, 5, 2, 47, 8, 2, 10, 2, 12, 2, 50, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 55, 8, 3, 10, 3, 12, 3, 58, 9, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 66, 8, 4, 10, 4, 12, 4, 69, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 80, 8, 5, 10, 5, 12, 5, 83, 9, 5, 1, 6, 1, 6, 4, 6, 87, 8, 6, 11, 6, 12, 6, 88, 1, 6, 1, 6, 4, 6, 93, 8, 6, 11, 6, 12, 6, 94, 1, 6, 3, 6, 98, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 106, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 114, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 120, 8, 7, 1, 7, 1, 7, 1, 7, 5, 7, 125, 8, 7, 10, 7, 12, 7, 128, 9, 7, 1, 8, 3, 8, 131, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 136, 8, 8, 1, 8, 3, 8, 139, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 147, 8, 8, 1, 8, 3, 8, 150, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 155, 8, 8, 1, 8, 3, 8, 158, 8, 8, 1, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8, 167, 8, 8, 10, 8, 12, 8, 170, 9, 8, 1, 8, 1, 8, 3, 8, 174, 8, 8, 1, 8, 3, 8, 177, 8, 8, 1, 8, 1, 8, 3, 8, 181, 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 186, 8, 9, 10, 9, 12, 9, 189, 9, 9, 1, 10, 1, 10, 1, 10, 5, 10, 194, 8, 10, 10, 10, 12, 10, 197, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 207, 8, 11, 10, 11, 12, 11, 210, 9, 11, 1, 12, 3, 12, 213, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 225, 8, 13, 10, 13, 12, 13, 228, 9, 13, 1, 14, 3, 14, 231, 8, 14, 1, 14, 1, 14, 1, 15, 3, 15, 236, 8, 15, 1, 15, 1, 15, 1, 15, 3, 15, 241, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 249, 8, 15, 1, 15, 0, 3, 8, 10, 14, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 0, 3, 1, 0, 1, 7, 1, 0, 23, 25, 2, 0, 18, 18, 22, 22, 281, 0, 32, 1, 0, 0, 0, 2, 35, 1, 0, 0, 0, 4, 43, 1, 0, 0, 0, 6, 51, 1, 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 70, 1, 0, 0, 0, 12, 97, 1, 0, 0, 0, 14, 99, 1, 0, 0, 0, 16, 180, 1, 0, 0, 0, 18, 182, 1, 0, 0, 0, 20, 190, 1, 0, 0, 0, 22, 198, 1, 0, 0, 0, 24, 212, 1, 0, 0, 0, 26, 216, 1, 0, 0, 0, 28, 230, 1, 0, 0, 0, 30, 248, 1, 0, 0, 0, 32, 33, 3, 2, 1, 0, 33, 34, 5, 0, 0, 1, 34, 1, 1, 0, 0, 0, 35, 41, 3, 4, 2, 0, 36, 37, 5, 20, 0, 0, 37, 38, 3, 4, 2, 0, 38, 39, 5, 21, 0, 0, 39, 40, 3, 2, 1, 0, 40, 42, 1, 0, 0, 0, 41, 36, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 3, 1, 0, 0, 0, 43, 48, 3, 6, 3, 0, 44, 45, 5, 9, 0, 0, 45, 47, 3, 6, 3, 0, 46, 44, 1, 0, 0, 0, 47, 50, 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 48, 49, 1, 0, 0, 0, 49, 5, 1, 0, 0, 0, 50, 48, 1, 0, 0, 0, 51, 56, 3, 8, 4, 0, 52, 53, 5, 8, 0, 0, 53, 55, 3, 8, 4, 0, 54, 52, 1, 0, 0, 0, 55, 58, 1, 0, 0, 0, 56, 54, 1, 0, 0, 0, 56, 57, 1, 0, 0, 0, 57, 7, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 59, 60, 6, 4, -1, 0, 60, 61, 3, 10, 5, 0, 61, 67, 1, 0, 0, 0, 62, 63, 10, 1, 0, 0, 63, 64, 7, 0, 0, 0, 64, 66, 3, 8, 4, 2, 65, 62, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 9, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 71, 6, 5, -1, 0, 71, 72, 3, 12, 6, 0, 72, 81, 1, 0, 0, 0, 73, 74, 10, 2, 0, 0, 74, 75, 7, 1, 0, 0, 75, 80, 3, 10, 5, 3, 76, 77, 10, 1, 0, 0, 77, 78, 7, 2, 0, 0, 78, 80, 3, 10, 5, 2, 79, 73, 1, 0, 0, 0, 79, 76, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 11, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 98, 3, 14, 7, 0, 85, 87, 5, 19, 0, 0, 86, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 98, 3, 14, 7, 0, 91, 93, 5, 18, 0, 0, 92, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 3, 14, 7, 0, 97, 84, 1, 0, 0, 0, 97, 86, 1, 0, 0, 0, 97, 92, 1, 0, 0, 0, 98, 13, 1, 0, 0, 0, 99, 100, 6, 7, -1, 0, 100, 101, 3, 16, 8, 0, 101, 126, 1, 0, 0, 0, 102, 103, 10, 3, 0, 0, 103, 105, 5, 16, 0, 0, 104, 106, 5, 20, 0, 0, 105, 104, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 125, 5, 36, 0, 0, 108, 109, 10, 2, 0, 0, 109, 110, 5, 16, 0, 0, 110, 111, 5, 36, 0, 0, 111, 113, 5, 14, 0, 0, 112, 114, 3, 18, 9, 0, 113, 112, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 125, 5, 15, 0, 0, 116, 117, 10, 1, 0, 0, 117, 119, 5, 10, 0, 0, 118, 120, 5, 20, 0, 0, 119, 118, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 122, 3, 2, 1, 0, 122, 123, 5, 11, 0, 0, 123, 125, 1, 0, 0, 0, 124, 102, 1, 0, 0, 0, 124, 108, 1, 0, 0, 0, 124, 116, 1, 0, 0, 0, 125, 128, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 15, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 129, 131, 5, 16, 0, 0, 130, 129, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 138, 5, 36, 0, 0, 133, 135, 5, 14, 0, 0, 134, 136, 3, 18, 9, 0, 135, 134, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 139, 5, 15, 0, 0, 138, 133, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 181, 1, 0, 0, 0, 140, 141, 5, 14, 0, 0, 141, 142, 3, 2, 1, 0, 142, 143, 5, 15, 0, 0, 143, 181, 1, 0, 0, 0, 144, 146, 5, 10, 0, 0, 145, 147, 3, 20, 10, 0, 146, 145, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 149, 1, 0, 0, 0, 148, 150, 5, 17, 0, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 181, 5, 11, 0, 0, 152, 154, 5, 12, 0, 0, 153, 155, 3, 26, 13, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 157, 1, 0, 0, 0, 156, 158, 5, 17, 0, 0, 157, 156, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 181, 5, 13, 0, 0, 160, 162, 5, 16, 0, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 168, 5, 36, 0, 0, 164, 165, 5, 16, 0, 0, 165, 167, 5, 36, 0, 0, 166, 164, 1, 0, 0, 0, 167, 170, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 171, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 171, 173, 5, 12, 0, 0, 172, 174, 3, 22, 11, 0, 173, 172, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 177, 5, 17, 0, 0, 176, 175, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 181, 5, 13, 0, 0, 179, 181, 3, 30, 15, 0, 180, 130, 1, 0, 0, 0, 180, 140, 1, 0, 0, 0, 180, 144, 1, 0, 0, 0, 180, 152, 1, 0, 0, 0, 180, 161, 1, 0, 0, 0, 180, 179, 1, 0, 0, 0, 181, 17, 1, 0, 0, 0, 182, 187, 3, 2, 1, 0, 183, 184, 5, 17, 0, 0, 184, 186, 3, 2, 1, 0, 185, 183, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 19, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 190, 195, 3, 28, 14, 0, 191, 192, 5, 17, 0, 0, 192, 194, 3, 28, 14, 0, 193, 191, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 21, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 199, 3, 24, 12, 0, 199, 200, 5, 21, 0, 0, 200, 208, 3, 2, 1, 0, 201, 202, 5, 17, 0, 0, 202, 203, 3, 24, 12, 0, 203, 204, 5, 21, 0, 0, 204, 205, 3, 2, 1, 0, 205, 207, 1, 0, 0, 0, 206, 201, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 23, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 213, 5, 20, 0, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 36, 0, 0, 215, 25, 1, 0, 0, 0, 216, 217, 3, 28, 14, 0, 217, 218, 5, 21, 0, 0, 218, 226, 3, 2, 1, 0, 219, 220, 5, 17, 0, 0, 220, 221, 3, 28, 14, 0, 221, 222, 5, 21, 0, 0, 222, 223, 3, 2, 1, 0, 223, 225, 1, 0, 0, 0, 224, 219, 1, 0, 0, 0, 225, 228, 1, 0, 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 27, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 229, 231, 5, 20, 0, 0, 230, 229, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 3, 2, 1, 0, 233, 29, 1, 0, 0, 0, 234, 236, 5, 18, 0, 0, 235, 234, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 249, 5, 32, 0, 0, 238, 249, 5, 33, 0, 0, 239, 241, 5, 18, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 249, 5, 31, 0, 0, 243, 249, 5, 34, 0, 0, 244, 249, 5, 35, 0, 0, 245, 249, 5, 26, 0, 0, 246, 249, 5, 27, 0, 0, 247, 249, 5, 28, 0, 0, 248, 235, 1, 0, 0, 0, 248, 238, 1, 0, 0, 0, 248, 240, 1, 0, 0, 0, 248, 243, 1, 0, 0, 0, 248, 244, 1, 0, 0, 0, 248, 245, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, 247, 1, 0, 0, 0, 249, 31, 1, 0, 0, 0, 35, 41, 48, 56, 67, 79, 81, 88, 94, 97, 105, 113, 119, 124, 126, 130, 135, 138, 146, 149, 154, 157, 161, 168, 173, 176, 180, 187, 195, 208, 212, 226, 230, 235, 240, 248]
\ No newline at end of file
+[4, 1, 37, 259, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 44, 8, 1, 1, 2, 1, 2, 1, 2, 5, 2, 49, 8, 2, 10, 2, 12, 2, 52, 9, 2, 1, 3, 1, 3, 1, 3, 5, 3, 57, 8, 3, 10, 3, 12, 3, 60, 9, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 68, 8, 4, 10, 4, 12, 4, 71, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 82, 8, 5, 10, 5, 12, 5, 85, 9, 5, 1, 6, 1, 6, 4, 6, 89, 8, 6, 11, 6, 12, 6, 90, 1, 6, 1, 6, 4, 6, 95, 8, 6, 11, 6, 12, 6, 96, 1, 6, 3, 6, 100, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 108, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 116, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 122, 8, 7, 1, 7, 1, 7, 1, 7, 5, 7, 127, 8, 7, 10, 7, 12, 7, 130, 9, 7, 1, 8, 3, 8, 133, 8, 8, 1, 8, 1, 8, 3, 8, 137, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 142, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 151, 8, 8, 1, 8, 3, 8, 154, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 159, 8, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 3, 8, 166, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8, 171, 8, 8, 10, 8, 12, 8, 174, 9, 8, 1, 8, 1, 8, 3, 8, 178, 8, 8, 1, 8, 3, 8, 181, 8, 8, 1, 8, 1, 8, 3, 8, 185, 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 190, 8, 9, 10, 9, 12, 9, 193, 9, 9, 1, 10, 1, 10, 1, 10, 5, 10, 198, 8, 10, 10, 10, 12, 10, 201, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 211, 8, 11, 10, 11, 12, 11, 214, 9, 11, 1, 12, 3, 12, 217, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 229, 8, 13, 10, 13, 12, 13, 232, 9, 13, 1, 14, 1, 14, 3, 14, 236, 8, 14, 1, 15, 3, 15, 239, 8, 15, 1, 15, 1, 15, 1, 16, 3, 16, 244, 8, 16, 1, 16, 1, 16, 1, 16, 3, 16, 249, 8, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 257, 8, 16, 1, 16, 0, 3, 8, 10, 14, 17, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 0, 3, 1, 0, 1, 7, 1, 0, 23, 25, 2, 0, 18, 18, 22, 22, 290, 0, 34, 1, 0, 0, 0, 2, 37, 1, 0, 0, 0, 4, 45, 1, 0, 0, 0, 6, 53, 1, 0, 0, 0, 8, 61, 1, 0, 0, 0, 10, 72, 1, 0, 0, 0, 12, 99, 1, 0, 0, 0, 14, 101, 1, 0, 0, 0, 16, 184, 1, 0, 0, 0, 18, 186, 1, 0, 0, 0, 20, 194, 1, 0, 0, 0, 22, 202, 1, 0, 0, 0, 24, 216, 1, 0, 0, 0, 26, 220, 1, 0, 0, 0, 28, 235, 1, 0, 0, 0, 30, 238, 1, 0, 0, 0, 32, 256, 1, 0, 0, 0, 34, 35, 3, 2, 1, 0, 35, 36, 5, 0, 0, 1, 36, 1, 1, 0, 0, 0, 37, 43, 3, 4, 2, 0, 38, 39, 5, 20, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 5, 21, 0, 0, 41, 42, 3, 2, 1, 0, 42, 44, 1, 0, 0, 0, 43, 38, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 3, 1, 0, 0, 0, 45, 50, 3, 6, 3, 0, 46, 47, 5, 9, 0, 0, 47, 49, 3, 6, 3, 0, 48, 46, 1, 0, 0, 0, 49, 52, 1, 0, 0, 0, 50, 48, 1, 0, 0, 0, 50, 51, 1, 0, 0, 0, 51, 5, 1, 0, 0, 0, 52, 50, 1, 0, 0, 0, 53, 58, 3, 8, 4, 0, 54, 55, 5, 8, 0, 0, 55, 57, 3, 8, 4, 0, 56, 54, 1, 0, 0, 0, 57, 60, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 7, 1, 0, 0, 0, 60, 58, 1, 0, 0, 0, 61, 62, 6, 4, -1, 0, 62, 63, 3, 10, 5, 0, 63, 69, 1, 0, 0, 0, 64, 65, 10, 1, 0, 0, 65, 66, 7, 0, 0, 0, 66, 68, 3, 8, 4, 2, 67, 64, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 9, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 6, 5, -1, 0, 73, 74, 3, 12, 6, 0, 74, 83, 1, 0, 0, 0, 75, 76, 10, 2, 0, 0, 76, 77, 7, 1, 0, 0, 77, 82, 3, 10, 5, 3, 78, 79, 10, 1, 0, 0, 79, 80, 7, 2, 0, 0, 80, 82, 3, 10, 5, 2, 81, 75, 1, 0, 0, 0, 81, 78, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 11, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0, 86, 100, 3, 14, 7, 0, 87, 89, 5, 19, 0, 0, 88, 87, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 100, 3, 14, 7, 0, 93, 95, 5, 18, 0, 0, 94, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 100, 3, 14, 7, 0, 99, 86, 1, 0, 0, 0, 99, 88, 1, 0, 0, 0, 99, 94, 1, 0, 0, 0, 100, 13, 1, 0, 0, 0, 101, 102, 6, 7, -1, 0, 102, 103, 3, 16, 8, 0, 103, 128, 1, 0, 0, 0, 104, 105, 10, 3, 0, 0, 105, 107, 5, 16, 0, 0, 106, 108, 5, 20, 0, 0, 107, 106, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 127, 3, 28, 14, 0, 110, 111, 10, 2, 0, 0, 111, 112, 5, 16, 0, 0, 112, 113, 5, 36, 0, 0, 113, 115, 5, 14, 0, 0, 114, 116, 3, 18, 9, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 127, 5, 15, 0, 0, 118, 119, 10, 1, 0, 0, 119, 121, 5, 10, 0, 0, 120, 122, 5, 20, 0, 0, 121, 120, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 3, 2, 1, 0, 124, 125, 5, 11, 0, 0, 125, 127, 1, 0, 0, 0, 126, 104, 1, 0, 0, 0, 126, 110, 1, 0, 0, 0, 126, 118, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 15, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 133, 5, 16, 0, 0, 132, 131, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0, 134, 185, 5, 36, 0, 0, 135, 137, 5, 16, 0, 0, 136, 135, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 36, 0, 0, 139, 141, 5, 14, 0, 0, 140, 142, 3, 18, 9, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 185, 5, 15, 0, 0, 144, 145, 5, 14, 0, 0, 145, 146, 3, 2, 1, 0, 146, 147, 5, 15, 0, 0, 147, 185, 1, 0, 0, 0, 148, 150, 5, 10, 0, 0, 149, 151, 3, 20, 10, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 154, 5, 17, 0, 0, 153, 152, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 185, 5, 11, 0, 0, 156, 158, 5, 12, 0, 0, 157, 159, 3, 26, 13, 0, 158, 157, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 162, 5, 17, 0, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 185, 5, 13, 0, 0, 164, 166, 5, 16, 0, 0, 165, 164, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 172, 5, 36, 0, 0, 168, 169, 5, 16, 0, 0, 169, 171, 5, 36, 0, 0, 170, 168, 1, 0, 0, 0, 171, 174, 1, 0, 0, 0, 172, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 175, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 175, 177, 5, 12, 0, 0, 176, 178, 3, 22, 11, 0, 177, 176, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 180, 1, 0, 0, 0, 179, 181, 5, 17, 0, 0, 180, 179, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 185, 5, 13, 0, 0, 183, 185, 3, 32, 16, 0, 184, 132, 1, 0, 0, 0, 184, 136, 1, 0, 0, 0, 184, 144, 1, 0, 0, 0, 184, 148, 1, 0, 0, 0, 184, 156, 1, 0, 0, 0, 184, 165, 1, 0, 0, 0, 184, 183, 1, 0, 0, 0, 185, 17, 1, 0, 0, 0, 186, 191, 3, 2, 1, 0, 187, 188, 5, 17, 0, 0, 188, 190, 3, 2, 1, 0, 189, 187, 1, 0, 0, 0, 190, 193, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 19, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 194, 199, 3, 30, 15, 0, 195, 196, 5, 17, 0, 0, 196, 198, 3, 30, 15, 0, 197, 195, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 21, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 3, 24, 12, 0, 203, 204, 5, 21, 0, 0, 204, 212, 3, 2, 1, 0, 205, 206, 5, 17, 0, 0, 206, 207, 3, 24, 12, 0, 207, 208, 5, 21, 0, 0, 208, 209, 3, 2, 1, 0, 209, 211, 1, 0, 0, 0, 210, 205, 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 23, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 215, 217, 5, 20, 0, 0, 216, 215, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 219, 3, 28, 14, 0, 219, 25, 1, 0, 0, 0, 220, 221, 3, 30, 15, 0, 221, 222, 5, 21, 0, 0, 222, 230, 3, 2, 1, 0, 223, 224, 5, 17, 0, 0, 224, 225, 3, 30, 15, 0, 225, 226, 5, 21, 0, 0, 226, 227, 3, 2, 1, 0, 227, 229, 1, 0, 0, 0, 228, 223, 1, 0, 0, 0, 229, 232, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 27, 1, 0, 0, 0, 232, 230, 1, 0, 0, 0, 233, 236, 5, 36, 0, 0, 234, 236, 5, 37, 0, 0, 235, 233, 1, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 29, 1, 0, 0, 0, 237, 239, 5, 20, 0, 0, 238, 237, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 241, 3, 2, 1, 0, 241, 31, 1, 0, 0, 0, 242, 244, 5, 18, 0, 0, 243, 242, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 257, 5, 32, 0, 0, 246, 257, 5, 33, 0, 0, 247, 249, 5, 18, 0, 0, 248, 247, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 257, 5, 31, 0, 0, 251, 257, 5, 34, 0, 0, 252, 257, 5, 35, 0, 0, 253, 257, 5, 26, 0, 0, 254, 257, 5, 27, 0, 0, 255, 257, 5, 28, 0, 0, 256, 243, 1, 0, 0, 0, 256, 246, 1, 0, 0, 0, 256, 248, 1, 0, 0, 0, 256, 251, 1, 0, 0, 0, 256, 252, 1, 0, 0, 0, 256, 253, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257, 33, 1, 0, 0, 0, 36, 43, 50, 58, 69, 81, 83, 90, 96, 99, 107, 115, 121, 126, 128, 132, 136, 141, 150, 153, 158, 161, 165, 172, 177, 180, 184, 191, 199, 212, 216, 230, 235, 238, 243, 248, 256]
\ No newline at end of file
diff --git a/vendor/github.com/google/cel-go/parser/gen/CEL.tokens b/vendor/github.com/google/cel-go/parser/gen/CEL.tokens
index b305bdad3..aa1f5eee6 100644
--- a/vendor/github.com/google/cel-go/parser/gen/CEL.tokens
+++ b/vendor/github.com/google/cel-go/parser/gen/CEL.tokens
@@ -34,6 +34,7 @@ NUM_UINT=33
STRING=34
BYTES=35
IDENTIFIER=36
+ESC_IDENTIFIER=37
'=='=1
'!='=2
'in'=3
diff --git a/vendor/github.com/google/cel-go/parser/gen/CELLexer.interp b/vendor/github.com/google/cel-go/parser/gen/CELLexer.interp
index 26e7f471e..162d52188 100644
--- a/vendor/github.com/google/cel-go/parser/gen/CELLexer.interp
+++ b/vendor/github.com/google/cel-go/parser/gen/CELLexer.interp
@@ -36,6 +36,7 @@ null
null
null
null
+null
token symbolic names:
null
@@ -75,6 +76,7 @@ NUM_UINT
STRING
BYTES
IDENTIFIER
+ESC_IDENTIFIER
rule names:
EQUALS
@@ -124,6 +126,7 @@ NUM_UINT
STRING
BYTES
IDENTIFIER
+ESC_IDENTIFIER
channel names:
DEFAULT_TOKEN_CHANNEL
@@ -133,4 +136,4 @@ mode names:
DEFAULT_MODE
atn:
-[4, 0, 36, 423, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 177, 8, 31, 1, 31, 4, 31, 180, 8, 31, 11, 31, 12, 31, 181, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 192, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 225, 8, 38, 1, 39, 4, 39, 228, 8, 39, 11, 39, 12, 39, 229, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 238, 8, 40, 10, 40, 12, 40, 241, 9, 40, 1, 40, 1, 40, 1, 41, 4, 41, 246, 8, 41, 11, 41, 12, 41, 247, 1, 41, 1, 41, 4, 41, 252, 8, 41, 11, 41, 12, 41, 253, 1, 41, 3, 41, 257, 8, 41, 1, 41, 4, 41, 260, 8, 41, 11, 41, 12, 41, 261, 1, 41, 1, 41, 1, 41, 1, 41, 4, 41, 268, 8, 41, 11, 41, 12, 41, 269, 1, 41, 3, 41, 273, 8, 41, 3, 41, 275, 8, 41, 1, 42, 4, 42, 278, 8, 42, 11, 42, 12, 42, 279, 1, 42, 1, 42, 1, 42, 1, 42, 4, 42, 286, 8, 42, 11, 42, 12, 42, 287, 3, 42, 290, 8, 42, 1, 43, 4, 43, 293, 8, 43, 11, 43, 12, 43, 294, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 303, 8, 43, 11, 43, 12, 43, 304, 1, 43, 1, 43, 3, 43, 309, 8, 43, 1, 44, 1, 44, 1, 44, 5, 44, 314, 8, 44, 10, 44, 12, 44, 317, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 323, 8, 44, 10, 44, 12, 44, 326, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 335, 8, 44, 10, 44, 12, 44, 338, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 349, 8, 44, 10, 44, 12, 44, 352, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 360, 8, 44, 10, 44, 12, 44, 363, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 370, 8, 44, 10, 44, 12, 44, 373, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 383, 8, 44, 10, 44, 12, 44, 386, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 398, 8, 44, 10, 44, 12, 44, 401, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 407, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 414, 8, 46, 1, 46, 1, 46, 1, 46, 5, 46, 419, 8, 46, 10, 46, 12, 46, 422, 9, 46, 4, 336, 350, 384, 399, 0, 47, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 0, 59, 0, 61, 0, 63, 0, 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, 0, 79, 29, 81, 30, 83, 31, 85, 32, 87, 33, 89, 34, 91, 35, 93, 36, 1, 0, 16, 2, 0, 65, 90, 97, 122, 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 82, 82, 114, 114, 10, 0, 34, 34, 39, 39, 63, 63, 92, 92, 96, 98, 102, 102, 110, 110, 114, 114, 116, 116, 118, 118, 2, 0, 88, 88, 120, 120, 3, 0, 9, 10, 12, 13, 32, 32, 1, 0, 10, 10, 2, 0, 85, 85, 117, 117, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 39, 39, 92, 92, 1, 0, 92, 92, 3, 0, 10, 10, 13, 13, 34, 34, 3, 0, 10, 10, 13, 13, 39, 39, 2, 0, 66, 66, 98, 98, 456, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0, 3, 98, 1, 0, 0, 0, 5, 101, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 9, 106, 1, 0, 0, 0, 11, 109, 1, 0, 0, 0, 13, 112, 1, 0, 0, 0, 15, 114, 1, 0, 0, 0, 17, 117, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 122, 1, 0, 0, 0, 23, 124, 1, 0, 0, 0, 25, 126, 1, 0, 0, 0, 27, 128, 1, 0, 0, 0, 29, 130, 1, 0, 0, 0, 31, 132, 1, 0, 0, 0, 33, 134, 1, 0, 0, 0, 35, 136, 1, 0, 0, 0, 37, 138, 1, 0, 0, 0, 39, 140, 1, 0, 0, 0, 41, 142, 1, 0, 0, 0, 43, 144, 1, 0, 0, 0, 45, 146, 1, 0, 0, 0, 47, 148, 1, 0, 0, 0, 49, 150, 1, 0, 0, 0, 51, 152, 1, 0, 0, 0, 53, 157, 1, 0, 0, 0, 55, 163, 1, 0, 0, 0, 57, 168, 1, 0, 0, 0, 59, 170, 1, 0, 0, 0, 61, 172, 1, 0, 0, 0, 63, 174, 1, 0, 0, 0, 65, 183, 1, 0, 0, 0, 67, 185, 1, 0, 0, 0, 69, 191, 1, 0, 0, 0, 71, 193, 1, 0, 0, 0, 73, 196, 1, 0, 0, 0, 75, 201, 1, 0, 0, 0, 77, 224, 1, 0, 0, 0, 79, 227, 1, 0, 0, 0, 81, 233, 1, 0, 0, 0, 83, 274, 1, 0, 0, 0, 85, 289, 1, 0, 0, 0, 87, 308, 1, 0, 0, 0, 89, 406, 1, 0, 0, 0, 91, 408, 1, 0, 0, 0, 93, 413, 1, 0, 0, 0, 95, 96, 5, 61, 0, 0, 96, 97, 5, 61, 0, 0, 97, 2, 1, 0, 0, 0, 98, 99, 5, 33, 0, 0, 99, 100, 5, 61, 0, 0, 100, 4, 1, 0, 0, 0, 101, 102, 5, 105, 0, 0, 102, 103, 5, 110, 0, 0, 103, 6, 1, 0, 0, 0, 104, 105, 5, 60, 0, 0, 105, 8, 1, 0, 0, 0, 106, 107, 5, 60, 0, 0, 107, 108, 5, 61, 0, 0, 108, 10, 1, 0, 0, 0, 109, 110, 5, 62, 0, 0, 110, 111, 5, 61, 0, 0, 111, 12, 1, 0, 0, 0, 112, 113, 5, 62, 0, 0, 113, 14, 1, 0, 0, 0, 114, 115, 5, 38, 0, 0, 115, 116, 5, 38, 0, 0, 116, 16, 1, 0, 0, 0, 117, 118, 5, 124, 0, 0, 118, 119, 5, 124, 0, 0, 119, 18, 1, 0, 0, 0, 120, 121, 5, 91, 0, 0, 121, 20, 1, 0, 0, 0, 122, 123, 5, 93, 0, 0, 123, 22, 1, 0, 0, 0, 124, 125, 5, 123, 0, 0, 125, 24, 1, 0, 0, 0, 126, 127, 5, 125, 0, 0, 127, 26, 1, 0, 0, 0, 128, 129, 5, 40, 0, 0, 129, 28, 1, 0, 0, 0, 130, 131, 5, 41, 0, 0, 131, 30, 1, 0, 0, 0, 132, 133, 5, 46, 0, 0, 133, 32, 1, 0, 0, 0, 134, 135, 5, 44, 0, 0, 135, 34, 1, 0, 0, 0, 136, 137, 5, 45, 0, 0, 137, 36, 1, 0, 0, 0, 138, 139, 5, 33, 0, 0, 139, 38, 1, 0, 0, 0, 140, 141, 5, 63, 0, 0, 141, 40, 1, 0, 0, 0, 142, 143, 5, 58, 0, 0, 143, 42, 1, 0, 0, 0, 144, 145, 5, 43, 0, 0, 145, 44, 1, 0, 0, 0, 146, 147, 5, 42, 0, 0, 147, 46, 1, 0, 0, 0, 148, 149, 5, 47, 0, 0, 149, 48, 1, 0, 0, 0, 150, 151, 5, 37, 0, 0, 151, 50, 1, 0, 0, 0, 152, 153, 5, 116, 0, 0, 153, 154, 5, 114, 0, 0, 154, 155, 5, 117, 0, 0, 155, 156, 5, 101, 0, 0, 156, 52, 1, 0, 0, 0, 157, 158, 5, 102, 0, 0, 158, 159, 5, 97, 0, 0, 159, 160, 5, 108, 0, 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 54, 1, 0, 0, 0, 163, 164, 5, 110, 0, 0, 164, 165, 5, 117, 0, 0, 165, 166, 5, 108, 0, 0, 166, 167, 5, 108, 0, 0, 167, 56, 1, 0, 0, 0, 168, 169, 5, 92, 0, 0, 169, 58, 1, 0, 0, 0, 170, 171, 7, 0, 0, 0, 171, 60, 1, 0, 0, 0, 172, 173, 2, 48, 57, 0, 173, 62, 1, 0, 0, 0, 174, 176, 7, 1, 0, 0, 175, 177, 7, 2, 0, 0, 176, 175, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 1, 0, 0, 0, 178, 180, 3, 61, 30, 0, 179, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 64, 1, 0, 0, 0, 183, 184, 7, 3, 0, 0, 184, 66, 1, 0, 0, 0, 185, 186, 7, 4, 0, 0, 186, 68, 1, 0, 0, 0, 187, 192, 3, 71, 35, 0, 188, 192, 3, 75, 37, 0, 189, 192, 3, 77, 38, 0, 190, 192, 3, 73, 36, 0, 191, 187, 1, 0, 0, 0, 191, 188, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 190, 1, 0, 0, 0, 192, 70, 1, 0, 0, 0, 193, 194, 3, 57, 28, 0, 194, 195, 7, 5, 0, 0, 195, 72, 1, 0, 0, 0, 196, 197, 3, 57, 28, 0, 197, 198, 2, 48, 51, 0, 198, 199, 2, 48, 55, 0, 199, 200, 2, 48, 55, 0, 200, 74, 1, 0, 0, 0, 201, 202, 3, 57, 28, 0, 202, 203, 7, 6, 0, 0, 203, 204, 3, 65, 32, 0, 204, 205, 3, 65, 32, 0, 205, 76, 1, 0, 0, 0, 206, 207, 3, 57, 28, 0, 207, 208, 5, 117, 0, 0, 208, 209, 3, 65, 32, 0, 209, 210, 3, 65, 32, 0, 210, 211, 3, 65, 32, 0, 211, 212, 3, 65, 32, 0, 212, 225, 1, 0, 0, 0, 213, 214, 3, 57, 28, 0, 214, 215, 5, 85, 0, 0, 215, 216, 3, 65, 32, 0, 216, 217, 3, 65, 32, 0, 217, 218, 3, 65, 32, 0, 218, 219, 3, 65, 32, 0, 219, 220, 3, 65, 32, 0, 220, 221, 3, 65, 32, 0, 221, 222, 3, 65, 32, 0, 222, 223, 3, 65, 32, 0, 223, 225, 1, 0, 0, 0, 224, 206, 1, 0, 0, 0, 224, 213, 1, 0, 0, 0, 225, 78, 1, 0, 0, 0, 226, 228, 7, 7, 0, 0, 227, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 229, 230, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 6, 39, 0, 0, 232, 80, 1, 0, 0, 0, 233, 234, 5, 47, 0, 0, 234, 235, 5, 47, 0, 0, 235, 239, 1, 0, 0, 0, 236, 238, 8, 8, 0, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 6, 40, 0, 0, 243, 82, 1, 0, 0, 0, 244, 246, 3, 61, 30, 0, 245, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 5, 46, 0, 0, 250, 252, 3, 61, 30, 0, 251, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 1, 0, 0, 0, 255, 257, 3, 63, 31, 0, 256, 255, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 275, 1, 0, 0, 0, 258, 260, 3, 61, 30, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 264, 3, 63, 31, 0, 264, 275, 1, 0, 0, 0, 265, 267, 5, 46, 0, 0, 266, 268, 3, 61, 30, 0, 267, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 272, 1, 0, 0, 0, 271, 273, 3, 63, 31, 0, 272, 271, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1, 0, 0, 0, 274, 245, 1, 0, 0, 0, 274, 259, 1, 0, 0, 0, 274, 265, 1, 0, 0, 0, 275, 84, 1, 0, 0, 0, 276, 278, 3, 61, 30, 0, 277, 276, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 290, 1, 0, 0, 0, 281, 282, 5, 48, 0, 0, 282, 283, 5, 120, 0, 0, 283, 285, 1, 0, 0, 0, 284, 286, 3, 65, 32, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 1, 0, 0, 0, 289, 277, 1, 0, 0, 0, 289, 281, 1, 0, 0, 0, 290, 86, 1, 0, 0, 0, 291, 293, 3, 61, 30, 0, 292, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 292, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 7, 9, 0, 0, 297, 309, 1, 0, 0, 0, 298, 299, 5, 48, 0, 0, 299, 300, 5, 120, 0, 0, 300, 302, 1, 0, 0, 0, 301, 303, 3, 65, 32, 0, 302, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 7, 9, 0, 0, 307, 309, 1, 0, 0, 0, 308, 292, 1, 0, 0, 0, 308, 298, 1, 0, 0, 0, 309, 88, 1, 0, 0, 0, 310, 315, 5, 34, 0, 0, 311, 314, 3, 69, 34, 0, 312, 314, 8, 10, 0, 0, 313, 311, 1, 0, 0, 0, 313, 312, 1, 0, 0, 0, 314, 317, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 318, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 407, 5, 34, 0, 0, 319, 324, 5, 39, 0, 0, 320, 323, 3, 69, 34, 0, 321, 323, 8, 11, 0, 0, 322, 320, 1, 0, 0, 0, 322, 321, 1, 0, 0, 0, 323, 326, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 327, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 327, 407, 5, 39, 0, 0, 328, 329, 5, 34, 0, 0, 329, 330, 5, 34, 0, 0, 330, 331, 5, 34, 0, 0, 331, 336, 1, 0, 0, 0, 332, 335, 3, 69, 34, 0, 333, 335, 8, 12, 0, 0, 334, 332, 1, 0, 0, 0, 334, 333, 1, 0, 0, 0, 335, 338, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337, 339, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 340, 5, 34, 0, 0, 340, 341, 5, 34, 0, 0, 341, 407, 5, 34, 0, 0, 342, 343, 5, 39, 0, 0, 343, 344, 5, 39, 0, 0, 344, 345, 5, 39, 0, 0, 345, 350, 1, 0, 0, 0, 346, 349, 3, 69, 34, 0, 347, 349, 8, 12, 0, 0, 348, 346, 1, 0, 0, 0, 348, 347, 1, 0, 0, 0, 349, 352, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 351, 353, 1, 0, 0, 0, 352, 350, 1, 0, 0, 0, 353, 354, 5, 39, 0, 0, 354, 355, 5, 39, 0, 0, 355, 407, 5, 39, 0, 0, 356, 357, 3, 67, 33, 0, 357, 361, 5, 34, 0, 0, 358, 360, 8, 13, 0, 0, 359, 358, 1, 0, 0, 0, 360, 363, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 364, 1, 0, 0, 0, 363, 361, 1, 0, 0, 0, 364, 365, 5, 34, 0, 0, 365, 407, 1, 0, 0, 0, 366, 367, 3, 67, 33, 0, 367, 371, 5, 39, 0, 0, 368, 370, 8, 14, 0, 0, 369, 368, 1, 0, 0, 0, 370, 373, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 371, 372, 1, 0, 0, 0, 372, 374, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 374, 375, 5, 39, 0, 0, 375, 407, 1, 0, 0, 0, 376, 377, 3, 67, 33, 0, 377, 378, 5, 34, 0, 0, 378, 379, 5, 34, 0, 0, 379, 380, 5, 34, 0, 0, 380, 384, 1, 0, 0, 0, 381, 383, 9, 0, 0, 0, 382, 381, 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 385, 1, 0, 0, 0, 384, 382, 1, 0, 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 388, 5, 34, 0, 0, 388, 389, 5, 34, 0, 0, 389, 390, 5, 34, 0, 0, 390, 407, 1, 0, 0, 0, 391, 392, 3, 67, 33, 0, 392, 393, 5, 39, 0, 0, 393, 394, 5, 39, 0, 0, 394, 395, 5, 39, 0, 0, 395, 399, 1, 0, 0, 0, 396, 398, 9, 0, 0, 0, 397, 396, 1, 0, 0, 0, 398, 401, 1, 0, 0, 0, 399, 400, 1, 0, 0, 0, 399, 397, 1, 0, 0, 0, 400, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402, 403, 5, 39, 0, 0, 403, 404, 5, 39, 0, 0, 404, 405, 5, 39, 0, 0, 405, 407, 1, 0, 0, 0, 406, 310, 1, 0, 0, 0, 406, 319, 1, 0, 0, 0, 406, 328, 1, 0, 0, 0, 406, 342, 1, 0, 0, 0, 406, 356, 1, 0, 0, 0, 406, 366, 1, 0, 0, 0, 406, 376, 1, 0, 0, 0, 406, 391, 1, 0, 0, 0, 407, 90, 1, 0, 0, 0, 408, 409, 7, 15, 0, 0, 409, 410, 3, 89, 44, 0, 410, 92, 1, 0, 0, 0, 411, 414, 3, 59, 29, 0, 412, 414, 5, 95, 0, 0, 413, 411, 1, 0, 0, 0, 413, 412, 1, 0, 0, 0, 414, 420, 1, 0, 0, 0, 415, 419, 3, 59, 29, 0, 416, 419, 3, 61, 30, 0, 417, 419, 5, 95, 0, 0, 418, 415, 1, 0, 0, 0, 418, 416, 1, 0, 0, 0, 418, 417, 1, 0, 0, 0, 419, 422, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 420, 421, 1, 0, 0, 0, 421, 94, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 36, 0, 176, 181, 191, 224, 229, 239, 247, 253, 256, 261, 269, 272, 274, 279, 287, 289, 294, 304, 308, 313, 315, 322, 324, 334, 336, 348, 350, 361, 371, 384, 399, 406, 413, 418, 420, 1, 0, 1, 0]
\ No newline at end of file
+[4, 0, 37, 435, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 179, 8, 31, 1, 31, 4, 31, 182, 8, 31, 11, 31, 12, 31, 183, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 194, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 227, 8, 38, 1, 39, 4, 39, 230, 8, 39, 11, 39, 12, 39, 231, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 240, 8, 40, 10, 40, 12, 40, 243, 9, 40, 1, 40, 1, 40, 1, 41, 4, 41, 248, 8, 41, 11, 41, 12, 41, 249, 1, 41, 1, 41, 4, 41, 254, 8, 41, 11, 41, 12, 41, 255, 1, 41, 3, 41, 259, 8, 41, 1, 41, 4, 41, 262, 8, 41, 11, 41, 12, 41, 263, 1, 41, 1, 41, 1, 41, 1, 41, 4, 41, 270, 8, 41, 11, 41, 12, 41, 271, 1, 41, 3, 41, 275, 8, 41, 3, 41, 277, 8, 41, 1, 42, 4, 42, 280, 8, 42, 11, 42, 12, 42, 281, 1, 42, 1, 42, 1, 42, 1, 42, 4, 42, 288, 8, 42, 11, 42, 12, 42, 289, 3, 42, 292, 8, 42, 1, 43, 4, 43, 295, 8, 43, 11, 43, 12, 43, 296, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 305, 8, 43, 11, 43, 12, 43, 306, 1, 43, 1, 43, 3, 43, 311, 8, 43, 1, 44, 1, 44, 1, 44, 5, 44, 316, 8, 44, 10, 44, 12, 44, 319, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 325, 8, 44, 10, 44, 12, 44, 328, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 337, 8, 44, 10, 44, 12, 44, 340, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 351, 8, 44, 10, 44, 12, 44, 354, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 362, 8, 44, 10, 44, 12, 44, 365, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 372, 8, 44, 10, 44, 12, 44, 375, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 385, 8, 44, 10, 44, 12, 44, 388, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 400, 8, 44, 10, 44, 12, 44, 403, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 409, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 416, 8, 46, 1, 46, 1, 46, 1, 46, 5, 46, 421, 8, 46, 10, 46, 12, 46, 424, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 4, 47, 430, 8, 47, 11, 47, 12, 47, 431, 1, 47, 1, 47, 4, 338, 352, 386, 401, 0, 48, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 0, 59, 0, 61, 0, 63, 0, 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, 0, 79, 29, 81, 30, 83, 31, 85, 32, 87, 33, 89, 34, 91, 35, 93, 36, 95, 37, 1, 0, 17, 2, 0, 65, 90, 97, 122, 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 82, 82, 114, 114, 10, 0, 34, 34, 39, 39, 63, 63, 92, 92, 96, 98, 102, 102, 110, 110, 114, 114, 116, 116, 118, 118, 2, 0, 88, 88, 120, 120, 3, 0, 9, 10, 12, 13, 32, 32, 1, 0, 10, 10, 2, 0, 85, 85, 117, 117, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 39, 39, 92, 92, 1, 0, 92, 92, 3, 0, 10, 10, 13, 13, 34, 34, 3, 0, 10, 10, 13, 13, 39, 39, 2, 0, 66, 66, 98, 98, 3, 0, 32, 32, 45, 47, 95, 95, 471, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 1, 97, 1, 0, 0, 0, 3, 100, 1, 0, 0, 0, 5, 103, 1, 0, 0, 0, 7, 106, 1, 0, 0, 0, 9, 108, 1, 0, 0, 0, 11, 111, 1, 0, 0, 0, 13, 114, 1, 0, 0, 0, 15, 116, 1, 0, 0, 0, 17, 119, 1, 0, 0, 0, 19, 122, 1, 0, 0, 0, 21, 124, 1, 0, 0, 0, 23, 126, 1, 0, 0, 0, 25, 128, 1, 0, 0, 0, 27, 130, 1, 0, 0, 0, 29, 132, 1, 0, 0, 0, 31, 134, 1, 0, 0, 0, 33, 136, 1, 0, 0, 0, 35, 138, 1, 0, 0, 0, 37, 140, 1, 0, 0, 0, 39, 142, 1, 0, 0, 0, 41, 144, 1, 0, 0, 0, 43, 146, 1, 0, 0, 0, 45, 148, 1, 0, 0, 0, 47, 150, 1, 0, 0, 0, 49, 152, 1, 0, 0, 0, 51, 154, 1, 0, 0, 0, 53, 159, 1, 0, 0, 0, 55, 165, 1, 0, 0, 0, 57, 170, 1, 0, 0, 0, 59, 172, 1, 0, 0, 0, 61, 174, 1, 0, 0, 0, 63, 176, 1, 0, 0, 0, 65, 185, 1, 0, 0, 0, 67, 187, 1, 0, 0, 0, 69, 193, 1, 0, 0, 0, 71, 195, 1, 0, 0, 0, 73, 198, 1, 0, 0, 0, 75, 203, 1, 0, 0, 0, 77, 226, 1, 0, 0, 0, 79, 229, 1, 0, 0, 0, 81, 235, 1, 0, 0, 0, 83, 276, 1, 0, 0, 0, 85, 291, 1, 0, 0, 0, 87, 310, 1, 0, 0, 0, 89, 408, 1, 0, 0, 0, 91, 410, 1, 0, 0, 0, 93, 415, 1, 0, 0, 0, 95, 425, 1, 0, 0, 0, 97, 98, 5, 61, 0, 0, 98, 99, 5, 61, 0, 0, 99, 2, 1, 0, 0, 0, 100, 101, 5, 33, 0, 0, 101, 102, 5, 61, 0, 0, 102, 4, 1, 0, 0, 0, 103, 104, 5, 105, 0, 0, 104, 105, 5, 110, 0, 0, 105, 6, 1, 0, 0, 0, 106, 107, 5, 60, 0, 0, 107, 8, 1, 0, 0, 0, 108, 109, 5, 60, 0, 0, 109, 110, 5, 61, 0, 0, 110, 10, 1, 0, 0, 0, 111, 112, 5, 62, 0, 0, 112, 113, 5, 61, 0, 0, 113, 12, 1, 0, 0, 0, 114, 115, 5, 62, 0, 0, 115, 14, 1, 0, 0, 0, 116, 117, 5, 38, 0, 0, 117, 118, 5, 38, 0, 0, 118, 16, 1, 0, 0, 0, 119, 120, 5, 124, 0, 0, 120, 121, 5, 124, 0, 0, 121, 18, 1, 0, 0, 0, 122, 123, 5, 91, 0, 0, 123, 20, 1, 0, 0, 0, 124, 125, 5, 93, 0, 0, 125, 22, 1, 0, 0, 0, 126, 127, 5, 123, 0, 0, 127, 24, 1, 0, 0, 0, 128, 129, 5, 125, 0, 0, 129, 26, 1, 0, 0, 0, 130, 131, 5, 40, 0, 0, 131, 28, 1, 0, 0, 0, 132, 133, 5, 41, 0, 0, 133, 30, 1, 0, 0, 0, 134, 135, 5, 46, 0, 0, 135, 32, 1, 0, 0, 0, 136, 137, 5, 44, 0, 0, 137, 34, 1, 0, 0, 0, 138, 139, 5, 45, 0, 0, 139, 36, 1, 0, 0, 0, 140, 141, 5, 33, 0, 0, 141, 38, 1, 0, 0, 0, 142, 143, 5, 63, 0, 0, 143, 40, 1, 0, 0, 0, 144, 145, 5, 58, 0, 0, 145, 42, 1, 0, 0, 0, 146, 147, 5, 43, 0, 0, 147, 44, 1, 0, 0, 0, 148, 149, 5, 42, 0, 0, 149, 46, 1, 0, 0, 0, 150, 151, 5, 47, 0, 0, 151, 48, 1, 0, 0, 0, 152, 153, 5, 37, 0, 0, 153, 50, 1, 0, 0, 0, 154, 155, 5, 116, 0, 0, 155, 156, 5, 114, 0, 0, 156, 157, 5, 117, 0, 0, 157, 158, 5, 101, 0, 0, 158, 52, 1, 0, 0, 0, 159, 160, 5, 102, 0, 0, 160, 161, 5, 97, 0, 0, 161, 162, 5, 108, 0, 0, 162, 163, 5, 115, 0, 0, 163, 164, 5, 101, 0, 0, 164, 54, 1, 0, 0, 0, 165, 166, 5, 110, 0, 0, 166, 167, 5, 117, 0, 0, 167, 168, 5, 108, 0, 0, 168, 169, 5, 108, 0, 0, 169, 56, 1, 0, 0, 0, 170, 171, 5, 92, 0, 0, 171, 58, 1, 0, 0, 0, 172, 173, 7, 0, 0, 0, 173, 60, 1, 0, 0, 0, 174, 175, 2, 48, 57, 0, 175, 62, 1, 0, 0, 0, 176, 178, 7, 1, 0, 0, 177, 179, 7, 2, 0, 0, 178, 177, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 181, 1, 0, 0, 0, 180, 182, 3, 61, 30, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 64, 1, 0, 0, 0, 185, 186, 7, 3, 0, 0, 186, 66, 1, 0, 0, 0, 187, 188, 7, 4, 0, 0, 188, 68, 1, 0, 0, 0, 189, 194, 3, 71, 35, 0, 190, 194, 3, 75, 37, 0, 191, 194, 3, 77, 38, 0, 192, 194, 3, 73, 36, 0, 193, 189, 1, 0, 0, 0, 193, 190, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 193, 192, 1, 0, 0, 0, 194, 70, 1, 0, 0, 0, 195, 196, 3, 57, 28, 0, 196, 197, 7, 5, 0, 0, 197, 72, 1, 0, 0, 0, 198, 199, 3, 57, 28, 0, 199, 200, 2, 48, 51, 0, 200, 201, 2, 48, 55, 0, 201, 202, 2, 48, 55, 0, 202, 74, 1, 0, 0, 0, 203, 204, 3, 57, 28, 0, 204, 205, 7, 6, 0, 0, 205, 206, 3, 65, 32, 0, 206, 207, 3, 65, 32, 0, 207, 76, 1, 0, 0, 0, 208, 209, 3, 57, 28, 0, 209, 210, 5, 117, 0, 0, 210, 211, 3, 65, 32, 0, 211, 212, 3, 65, 32, 0, 212, 213, 3, 65, 32, 0, 213, 214, 3, 65, 32, 0, 214, 227, 1, 0, 0, 0, 215, 216, 3, 57, 28, 0, 216, 217, 5, 85, 0, 0, 217, 218, 3, 65, 32, 0, 218, 219, 3, 65, 32, 0, 219, 220, 3, 65, 32, 0, 220, 221, 3, 65, 32, 0, 221, 222, 3, 65, 32, 0, 222, 223, 3, 65, 32, 0, 223, 224, 3, 65, 32, 0, 224, 225, 3, 65, 32, 0, 225, 227, 1, 0, 0, 0, 226, 208, 1, 0, 0, 0, 226, 215, 1, 0, 0, 0, 227, 78, 1, 0, 0, 0, 228, 230, 7, 7, 0, 0, 229, 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 1, 0, 0, 0, 233, 234, 6, 39, 0, 0, 234, 80, 1, 0, 0, 0, 235, 236, 5, 47, 0, 0, 236, 237, 5, 47, 0, 0, 237, 241, 1, 0, 0, 0, 238, 240, 8, 8, 0, 0, 239, 238, 1, 0, 0, 0, 240, 243, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 1, 0, 0, 0, 243, 241, 1, 0, 0, 0, 244, 245, 6, 40, 0, 0, 245, 82, 1, 0, 0, 0, 246, 248, 3, 61, 30, 0, 247, 246, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 247, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 253, 5, 46, 0, 0, 252, 254, 3, 61, 30, 0, 253, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 258, 1, 0, 0, 0, 257, 259, 3, 63, 31, 0, 258, 257, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 277, 1, 0, 0, 0, 260, 262, 3, 61, 30, 0, 261, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 3, 63, 31, 0, 266, 277, 1, 0, 0, 0, 267, 269, 5, 46, 0, 0, 268, 270, 3, 61, 30, 0, 269, 268, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 274, 1, 0, 0, 0, 273, 275, 3, 63, 31, 0, 274, 273, 1, 0, 0, 0, 274, 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 247, 1, 0, 0, 0, 276, 261, 1, 0, 0, 0, 276, 267, 1, 0, 0, 0, 277, 84, 1, 0, 0, 0, 278, 280, 3, 61, 30, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 292, 1, 0, 0, 0, 283, 284, 5, 48, 0, 0, 284, 285, 5, 120, 0, 0, 285, 287, 1, 0, 0, 0, 286, 288, 3, 65, 32, 0, 287, 286, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 292, 1, 0, 0, 0, 291, 279, 1, 0, 0, 0, 291, 283, 1, 0, 0, 0, 292, 86, 1, 0, 0, 0, 293, 295, 3, 61, 30, 0, 294, 293, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 7, 9, 0, 0, 299, 311, 1, 0, 0, 0, 300, 301, 5, 48, 0, 0, 301, 302, 5, 120, 0, 0, 302, 304, 1, 0, 0, 0, 303, 305, 3, 65, 32, 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 309, 7, 9, 0, 0, 309, 311, 1, 0, 0, 0, 310, 294, 1, 0, 0, 0, 310, 300, 1, 0, 0, 0, 311, 88, 1, 0, 0, 0, 312, 317, 5, 34, 0, 0, 313, 316, 3, 69, 34, 0, 314, 316, 8, 10, 0, 0, 315, 313, 1, 0, 0, 0, 315, 314, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 318, 320, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 320, 409, 5, 34, 0, 0, 321, 326, 5, 39, 0, 0, 322, 325, 3, 69, 34, 0, 323, 325, 8, 11, 0, 0, 324, 322, 1, 0, 0, 0, 324, 323, 1, 0, 0, 0, 325, 328, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 329, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 329, 409, 5, 39, 0, 0, 330, 331, 5, 34, 0, 0, 331, 332, 5, 34, 0, 0, 332, 333, 5, 34, 0, 0, 333, 338, 1, 0, 0, 0, 334, 337, 3, 69, 34, 0, 335, 337, 8, 12, 0, 0, 336, 334, 1, 0, 0, 0, 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 341, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 341, 342, 5, 34, 0, 0, 342, 343, 5, 34, 0, 0, 343, 409, 5, 34, 0, 0, 344, 345, 5, 39, 0, 0, 345, 346, 5, 39, 0, 0, 346, 347, 5, 39, 0, 0, 347, 352, 1, 0, 0, 0, 348, 351, 3, 69, 34, 0, 349, 351, 8, 12, 0, 0, 350, 348, 1, 0, 0, 0, 350, 349, 1, 0, 0, 0, 351, 354, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, 352, 350, 1, 0, 0, 0, 353, 355, 1, 0, 0, 0, 354, 352, 1, 0, 0, 0, 355, 356, 5, 39, 0, 0, 356, 357, 5, 39, 0, 0, 357, 409, 5, 39, 0, 0, 358, 359, 3, 67, 33, 0, 359, 363, 5, 34, 0, 0, 360, 362, 8, 13, 0, 0, 361, 360, 1, 0, 0, 0, 362, 365, 1, 0, 0, 0, 363, 361, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 366, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 366, 367, 5, 34, 0, 0, 367, 409, 1, 0, 0, 0, 368, 369, 3, 67, 33, 0, 369, 373, 5, 39, 0, 0, 370, 372, 8, 14, 0, 0, 371, 370, 1, 0, 0, 0, 372, 375, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 376, 1, 0, 0, 0, 375, 373, 1, 0, 0, 0, 376, 377, 5, 39, 0, 0, 377, 409, 1, 0, 0, 0, 378, 379, 3, 67, 33, 0, 379, 380, 5, 34, 0, 0, 380, 381, 5, 34, 0, 0, 381, 382, 5, 34, 0, 0, 382, 386, 1, 0, 0, 0, 383, 385, 9, 0, 0, 0, 384, 383, 1, 0, 0, 0, 385, 388, 1, 0, 0, 0, 386, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 389, 1, 0, 0, 0, 388, 386, 1, 0, 0, 0, 389, 390, 5, 34, 0, 0, 390, 391, 5, 34, 0, 0, 391, 392, 5, 34, 0, 0, 392, 409, 1, 0, 0, 0, 393, 394, 3, 67, 33, 0, 394, 395, 5, 39, 0, 0, 395, 396, 5, 39, 0, 0, 396, 397, 5, 39, 0, 0, 397, 401, 1, 0, 0, 0, 398, 400, 9, 0, 0, 0, 399, 398, 1, 0, 0, 0, 400, 403, 1, 0, 0, 0, 401, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402, 404, 1, 0, 0, 0, 403, 401, 1, 0, 0, 0, 404, 405, 5, 39, 0, 0, 405, 406, 5, 39, 0, 0, 406, 407, 5, 39, 0, 0, 407, 409, 1, 0, 0, 0, 408, 312, 1, 0, 0, 0, 408, 321, 1, 0, 0, 0, 408, 330, 1, 0, 0, 0, 408, 344, 1, 0, 0, 0, 408, 358, 1, 0, 0, 0, 408, 368, 1, 0, 0, 0, 408, 378, 1, 0, 0, 0, 408, 393, 1, 0, 0, 0, 409, 90, 1, 0, 0, 0, 410, 411, 7, 15, 0, 0, 411, 412, 3, 89, 44, 0, 412, 92, 1, 0, 0, 0, 413, 416, 3, 59, 29, 0, 414, 416, 5, 95, 0, 0, 415, 413, 1, 0, 0, 0, 415, 414, 1, 0, 0, 0, 416, 422, 1, 0, 0, 0, 417, 421, 3, 59, 29, 0, 418, 421, 3, 61, 30, 0, 419, 421, 5, 95, 0, 0, 420, 417, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 420, 419, 1, 0, 0, 0, 421, 424, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 94, 1, 0, 0, 0, 424, 422, 1, 0, 0, 0, 425, 429, 5, 96, 0, 0, 426, 430, 3, 59, 29, 0, 427, 430, 3, 61, 30, 0, 428, 430, 7, 16, 0, 0, 429, 426, 1, 0, 0, 0, 429, 427, 1, 0, 0, 0, 429, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 429, 1, 0, 0, 0, 431, 432, 1, 0, 0, 0, 432, 433, 1, 0, 0, 0, 433, 434, 5, 96, 0, 0, 434, 96, 1, 0, 0, 0, 38, 0, 178, 183, 193, 226, 231, 241, 249, 255, 258, 263, 271, 274, 276, 281, 289, 291, 296, 306, 310, 315, 317, 324, 326, 336, 338, 350, 352, 363, 373, 386, 401, 408, 415, 420, 422, 429, 431, 1, 0, 1, 0]
\ No newline at end of file
diff --git a/vendor/github.com/google/cel-go/parser/gen/CELLexer.tokens b/vendor/github.com/google/cel-go/parser/gen/CELLexer.tokens
index b305bdad3..aa1f5eee6 100644
--- a/vendor/github.com/google/cel-go/parser/gen/CELLexer.tokens
+++ b/vendor/github.com/google/cel-go/parser/gen/CELLexer.tokens
@@ -34,6 +34,7 @@ NUM_UINT=33
STRING=34
BYTES=35
IDENTIFIER=36
+ESC_IDENTIFIER=37
'=='=1
'!='=2
'in'=3
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go b/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go
index c49d03867..514f2082f 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go
@@ -1,4 +1,4 @@
-// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
+// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
import "github.com/antlr4-go/antlr/v4"
@@ -98,11 +98,17 @@ func (s *BaseCELListener) EnterIndex(ctx *IndexContext) {}
// ExitIndex is called when production Index is exited.
func (s *BaseCELListener) ExitIndex(ctx *IndexContext) {}
-// EnterIdentOrGlobalCall is called when production IdentOrGlobalCall is entered.
-func (s *BaseCELListener) EnterIdentOrGlobalCall(ctx *IdentOrGlobalCallContext) {}
+// EnterIdent is called when production Ident is entered.
+func (s *BaseCELListener) EnterIdent(ctx *IdentContext) {}
-// ExitIdentOrGlobalCall is called when production IdentOrGlobalCall is exited.
-func (s *BaseCELListener) ExitIdentOrGlobalCall(ctx *IdentOrGlobalCallContext) {}
+// ExitIdent is called when production Ident is exited.
+func (s *BaseCELListener) ExitIdent(ctx *IdentContext) {}
+
+// EnterGlobalCall is called when production GlobalCall is entered.
+func (s *BaseCELListener) EnterGlobalCall(ctx *GlobalCallContext) {}
+
+// ExitGlobalCall is called when production GlobalCall is exited.
+func (s *BaseCELListener) ExitGlobalCall(ctx *GlobalCallContext) {}
// EnterNested is called when production Nested is entered.
func (s *BaseCELListener) EnterNested(ctx *NestedContext) {}
@@ -164,6 +170,18 @@ func (s *BaseCELListener) EnterMapInitializerList(ctx *MapInitializerListContext
// ExitMapInitializerList is called when production mapInitializerList is exited.
func (s *BaseCELListener) ExitMapInitializerList(ctx *MapInitializerListContext) {}
+// EnterSimpleIdentifier is called when production SimpleIdentifier is entered.
+func (s *BaseCELListener) EnterSimpleIdentifier(ctx *SimpleIdentifierContext) {}
+
+// ExitSimpleIdentifier is called when production SimpleIdentifier is exited.
+func (s *BaseCELListener) ExitSimpleIdentifier(ctx *SimpleIdentifierContext) {}
+
+// EnterEscapedIdentifier is called when production EscapedIdentifier is entered.
+func (s *BaseCELListener) EnterEscapedIdentifier(ctx *EscapedIdentifierContext) {}
+
+// ExitEscapedIdentifier is called when production EscapedIdentifier is exited.
+func (s *BaseCELListener) ExitEscapedIdentifier(ctx *EscapedIdentifierContext) {}
+
// EnterOptExpr is called when production optExpr is entered.
func (s *BaseCELListener) EnterOptExpr(ctx *OptExprContext) {}
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go b/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go
index b2c0783d3..8a12cb65e 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go
@@ -1,9 +1,8 @@
-// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
+// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
import "github.com/antlr4-go/antlr/v4"
-
type BaseCELVisitor struct {
*antlr.BaseParseTreeVisitor
}
@@ -60,7 +59,11 @@ func (v *BaseCELVisitor) VisitIndex(ctx *IndexContext) interface{} {
return v.VisitChildren(ctx)
}
-func (v *BaseCELVisitor) VisitIdentOrGlobalCall(ctx *IdentOrGlobalCallContext) interface{} {
+func (v *BaseCELVisitor) VisitIdent(ctx *IdentContext) interface{} {
+ return v.VisitChildren(ctx)
+}
+
+func (v *BaseCELVisitor) VisitGlobalCall(ctx *GlobalCallContext) interface{} {
return v.VisitChildren(ctx)
}
@@ -104,6 +107,14 @@ func (v *BaseCELVisitor) VisitMapInitializerList(ctx *MapInitializerListContext)
return v.VisitChildren(ctx)
}
+func (v *BaseCELVisitor) VisitSimpleIdentifier(ctx *SimpleIdentifierContext) interface{} {
+ return v.VisitChildren(ctx)
+}
+
+func (v *BaseCELVisitor) VisitEscapedIdentifier(ctx *EscapedIdentifierContext) interface{} {
+ return v.VisitChildren(ctx)
+}
+
func (v *BaseCELVisitor) VisitOptExpr(ctx *OptExprContext) interface{} {
return v.VisitChildren(ctx)
}
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go b/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go
index e026cc46f..896562f5f 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go
@@ -1,278 +1,285 @@
-// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
+// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen
+
import (
"fmt"
- "sync"
- "unicode"
"github.com/antlr4-go/antlr/v4"
+ "sync"
+ "unicode"
)
+
// Suppress unused import error
var _ = fmt.Printf
var _ = sync.Once{}
var _ = unicode.IsLetter
-
type CELLexer struct {
*antlr.BaseLexer
channelNames []string
- modeNames []string
+ modeNames []string
// TODO: EOF string
}
var CELLexerLexerStaticData struct {
- once sync.Once
- serializedATN []int32
- ChannelNames []string
- ModeNames []string
- LiteralNames []string
- SymbolicNames []string
- RuleNames []string
- PredictionContextCache *antlr.PredictionContextCache
- atn *antlr.ATN
- decisionToDFA []*antlr.DFA
+ once sync.Once
+ serializedATN []int32
+ ChannelNames []string
+ ModeNames []string
+ LiteralNames []string
+ SymbolicNames []string
+ RuleNames []string
+ PredictionContextCache *antlr.PredictionContextCache
+ atn *antlr.ATN
+ decisionToDFA []*antlr.DFA
}
func cellexerLexerInit() {
- staticData := &CELLexerLexerStaticData
- staticData.ChannelNames = []string{
- "DEFAULT_TOKEN_CHANNEL", "HIDDEN",
- }
- staticData.ModeNames = []string{
- "DEFAULT_MODE",
- }
- staticData.LiteralNames = []string{
- "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
- "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
- "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
- }
- staticData.SymbolicNames = []string{
- "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
- "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
- "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
- "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
- "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
- "STRING", "BYTES", "IDENTIFIER",
- }
- staticData.RuleNames = []string{
- "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
- "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
- "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
- "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
- "NUL", "BACKSLASH", "LETTER", "DIGIT", "EXPONENT", "HEXDIGIT", "RAW",
- "ESC_SEQ", "ESC_CHAR_SEQ", "ESC_OCT_SEQ", "ESC_BYTE_SEQ", "ESC_UNI_SEQ",
- "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT", "STRING",
- "BYTES", "IDENTIFIER",
- }
- staticData.PredictionContextCache = antlr.NewPredictionContextCache()
- staticData.serializedATN = []int32{
- 4, 0, 36, 423, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2,
- 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2,
- 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15,
- 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7,
- 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25,
- 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2,
- 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36,
- 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7,
- 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46,
- 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4,
- 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8,
- 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13,
- 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1,
- 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24,
- 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1,
- 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29,
- 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 177, 8, 31, 1, 31, 4, 31, 180, 8, 31,
- 11, 31, 12, 31, 181, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1,
- 34, 3, 34, 192, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36,
- 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1,
- 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38,
- 1, 38, 1, 38, 1, 38, 3, 38, 225, 8, 38, 1, 39, 4, 39, 228, 8, 39, 11, 39,
- 12, 39, 229, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 238, 8, 40,
- 10, 40, 12, 40, 241, 9, 40, 1, 40, 1, 40, 1, 41, 4, 41, 246, 8, 41, 11,
- 41, 12, 41, 247, 1, 41, 1, 41, 4, 41, 252, 8, 41, 11, 41, 12, 41, 253,
- 1, 41, 3, 41, 257, 8, 41, 1, 41, 4, 41, 260, 8, 41, 11, 41, 12, 41, 261,
- 1, 41, 1, 41, 1, 41, 1, 41, 4, 41, 268, 8, 41, 11, 41, 12, 41, 269, 1,
- 41, 3, 41, 273, 8, 41, 3, 41, 275, 8, 41, 1, 42, 4, 42, 278, 8, 42, 11,
- 42, 12, 42, 279, 1, 42, 1, 42, 1, 42, 1, 42, 4, 42, 286, 8, 42, 11, 42,
- 12, 42, 287, 3, 42, 290, 8, 42, 1, 43, 4, 43, 293, 8, 43, 11, 43, 12, 43,
- 294, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 303, 8, 43, 11, 43,
- 12, 43, 304, 1, 43, 1, 43, 3, 43, 309, 8, 43, 1, 44, 1, 44, 1, 44, 5, 44,
- 314, 8, 44, 10, 44, 12, 44, 317, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5,
- 44, 323, 8, 44, 10, 44, 12, 44, 326, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44,
- 1, 44, 1, 44, 1, 44, 5, 44, 335, 8, 44, 10, 44, 12, 44, 338, 9, 44, 1,
- 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 349,
- 8, 44, 10, 44, 12, 44, 352, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
- 44, 5, 44, 360, 8, 44, 10, 44, 12, 44, 363, 9, 44, 1, 44, 1, 44, 1, 44,
- 1, 44, 1, 44, 5, 44, 370, 8, 44, 10, 44, 12, 44, 373, 9, 44, 1, 44, 1,
- 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 383, 8, 44, 10, 44,
- 12, 44, 386, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
- 44, 1, 44, 1, 44, 5, 44, 398, 8, 44, 10, 44, 12, 44, 401, 9, 44, 1, 44,
- 1, 44, 1, 44, 1, 44, 3, 44, 407, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1,
- 46, 3, 46, 414, 8, 46, 1, 46, 1, 46, 1, 46, 5, 46, 419, 8, 46, 10, 46,
- 12, 46, 422, 9, 46, 4, 336, 350, 384, 399, 0, 47, 1, 1, 3, 2, 5, 3, 7,
- 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27,
- 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45,
- 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 0, 59, 0, 61, 0, 63, 0,
- 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, 0, 79, 29, 81, 30, 83, 31,
- 85, 32, 87, 33, 89, 34, 91, 35, 93, 36, 1, 0, 16, 2, 0, 65, 90, 97, 122,
- 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, 65, 70, 97,
- 102, 2, 0, 82, 82, 114, 114, 10, 0, 34, 34, 39, 39, 63, 63, 92, 92, 96,
- 98, 102, 102, 110, 110, 114, 114, 116, 116, 118, 118, 2, 0, 88, 88, 120,
- 120, 3, 0, 9, 10, 12, 13, 32, 32, 1, 0, 10, 10, 2, 0, 85, 85, 117, 117,
- 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 39, 39, 92,
- 92, 1, 0, 92, 92, 3, 0, 10, 10, 13, 13, 34, 34, 3, 0, 10, 10, 13, 13, 39,
- 39, 2, 0, 66, 66, 98, 98, 456, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5,
- 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13,
- 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0,
- 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0,
- 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0,
- 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0,
- 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1,
- 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81,
- 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0,
- 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0,
- 3, 98, 1, 0, 0, 0, 5, 101, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 9, 106, 1, 0,
- 0, 0, 11, 109, 1, 0, 0, 0, 13, 112, 1, 0, 0, 0, 15, 114, 1, 0, 0, 0, 17,
- 117, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 122, 1, 0, 0, 0, 23, 124, 1,
- 0, 0, 0, 25, 126, 1, 0, 0, 0, 27, 128, 1, 0, 0, 0, 29, 130, 1, 0, 0, 0,
- 31, 132, 1, 0, 0, 0, 33, 134, 1, 0, 0, 0, 35, 136, 1, 0, 0, 0, 37, 138,
- 1, 0, 0, 0, 39, 140, 1, 0, 0, 0, 41, 142, 1, 0, 0, 0, 43, 144, 1, 0, 0,
- 0, 45, 146, 1, 0, 0, 0, 47, 148, 1, 0, 0, 0, 49, 150, 1, 0, 0, 0, 51, 152,
- 1, 0, 0, 0, 53, 157, 1, 0, 0, 0, 55, 163, 1, 0, 0, 0, 57, 168, 1, 0, 0,
- 0, 59, 170, 1, 0, 0, 0, 61, 172, 1, 0, 0, 0, 63, 174, 1, 0, 0, 0, 65, 183,
- 1, 0, 0, 0, 67, 185, 1, 0, 0, 0, 69, 191, 1, 0, 0, 0, 71, 193, 1, 0, 0,
- 0, 73, 196, 1, 0, 0, 0, 75, 201, 1, 0, 0, 0, 77, 224, 1, 0, 0, 0, 79, 227,
- 1, 0, 0, 0, 81, 233, 1, 0, 0, 0, 83, 274, 1, 0, 0, 0, 85, 289, 1, 0, 0,
- 0, 87, 308, 1, 0, 0, 0, 89, 406, 1, 0, 0, 0, 91, 408, 1, 0, 0, 0, 93, 413,
- 1, 0, 0, 0, 95, 96, 5, 61, 0, 0, 96, 97, 5, 61, 0, 0, 97, 2, 1, 0, 0, 0,
- 98, 99, 5, 33, 0, 0, 99, 100, 5, 61, 0, 0, 100, 4, 1, 0, 0, 0, 101, 102,
- 5, 105, 0, 0, 102, 103, 5, 110, 0, 0, 103, 6, 1, 0, 0, 0, 104, 105, 5,
- 60, 0, 0, 105, 8, 1, 0, 0, 0, 106, 107, 5, 60, 0, 0, 107, 108, 5, 61, 0,
- 0, 108, 10, 1, 0, 0, 0, 109, 110, 5, 62, 0, 0, 110, 111, 5, 61, 0, 0, 111,
- 12, 1, 0, 0, 0, 112, 113, 5, 62, 0, 0, 113, 14, 1, 0, 0, 0, 114, 115, 5,
- 38, 0, 0, 115, 116, 5, 38, 0, 0, 116, 16, 1, 0, 0, 0, 117, 118, 5, 124,
- 0, 0, 118, 119, 5, 124, 0, 0, 119, 18, 1, 0, 0, 0, 120, 121, 5, 91, 0,
- 0, 121, 20, 1, 0, 0, 0, 122, 123, 5, 93, 0, 0, 123, 22, 1, 0, 0, 0, 124,
- 125, 5, 123, 0, 0, 125, 24, 1, 0, 0, 0, 126, 127, 5, 125, 0, 0, 127, 26,
- 1, 0, 0, 0, 128, 129, 5, 40, 0, 0, 129, 28, 1, 0, 0, 0, 130, 131, 5, 41,
- 0, 0, 131, 30, 1, 0, 0, 0, 132, 133, 5, 46, 0, 0, 133, 32, 1, 0, 0, 0,
- 134, 135, 5, 44, 0, 0, 135, 34, 1, 0, 0, 0, 136, 137, 5, 45, 0, 0, 137,
- 36, 1, 0, 0, 0, 138, 139, 5, 33, 0, 0, 139, 38, 1, 0, 0, 0, 140, 141, 5,
- 63, 0, 0, 141, 40, 1, 0, 0, 0, 142, 143, 5, 58, 0, 0, 143, 42, 1, 0, 0,
- 0, 144, 145, 5, 43, 0, 0, 145, 44, 1, 0, 0, 0, 146, 147, 5, 42, 0, 0, 147,
- 46, 1, 0, 0, 0, 148, 149, 5, 47, 0, 0, 149, 48, 1, 0, 0, 0, 150, 151, 5,
- 37, 0, 0, 151, 50, 1, 0, 0, 0, 152, 153, 5, 116, 0, 0, 153, 154, 5, 114,
- 0, 0, 154, 155, 5, 117, 0, 0, 155, 156, 5, 101, 0, 0, 156, 52, 1, 0, 0,
- 0, 157, 158, 5, 102, 0, 0, 158, 159, 5, 97, 0, 0, 159, 160, 5, 108, 0,
- 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 54, 1, 0, 0, 0,
- 163, 164, 5, 110, 0, 0, 164, 165, 5, 117, 0, 0, 165, 166, 5, 108, 0, 0,
- 166, 167, 5, 108, 0, 0, 167, 56, 1, 0, 0, 0, 168, 169, 5, 92, 0, 0, 169,
- 58, 1, 0, 0, 0, 170, 171, 7, 0, 0, 0, 171, 60, 1, 0, 0, 0, 172, 173, 2,
- 48, 57, 0, 173, 62, 1, 0, 0, 0, 174, 176, 7, 1, 0, 0, 175, 177, 7, 2, 0,
- 0, 176, 175, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 1, 0, 0, 0, 178,
- 180, 3, 61, 30, 0, 179, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 179,
- 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 64, 1, 0, 0, 0, 183, 184, 7, 3,
- 0, 0, 184, 66, 1, 0, 0, 0, 185, 186, 7, 4, 0, 0, 186, 68, 1, 0, 0, 0, 187,
- 192, 3, 71, 35, 0, 188, 192, 3, 75, 37, 0, 189, 192, 3, 77, 38, 0, 190,
- 192, 3, 73, 36, 0, 191, 187, 1, 0, 0, 0, 191, 188, 1, 0, 0, 0, 191, 189,
- 1, 0, 0, 0, 191, 190, 1, 0, 0, 0, 192, 70, 1, 0, 0, 0, 193, 194, 3, 57,
- 28, 0, 194, 195, 7, 5, 0, 0, 195, 72, 1, 0, 0, 0, 196, 197, 3, 57, 28,
- 0, 197, 198, 2, 48, 51, 0, 198, 199, 2, 48, 55, 0, 199, 200, 2, 48, 55,
- 0, 200, 74, 1, 0, 0, 0, 201, 202, 3, 57, 28, 0, 202, 203, 7, 6, 0, 0, 203,
- 204, 3, 65, 32, 0, 204, 205, 3, 65, 32, 0, 205, 76, 1, 0, 0, 0, 206, 207,
- 3, 57, 28, 0, 207, 208, 5, 117, 0, 0, 208, 209, 3, 65, 32, 0, 209, 210,
- 3, 65, 32, 0, 210, 211, 3, 65, 32, 0, 211, 212, 3, 65, 32, 0, 212, 225,
- 1, 0, 0, 0, 213, 214, 3, 57, 28, 0, 214, 215, 5, 85, 0, 0, 215, 216, 3,
- 65, 32, 0, 216, 217, 3, 65, 32, 0, 217, 218, 3, 65, 32, 0, 218, 219, 3,
- 65, 32, 0, 219, 220, 3, 65, 32, 0, 220, 221, 3, 65, 32, 0, 221, 222, 3,
- 65, 32, 0, 222, 223, 3, 65, 32, 0, 223, 225, 1, 0, 0, 0, 224, 206, 1, 0,
- 0, 0, 224, 213, 1, 0, 0, 0, 225, 78, 1, 0, 0, 0, 226, 228, 7, 7, 0, 0,
- 227, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 229,
- 230, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 6, 39, 0, 0, 232, 80,
- 1, 0, 0, 0, 233, 234, 5, 47, 0, 0, 234, 235, 5, 47, 0, 0, 235, 239, 1,
- 0, 0, 0, 236, 238, 8, 8, 0, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0,
- 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241,
- 239, 1, 0, 0, 0, 242, 243, 6, 40, 0, 0, 243, 82, 1, 0, 0, 0, 244, 246,
- 3, 61, 30, 0, 245, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 245, 1,
- 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 5, 46, 0,
- 0, 250, 252, 3, 61, 30, 0, 251, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0,
- 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 1, 0, 0, 0, 255,
- 257, 3, 63, 31, 0, 256, 255, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 275,
- 1, 0, 0, 0, 258, 260, 3, 61, 30, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1,
- 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 263, 1, 0, 0,
- 0, 263, 264, 3, 63, 31, 0, 264, 275, 1, 0, 0, 0, 265, 267, 5, 46, 0, 0,
- 266, 268, 3, 61, 30, 0, 267, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269,
- 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 272, 1, 0, 0, 0, 271, 273,
- 3, 63, 31, 0, 272, 271, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1,
- 0, 0, 0, 274, 245, 1, 0, 0, 0, 274, 259, 1, 0, 0, 0, 274, 265, 1, 0, 0,
- 0, 275, 84, 1, 0, 0, 0, 276, 278, 3, 61, 30, 0, 277, 276, 1, 0, 0, 0, 278,
- 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 290,
- 1, 0, 0, 0, 281, 282, 5, 48, 0, 0, 282, 283, 5, 120, 0, 0, 283, 285, 1,
- 0, 0, 0, 284, 286, 3, 65, 32, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0,
- 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 1, 0, 0, 0,
- 289, 277, 1, 0, 0, 0, 289, 281, 1, 0, 0, 0, 290, 86, 1, 0, 0, 0, 291, 293,
- 3, 61, 30, 0, 292, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 292, 1,
- 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 7, 9, 0,
- 0, 297, 309, 1, 0, 0, 0, 298, 299, 5, 48, 0, 0, 299, 300, 5, 120, 0, 0,
- 300, 302, 1, 0, 0, 0, 301, 303, 3, 65, 32, 0, 302, 301, 1, 0, 0, 0, 303,
- 304, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 306,
- 1, 0, 0, 0, 306, 307, 7, 9, 0, 0, 307, 309, 1, 0, 0, 0, 308, 292, 1, 0,
- 0, 0, 308, 298, 1, 0, 0, 0, 309, 88, 1, 0, 0, 0, 310, 315, 5, 34, 0, 0,
- 311, 314, 3, 69, 34, 0, 312, 314, 8, 10, 0, 0, 313, 311, 1, 0, 0, 0, 313,
- 312, 1, 0, 0, 0, 314, 317, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 315, 316,
- 1, 0, 0, 0, 316, 318, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 407, 5, 34,
- 0, 0, 319, 324, 5, 39, 0, 0, 320, 323, 3, 69, 34, 0, 321, 323, 8, 11, 0,
- 0, 322, 320, 1, 0, 0, 0, 322, 321, 1, 0, 0, 0, 323, 326, 1, 0, 0, 0, 324,
- 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 327, 1, 0, 0, 0, 326, 324,
- 1, 0, 0, 0, 327, 407, 5, 39, 0, 0, 328, 329, 5, 34, 0, 0, 329, 330, 5,
- 34, 0, 0, 330, 331, 5, 34, 0, 0, 331, 336, 1, 0, 0, 0, 332, 335, 3, 69,
- 34, 0, 333, 335, 8, 12, 0, 0, 334, 332, 1, 0, 0, 0, 334, 333, 1, 0, 0,
- 0, 335, 338, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337,
- 339, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 340, 5, 34, 0, 0, 340, 341,
- 5, 34, 0, 0, 341, 407, 5, 34, 0, 0, 342, 343, 5, 39, 0, 0, 343, 344, 5,
- 39, 0, 0, 344, 345, 5, 39, 0, 0, 345, 350, 1, 0, 0, 0, 346, 349, 3, 69,
- 34, 0, 347, 349, 8, 12, 0, 0, 348, 346, 1, 0, 0, 0, 348, 347, 1, 0, 0,
- 0, 349, 352, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 351,
- 353, 1, 0, 0, 0, 352, 350, 1, 0, 0, 0, 353, 354, 5, 39, 0, 0, 354, 355,
- 5, 39, 0, 0, 355, 407, 5, 39, 0, 0, 356, 357, 3, 67, 33, 0, 357, 361, 5,
- 34, 0, 0, 358, 360, 8, 13, 0, 0, 359, 358, 1, 0, 0, 0, 360, 363, 1, 0,
- 0, 0, 361, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 364, 1, 0, 0, 0,
- 363, 361, 1, 0, 0, 0, 364, 365, 5, 34, 0, 0, 365, 407, 1, 0, 0, 0, 366,
- 367, 3, 67, 33, 0, 367, 371, 5, 39, 0, 0, 368, 370, 8, 14, 0, 0, 369, 368,
- 1, 0, 0, 0, 370, 373, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 371, 372, 1, 0,
- 0, 0, 372, 374, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 374, 375, 5, 39, 0, 0,
- 375, 407, 1, 0, 0, 0, 376, 377, 3, 67, 33, 0, 377, 378, 5, 34, 0, 0, 378,
- 379, 5, 34, 0, 0, 379, 380, 5, 34, 0, 0, 380, 384, 1, 0, 0, 0, 381, 383,
- 9, 0, 0, 0, 382, 381, 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 385, 1, 0,
- 0, 0, 384, 382, 1, 0, 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0,
- 387, 388, 5, 34, 0, 0, 388, 389, 5, 34, 0, 0, 389, 390, 5, 34, 0, 0, 390,
- 407, 1, 0, 0, 0, 391, 392, 3, 67, 33, 0, 392, 393, 5, 39, 0, 0, 393, 394,
- 5, 39, 0, 0, 394, 395, 5, 39, 0, 0, 395, 399, 1, 0, 0, 0, 396, 398, 9,
- 0, 0, 0, 397, 396, 1, 0, 0, 0, 398, 401, 1, 0, 0, 0, 399, 400, 1, 0, 0,
- 0, 399, 397, 1, 0, 0, 0, 400, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402,
- 403, 5, 39, 0, 0, 403, 404, 5, 39, 0, 0, 404, 405, 5, 39, 0, 0, 405, 407,
- 1, 0, 0, 0, 406, 310, 1, 0, 0, 0, 406, 319, 1, 0, 0, 0, 406, 328, 1, 0,
- 0, 0, 406, 342, 1, 0, 0, 0, 406, 356, 1, 0, 0, 0, 406, 366, 1, 0, 0, 0,
- 406, 376, 1, 0, 0, 0, 406, 391, 1, 0, 0, 0, 407, 90, 1, 0, 0, 0, 408, 409,
- 7, 15, 0, 0, 409, 410, 3, 89, 44, 0, 410, 92, 1, 0, 0, 0, 411, 414, 3,
- 59, 29, 0, 412, 414, 5, 95, 0, 0, 413, 411, 1, 0, 0, 0, 413, 412, 1, 0,
- 0, 0, 414, 420, 1, 0, 0, 0, 415, 419, 3, 59, 29, 0, 416, 419, 3, 61, 30,
- 0, 417, 419, 5, 95, 0, 0, 418, 415, 1, 0, 0, 0, 418, 416, 1, 0, 0, 0, 418,
- 417, 1, 0, 0, 0, 419, 422, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 420, 421,
- 1, 0, 0, 0, 421, 94, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 36, 0, 176, 181,
- 191, 224, 229, 239, 247, 253, 256, 261, 269, 272, 274, 279, 287, 289, 294,
- 304, 308, 313, 315, 322, 324, 334, 336, 348, 350, 361, 371, 384, 399, 406,
- 413, 418, 420, 1, 0, 1, 0,
-}
- deserializer := antlr.NewATNDeserializer(nil)
- staticData.atn = deserializer.Deserialize(staticData.serializedATN)
- atn := staticData.atn
- staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
- decisionToDFA := staticData.decisionToDFA
- for index, state := range atn.DecisionToState {
- decisionToDFA[index] = antlr.NewDFA(state, index)
- }
+ staticData := &CELLexerLexerStaticData
+ staticData.ChannelNames = []string{
+ "DEFAULT_TOKEN_CHANNEL", "HIDDEN",
+ }
+ staticData.ModeNames = []string{
+ "DEFAULT_MODE",
+ }
+ staticData.LiteralNames = []string{
+ "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
+ "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
+ "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
+ }
+ staticData.SymbolicNames = []string{
+ "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
+ "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
+ "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
+ "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
+ "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
+ "STRING", "BYTES", "IDENTIFIER", "ESC_IDENTIFIER",
+ }
+ staticData.RuleNames = []string{
+ "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
+ "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
+ "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
+ "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
+ "NUL", "BACKSLASH", "LETTER", "DIGIT", "EXPONENT", "HEXDIGIT", "RAW",
+ "ESC_SEQ", "ESC_CHAR_SEQ", "ESC_OCT_SEQ", "ESC_BYTE_SEQ", "ESC_UNI_SEQ",
+ "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT", "STRING",
+ "BYTES", "IDENTIFIER", "ESC_IDENTIFIER",
+ }
+ staticData.PredictionContextCache = antlr.NewPredictionContextCache()
+ staticData.serializedATN = []int32{
+ 4, 0, 37, 435, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2,
+ 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2,
+ 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15,
+ 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7,
+ 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25,
+ 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2,
+ 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36,
+ 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7,
+ 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46,
+ 2, 47, 7, 47, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1,
+ 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1,
+ 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1,
+ 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17,
+ 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1,
+ 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26,
+ 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1,
+ 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 179, 8, 31, 1, 31,
+ 4, 31, 182, 8, 31, 11, 31, 12, 31, 183, 1, 32, 1, 32, 1, 33, 1, 33, 1,
+ 34, 1, 34, 1, 34, 1, 34, 3, 34, 194, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36,
+ 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1,
+ 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38,
+ 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 227, 8, 38, 1, 39, 4,
+ 39, 230, 8, 39, 11, 39, 12, 39, 231, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40,
+ 1, 40, 5, 40, 240, 8, 40, 10, 40, 12, 40, 243, 9, 40, 1, 40, 1, 40, 1,
+ 41, 4, 41, 248, 8, 41, 11, 41, 12, 41, 249, 1, 41, 1, 41, 4, 41, 254, 8,
+ 41, 11, 41, 12, 41, 255, 1, 41, 3, 41, 259, 8, 41, 1, 41, 4, 41, 262, 8,
+ 41, 11, 41, 12, 41, 263, 1, 41, 1, 41, 1, 41, 1, 41, 4, 41, 270, 8, 41,
+ 11, 41, 12, 41, 271, 1, 41, 3, 41, 275, 8, 41, 3, 41, 277, 8, 41, 1, 42,
+ 4, 42, 280, 8, 42, 11, 42, 12, 42, 281, 1, 42, 1, 42, 1, 42, 1, 42, 4,
+ 42, 288, 8, 42, 11, 42, 12, 42, 289, 3, 42, 292, 8, 42, 1, 43, 4, 43, 295,
+ 8, 43, 11, 43, 12, 43, 296, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4,
+ 43, 305, 8, 43, 11, 43, 12, 43, 306, 1, 43, 1, 43, 3, 43, 311, 8, 43, 1,
+ 44, 1, 44, 1, 44, 5, 44, 316, 8, 44, 10, 44, 12, 44, 319, 9, 44, 1, 44,
+ 1, 44, 1, 44, 1, 44, 5, 44, 325, 8, 44, 10, 44, 12, 44, 328, 9, 44, 1,
+ 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 337, 8, 44, 10, 44,
+ 12, 44, 340, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
+ 44, 1, 44, 5, 44, 351, 8, 44, 10, 44, 12, 44, 354, 9, 44, 1, 44, 1, 44,
+ 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 362, 8, 44, 10, 44, 12, 44, 365, 9,
+ 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 372, 8, 44, 10, 44, 12, 44,
+ 375, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5,
+ 44, 385, 8, 44, 10, 44, 12, 44, 388, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44,
+ 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 400, 8, 44, 10, 44, 12,
+ 44, 403, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 409, 8, 44, 1, 45, 1,
+ 45, 1, 45, 1, 46, 1, 46, 3, 46, 416, 8, 46, 1, 46, 1, 46, 1, 46, 5, 46,
+ 421, 8, 46, 10, 46, 12, 46, 424, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 4,
+ 47, 430, 8, 47, 11, 47, 12, 47, 431, 1, 47, 1, 47, 4, 338, 352, 386, 401,
+ 0, 48, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10,
+ 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19,
+ 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28,
+ 57, 0, 59, 0, 61, 0, 63, 0, 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77,
+ 0, 79, 29, 81, 30, 83, 31, 85, 32, 87, 33, 89, 34, 91, 35, 93, 36, 95,
+ 37, 1, 0, 17, 2, 0, 65, 90, 97, 122, 2, 0, 69, 69, 101, 101, 2, 0, 43,
+ 43, 45, 45, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 82, 82, 114, 114, 10,
+ 0, 34, 34, 39, 39, 63, 63, 92, 92, 96, 98, 102, 102, 110, 110, 114, 114,
+ 116, 116, 118, 118, 2, 0, 88, 88, 120, 120, 3, 0, 9, 10, 12, 13, 32, 32,
+ 1, 0, 10, 10, 2, 0, 85, 85, 117, 117, 4, 0, 10, 10, 13, 13, 34, 34, 92,
+ 92, 4, 0, 10, 10, 13, 13, 39, 39, 92, 92, 1, 0, 92, 92, 3, 0, 10, 10, 13,
+ 13, 34, 34, 3, 0, 10, 10, 13, 13, 39, 39, 2, 0, 66, 66, 98, 98, 3, 0, 32,
+ 32, 45, 47, 95, 95, 471, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0,
+ 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1,
+ 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21,
+ 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0,
+ 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0,
+ 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0,
+ 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0,
+ 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1,
+ 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89,
+ 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 1,
+ 97, 1, 0, 0, 0, 3, 100, 1, 0, 0, 0, 5, 103, 1, 0, 0, 0, 7, 106, 1, 0, 0,
+ 0, 9, 108, 1, 0, 0, 0, 11, 111, 1, 0, 0, 0, 13, 114, 1, 0, 0, 0, 15, 116,
+ 1, 0, 0, 0, 17, 119, 1, 0, 0, 0, 19, 122, 1, 0, 0, 0, 21, 124, 1, 0, 0,
+ 0, 23, 126, 1, 0, 0, 0, 25, 128, 1, 0, 0, 0, 27, 130, 1, 0, 0, 0, 29, 132,
+ 1, 0, 0, 0, 31, 134, 1, 0, 0, 0, 33, 136, 1, 0, 0, 0, 35, 138, 1, 0, 0,
+ 0, 37, 140, 1, 0, 0, 0, 39, 142, 1, 0, 0, 0, 41, 144, 1, 0, 0, 0, 43, 146,
+ 1, 0, 0, 0, 45, 148, 1, 0, 0, 0, 47, 150, 1, 0, 0, 0, 49, 152, 1, 0, 0,
+ 0, 51, 154, 1, 0, 0, 0, 53, 159, 1, 0, 0, 0, 55, 165, 1, 0, 0, 0, 57, 170,
+ 1, 0, 0, 0, 59, 172, 1, 0, 0, 0, 61, 174, 1, 0, 0, 0, 63, 176, 1, 0, 0,
+ 0, 65, 185, 1, 0, 0, 0, 67, 187, 1, 0, 0, 0, 69, 193, 1, 0, 0, 0, 71, 195,
+ 1, 0, 0, 0, 73, 198, 1, 0, 0, 0, 75, 203, 1, 0, 0, 0, 77, 226, 1, 0, 0,
+ 0, 79, 229, 1, 0, 0, 0, 81, 235, 1, 0, 0, 0, 83, 276, 1, 0, 0, 0, 85, 291,
+ 1, 0, 0, 0, 87, 310, 1, 0, 0, 0, 89, 408, 1, 0, 0, 0, 91, 410, 1, 0, 0,
+ 0, 93, 415, 1, 0, 0, 0, 95, 425, 1, 0, 0, 0, 97, 98, 5, 61, 0, 0, 98, 99,
+ 5, 61, 0, 0, 99, 2, 1, 0, 0, 0, 100, 101, 5, 33, 0, 0, 101, 102, 5, 61,
+ 0, 0, 102, 4, 1, 0, 0, 0, 103, 104, 5, 105, 0, 0, 104, 105, 5, 110, 0,
+ 0, 105, 6, 1, 0, 0, 0, 106, 107, 5, 60, 0, 0, 107, 8, 1, 0, 0, 0, 108,
+ 109, 5, 60, 0, 0, 109, 110, 5, 61, 0, 0, 110, 10, 1, 0, 0, 0, 111, 112,
+ 5, 62, 0, 0, 112, 113, 5, 61, 0, 0, 113, 12, 1, 0, 0, 0, 114, 115, 5, 62,
+ 0, 0, 115, 14, 1, 0, 0, 0, 116, 117, 5, 38, 0, 0, 117, 118, 5, 38, 0, 0,
+ 118, 16, 1, 0, 0, 0, 119, 120, 5, 124, 0, 0, 120, 121, 5, 124, 0, 0, 121,
+ 18, 1, 0, 0, 0, 122, 123, 5, 91, 0, 0, 123, 20, 1, 0, 0, 0, 124, 125, 5,
+ 93, 0, 0, 125, 22, 1, 0, 0, 0, 126, 127, 5, 123, 0, 0, 127, 24, 1, 0, 0,
+ 0, 128, 129, 5, 125, 0, 0, 129, 26, 1, 0, 0, 0, 130, 131, 5, 40, 0, 0,
+ 131, 28, 1, 0, 0, 0, 132, 133, 5, 41, 0, 0, 133, 30, 1, 0, 0, 0, 134, 135,
+ 5, 46, 0, 0, 135, 32, 1, 0, 0, 0, 136, 137, 5, 44, 0, 0, 137, 34, 1, 0,
+ 0, 0, 138, 139, 5, 45, 0, 0, 139, 36, 1, 0, 0, 0, 140, 141, 5, 33, 0, 0,
+ 141, 38, 1, 0, 0, 0, 142, 143, 5, 63, 0, 0, 143, 40, 1, 0, 0, 0, 144, 145,
+ 5, 58, 0, 0, 145, 42, 1, 0, 0, 0, 146, 147, 5, 43, 0, 0, 147, 44, 1, 0,
+ 0, 0, 148, 149, 5, 42, 0, 0, 149, 46, 1, 0, 0, 0, 150, 151, 5, 47, 0, 0,
+ 151, 48, 1, 0, 0, 0, 152, 153, 5, 37, 0, 0, 153, 50, 1, 0, 0, 0, 154, 155,
+ 5, 116, 0, 0, 155, 156, 5, 114, 0, 0, 156, 157, 5, 117, 0, 0, 157, 158,
+ 5, 101, 0, 0, 158, 52, 1, 0, 0, 0, 159, 160, 5, 102, 0, 0, 160, 161, 5,
+ 97, 0, 0, 161, 162, 5, 108, 0, 0, 162, 163, 5, 115, 0, 0, 163, 164, 5,
+ 101, 0, 0, 164, 54, 1, 0, 0, 0, 165, 166, 5, 110, 0, 0, 166, 167, 5, 117,
+ 0, 0, 167, 168, 5, 108, 0, 0, 168, 169, 5, 108, 0, 0, 169, 56, 1, 0, 0,
+ 0, 170, 171, 5, 92, 0, 0, 171, 58, 1, 0, 0, 0, 172, 173, 7, 0, 0, 0, 173,
+ 60, 1, 0, 0, 0, 174, 175, 2, 48, 57, 0, 175, 62, 1, 0, 0, 0, 176, 178,
+ 7, 1, 0, 0, 177, 179, 7, 2, 0, 0, 178, 177, 1, 0, 0, 0, 178, 179, 1, 0,
+ 0, 0, 179, 181, 1, 0, 0, 0, 180, 182, 3, 61, 30, 0, 181, 180, 1, 0, 0,
+ 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184,
+ 64, 1, 0, 0, 0, 185, 186, 7, 3, 0, 0, 186, 66, 1, 0, 0, 0, 187, 188, 7,
+ 4, 0, 0, 188, 68, 1, 0, 0, 0, 189, 194, 3, 71, 35, 0, 190, 194, 3, 75,
+ 37, 0, 191, 194, 3, 77, 38, 0, 192, 194, 3, 73, 36, 0, 193, 189, 1, 0,
+ 0, 0, 193, 190, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 193, 192, 1, 0, 0, 0,
+ 194, 70, 1, 0, 0, 0, 195, 196, 3, 57, 28, 0, 196, 197, 7, 5, 0, 0, 197,
+ 72, 1, 0, 0, 0, 198, 199, 3, 57, 28, 0, 199, 200, 2, 48, 51, 0, 200, 201,
+ 2, 48, 55, 0, 201, 202, 2, 48, 55, 0, 202, 74, 1, 0, 0, 0, 203, 204, 3,
+ 57, 28, 0, 204, 205, 7, 6, 0, 0, 205, 206, 3, 65, 32, 0, 206, 207, 3, 65,
+ 32, 0, 207, 76, 1, 0, 0, 0, 208, 209, 3, 57, 28, 0, 209, 210, 5, 117, 0,
+ 0, 210, 211, 3, 65, 32, 0, 211, 212, 3, 65, 32, 0, 212, 213, 3, 65, 32,
+ 0, 213, 214, 3, 65, 32, 0, 214, 227, 1, 0, 0, 0, 215, 216, 3, 57, 28, 0,
+ 216, 217, 5, 85, 0, 0, 217, 218, 3, 65, 32, 0, 218, 219, 3, 65, 32, 0,
+ 219, 220, 3, 65, 32, 0, 220, 221, 3, 65, 32, 0, 221, 222, 3, 65, 32, 0,
+ 222, 223, 3, 65, 32, 0, 223, 224, 3, 65, 32, 0, 224, 225, 3, 65, 32, 0,
+ 225, 227, 1, 0, 0, 0, 226, 208, 1, 0, 0, 0, 226, 215, 1, 0, 0, 0, 227,
+ 78, 1, 0, 0, 0, 228, 230, 7, 7, 0, 0, 229, 228, 1, 0, 0, 0, 230, 231, 1,
+ 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 1, 0, 0,
+ 0, 233, 234, 6, 39, 0, 0, 234, 80, 1, 0, 0, 0, 235, 236, 5, 47, 0, 0, 236,
+ 237, 5, 47, 0, 0, 237, 241, 1, 0, 0, 0, 238, 240, 8, 8, 0, 0, 239, 238,
+ 1, 0, 0, 0, 240, 243, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0,
+ 0, 0, 242, 244, 1, 0, 0, 0, 243, 241, 1, 0, 0, 0, 244, 245, 6, 40, 0, 0,
+ 245, 82, 1, 0, 0, 0, 246, 248, 3, 61, 30, 0, 247, 246, 1, 0, 0, 0, 248,
+ 249, 1, 0, 0, 0, 249, 247, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251,
+ 1, 0, 0, 0, 251, 253, 5, 46, 0, 0, 252, 254, 3, 61, 30, 0, 253, 252, 1,
+ 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0,
+ 0, 256, 258, 1, 0, 0, 0, 257, 259, 3, 63, 31, 0, 258, 257, 1, 0, 0, 0,
+ 258, 259, 1, 0, 0, 0, 259, 277, 1, 0, 0, 0, 260, 262, 3, 61, 30, 0, 261,
+ 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 263, 264,
+ 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 3, 63, 31, 0, 266, 277, 1,
+ 0, 0, 0, 267, 269, 5, 46, 0, 0, 268, 270, 3, 61, 30, 0, 269, 268, 1, 0,
+ 0, 0, 270, 271, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0,
+ 272, 274, 1, 0, 0, 0, 273, 275, 3, 63, 31, 0, 274, 273, 1, 0, 0, 0, 274,
+ 275, 1, 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 247, 1, 0, 0, 0, 276, 261,
+ 1, 0, 0, 0, 276, 267, 1, 0, 0, 0, 277, 84, 1, 0, 0, 0, 278, 280, 3, 61,
+ 30, 0, 279, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0,
+ 281, 282, 1, 0, 0, 0, 282, 292, 1, 0, 0, 0, 283, 284, 5, 48, 0, 0, 284,
+ 285, 5, 120, 0, 0, 285, 287, 1, 0, 0, 0, 286, 288, 3, 65, 32, 0, 287, 286,
+ 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0,
+ 0, 0, 290, 292, 1, 0, 0, 0, 291, 279, 1, 0, 0, 0, 291, 283, 1, 0, 0, 0,
+ 292, 86, 1, 0, 0, 0, 293, 295, 3, 61, 30, 0, 294, 293, 1, 0, 0, 0, 295,
+ 296, 1, 0, 0, 0, 296, 294, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, 298,
+ 1, 0, 0, 0, 298, 299, 7, 9, 0, 0, 299, 311, 1, 0, 0, 0, 300, 301, 5, 48,
+ 0, 0, 301, 302, 5, 120, 0, 0, 302, 304, 1, 0, 0, 0, 303, 305, 3, 65, 32,
+ 0, 304, 303, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 304, 1, 0, 0, 0, 306,
+ 307, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 309, 7, 9, 0, 0, 309, 311,
+ 1, 0, 0, 0, 310, 294, 1, 0, 0, 0, 310, 300, 1, 0, 0, 0, 311, 88, 1, 0,
+ 0, 0, 312, 317, 5, 34, 0, 0, 313, 316, 3, 69, 34, 0, 314, 316, 8, 10, 0,
+ 0, 315, 313, 1, 0, 0, 0, 315, 314, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, 317,
+ 315, 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 318, 320, 1, 0, 0, 0, 319, 317,
+ 1, 0, 0, 0, 320, 409, 5, 34, 0, 0, 321, 326, 5, 39, 0, 0, 322, 325, 3,
+ 69, 34, 0, 323, 325, 8, 11, 0, 0, 324, 322, 1, 0, 0, 0, 324, 323, 1, 0,
+ 0, 0, 325, 328, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0,
+ 327, 329, 1, 0, 0, 0, 328, 326, 1, 0, 0, 0, 329, 409, 5, 39, 0, 0, 330,
+ 331, 5, 34, 0, 0, 331, 332, 5, 34, 0, 0, 332, 333, 5, 34, 0, 0, 333, 338,
+ 1, 0, 0, 0, 334, 337, 3, 69, 34, 0, 335, 337, 8, 12, 0, 0, 336, 334, 1,
+ 0, 0, 0, 336, 335, 1, 0, 0, 0, 337, 340, 1, 0, 0, 0, 338, 339, 1, 0, 0,
+ 0, 338, 336, 1, 0, 0, 0, 339, 341, 1, 0, 0, 0, 340, 338, 1, 0, 0, 0, 341,
+ 342, 5, 34, 0, 0, 342, 343, 5, 34, 0, 0, 343, 409, 5, 34, 0, 0, 344, 345,
+ 5, 39, 0, 0, 345, 346, 5, 39, 0, 0, 346, 347, 5, 39, 0, 0, 347, 352, 1,
+ 0, 0, 0, 348, 351, 3, 69, 34, 0, 349, 351, 8, 12, 0, 0, 350, 348, 1, 0,
+ 0, 0, 350, 349, 1, 0, 0, 0, 351, 354, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0,
+ 352, 350, 1, 0, 0, 0, 353, 355, 1, 0, 0, 0, 354, 352, 1, 0, 0, 0, 355,
+ 356, 5, 39, 0, 0, 356, 357, 5, 39, 0, 0, 357, 409, 5, 39, 0, 0, 358, 359,
+ 3, 67, 33, 0, 359, 363, 5, 34, 0, 0, 360, 362, 8, 13, 0, 0, 361, 360, 1,
+ 0, 0, 0, 362, 365, 1, 0, 0, 0, 363, 361, 1, 0, 0, 0, 363, 364, 1, 0, 0,
+ 0, 364, 366, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 366, 367, 5, 34, 0, 0, 367,
+ 409, 1, 0, 0, 0, 368, 369, 3, 67, 33, 0, 369, 373, 5, 39, 0, 0, 370, 372,
+ 8, 14, 0, 0, 371, 370, 1, 0, 0, 0, 372, 375, 1, 0, 0, 0, 373, 371, 1, 0,
+ 0, 0, 373, 374, 1, 0, 0, 0, 374, 376, 1, 0, 0, 0, 375, 373, 1, 0, 0, 0,
+ 376, 377, 5, 39, 0, 0, 377, 409, 1, 0, 0, 0, 378, 379, 3, 67, 33, 0, 379,
+ 380, 5, 34, 0, 0, 380, 381, 5, 34, 0, 0, 381, 382, 5, 34, 0, 0, 382, 386,
+ 1, 0, 0, 0, 383, 385, 9, 0, 0, 0, 384, 383, 1, 0, 0, 0, 385, 388, 1, 0,
+ 0, 0, 386, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 389, 1, 0, 0, 0,
+ 388, 386, 1, 0, 0, 0, 389, 390, 5, 34, 0, 0, 390, 391, 5, 34, 0, 0, 391,
+ 392, 5, 34, 0, 0, 392, 409, 1, 0, 0, 0, 393, 394, 3, 67, 33, 0, 394, 395,
+ 5, 39, 0, 0, 395, 396, 5, 39, 0, 0, 396, 397, 5, 39, 0, 0, 397, 401, 1,
+ 0, 0, 0, 398, 400, 9, 0, 0, 0, 399, 398, 1, 0, 0, 0, 400, 403, 1, 0, 0,
+ 0, 401, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402, 404, 1, 0, 0, 0, 403,
+ 401, 1, 0, 0, 0, 404, 405, 5, 39, 0, 0, 405, 406, 5, 39, 0, 0, 406, 407,
+ 5, 39, 0, 0, 407, 409, 1, 0, 0, 0, 408, 312, 1, 0, 0, 0, 408, 321, 1, 0,
+ 0, 0, 408, 330, 1, 0, 0, 0, 408, 344, 1, 0, 0, 0, 408, 358, 1, 0, 0, 0,
+ 408, 368, 1, 0, 0, 0, 408, 378, 1, 0, 0, 0, 408, 393, 1, 0, 0, 0, 409,
+ 90, 1, 0, 0, 0, 410, 411, 7, 15, 0, 0, 411, 412, 3, 89, 44, 0, 412, 92,
+ 1, 0, 0, 0, 413, 416, 3, 59, 29, 0, 414, 416, 5, 95, 0, 0, 415, 413, 1,
+ 0, 0, 0, 415, 414, 1, 0, 0, 0, 416, 422, 1, 0, 0, 0, 417, 421, 3, 59, 29,
+ 0, 418, 421, 3, 61, 30, 0, 419, 421, 5, 95, 0, 0, 420, 417, 1, 0, 0, 0,
+ 420, 418, 1, 0, 0, 0, 420, 419, 1, 0, 0, 0, 421, 424, 1, 0, 0, 0, 422,
+ 420, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 94, 1, 0, 0, 0, 424, 422, 1,
+ 0, 0, 0, 425, 429, 5, 96, 0, 0, 426, 430, 3, 59, 29, 0, 427, 430, 3, 61,
+ 30, 0, 428, 430, 7, 16, 0, 0, 429, 426, 1, 0, 0, 0, 429, 427, 1, 0, 0,
+ 0, 429, 428, 1, 0, 0, 0, 430, 431, 1, 0, 0, 0, 431, 429, 1, 0, 0, 0, 431,
+ 432, 1, 0, 0, 0, 432, 433, 1, 0, 0, 0, 433, 434, 5, 96, 0, 0, 434, 96,
+ 1, 0, 0, 0, 38, 0, 178, 183, 193, 226, 231, 241, 249, 255, 258, 263, 271,
+ 274, 276, 281, 289, 291, 296, 306, 310, 315, 317, 324, 326, 336, 338, 350,
+ 352, 363, 373, 386, 401, 408, 415, 420, 422, 429, 431, 1, 0, 1, 0,
+ }
+ deserializer := antlr.NewATNDeserializer(nil)
+ staticData.atn = deserializer.Deserialize(staticData.serializedATN)
+ atn := staticData.atn
+ staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
+ decisionToDFA := staticData.decisionToDFA
+ for index, state := range atn.DecisionToState {
+ decisionToDFA[index] = antlr.NewDFA(state, index)
+ }
}
// CELLexerInit initializes any static state used to implement CELLexer. By default the
@@ -280,16 +287,16 @@ func cellexerLexerInit() {
// NewCELLexer(). You can call this function if you wish to initialize the static state ahead
// of time.
func CELLexerInit() {
- staticData := &CELLexerLexerStaticData
- staticData.once.Do(cellexerLexerInit)
+ staticData := &CELLexerLexerStaticData
+ staticData.once.Do(cellexerLexerInit)
}
// NewCELLexer produces a new lexer instance for the optional input antlr.CharStream.
func NewCELLexer(input antlr.CharStream) *CELLexer {
- CELLexerInit()
+ CELLexerInit()
l := new(CELLexer)
l.BaseLexer = antlr.NewBaseLexer(input)
- staticData := &CELLexerLexerStaticData
+ staticData := &CELLexerLexerStaticData
l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache)
l.channelNames = staticData.ChannelNames
l.modeNames = staticData.ModeNames
@@ -304,41 +311,41 @@ func NewCELLexer(input antlr.CharStream) *CELLexer {
// CELLexer tokens.
const (
- CELLexerEQUALS = 1
- CELLexerNOT_EQUALS = 2
- CELLexerIN = 3
- CELLexerLESS = 4
- CELLexerLESS_EQUALS = 5
+ CELLexerEQUALS = 1
+ CELLexerNOT_EQUALS = 2
+ CELLexerIN = 3
+ CELLexerLESS = 4
+ CELLexerLESS_EQUALS = 5
CELLexerGREATER_EQUALS = 6
- CELLexerGREATER = 7
- CELLexerLOGICAL_AND = 8
- CELLexerLOGICAL_OR = 9
- CELLexerLBRACKET = 10
- CELLexerRPRACKET = 11
- CELLexerLBRACE = 12
- CELLexerRBRACE = 13
- CELLexerLPAREN = 14
- CELLexerRPAREN = 15
- CELLexerDOT = 16
- CELLexerCOMMA = 17
- CELLexerMINUS = 18
- CELLexerEXCLAM = 19
- CELLexerQUESTIONMARK = 20
- CELLexerCOLON = 21
- CELLexerPLUS = 22
- CELLexerSTAR = 23
- CELLexerSLASH = 24
- CELLexerPERCENT = 25
- CELLexerCEL_TRUE = 26
- CELLexerCEL_FALSE = 27
- CELLexerNUL = 28
- CELLexerWHITESPACE = 29
- CELLexerCOMMENT = 30
- CELLexerNUM_FLOAT = 31
- CELLexerNUM_INT = 32
- CELLexerNUM_UINT = 33
- CELLexerSTRING = 34
- CELLexerBYTES = 35
- CELLexerIDENTIFIER = 36
+ CELLexerGREATER = 7
+ CELLexerLOGICAL_AND = 8
+ CELLexerLOGICAL_OR = 9
+ CELLexerLBRACKET = 10
+ CELLexerRPRACKET = 11
+ CELLexerLBRACE = 12
+ CELLexerRBRACE = 13
+ CELLexerLPAREN = 14
+ CELLexerRPAREN = 15
+ CELLexerDOT = 16
+ CELLexerCOMMA = 17
+ CELLexerMINUS = 18
+ CELLexerEXCLAM = 19
+ CELLexerQUESTIONMARK = 20
+ CELLexerCOLON = 21
+ CELLexerPLUS = 22
+ CELLexerSTAR = 23
+ CELLexerSLASH = 24
+ CELLexerPERCENT = 25
+ CELLexerCEL_TRUE = 26
+ CELLexerCEL_FALSE = 27
+ CELLexerNUL = 28
+ CELLexerWHITESPACE = 29
+ CELLexerCOMMENT = 30
+ CELLexerNUM_FLOAT = 31
+ CELLexerNUM_INT = 32
+ CELLexerNUM_UINT = 33
+ CELLexerSTRING = 34
+ CELLexerBYTES = 35
+ CELLexerIDENTIFIER = 36
+ CELLexerESC_IDENTIFIER = 37
)
-
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_listener.go b/vendor/github.com/google/cel-go/parser/gen/cel_listener.go
index 22dc99789..da477c4b7 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_listener.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_listener.go
@@ -1,9 +1,8 @@
-// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
+// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
import "github.com/antlr4-go/antlr/v4"
-
// CELListener is a complete listener for a parse tree produced by CELParser.
type CELListener interface {
antlr.ParseTreeListener
@@ -47,8 +46,11 @@ type CELListener interface {
// EnterIndex is called when entering the Index production.
EnterIndex(c *IndexContext)
- // EnterIdentOrGlobalCall is called when entering the IdentOrGlobalCall production.
- EnterIdentOrGlobalCall(c *IdentOrGlobalCallContext)
+ // EnterIdent is called when entering the Ident production.
+ EnterIdent(c *IdentContext)
+
+ // EnterGlobalCall is called when entering the GlobalCall production.
+ EnterGlobalCall(c *GlobalCallContext)
// EnterNested is called when entering the Nested production.
EnterNested(c *NestedContext)
@@ -80,6 +82,12 @@ type CELListener interface {
// EnterMapInitializerList is called when entering the mapInitializerList production.
EnterMapInitializerList(c *MapInitializerListContext)
+ // EnterSimpleIdentifier is called when entering the SimpleIdentifier production.
+ EnterSimpleIdentifier(c *SimpleIdentifierContext)
+
+ // EnterEscapedIdentifier is called when entering the EscapedIdentifier production.
+ EnterEscapedIdentifier(c *EscapedIdentifierContext)
+
// EnterOptExpr is called when entering the optExpr production.
EnterOptExpr(c *OptExprContext)
@@ -146,8 +154,11 @@ type CELListener interface {
// ExitIndex is called when exiting the Index production.
ExitIndex(c *IndexContext)
- // ExitIdentOrGlobalCall is called when exiting the IdentOrGlobalCall production.
- ExitIdentOrGlobalCall(c *IdentOrGlobalCallContext)
+ // ExitIdent is called when exiting the Ident production.
+ ExitIdent(c *IdentContext)
+
+ // ExitGlobalCall is called when exiting the GlobalCall production.
+ ExitGlobalCall(c *GlobalCallContext)
// ExitNested is called when exiting the Nested production.
ExitNested(c *NestedContext)
@@ -179,6 +190,12 @@ type CELListener interface {
// ExitMapInitializerList is called when exiting the mapInitializerList production.
ExitMapInitializerList(c *MapInitializerListContext)
+ // ExitSimpleIdentifier is called when exiting the SimpleIdentifier production.
+ ExitSimpleIdentifier(c *SimpleIdentifierContext)
+
+ // ExitEscapedIdentifier is called when exiting the EscapedIdentifier production.
+ ExitEscapedIdentifier(c *EscapedIdentifierContext)
+
// ExitOptExpr is called when exiting the optExpr production.
ExitOptExpr(c *OptExprContext)
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_parser.go b/vendor/github.com/google/cel-go/parser/gen/cel_parser.go
index 35334af61..38693df58 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_parser.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_parser.go
@@ -1,10 +1,10 @@
-// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
+// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
import (
"fmt"
"strconv"
- "sync"
+ "sync"
"github.com/antlr4-go/antlr/v4"
)
@@ -14,167 +14,170 @@ var _ = fmt.Printf
var _ = strconv.Itoa
var _ = sync.Once{}
-
type CELParser struct {
*antlr.BaseParser
}
var CELParserStaticData struct {
- once sync.Once
- serializedATN []int32
- LiteralNames []string
- SymbolicNames []string
- RuleNames []string
- PredictionContextCache *antlr.PredictionContextCache
- atn *antlr.ATN
- decisionToDFA []*antlr.DFA
+ once sync.Once
+ serializedATN []int32
+ LiteralNames []string
+ SymbolicNames []string
+ RuleNames []string
+ PredictionContextCache *antlr.PredictionContextCache
+ atn *antlr.ATN
+ decisionToDFA []*antlr.DFA
}
func celParserInit() {
- staticData := &CELParserStaticData
- staticData.LiteralNames = []string{
- "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
- "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
- "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
- }
- staticData.SymbolicNames = []string{
- "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
- "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
- "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
- "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
- "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
- "STRING", "BYTES", "IDENTIFIER",
- }
- staticData.RuleNames = []string{
- "start", "expr", "conditionalOr", "conditionalAnd", "relation", "calc",
- "unary", "member", "primary", "exprList", "listInit", "fieldInitializerList",
- "optField", "mapInitializerList", "optExpr", "literal",
- }
- staticData.PredictionContextCache = antlr.NewPredictionContextCache()
- staticData.serializedATN = []int32{
- 4, 1, 36, 251, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7,
- 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7,
- 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15,
- 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 42, 8, 1, 1,
- 2, 1, 2, 1, 2, 5, 2, 47, 8, 2, 10, 2, 12, 2, 50, 9, 2, 1, 3, 1, 3, 1, 3,
- 5, 3, 55, 8, 3, 10, 3, 12, 3, 58, 9, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1,
- 4, 5, 4, 66, 8, 4, 10, 4, 12, 4, 69, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5,
- 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 80, 8, 5, 10, 5, 12, 5, 83, 9, 5, 1, 6, 1,
- 6, 4, 6, 87, 8, 6, 11, 6, 12, 6, 88, 1, 6, 1, 6, 4, 6, 93, 8, 6, 11, 6,
- 12, 6, 94, 1, 6, 3, 6, 98, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3,
- 7, 106, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 114, 8, 7, 1, 7,
- 1, 7, 1, 7, 1, 7, 3, 7, 120, 8, 7, 1, 7, 1, 7, 1, 7, 5, 7, 125, 8, 7, 10,
- 7, 12, 7, 128, 9, 7, 1, 8, 3, 8, 131, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 136,
- 8, 8, 1, 8, 3, 8, 139, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8,
- 147, 8, 8, 1, 8, 3, 8, 150, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 155, 8, 8, 1,
- 8, 3, 8, 158, 8, 8, 1, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8,
- 167, 8, 8, 10, 8, 12, 8, 170, 9, 8, 1, 8, 1, 8, 3, 8, 174, 8, 8, 1, 8,
- 3, 8, 177, 8, 8, 1, 8, 1, 8, 3, 8, 181, 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 186,
- 8, 9, 10, 9, 12, 9, 189, 9, 9, 1, 10, 1, 10, 1, 10, 5, 10, 194, 8, 10,
- 10, 10, 12, 10, 197, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1,
- 11, 1, 11, 5, 11, 207, 8, 11, 10, 11, 12, 11, 210, 9, 11, 1, 12, 3, 12,
- 213, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1,
- 13, 1, 13, 5, 13, 225, 8, 13, 10, 13, 12, 13, 228, 9, 13, 1, 14, 3, 14,
- 231, 8, 14, 1, 14, 1, 14, 1, 15, 3, 15, 236, 8, 15, 1, 15, 1, 15, 1, 15,
- 3, 15, 241, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 249,
- 8, 15, 1, 15, 0, 3, 8, 10, 14, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
- 22, 24, 26, 28, 30, 0, 3, 1, 0, 1, 7, 1, 0, 23, 25, 2, 0, 18, 18, 22, 22,
- 281, 0, 32, 1, 0, 0, 0, 2, 35, 1, 0, 0, 0, 4, 43, 1, 0, 0, 0, 6, 51, 1,
- 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 70, 1, 0, 0, 0, 12, 97, 1, 0, 0, 0, 14,
- 99, 1, 0, 0, 0, 16, 180, 1, 0, 0, 0, 18, 182, 1, 0, 0, 0, 20, 190, 1, 0,
- 0, 0, 22, 198, 1, 0, 0, 0, 24, 212, 1, 0, 0, 0, 26, 216, 1, 0, 0, 0, 28,
- 230, 1, 0, 0, 0, 30, 248, 1, 0, 0, 0, 32, 33, 3, 2, 1, 0, 33, 34, 5, 0,
- 0, 1, 34, 1, 1, 0, 0, 0, 35, 41, 3, 4, 2, 0, 36, 37, 5, 20, 0, 0, 37, 38,
- 3, 4, 2, 0, 38, 39, 5, 21, 0, 0, 39, 40, 3, 2, 1, 0, 40, 42, 1, 0, 0, 0,
- 41, 36, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 3, 1, 0, 0, 0, 43, 48, 3, 6,
- 3, 0, 44, 45, 5, 9, 0, 0, 45, 47, 3, 6, 3, 0, 46, 44, 1, 0, 0, 0, 47, 50,
- 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 48, 49, 1, 0, 0, 0, 49, 5, 1, 0, 0, 0,
- 50, 48, 1, 0, 0, 0, 51, 56, 3, 8, 4, 0, 52, 53, 5, 8, 0, 0, 53, 55, 3,
- 8, 4, 0, 54, 52, 1, 0, 0, 0, 55, 58, 1, 0, 0, 0, 56, 54, 1, 0, 0, 0, 56,
- 57, 1, 0, 0, 0, 57, 7, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 59, 60, 6, 4, -1,
- 0, 60, 61, 3, 10, 5, 0, 61, 67, 1, 0, 0, 0, 62, 63, 10, 1, 0, 0, 63, 64,
- 7, 0, 0, 0, 64, 66, 3, 8, 4, 2, 65, 62, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0,
- 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 9, 1, 0, 0, 0, 69, 67, 1, 0,
- 0, 0, 70, 71, 6, 5, -1, 0, 71, 72, 3, 12, 6, 0, 72, 81, 1, 0, 0, 0, 73,
- 74, 10, 2, 0, 0, 74, 75, 7, 1, 0, 0, 75, 80, 3, 10, 5, 3, 76, 77, 10, 1,
- 0, 0, 77, 78, 7, 2, 0, 0, 78, 80, 3, 10, 5, 2, 79, 73, 1, 0, 0, 0, 79,
- 76, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0,
- 0, 82, 11, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 98, 3, 14, 7, 0, 85, 87,
- 5, 19, 0, 0, 86, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0,
- 88, 89, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 98, 3, 14, 7, 0, 91, 93, 5,
- 18, 0, 0, 92, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94,
- 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 3, 14, 7, 0, 97, 84, 1, 0,
- 0, 0, 97, 86, 1, 0, 0, 0, 97, 92, 1, 0, 0, 0, 98, 13, 1, 0, 0, 0, 99, 100,
- 6, 7, -1, 0, 100, 101, 3, 16, 8, 0, 101, 126, 1, 0, 0, 0, 102, 103, 10,
- 3, 0, 0, 103, 105, 5, 16, 0, 0, 104, 106, 5, 20, 0, 0, 105, 104, 1, 0,
- 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 125, 5, 36, 0, 0,
- 108, 109, 10, 2, 0, 0, 109, 110, 5, 16, 0, 0, 110, 111, 5, 36, 0, 0, 111,
- 113, 5, 14, 0, 0, 112, 114, 3, 18, 9, 0, 113, 112, 1, 0, 0, 0, 113, 114,
- 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 125, 5, 15, 0, 0, 116, 117, 10,
- 1, 0, 0, 117, 119, 5, 10, 0, 0, 118, 120, 5, 20, 0, 0, 119, 118, 1, 0,
- 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 122, 3, 2, 1, 0,
- 122, 123, 5, 11, 0, 0, 123, 125, 1, 0, 0, 0, 124, 102, 1, 0, 0, 0, 124,
- 108, 1, 0, 0, 0, 124, 116, 1, 0, 0, 0, 125, 128, 1, 0, 0, 0, 126, 124,
- 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 15, 1, 0, 0, 0, 128, 126, 1, 0,
- 0, 0, 129, 131, 5, 16, 0, 0, 130, 129, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0,
- 131, 132, 1, 0, 0, 0, 132, 138, 5, 36, 0, 0, 133, 135, 5, 14, 0, 0, 134,
- 136, 3, 18, 9, 0, 135, 134, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 137,
- 1, 0, 0, 0, 137, 139, 5, 15, 0, 0, 138, 133, 1, 0, 0, 0, 138, 139, 1, 0,
- 0, 0, 139, 181, 1, 0, 0, 0, 140, 141, 5, 14, 0, 0, 141, 142, 3, 2, 1, 0,
- 142, 143, 5, 15, 0, 0, 143, 181, 1, 0, 0, 0, 144, 146, 5, 10, 0, 0, 145,
- 147, 3, 20, 10, 0, 146, 145, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 149,
- 1, 0, 0, 0, 148, 150, 5, 17, 0, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0,
- 0, 0, 150, 151, 1, 0, 0, 0, 151, 181, 5, 11, 0, 0, 152, 154, 5, 12, 0,
- 0, 153, 155, 3, 26, 13, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0,
- 155, 157, 1, 0, 0, 0, 156, 158, 5, 17, 0, 0, 157, 156, 1, 0, 0, 0, 157,
- 158, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 181, 5, 13, 0, 0, 160, 162,
- 5, 16, 0, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0,
- 0, 0, 163, 168, 5, 36, 0, 0, 164, 165, 5, 16, 0, 0, 165, 167, 5, 36, 0,
- 0, 166, 164, 1, 0, 0, 0, 167, 170, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 168,
- 169, 1, 0, 0, 0, 169, 171, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 171, 173,
- 5, 12, 0, 0, 172, 174, 3, 22, 11, 0, 173, 172, 1, 0, 0, 0, 173, 174, 1,
- 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 177, 5, 17, 0, 0, 176, 175, 1, 0, 0,
- 0, 176, 177, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 181, 5, 13, 0, 0, 179,
- 181, 3, 30, 15, 0, 180, 130, 1, 0, 0, 0, 180, 140, 1, 0, 0, 0, 180, 144,
- 1, 0, 0, 0, 180, 152, 1, 0, 0, 0, 180, 161, 1, 0, 0, 0, 180, 179, 1, 0,
- 0, 0, 181, 17, 1, 0, 0, 0, 182, 187, 3, 2, 1, 0, 183, 184, 5, 17, 0, 0,
- 184, 186, 3, 2, 1, 0, 185, 183, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187,
- 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 19, 1, 0, 0, 0, 189, 187, 1,
- 0, 0, 0, 190, 195, 3, 28, 14, 0, 191, 192, 5, 17, 0, 0, 192, 194, 3, 28,
- 14, 0, 193, 191, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0,
- 195, 196, 1, 0, 0, 0, 196, 21, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 199,
- 3, 24, 12, 0, 199, 200, 5, 21, 0, 0, 200, 208, 3, 2, 1, 0, 201, 202, 5,
- 17, 0, 0, 202, 203, 3, 24, 12, 0, 203, 204, 5, 21, 0, 0, 204, 205, 3, 2,
- 1, 0, 205, 207, 1, 0, 0, 0, 206, 201, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0,
- 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 23, 1, 0, 0, 0, 210, 208,
- 1, 0, 0, 0, 211, 213, 5, 20, 0, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0,
- 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 36, 0, 0, 215, 25, 1, 0, 0, 0,
- 216, 217, 3, 28, 14, 0, 217, 218, 5, 21, 0, 0, 218, 226, 3, 2, 1, 0, 219,
- 220, 5, 17, 0, 0, 220, 221, 3, 28, 14, 0, 221, 222, 5, 21, 0, 0, 222, 223,
- 3, 2, 1, 0, 223, 225, 1, 0, 0, 0, 224, 219, 1, 0, 0, 0, 225, 228, 1, 0,
- 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 27, 1, 0, 0, 0,
- 228, 226, 1, 0, 0, 0, 229, 231, 5, 20, 0, 0, 230, 229, 1, 0, 0, 0, 230,
- 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 3, 2, 1, 0, 233, 29, 1,
- 0, 0, 0, 234, 236, 5, 18, 0, 0, 235, 234, 1, 0, 0, 0, 235, 236, 1, 0, 0,
- 0, 236, 237, 1, 0, 0, 0, 237, 249, 5, 32, 0, 0, 238, 249, 5, 33, 0, 0,
- 239, 241, 5, 18, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241,
- 242, 1, 0, 0, 0, 242, 249, 5, 31, 0, 0, 243, 249, 5, 34, 0, 0, 244, 249,
- 5, 35, 0, 0, 245, 249, 5, 26, 0, 0, 246, 249, 5, 27, 0, 0, 247, 249, 5,
- 28, 0, 0, 248, 235, 1, 0, 0, 0, 248, 238, 1, 0, 0, 0, 248, 240, 1, 0, 0,
- 0, 248, 243, 1, 0, 0, 0, 248, 244, 1, 0, 0, 0, 248, 245, 1, 0, 0, 0, 248,
- 246, 1, 0, 0, 0, 248, 247, 1, 0, 0, 0, 249, 31, 1, 0, 0, 0, 35, 41, 48,
- 56, 67, 79, 81, 88, 94, 97, 105, 113, 119, 124, 126, 130, 135, 138, 146,
- 149, 154, 157, 161, 168, 173, 176, 180, 187, 195, 208, 212, 226, 230, 235,
- 240, 248,
-}
- deserializer := antlr.NewATNDeserializer(nil)
- staticData.atn = deserializer.Deserialize(staticData.serializedATN)
- atn := staticData.atn
- staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
- decisionToDFA := staticData.decisionToDFA
- for index, state := range atn.DecisionToState {
- decisionToDFA[index] = antlr.NewDFA(state, index)
- }
+ staticData := &CELParserStaticData
+ staticData.LiteralNames = []string{
+ "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
+ "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
+ "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
+ }
+ staticData.SymbolicNames = []string{
+ "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
+ "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
+ "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
+ "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
+ "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
+ "STRING", "BYTES", "IDENTIFIER", "ESC_IDENTIFIER",
+ }
+ staticData.RuleNames = []string{
+ "start", "expr", "conditionalOr", "conditionalAnd", "relation", "calc",
+ "unary", "member", "primary", "exprList", "listInit", "fieldInitializerList",
+ "optField", "mapInitializerList", "escapeIdent", "optExpr", "literal",
+ }
+ staticData.PredictionContextCache = antlr.NewPredictionContextCache()
+ staticData.serializedATN = []int32{
+ 4, 1, 37, 259, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7,
+ 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7,
+ 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15,
+ 2, 16, 7, 16, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
+ 1, 44, 8, 1, 1, 2, 1, 2, 1, 2, 5, 2, 49, 8, 2, 10, 2, 12, 2, 52, 9, 2,
+ 1, 3, 1, 3, 1, 3, 5, 3, 57, 8, 3, 10, 3, 12, 3, 60, 9, 3, 1, 4, 1, 4, 1,
+ 4, 1, 4, 1, 4, 1, 4, 5, 4, 68, 8, 4, 10, 4, 12, 4, 71, 9, 4, 1, 5, 1, 5,
+ 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 82, 8, 5, 10, 5, 12, 5,
+ 85, 9, 5, 1, 6, 1, 6, 4, 6, 89, 8, 6, 11, 6, 12, 6, 90, 1, 6, 1, 6, 4,
+ 6, 95, 8, 6, 11, 6, 12, 6, 96, 1, 6, 3, 6, 100, 8, 6, 1, 7, 1, 7, 1, 7,
+ 1, 7, 1, 7, 1, 7, 3, 7, 108, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7,
+ 3, 7, 116, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 122, 8, 7, 1, 7, 1, 7, 1,
+ 7, 5, 7, 127, 8, 7, 10, 7, 12, 7, 130, 9, 7, 1, 8, 3, 8, 133, 8, 8, 1,
+ 8, 1, 8, 3, 8, 137, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 142, 8, 8, 1, 8, 1, 8,
+ 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 151, 8, 8, 1, 8, 3, 8, 154, 8, 8, 1,
+ 8, 1, 8, 1, 8, 3, 8, 159, 8, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 3, 8,
+ 166, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8, 171, 8, 8, 10, 8, 12, 8, 174, 9, 8,
+ 1, 8, 1, 8, 3, 8, 178, 8, 8, 1, 8, 3, 8, 181, 8, 8, 1, 8, 1, 8, 3, 8, 185,
+ 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 190, 8, 9, 10, 9, 12, 9, 193, 9, 9, 1, 10,
+ 1, 10, 1, 10, 5, 10, 198, 8, 10, 10, 10, 12, 10, 201, 9, 10, 1, 11, 1,
+ 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 211, 8, 11, 10, 11,
+ 12, 11, 214, 9, 11, 1, 12, 3, 12, 217, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13,
+ 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 229, 8, 13, 10, 13, 12,
+ 13, 232, 9, 13, 1, 14, 1, 14, 3, 14, 236, 8, 14, 1, 15, 3, 15, 239, 8,
+ 15, 1, 15, 1, 15, 1, 16, 3, 16, 244, 8, 16, 1, 16, 1, 16, 1, 16, 3, 16,
+ 249, 8, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 257, 8, 16,
+ 1, 16, 0, 3, 8, 10, 14, 17, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22,
+ 24, 26, 28, 30, 32, 0, 3, 1, 0, 1, 7, 1, 0, 23, 25, 2, 0, 18, 18, 22, 22,
+ 290, 0, 34, 1, 0, 0, 0, 2, 37, 1, 0, 0, 0, 4, 45, 1, 0, 0, 0, 6, 53, 1,
+ 0, 0, 0, 8, 61, 1, 0, 0, 0, 10, 72, 1, 0, 0, 0, 12, 99, 1, 0, 0, 0, 14,
+ 101, 1, 0, 0, 0, 16, 184, 1, 0, 0, 0, 18, 186, 1, 0, 0, 0, 20, 194, 1,
+ 0, 0, 0, 22, 202, 1, 0, 0, 0, 24, 216, 1, 0, 0, 0, 26, 220, 1, 0, 0, 0,
+ 28, 235, 1, 0, 0, 0, 30, 238, 1, 0, 0, 0, 32, 256, 1, 0, 0, 0, 34, 35,
+ 3, 2, 1, 0, 35, 36, 5, 0, 0, 1, 36, 1, 1, 0, 0, 0, 37, 43, 3, 4, 2, 0,
+ 38, 39, 5, 20, 0, 0, 39, 40, 3, 4, 2, 0, 40, 41, 5, 21, 0, 0, 41, 42, 3,
+ 2, 1, 0, 42, 44, 1, 0, 0, 0, 43, 38, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44,
+ 3, 1, 0, 0, 0, 45, 50, 3, 6, 3, 0, 46, 47, 5, 9, 0, 0, 47, 49, 3, 6, 3,
+ 0, 48, 46, 1, 0, 0, 0, 49, 52, 1, 0, 0, 0, 50, 48, 1, 0, 0, 0, 50, 51,
+ 1, 0, 0, 0, 51, 5, 1, 0, 0, 0, 52, 50, 1, 0, 0, 0, 53, 58, 3, 8, 4, 0,
+ 54, 55, 5, 8, 0, 0, 55, 57, 3, 8, 4, 0, 56, 54, 1, 0, 0, 0, 57, 60, 1,
+ 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 7, 1, 0, 0, 0, 60,
+ 58, 1, 0, 0, 0, 61, 62, 6, 4, -1, 0, 62, 63, 3, 10, 5, 0, 63, 69, 1, 0,
+ 0, 0, 64, 65, 10, 1, 0, 0, 65, 66, 7, 0, 0, 0, 66, 68, 3, 8, 4, 2, 67,
+ 64, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0,
+ 0, 70, 9, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 73, 6, 5, -1, 0, 73, 74,
+ 3, 12, 6, 0, 74, 83, 1, 0, 0, 0, 75, 76, 10, 2, 0, 0, 76, 77, 7, 1, 0,
+ 0, 77, 82, 3, 10, 5, 3, 78, 79, 10, 1, 0, 0, 79, 80, 7, 2, 0, 0, 80, 82,
+ 3, 10, 5, 2, 81, 75, 1, 0, 0, 0, 81, 78, 1, 0, 0, 0, 82, 85, 1, 0, 0, 0,
+ 83, 81, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 11, 1, 0, 0, 0, 85, 83, 1,
+ 0, 0, 0, 86, 100, 3, 14, 7, 0, 87, 89, 5, 19, 0, 0, 88, 87, 1, 0, 0, 0,
+ 89, 90, 1, 0, 0, 0, 90, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 1,
+ 0, 0, 0, 92, 100, 3, 14, 7, 0, 93, 95, 5, 18, 0, 0, 94, 93, 1, 0, 0, 0,
+ 95, 96, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1,
+ 0, 0, 0, 98, 100, 3, 14, 7, 0, 99, 86, 1, 0, 0, 0, 99, 88, 1, 0, 0, 0,
+ 99, 94, 1, 0, 0, 0, 100, 13, 1, 0, 0, 0, 101, 102, 6, 7, -1, 0, 102, 103,
+ 3, 16, 8, 0, 103, 128, 1, 0, 0, 0, 104, 105, 10, 3, 0, 0, 105, 107, 5,
+ 16, 0, 0, 106, 108, 5, 20, 0, 0, 107, 106, 1, 0, 0, 0, 107, 108, 1, 0,
+ 0, 0, 108, 109, 1, 0, 0, 0, 109, 127, 3, 28, 14, 0, 110, 111, 10, 2, 0,
+ 0, 111, 112, 5, 16, 0, 0, 112, 113, 5, 36, 0, 0, 113, 115, 5, 14, 0, 0,
+ 114, 116, 3, 18, 9, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116,
+ 117, 1, 0, 0, 0, 117, 127, 5, 15, 0, 0, 118, 119, 10, 1, 0, 0, 119, 121,
+ 5, 10, 0, 0, 120, 122, 5, 20, 0, 0, 121, 120, 1, 0, 0, 0, 121, 122, 1,
+ 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 3, 2, 1, 0, 124, 125, 5, 11, 0,
+ 0, 125, 127, 1, 0, 0, 0, 126, 104, 1, 0, 0, 0, 126, 110, 1, 0, 0, 0, 126,
+ 118, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129,
+ 1, 0, 0, 0, 129, 15, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 133, 5, 16,
+ 0, 0, 132, 131, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0,
+ 134, 185, 5, 36, 0, 0, 135, 137, 5, 16, 0, 0, 136, 135, 1, 0, 0, 0, 136,
+ 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 36, 0, 0, 139, 141,
+ 5, 14, 0, 0, 140, 142, 3, 18, 9, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1,
+ 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 185, 5, 15, 0, 0, 144, 145, 5, 14,
+ 0, 0, 145, 146, 3, 2, 1, 0, 146, 147, 5, 15, 0, 0, 147, 185, 1, 0, 0, 0,
+ 148, 150, 5, 10, 0, 0, 149, 151, 3, 20, 10, 0, 150, 149, 1, 0, 0, 0, 150,
+ 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 154, 5, 17, 0, 0, 153, 152,
+ 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 185, 5, 11,
+ 0, 0, 156, 158, 5, 12, 0, 0, 157, 159, 3, 26, 13, 0, 158, 157, 1, 0, 0,
+ 0, 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 162, 5, 17, 0, 0, 161,
+ 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 185,
+ 5, 13, 0, 0, 164, 166, 5, 16, 0, 0, 165, 164, 1, 0, 0, 0, 165, 166, 1,
+ 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 172, 5, 36, 0, 0, 168, 169, 5, 16,
+ 0, 0, 169, 171, 5, 36, 0, 0, 170, 168, 1, 0, 0, 0, 171, 174, 1, 0, 0, 0,
+ 172, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, 175, 1, 0, 0, 0, 174,
+ 172, 1, 0, 0, 0, 175, 177, 5, 12, 0, 0, 176, 178, 3, 22, 11, 0, 177, 176,
+ 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 180, 1, 0, 0, 0, 179, 181, 5, 17,
+ 0, 0, 180, 179, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0,
+ 182, 185, 5, 13, 0, 0, 183, 185, 3, 32, 16, 0, 184, 132, 1, 0, 0, 0, 184,
+ 136, 1, 0, 0, 0, 184, 144, 1, 0, 0, 0, 184, 148, 1, 0, 0, 0, 184, 156,
+ 1, 0, 0, 0, 184, 165, 1, 0, 0, 0, 184, 183, 1, 0, 0, 0, 185, 17, 1, 0,
+ 0, 0, 186, 191, 3, 2, 1, 0, 187, 188, 5, 17, 0, 0, 188, 190, 3, 2, 1, 0,
+ 189, 187, 1, 0, 0, 0, 190, 193, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191,
+ 192, 1, 0, 0, 0, 192, 19, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 194, 199, 3,
+ 30, 15, 0, 195, 196, 5, 17, 0, 0, 196, 198, 3, 30, 15, 0, 197, 195, 1,
+ 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0,
+ 0, 200, 21, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 3, 24, 12, 0, 203,
+ 204, 5, 21, 0, 0, 204, 212, 3, 2, 1, 0, 205, 206, 5, 17, 0, 0, 206, 207,
+ 3, 24, 12, 0, 207, 208, 5, 21, 0, 0, 208, 209, 3, 2, 1, 0, 209, 211, 1,
+ 0, 0, 0, 210, 205, 1, 0, 0, 0, 211, 214, 1, 0, 0, 0, 212, 210, 1, 0, 0,
+ 0, 212, 213, 1, 0, 0, 0, 213, 23, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 215,
+ 217, 5, 20, 0, 0, 216, 215, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 218,
+ 1, 0, 0, 0, 218, 219, 3, 28, 14, 0, 219, 25, 1, 0, 0, 0, 220, 221, 3, 30,
+ 15, 0, 221, 222, 5, 21, 0, 0, 222, 230, 3, 2, 1, 0, 223, 224, 5, 17, 0,
+ 0, 224, 225, 3, 30, 15, 0, 225, 226, 5, 21, 0, 0, 226, 227, 3, 2, 1, 0,
+ 227, 229, 1, 0, 0, 0, 228, 223, 1, 0, 0, 0, 229, 232, 1, 0, 0, 0, 230,
+ 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 27, 1, 0, 0, 0, 232, 230, 1,
+ 0, 0, 0, 233, 236, 5, 36, 0, 0, 234, 236, 5, 37, 0, 0, 235, 233, 1, 0,
+ 0, 0, 235, 234, 1, 0, 0, 0, 236, 29, 1, 0, 0, 0, 237, 239, 5, 20, 0, 0,
+ 238, 237, 1, 0, 0, 0, 238, 239, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240,
+ 241, 3, 2, 1, 0, 241, 31, 1, 0, 0, 0, 242, 244, 5, 18, 0, 0, 243, 242,
+ 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 257, 5, 32,
+ 0, 0, 246, 257, 5, 33, 0, 0, 247, 249, 5, 18, 0, 0, 248, 247, 1, 0, 0,
+ 0, 248, 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 257, 5, 31, 0, 0, 251,
+ 257, 5, 34, 0, 0, 252, 257, 5, 35, 0, 0, 253, 257, 5, 26, 0, 0, 254, 257,
+ 5, 27, 0, 0, 255, 257, 5, 28, 0, 0, 256, 243, 1, 0, 0, 0, 256, 246, 1,
+ 0, 0, 0, 256, 248, 1, 0, 0, 0, 256, 251, 1, 0, 0, 0, 256, 252, 1, 0, 0,
+ 0, 256, 253, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 255, 1, 0, 0, 0, 257,
+ 33, 1, 0, 0, 0, 36, 43, 50, 58, 69, 81, 83, 90, 96, 99, 107, 115, 121,
+ 126, 128, 132, 136, 141, 150, 153, 158, 161, 165, 172, 177, 180, 184, 191,
+ 199, 212, 216, 230, 235, 238, 243, 248, 256,
+ }
+ deserializer := antlr.NewATNDeserializer(nil)
+ staticData.atn = deserializer.Deserialize(staticData.serializedATN)
+ atn := staticData.atn
+ staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
+ decisionToDFA := staticData.decisionToDFA
+ for index, state := range atn.DecisionToState {
+ decisionToDFA[index] = antlr.NewDFA(state, index)
+ }
}
// CELParserInit initializes any static state used to implement CELParser. By default the
@@ -182,8 +185,8 @@ func celParserInit() {
// NewCELParser(). You can call this function if you wish to initialize the static state ahead
// of time.
func CELParserInit() {
- staticData := &CELParserStaticData
- staticData.once.Do(celParserInit)
+ staticData := &CELParserStaticData
+ staticData.once.Do(celParserInit)
}
// NewCELParser produces a new parser instance for the optional input antlr.TokenStream.
@@ -191,7 +194,7 @@ func NewCELParser(input antlr.TokenStream) *CELParser {
CELParserInit()
this := new(CELParser)
this.BaseParser = antlr.NewBaseParser(input)
- staticData := &CELParserStaticData
+ staticData := &CELParserStaticData
this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache)
this.RuleNames = staticData.RuleNames
this.LiteralNames = staticData.LiteralNames
@@ -201,66 +204,67 @@ func NewCELParser(input antlr.TokenStream) *CELParser {
return this
}
-
// CELParser tokens.
const (
- CELParserEOF = antlr.TokenEOF
- CELParserEQUALS = 1
- CELParserNOT_EQUALS = 2
- CELParserIN = 3
- CELParserLESS = 4
- CELParserLESS_EQUALS = 5
+ CELParserEOF = antlr.TokenEOF
+ CELParserEQUALS = 1
+ CELParserNOT_EQUALS = 2
+ CELParserIN = 3
+ CELParserLESS = 4
+ CELParserLESS_EQUALS = 5
CELParserGREATER_EQUALS = 6
- CELParserGREATER = 7
- CELParserLOGICAL_AND = 8
- CELParserLOGICAL_OR = 9
- CELParserLBRACKET = 10
- CELParserRPRACKET = 11
- CELParserLBRACE = 12
- CELParserRBRACE = 13
- CELParserLPAREN = 14
- CELParserRPAREN = 15
- CELParserDOT = 16
- CELParserCOMMA = 17
- CELParserMINUS = 18
- CELParserEXCLAM = 19
- CELParserQUESTIONMARK = 20
- CELParserCOLON = 21
- CELParserPLUS = 22
- CELParserSTAR = 23
- CELParserSLASH = 24
- CELParserPERCENT = 25
- CELParserCEL_TRUE = 26
- CELParserCEL_FALSE = 27
- CELParserNUL = 28
- CELParserWHITESPACE = 29
- CELParserCOMMENT = 30
- CELParserNUM_FLOAT = 31
- CELParserNUM_INT = 32
- CELParserNUM_UINT = 33
- CELParserSTRING = 34
- CELParserBYTES = 35
- CELParserIDENTIFIER = 36
+ CELParserGREATER = 7
+ CELParserLOGICAL_AND = 8
+ CELParserLOGICAL_OR = 9
+ CELParserLBRACKET = 10
+ CELParserRPRACKET = 11
+ CELParserLBRACE = 12
+ CELParserRBRACE = 13
+ CELParserLPAREN = 14
+ CELParserRPAREN = 15
+ CELParserDOT = 16
+ CELParserCOMMA = 17
+ CELParserMINUS = 18
+ CELParserEXCLAM = 19
+ CELParserQUESTIONMARK = 20
+ CELParserCOLON = 21
+ CELParserPLUS = 22
+ CELParserSTAR = 23
+ CELParserSLASH = 24
+ CELParserPERCENT = 25
+ CELParserCEL_TRUE = 26
+ CELParserCEL_FALSE = 27
+ CELParserNUL = 28
+ CELParserWHITESPACE = 29
+ CELParserCOMMENT = 30
+ CELParserNUM_FLOAT = 31
+ CELParserNUM_INT = 32
+ CELParserNUM_UINT = 33
+ CELParserSTRING = 34
+ CELParserBYTES = 35
+ CELParserIDENTIFIER = 36
+ CELParserESC_IDENTIFIER = 37
)
// CELParser rules.
const (
- CELParserRULE_start = 0
- CELParserRULE_expr = 1
- CELParserRULE_conditionalOr = 2
- CELParserRULE_conditionalAnd = 3
- CELParserRULE_relation = 4
- CELParserRULE_calc = 5
- CELParserRULE_unary = 6
- CELParserRULE_member = 7
- CELParserRULE_primary = 8
- CELParserRULE_exprList = 9
- CELParserRULE_listInit = 10
+ CELParserRULE_start = 0
+ CELParserRULE_expr = 1
+ CELParserRULE_conditionalOr = 2
+ CELParserRULE_conditionalAnd = 3
+ CELParserRULE_relation = 4
+ CELParserRULE_calc = 5
+ CELParserRULE_unary = 6
+ CELParserRULE_member = 7
+ CELParserRULE_primary = 8
+ CELParserRULE_exprList = 9
+ CELParserRULE_listInit = 10
CELParserRULE_fieldInitializerList = 11
- CELParserRULE_optField = 12
- CELParserRULE_mapInitializerList = 13
- CELParserRULE_optExpr = 14
- CELParserRULE_literal = 15
+ CELParserRULE_optField = 12
+ CELParserRULE_mapInitializerList = 13
+ CELParserRULE_escapeIdent = 14
+ CELParserRULE_optExpr = 15
+ CELParserRULE_literal = 16
)
// IStartContext is an interface to support dynamic dispatch.
@@ -273,11 +277,9 @@ type IStartContext interface {
// GetE returns the e rule contexts.
GetE() IExprContext
-
// SetE sets the e rule contexts.
SetE(IExprContext)
-
// Getter signatures
EOF() antlr.TerminalNode
Expr() IExprContext
@@ -289,7 +291,7 @@ type IStartContext interface {
type StartContext struct {
antlr.BaseParserRuleContext
parser antlr.Parser
- e IExprContext
+ e IExprContext
}
func NewEmptyStartContext() *StartContext {
@@ -299,7 +301,7 @@ func NewEmptyStartContext() *StartContext {
return p
}
-func InitEmptyStartContext(p *StartContext) {
+func InitEmptyStartContext(p *StartContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_start
}
@@ -321,19 +323,17 @@ func (s *StartContext) GetParser() antlr.Parser { return s.parser }
func (s *StartContext) GetE() IExprContext { return s.e }
-
func (s *StartContext) SetE(v IExprContext) { s.e = v }
-
func (s *StartContext) EOF() antlr.TerminalNode {
return s.GetToken(CELParserEOF, 0)
}
func (s *StartContext) Expr() IExprContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -353,7 +353,6 @@ func (s *StartContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *StartContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterStart(s)
@@ -376,32 +375,26 @@ func (s *StartContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
-
func (p *CELParser) Start_() (localctx IStartContext) {
localctx = NewStartContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 0, CELParserRULE_start)
p.EnterOuterAlt(localctx, 1)
{
- p.SetState(32)
+ p.SetState(34)
var _x = p.Expr()
-
localctx.(*StartContext).e = _x
}
{
- p.SetState(33)
+ p.SetState(35)
p.Match(CELParserEOF)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -415,7 +408,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IExprContext is an interface to support dynamic dispatch.
type IExprContext interface {
antlr.ParserRuleContext
@@ -424,12 +416,10 @@ type IExprContext interface {
GetParser() antlr.Parser
// GetOp returns the op token.
- GetOp() antlr.Token
-
+ GetOp() antlr.Token
// SetOp sets the op token.
- SetOp(antlr.Token)
-
+ SetOp(antlr.Token)
// GetE returns the e rule contexts.
GetE() IConditionalOrContext
@@ -440,7 +430,6 @@ type IExprContext interface {
// GetE2 returns the e2 rule contexts.
GetE2() IExprContext
-
// SetE sets the e rule contexts.
SetE(IConditionalOrContext)
@@ -450,7 +439,6 @@ type IExprContext interface {
// SetE2 sets the e2 rule contexts.
SetE2(IExprContext)
-
// Getter signatures
AllConditionalOr() []IConditionalOrContext
ConditionalOr(i int) IConditionalOrContext
@@ -465,10 +453,10 @@ type IExprContext interface {
type ExprContext struct {
antlr.BaseParserRuleContext
parser antlr.Parser
- e IConditionalOrContext
- op antlr.Token
- e1 IConditionalOrContext
- e2 IExprContext
+ e IConditionalOrContext
+ op antlr.Token
+ e1 IConditionalOrContext
+ e2 IExprContext
}
func NewEmptyExprContext() *ExprContext {
@@ -478,7 +466,7 @@ func NewEmptyExprContext() *ExprContext {
return p
}
-func InitEmptyExprContext(p *ExprContext) {
+func InitEmptyExprContext(p *ExprContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_expr
}
@@ -500,24 +488,20 @@ func (s *ExprContext) GetParser() antlr.Parser { return s.parser }
func (s *ExprContext) GetOp() antlr.Token { return s.op }
-
func (s *ExprContext) SetOp(v antlr.Token) { s.op = v }
-
func (s *ExprContext) GetE() IConditionalOrContext { return s.e }
func (s *ExprContext) GetE1() IConditionalOrContext { return s.e1 }
func (s *ExprContext) GetE2() IExprContext { return s.e2 }
-
func (s *ExprContext) SetE(v IConditionalOrContext) { s.e = v }
func (s *ExprContext) SetE1(v IConditionalOrContext) { s.e1 = v }
func (s *ExprContext) SetE2(v IExprContext) { s.e2 = v }
-
func (s *ExprContext) AllConditionalOr() []IConditionalOrContext {
children := s.GetChildren()
len := 0
@@ -540,12 +524,12 @@ func (s *ExprContext) AllConditionalOr() []IConditionalOrContext {
}
func (s *ExprContext) ConditionalOr(i int) IConditionalOrContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IConditionalOrContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
@@ -568,10 +552,10 @@ func (s *ExprContext) QUESTIONMARK() antlr.TerminalNode {
}
func (s *ExprContext) Expr() IExprContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -591,7 +575,6 @@ func (s *ExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *ExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterExpr(s)
@@ -614,9 +597,6 @@ func (s *ExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
-
func (p *CELParser) Expr() (localctx IExprContext) {
localctx = NewExprContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 2, CELParserRULE_expr)
@@ -624,62 +604,56 @@ func (p *CELParser) Expr() (localctx IExprContext) {
p.EnterOuterAlt(localctx, 1)
{
- p.SetState(35)
+ p.SetState(37)
var _x = p.ConditionalOr()
-
localctx.(*ExprContext).e = _x
}
- p.SetState(41)
+ p.SetState(43)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserQUESTIONMARK {
{
- p.SetState(36)
+ p.SetState(38)
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*ExprContext).op = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
{
- p.SetState(37)
+ p.SetState(39)
var _x = p.ConditionalOr()
-
localctx.(*ExprContext).e1 = _x
}
{
- p.SetState(38)
+ p.SetState(40)
p.Match(CELParserCOLON)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
{
- p.SetState(39)
+ p.SetState(41)
var _x = p.Expr()
-
localctx.(*ExprContext).e2 = _x
}
}
-
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -693,7 +667,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IConditionalOrContext is an interface to support dynamic dispatch.
type IConditionalOrContext interface {
antlr.ParserRuleContext
@@ -702,42 +675,34 @@ type IConditionalOrContext interface {
GetParser() antlr.Parser
// GetS9 returns the s9 token.
- GetS9() antlr.Token
-
+ GetS9() antlr.Token
// SetS9 sets the s9 token.
- SetS9(antlr.Token)
-
+ SetS9(antlr.Token)
// GetOps returns the ops token list.
GetOps() []antlr.Token
-
// SetOps sets the ops token list.
SetOps([]antlr.Token)
-
// GetE returns the e rule contexts.
GetE() IConditionalAndContext
// Get_conditionalAnd returns the _conditionalAnd rule contexts.
Get_conditionalAnd() IConditionalAndContext
-
// SetE sets the e rule contexts.
SetE(IConditionalAndContext)
// Set_conditionalAnd sets the _conditionalAnd rule contexts.
Set_conditionalAnd(IConditionalAndContext)
-
// GetE1 returns the e1 rule context list.
GetE1() []IConditionalAndContext
-
// SetE1 sets the e1 rule context list.
- SetE1([]IConditionalAndContext)
-
+ SetE1([]IConditionalAndContext)
// Getter signatures
AllConditionalAnd() []IConditionalAndContext
@@ -751,12 +716,12 @@ type IConditionalOrContext interface {
type ConditionalOrContext struct {
antlr.BaseParserRuleContext
- parser antlr.Parser
- e IConditionalAndContext
- s9 antlr.Token
- ops []antlr.Token
- _conditionalAnd IConditionalAndContext
- e1 []IConditionalAndContext
+ parser antlr.Parser
+ e IConditionalAndContext
+ s9 antlr.Token
+ ops []antlr.Token
+ _conditionalAnd IConditionalAndContext
+ e1 []IConditionalAndContext
}
func NewEmptyConditionalOrContext() *ConditionalOrContext {
@@ -766,7 +731,7 @@ func NewEmptyConditionalOrContext() *ConditionalOrContext {
return p
}
-func InitEmptyConditionalOrContext(p *ConditionalOrContext) {
+func InitEmptyConditionalOrContext(p *ConditionalOrContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_conditionalOr
}
@@ -788,32 +753,24 @@ func (s *ConditionalOrContext) GetParser() antlr.Parser { return s.parser }
func (s *ConditionalOrContext) GetS9() antlr.Token { return s.s9 }
-
func (s *ConditionalOrContext) SetS9(v antlr.Token) { s.s9 = v }
-
func (s *ConditionalOrContext) GetOps() []antlr.Token { return s.ops }
-
func (s *ConditionalOrContext) SetOps(v []antlr.Token) { s.ops = v }
-
func (s *ConditionalOrContext) GetE() IConditionalAndContext { return s.e }
func (s *ConditionalOrContext) Get_conditionalAnd() IConditionalAndContext { return s._conditionalAnd }
-
func (s *ConditionalOrContext) SetE(v IConditionalAndContext) { s.e = v }
func (s *ConditionalOrContext) Set_conditionalAnd(v IConditionalAndContext) { s._conditionalAnd = v }
-
func (s *ConditionalOrContext) GetE1() []IConditionalAndContext { return s.e1 }
-
func (s *ConditionalOrContext) SetE1(v []IConditionalAndContext) { s.e1 = v }
-
func (s *ConditionalOrContext) AllConditionalAnd() []IConditionalAndContext {
children := s.GetChildren()
len := 0
@@ -836,12 +793,12 @@ func (s *ConditionalOrContext) AllConditionalAnd() []IConditionalAndContext {
}
func (s *ConditionalOrContext) ConditionalAnd(i int) IConditionalAndContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IConditionalAndContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
@@ -871,7 +828,6 @@ func (s *ConditionalOrContext) ToStringTree(ruleNames []string, recog antlr.Reco
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *ConditionalOrContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterConditionalOr(s)
@@ -894,9 +850,6 @@ func (s *ConditionalOrContext) Accept(visitor antlr.ParseTreeVisitor) interface{
}
}
-
-
-
func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) {
localctx = NewConditionalOrContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 4, CELParserRULE_conditionalOr)
@@ -904,55 +857,49 @@ func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) {
p.EnterOuterAlt(localctx, 1)
{
- p.SetState(43)
+ p.SetState(45)
var _x = p.ConditionalAnd()
-
localctx.(*ConditionalOrContext).e = _x
}
- p.SetState(48)
+ p.SetState(50)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
for _la == CELParserLOGICAL_OR {
{
- p.SetState(44)
+ p.SetState(46)
var _m = p.Match(CELParserLOGICAL_OR)
localctx.(*ConditionalOrContext).s9 = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
localctx.(*ConditionalOrContext).ops = append(localctx.(*ConditionalOrContext).ops, localctx.(*ConditionalOrContext).s9)
{
- p.SetState(45)
+ p.SetState(47)
var _x = p.ConditionalAnd()
-
localctx.(*ConditionalOrContext)._conditionalAnd = _x
}
localctx.(*ConditionalOrContext).e1 = append(localctx.(*ConditionalOrContext).e1, localctx.(*ConditionalOrContext)._conditionalAnd)
-
- p.SetState(50)
+ p.SetState(52)
p.GetErrorHandler().Sync(p)
if p.HasError() {
- goto errorExit
- }
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
-
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -966,7 +913,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IConditionalAndContext is an interface to support dynamic dispatch.
type IConditionalAndContext interface {
antlr.ParserRuleContext
@@ -975,42 +921,34 @@ type IConditionalAndContext interface {
GetParser() antlr.Parser
// GetS8 returns the s8 token.
- GetS8() antlr.Token
-
+ GetS8() antlr.Token
// SetS8 sets the s8 token.
- SetS8(antlr.Token)
-
+ SetS8(antlr.Token)
// GetOps returns the ops token list.
GetOps() []antlr.Token
-
// SetOps sets the ops token list.
SetOps([]antlr.Token)
-
// GetE returns the e rule contexts.
GetE() IRelationContext
// Get_relation returns the _relation rule contexts.
Get_relation() IRelationContext
-
// SetE sets the e rule contexts.
SetE(IRelationContext)
// Set_relation sets the _relation rule contexts.
Set_relation(IRelationContext)
-
// GetE1 returns the e1 rule context list.
GetE1() []IRelationContext
-
// SetE1 sets the e1 rule context list.
- SetE1([]IRelationContext)
-
+ SetE1([]IRelationContext)
// Getter signatures
AllRelation() []IRelationContext
@@ -1024,12 +962,12 @@ type IConditionalAndContext interface {
type ConditionalAndContext struct {
antlr.BaseParserRuleContext
- parser antlr.Parser
- e IRelationContext
- s8 antlr.Token
- ops []antlr.Token
- _relation IRelationContext
- e1 []IRelationContext
+ parser antlr.Parser
+ e IRelationContext
+ s8 antlr.Token
+ ops []antlr.Token
+ _relation IRelationContext
+ e1 []IRelationContext
}
func NewEmptyConditionalAndContext() *ConditionalAndContext {
@@ -1039,7 +977,7 @@ func NewEmptyConditionalAndContext() *ConditionalAndContext {
return p
}
-func InitEmptyConditionalAndContext(p *ConditionalAndContext) {
+func InitEmptyConditionalAndContext(p *ConditionalAndContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_conditionalAnd
}
@@ -1061,32 +999,24 @@ func (s *ConditionalAndContext) GetParser() antlr.Parser { return s.parser }
func (s *ConditionalAndContext) GetS8() antlr.Token { return s.s8 }
-
func (s *ConditionalAndContext) SetS8(v antlr.Token) { s.s8 = v }
-
func (s *ConditionalAndContext) GetOps() []antlr.Token { return s.ops }
-
func (s *ConditionalAndContext) SetOps(v []antlr.Token) { s.ops = v }
-
func (s *ConditionalAndContext) GetE() IRelationContext { return s.e }
func (s *ConditionalAndContext) Get_relation() IRelationContext { return s._relation }
-
func (s *ConditionalAndContext) SetE(v IRelationContext) { s.e = v }
func (s *ConditionalAndContext) Set_relation(v IRelationContext) { s._relation = v }
-
func (s *ConditionalAndContext) GetE1() []IRelationContext { return s.e1 }
-
func (s *ConditionalAndContext) SetE1(v []IRelationContext) { s.e1 = v }
-
func (s *ConditionalAndContext) AllRelation() []IRelationContext {
children := s.GetChildren()
len := 0
@@ -1109,12 +1039,12 @@ func (s *ConditionalAndContext) AllRelation() []IRelationContext {
}
func (s *ConditionalAndContext) Relation(i int) IRelationContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IRelationContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
@@ -1144,7 +1074,6 @@ func (s *ConditionalAndContext) ToStringTree(ruleNames []string, recog antlr.Rec
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *ConditionalAndContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterConditionalAnd(s)
@@ -1167,9 +1096,6 @@ func (s *ConditionalAndContext) Accept(visitor antlr.ParseTreeVisitor) interface
}
}
-
-
-
func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
localctx = NewConditionalAndContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 6, CELParserRULE_conditionalAnd)
@@ -1177,35 +1103,34 @@ func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
p.EnterOuterAlt(localctx, 1)
{
- p.SetState(51)
+ p.SetState(53)
var _x = p.relation(0)
localctx.(*ConditionalAndContext).e = _x
}
- p.SetState(56)
+ p.SetState(58)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
for _la == CELParserLOGICAL_AND {
{
- p.SetState(52)
+ p.SetState(54)
var _m = p.Match(CELParserLOGICAL_AND)
localctx.(*ConditionalAndContext).s8 = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
localctx.(*ConditionalAndContext).ops = append(localctx.(*ConditionalAndContext).ops, localctx.(*ConditionalAndContext).s8)
{
- p.SetState(53)
+ p.SetState(55)
var _x = p.relation(0)
@@ -1213,17 +1138,14 @@ func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
}
localctx.(*ConditionalAndContext).e1 = append(localctx.(*ConditionalAndContext).e1, localctx.(*ConditionalAndContext)._relation)
-
- p.SetState(58)
+ p.SetState(60)
p.GetErrorHandler().Sync(p)
if p.HasError() {
- goto errorExit
- }
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
-
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -1237,7 +1159,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IRelationContext is an interface to support dynamic dispatch.
type IRelationContext interface {
antlr.ParserRuleContext
@@ -1246,12 +1167,10 @@ type IRelationContext interface {
GetParser() antlr.Parser
// GetOp returns the op token.
- GetOp() antlr.Token
-
+ GetOp() antlr.Token
// SetOp sets the op token.
- SetOp(antlr.Token)
-
+ SetOp(antlr.Token)
// Getter signatures
Calc() ICalcContext
@@ -1272,7 +1191,7 @@ type IRelationContext interface {
type RelationContext struct {
antlr.BaseParserRuleContext
parser antlr.Parser
- op antlr.Token
+ op antlr.Token
}
func NewEmptyRelationContext() *RelationContext {
@@ -1282,7 +1201,7 @@ func NewEmptyRelationContext() *RelationContext {
return p
}
-func InitEmptyRelationContext(p *RelationContext) {
+func InitEmptyRelationContext(p *RelationContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_relation
}
@@ -1304,15 +1223,13 @@ func (s *RelationContext) GetParser() antlr.Parser { return s.parser }
func (s *RelationContext) GetOp() antlr.Token { return s.op }
-
func (s *RelationContext) SetOp(v antlr.Token) { s.op = v }
-
func (s *RelationContext) Calc() ICalcContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(ICalcContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -1346,12 +1263,12 @@ func (s *RelationContext) AllRelation() []IRelationContext {
}
func (s *RelationContext) Relation(i int) IRelationContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IRelationContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
@@ -1401,7 +1318,6 @@ func (s *RelationContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *RelationContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterRelation(s)
@@ -1424,10 +1340,6 @@ func (s *RelationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
-
-
func (p *CELParser) Relation() (localctx IRelationContext) {
return p.relation(0)
}
@@ -1447,12 +1359,12 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
p.EnterOuterAlt(localctx, 1)
{
- p.SetState(60)
+ p.SetState(62)
p.calc(0)
}
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
- p.SetState(67)
+ p.SetState(69)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
@@ -1469,14 +1381,14 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
_prevctx = localctx
localctx = NewRelationContext(p, _parentctx, _parentState)
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_relation)
- p.SetState(62)
+ p.SetState(64)
if !(p.Precpred(p.GetParserRuleContext(), 1)) {
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
goto errorExit
}
{
- p.SetState(63)
+ p.SetState(65)
var _lt = p.GetTokenStream().LT(1)
@@ -1484,7 +1396,7 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
_la = p.GetTokenStream().LA(1)
- if !(((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 254) != 0)) {
+ if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&254) != 0) {
var _ri = p.GetErrorHandler().RecoverInline(p)
localctx.(*RelationContext).op = _ri
@@ -1494,26 +1406,23 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
}
}
{
- p.SetState(64)
+ p.SetState(66)
p.relation(2)
}
-
}
- p.SetState(69)
+ p.SetState(71)
p.GetErrorHandler().Sync(p)
if p.HasError() {
- goto errorExit
- }
+ goto errorExit
+ }
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext())
if p.HasError() {
goto errorExit
}
}
-
-
- errorExit:
+errorExit:
if p.HasError() {
v := p.GetError()
localctx.SetException(v)
@@ -1526,7 +1435,6 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// ICalcContext is an interface to support dynamic dispatch.
type ICalcContext interface {
antlr.ParserRuleContext
@@ -1535,12 +1443,10 @@ type ICalcContext interface {
GetParser() antlr.Parser
// GetOp returns the op token.
- GetOp() antlr.Token
-
+ GetOp() antlr.Token
// SetOp sets the op token.
- SetOp(antlr.Token)
-
+ SetOp(antlr.Token)
// Getter signatures
Unary() IUnaryContext
@@ -1559,7 +1465,7 @@ type ICalcContext interface {
type CalcContext struct {
antlr.BaseParserRuleContext
parser antlr.Parser
- op antlr.Token
+ op antlr.Token
}
func NewEmptyCalcContext() *CalcContext {
@@ -1569,7 +1475,7 @@ func NewEmptyCalcContext() *CalcContext {
return p
}
-func InitEmptyCalcContext(p *CalcContext) {
+func InitEmptyCalcContext(p *CalcContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_calc
}
@@ -1591,15 +1497,13 @@ func (s *CalcContext) GetParser() antlr.Parser { return s.parser }
func (s *CalcContext) GetOp() antlr.Token { return s.op }
-
func (s *CalcContext) SetOp(v antlr.Token) { s.op = v }
-
func (s *CalcContext) Unary() IUnaryContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IUnaryContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -1633,12 +1537,12 @@ func (s *CalcContext) AllCalc() []ICalcContext {
}
func (s *CalcContext) Calc(i int) ICalcContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(ICalcContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
@@ -1680,7 +1584,6 @@ func (s *CalcContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *CalcContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCalc(s)
@@ -1703,10 +1606,6 @@ func (s *CalcContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
-
-
func (p *CELParser) Calc() (localctx ICalcContext) {
return p.calc(0)
}
@@ -1726,12 +1625,12 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
p.EnterOuterAlt(localctx, 1)
{
- p.SetState(71)
+ p.SetState(73)
p.Unary()
}
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
- p.SetState(81)
+ p.SetState(83)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
@@ -1746,7 +1645,7 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
p.TriggerExitRuleEvent()
}
_prevctx = localctx
- p.SetState(79)
+ p.SetState(81)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
@@ -1756,14 +1655,14 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
case 1:
localctx = NewCalcContext(p, _parentctx, _parentState)
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_calc)
- p.SetState(73)
+ p.SetState(75)
if !(p.Precpred(p.GetParserRuleContext(), 2)) {
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
goto errorExit
}
{
- p.SetState(74)
+ p.SetState(76)
var _lt = p.GetTokenStream().LT(1)
@@ -1771,7 +1670,7 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
_la = p.GetTokenStream().LA(1)
- if !(((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 58720256) != 0)) {
+ if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&58720256) != 0) {
var _ri = p.GetErrorHandler().RecoverInline(p)
localctx.(*CalcContext).op = _ri
@@ -1781,22 +1680,21 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
}
}
{
- p.SetState(75)
+ p.SetState(77)
p.calc(3)
}
-
case 2:
localctx = NewCalcContext(p, _parentctx, _parentState)
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_calc)
- p.SetState(76)
+ p.SetState(78)
if !(p.Precpred(p.GetParserRuleContext(), 1)) {
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
goto errorExit
}
{
- p.SetState(77)
+ p.SetState(79)
var _lt = p.GetTokenStream().LT(1)
@@ -1814,7 +1712,7 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
}
}
{
- p.SetState(78)
+ p.SetState(80)
p.calc(2)
}
@@ -1823,20 +1721,18 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
}
}
- p.SetState(83)
+ p.SetState(85)
p.GetErrorHandler().Sync(p)
if p.HasError() {
- goto errorExit
- }
+ goto errorExit
+ }
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext())
if p.HasError() {
goto errorExit
}
}
-
-
- errorExit:
+errorExit:
if p.HasError() {
v := p.GetError()
localctx.SetException(v)
@@ -1849,7 +1745,6 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IUnaryContext is an interface to support dynamic dispatch.
type IUnaryContext interface {
antlr.ParserRuleContext
@@ -1872,7 +1767,7 @@ func NewEmptyUnaryContext() *UnaryContext {
return p
}
-func InitEmptyUnaryContext(p *UnaryContext) {
+func InitEmptyUnaryContext(p *UnaryContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_unary
}
@@ -1904,9 +1799,6 @@ func (s *UnaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
-
-
type LogicalNotContext struct {
UnaryContext
s19 antlr.Token
@@ -1923,16 +1815,12 @@ func NewLogicalNotContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *Log
return p
}
-
func (s *LogicalNotContext) GetS19() antlr.Token { return s.s19 }
-
func (s *LogicalNotContext) SetS19(v antlr.Token) { s.s19 = v }
-
func (s *LogicalNotContext) GetOps() []antlr.Token { return s.ops }
-
func (s *LogicalNotContext) SetOps(v []antlr.Token) { s.ops = v }
func (s *LogicalNotContext) GetRuleContext() antlr.RuleContext {
@@ -1940,10 +1828,10 @@ func (s *LogicalNotContext) GetRuleContext() antlr.RuleContext {
}
func (s *LogicalNotContext) Member() IMemberContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -1963,7 +1851,6 @@ func (s *LogicalNotContext) EXCLAM(i int) antlr.TerminalNode {
return s.GetToken(CELParserEXCLAM, i)
}
-
func (s *LogicalNotContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterLogicalNot(s)
@@ -1986,7 +1873,6 @@ func (s *LogicalNotContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type MemberExprContext struct {
UnaryContext
}
@@ -2006,10 +1892,10 @@ func (s *MemberExprContext) GetRuleContext() antlr.RuleContext {
}
func (s *MemberExprContext) Member() IMemberContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -2021,7 +1907,6 @@ func (s *MemberExprContext) Member() IMemberContext {
return t.(IMemberContext)
}
-
func (s *MemberExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterMemberExpr(s)
@@ -2044,7 +1929,6 @@ func (s *MemberExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type NegateContext struct {
UnaryContext
s18 antlr.Token
@@ -2061,16 +1945,12 @@ func NewNegateContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NegateC
return p
}
-
func (s *NegateContext) GetS18() antlr.Token { return s.s18 }
-
func (s *NegateContext) SetS18(v antlr.Token) { s.s18 = v }
-
func (s *NegateContext) GetOps() []antlr.Token { return s.ops }
-
func (s *NegateContext) SetOps(v []antlr.Token) { s.ops = v }
func (s *NegateContext) GetRuleContext() antlr.RuleContext {
@@ -2078,10 +1958,10 @@ func (s *NegateContext) GetRuleContext() antlr.RuleContext {
}
func (s *NegateContext) Member() IMemberContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -2101,7 +1981,6 @@ func (s *NegateContext) MINUS(i int) antlr.TerminalNode {
return s.GetToken(CELParserMINUS, i)
}
-
func (s *NegateContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterNegate(s)
@@ -2124,8 +2003,6 @@ func (s *NegateContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
func (p *CELParser) Unary() (localctx IUnaryContext) {
localctx = NewUnaryContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 12, CELParserRULE_unary)
@@ -2133,7 +2010,7 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
var _alt int
- p.SetState(97)
+ p.SetState(99)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
@@ -2144,54 +2021,50 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
localctx = NewMemberExprContext(p, localctx)
p.EnterOuterAlt(localctx, 1)
{
- p.SetState(84)
+ p.SetState(86)
p.member(0)
}
-
case 2:
localctx = NewLogicalNotContext(p, localctx)
p.EnterOuterAlt(localctx, 2)
- p.SetState(86)
+ p.SetState(88)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
for ok := true; ok; ok = _la == CELParserEXCLAM {
{
- p.SetState(85)
+ p.SetState(87)
var _m = p.Match(CELParserEXCLAM)
localctx.(*LogicalNotContext).s19 = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
localctx.(*LogicalNotContext).ops = append(localctx.(*LogicalNotContext).ops, localctx.(*LogicalNotContext).s19)
-
- p.SetState(88)
+ p.SetState(90)
p.GetErrorHandler().Sync(p)
if p.HasError() {
- goto errorExit
- }
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
{
- p.SetState(90)
+ p.SetState(92)
p.member(0)
}
-
case 3:
localctx = NewNegateContext(p, localctx)
p.EnterOuterAlt(localctx, 3)
- p.SetState(92)
+ p.SetState(94)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
@@ -2200,28 +2073,25 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
switch _alt {
case 1:
- {
- p.SetState(91)
+ {
+ p.SetState(93)
- var _m = p.Match(CELParserMINUS)
+ var _m = p.Match(CELParserMINUS)
- localctx.(*NegateContext).s18 = _m
- if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
- }
+ localctx.(*NegateContext).s18 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
}
- localctx.(*NegateContext).ops = append(localctx.(*NegateContext).ops, localctx.(*NegateContext).s18)
-
-
-
+ }
+ localctx.(*NegateContext).ops = append(localctx.(*NegateContext).ops, localctx.(*NegateContext).s18)
default:
p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
goto errorExit
}
- p.SetState(94)
+ p.SetState(96)
p.GetErrorHandler().Sync(p)
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 7, p.GetParserRuleContext())
if p.HasError() {
@@ -2229,7 +2099,7 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
}
}
{
- p.SetState(96)
+ p.SetState(98)
p.member(0)
}
@@ -2237,7 +2107,6 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
goto errorExit
}
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -2251,7 +2120,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IMemberContext is an interface to support dynamic dispatch.
type IMemberContext interface {
antlr.ParserRuleContext
@@ -2274,7 +2142,7 @@ func NewEmptyMemberContext() *MemberContext {
return p
}
-func InitEmptyMemberContext(p *MemberContext) {
+func InitEmptyMemberContext(p *MemberContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_member
}
@@ -2306,16 +2174,12 @@ func (s *MemberContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
-
-
-
type MemberCallContext struct {
MemberContext
- op antlr.Token
- id antlr.Token
+ op antlr.Token
+ id antlr.Token
open antlr.Token
- args IExprListContext
+ args IExprListContext
}
func NewMemberCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MemberCallContext {
@@ -2328,24 +2192,20 @@ func NewMemberCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *Mem
return p
}
-
func (s *MemberCallContext) GetOp() antlr.Token { return s.op }
func (s *MemberCallContext) GetId() antlr.Token { return s.id }
func (s *MemberCallContext) GetOpen() antlr.Token { return s.open }
-
func (s *MemberCallContext) SetOp(v antlr.Token) { s.op = v }
func (s *MemberCallContext) SetId(v antlr.Token) { s.id = v }
func (s *MemberCallContext) SetOpen(v antlr.Token) { s.open = v }
-
func (s *MemberCallContext) GetArgs() IExprListContext { return s.args }
-
func (s *MemberCallContext) SetArgs(v IExprListContext) { s.args = v }
func (s *MemberCallContext) GetRuleContext() antlr.RuleContext {
@@ -2353,10 +2213,10 @@ func (s *MemberCallContext) GetRuleContext() antlr.RuleContext {
}
func (s *MemberCallContext) Member() IMemberContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -2385,10 +2245,10 @@ func (s *MemberCallContext) LPAREN() antlr.TerminalNode {
}
func (s *MemberCallContext) ExprList() IExprListContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprListContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -2400,7 +2260,6 @@ func (s *MemberCallContext) ExprList() IExprListContext {
return t.(IExprListContext)
}
-
func (s *MemberCallContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterMemberCall(s)
@@ -2423,12 +2282,11 @@ func (s *MemberCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type SelectContext struct {
MemberContext
- op antlr.Token
+ op antlr.Token
opt antlr.Token
- id antlr.Token
+ id IEscapeIdentContext
}
func NewSelectContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectContext {
@@ -2441,29 +2299,27 @@ func NewSelectContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectC
return p
}
-
func (s *SelectContext) GetOp() antlr.Token { return s.op }
func (s *SelectContext) GetOpt() antlr.Token { return s.opt }
-func (s *SelectContext) GetId() antlr.Token { return s.id }
-
-
func (s *SelectContext) SetOp(v antlr.Token) { s.op = v }
func (s *SelectContext) SetOpt(v antlr.Token) { s.opt = v }
-func (s *SelectContext) SetId(v antlr.Token) { s.id = v }
+func (s *SelectContext) GetId() IEscapeIdentContext { return s.id }
+
+func (s *SelectContext) SetId(v IEscapeIdentContext) { s.id = v }
func (s *SelectContext) GetRuleContext() antlr.RuleContext {
return s
}
func (s *SelectContext) Member() IMemberContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -2479,15 +2335,26 @@ func (s *SelectContext) DOT() antlr.TerminalNode {
return s.GetToken(CELParserDOT, 0)
}
-func (s *SelectContext) IDENTIFIER() antlr.TerminalNode {
- return s.GetToken(CELParserIDENTIFIER, 0)
+func (s *SelectContext) EscapeIdent() IEscapeIdentContext {
+ var t antlr.RuleContext
+ for _, ctx := range s.GetChildren() {
+ if _, ok := ctx.(IEscapeIdentContext); ok {
+ t = ctx.(antlr.RuleContext)
+ break
+ }
+ }
+
+ if t == nil {
+ return nil
+ }
+
+ return t.(IEscapeIdentContext)
}
func (s *SelectContext) QUESTIONMARK() antlr.TerminalNode {
return s.GetToken(CELParserQUESTIONMARK, 0)
}
-
func (s *SelectContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterSelect(s)
@@ -2510,7 +2377,6 @@ func (s *SelectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type PrimaryExprContext struct {
MemberContext
}
@@ -2530,10 +2396,10 @@ func (s *PrimaryExprContext) GetRuleContext() antlr.RuleContext {
}
func (s *PrimaryExprContext) Primary() IPrimaryContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IPrimaryContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -2545,7 +2411,6 @@ func (s *PrimaryExprContext) Primary() IPrimaryContext {
return t.(IPrimaryContext)
}
-
func (s *PrimaryExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterPrimaryExpr(s)
@@ -2568,12 +2433,11 @@ func (s *PrimaryExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
}
}
-
type IndexContext struct {
MemberContext
- op antlr.Token
- opt antlr.Token
- index IExprContext
+ op antlr.Token
+ opt antlr.Token
+ index IExprContext
}
func NewIndexContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IndexContext {
@@ -2586,20 +2450,16 @@ func NewIndexContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IndexCon
return p
}
-
func (s *IndexContext) GetOp() antlr.Token { return s.op }
func (s *IndexContext) GetOpt() antlr.Token { return s.opt }
-
func (s *IndexContext) SetOp(v antlr.Token) { s.op = v }
func (s *IndexContext) SetOpt(v antlr.Token) { s.opt = v }
-
func (s *IndexContext) GetIndex() IExprContext { return s.index }
-
func (s *IndexContext) SetIndex(v IExprContext) { s.index = v }
func (s *IndexContext) GetRuleContext() antlr.RuleContext {
@@ -2607,10 +2467,10 @@ func (s *IndexContext) GetRuleContext() antlr.RuleContext {
}
func (s *IndexContext) Member() IMemberContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -2631,10 +2491,10 @@ func (s *IndexContext) LBRACKET() antlr.TerminalNode {
}
func (s *IndexContext) Expr() IExprContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -2650,7 +2510,6 @@ func (s *IndexContext) QUESTIONMARK() antlr.TerminalNode {
return s.GetToken(CELParserQUESTIONMARK, 0)
}
-
func (s *IndexContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterIndex(s)
@@ -2673,8 +2532,6 @@ func (s *IndexContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
func (p *CELParser) Member() (localctx IMemberContext) {
return p.member(0)
}
@@ -2698,12 +2555,12 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
_prevctx = localctx
{
- p.SetState(100)
+ p.SetState(102)
p.Primary()
}
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
- p.SetState(126)
+ p.SetState(128)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
@@ -2718,7 +2575,7 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
p.TriggerExitRuleEvent()
}
_prevctx = localctx
- p.SetState(124)
+ p.SetState(126)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
@@ -2728,185 +2585,174 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
case 1:
localctx = NewSelectContext(p, NewMemberContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member)
- p.SetState(102)
+ p.SetState(104)
if !(p.Precpred(p.GetParserRuleContext(), 3)) {
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", ""))
goto errorExit
}
{
- p.SetState(103)
+ p.SetState(105)
var _m = p.Match(CELParserDOT)
localctx.(*SelectContext).op = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
- p.SetState(105)
+ p.SetState(107)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserQUESTIONMARK {
{
- p.SetState(104)
+ p.SetState(106)
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*SelectContext).opt = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(107)
+ p.SetState(109)
- var _m = p.Match(CELParserIDENTIFIER)
+ var _x = p.EscapeIdent()
- localctx.(*SelectContext).id = _m
- if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
- }
+ localctx.(*SelectContext).id = _x
}
-
case 2:
localctx = NewMemberCallContext(p, NewMemberContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member)
- p.SetState(108)
+ p.SetState(110)
if !(p.Precpred(p.GetParserRuleContext(), 2)) {
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
goto errorExit
}
{
- p.SetState(109)
+ p.SetState(111)
var _m = p.Match(CELParserDOT)
localctx.(*MemberCallContext).op = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
{
- p.SetState(110)
+ p.SetState(112)
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*MemberCallContext).id = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
{
- p.SetState(111)
+ p.SetState(113)
var _m = p.Match(CELParserLPAREN)
localctx.(*MemberCallContext).open = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
- p.SetState(113)
+ p.SetState(115)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
- if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135762105344) != 0) {
+ if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135762105344) != 0 {
{
- p.SetState(112)
+ p.SetState(114)
var _x = p.ExprList()
-
localctx.(*MemberCallContext).args = _x
}
}
{
- p.SetState(115)
+ p.SetState(117)
p.Match(CELParserRPAREN)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
case 3:
localctx = NewIndexContext(p, NewMemberContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member)
- p.SetState(116)
+ p.SetState(118)
if !(p.Precpred(p.GetParserRuleContext(), 1)) {
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
goto errorExit
}
{
- p.SetState(117)
+ p.SetState(119)
var _m = p.Match(CELParserLBRACKET)
localctx.(*IndexContext).op = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
- p.SetState(119)
+ p.SetState(121)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserQUESTIONMARK {
{
- p.SetState(118)
+ p.SetState(120)
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*IndexContext).opt = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(121)
+ p.SetState(123)
var _x = p.Expr()
-
localctx.(*IndexContext).index = _x
}
{
- p.SetState(122)
+ p.SetState(124)
p.Match(CELParserRPRACKET)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
@@ -2915,20 +2761,18 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
}
}
- p.SetState(128)
+ p.SetState(130)
p.GetErrorHandler().Sync(p)
if p.HasError() {
- goto errorExit
- }
+ goto errorExit
+ }
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext())
if p.HasError() {
goto errorExit
}
}
-
-
- errorExit:
+errorExit:
if p.HasError() {
v := p.GetError()
localctx.SetException(v)
@@ -2941,7 +2785,6 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IPrimaryContext is an interface to support dynamic dispatch.
type IPrimaryContext interface {
antlr.ParserRuleContext
@@ -2964,7 +2807,7 @@ func NewEmptyPrimaryContext() *PrimaryContext {
return p
}
-func InitEmptyPrimaryContext(p *PrimaryContext) {
+func InitEmptyPrimaryContext(p *PrimaryContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_primary
}
@@ -2996,13 +2839,10 @@ func (s *PrimaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
-
-
type CreateListContext struct {
PrimaryContext
- op antlr.Token
- elems IListInitContext
+ op antlr.Token
+ elems IListInitContext
}
func NewCreateListContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateListContext {
@@ -3015,16 +2855,12 @@ func NewCreateListContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *Cre
return p
}
-
func (s *CreateListContext) GetOp() antlr.Token { return s.op }
-
func (s *CreateListContext) SetOp(v antlr.Token) { s.op = v }
-
func (s *CreateListContext) GetElems() IListInitContext { return s.elems }
-
func (s *CreateListContext) SetElems(v IListInitContext) { s.elems = v }
func (s *CreateListContext) GetRuleContext() antlr.RuleContext {
@@ -3044,10 +2880,10 @@ func (s *CreateListContext) COMMA() antlr.TerminalNode {
}
func (s *CreateListContext) ListInit() IListInitContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IListInitContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -3059,7 +2895,6 @@ func (s *CreateListContext) ListInit() IListInitContext {
return t.(IListInitContext)
}
-
func (s *CreateListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCreateList(s)
@@ -3082,11 +2917,68 @@ func (s *CreateListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+type IdentContext struct {
+ PrimaryContext
+ leadingDot antlr.Token
+ id antlr.Token
+}
+
+func NewIdentContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IdentContext {
+ var p = new(IdentContext)
+
+ InitEmptyPrimaryContext(&p.PrimaryContext)
+ p.parser = parser
+ p.CopyAll(ctx.(*PrimaryContext))
+
+ return p
+}
+
+func (s *IdentContext) GetLeadingDot() antlr.Token { return s.leadingDot }
+
+func (s *IdentContext) GetId() antlr.Token { return s.id }
+
+func (s *IdentContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v }
+
+func (s *IdentContext) SetId(v antlr.Token) { s.id = v }
+
+func (s *IdentContext) GetRuleContext() antlr.RuleContext {
+ return s
+}
+
+func (s *IdentContext) IDENTIFIER() antlr.TerminalNode {
+ return s.GetToken(CELParserIDENTIFIER, 0)
+}
+
+func (s *IdentContext) DOT() antlr.TerminalNode {
+ return s.GetToken(CELParserDOT, 0)
+}
+
+func (s *IdentContext) EnterRule(listener antlr.ParseTreeListener) {
+ if listenerT, ok := listener.(CELListener); ok {
+ listenerT.EnterIdent(s)
+ }
+}
+
+func (s *IdentContext) ExitRule(listener antlr.ParseTreeListener) {
+ if listenerT, ok := listener.(CELListener); ok {
+ listenerT.ExitIdent(s)
+ }
+}
+
+func (s *IdentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
+ switch t := visitor.(type) {
+ case CELVisitor:
+ return t.VisitIdent(s)
+
+ default:
+ return t.VisitChildren(s)
+ }
+}
type CreateStructContext struct {
PrimaryContext
- op antlr.Token
- entries IMapInitializerListContext
+ op antlr.Token
+ entries IMapInitializerListContext
}
func NewCreateStructContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateStructContext {
@@ -3099,16 +2991,12 @@ func NewCreateStructContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *C
return p
}
-
func (s *CreateStructContext) GetOp() antlr.Token { return s.op }
-
func (s *CreateStructContext) SetOp(v antlr.Token) { s.op = v }
-
func (s *CreateStructContext) GetEntries() IMapInitializerListContext { return s.entries }
-
func (s *CreateStructContext) SetEntries(v IMapInitializerListContext) { s.entries = v }
func (s *CreateStructContext) GetRuleContext() antlr.RuleContext {
@@ -3128,10 +3016,10 @@ func (s *CreateStructContext) COMMA() antlr.TerminalNode {
}
func (s *CreateStructContext) MapInitializerList() IMapInitializerListContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMapInitializerListContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -3143,7 +3031,6 @@ func (s *CreateStructContext) MapInitializerList() IMapInitializerListContext {
return t.(IMapInitializerListContext)
}
-
func (s *CreateStructContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCreateStruct(s)
@@ -3166,7 +3053,6 @@ func (s *CreateStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
}
}
-
type ConstantLiteralContext struct {
PrimaryContext
}
@@ -3186,10 +3072,10 @@ func (s *ConstantLiteralContext) GetRuleContext() antlr.RuleContext {
}
func (s *ConstantLiteralContext) Literal() ILiteralContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(ILiteralContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -3201,7 +3087,6 @@ func (s *ConstantLiteralContext) Literal() ILiteralContext {
return t.(ILiteralContext)
}
-
func (s *ConstantLiteralContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterConstantLiteral(s)
@@ -3224,10 +3109,9 @@ func (s *ConstantLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interfac
}
}
-
type NestedContext struct {
PrimaryContext
- e IExprContext
+ e IExprContext
}
func NewNestedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NestedContext {
@@ -3240,10 +3124,8 @@ func NewNestedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NestedC
return p
}
-
func (s *NestedContext) GetE() IExprContext { return s.e }
-
func (s *NestedContext) SetE(v IExprContext) { s.e = v }
func (s *NestedContext) GetRuleContext() antlr.RuleContext {
@@ -3259,10 +3141,10 @@ func (s *NestedContext) RPAREN() antlr.TerminalNode {
}
func (s *NestedContext) Expr() IExprContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -3274,7 +3156,6 @@ func (s *NestedContext) Expr() IExprContext {
return t.(IExprContext)
}
-
func (s *NestedContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterNested(s)
@@ -3297,16 +3178,15 @@ func (s *NestedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type CreateMessageContext struct {
PrimaryContext
- leadingDot antlr.Token
+ leadingDot antlr.Token
_IDENTIFIER antlr.Token
- ids []antlr.Token
- s16 antlr.Token
- ops []antlr.Token
- op antlr.Token
- entries IFieldInitializerListContext
+ ids []antlr.Token
+ s16 antlr.Token
+ ops []antlr.Token
+ op antlr.Token
+ entries IFieldInitializerListContext
}
func NewCreateMessageContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateMessageContext {
@@ -3319,7 +3199,6 @@ func NewCreateMessageContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *
return p
}
-
func (s *CreateMessageContext) GetLeadingDot() antlr.Token { return s.leadingDot }
func (s *CreateMessageContext) Get_IDENTIFIER() antlr.Token { return s._IDENTIFIER }
@@ -3328,7 +3207,6 @@ func (s *CreateMessageContext) GetS16() antlr.Token { return s.s16 }
func (s *CreateMessageContext) GetOp() antlr.Token { return s.op }
-
func (s *CreateMessageContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v }
func (s *CreateMessageContext) Set_IDENTIFIER(v antlr.Token) { s._IDENTIFIER = v }
@@ -3337,20 +3215,16 @@ func (s *CreateMessageContext) SetS16(v antlr.Token) { s.s16 = v }
func (s *CreateMessageContext) SetOp(v antlr.Token) { s.op = v }
-
func (s *CreateMessageContext) GetIds() []antlr.Token { return s.ids }
func (s *CreateMessageContext) GetOps() []antlr.Token { return s.ops }
-
func (s *CreateMessageContext) SetIds(v []antlr.Token) { s.ids = v }
func (s *CreateMessageContext) SetOps(v []antlr.Token) { s.ops = v }
-
func (s *CreateMessageContext) GetEntries() IFieldInitializerListContext { return s.entries }
-
func (s *CreateMessageContext) SetEntries(v IFieldInitializerListContext) { s.entries = v }
func (s *CreateMessageContext) GetRuleContext() antlr.RuleContext {
@@ -3386,10 +3260,10 @@ func (s *CreateMessageContext) DOT(i int) antlr.TerminalNode {
}
func (s *CreateMessageContext) FieldInitializerList() IFieldInitializerListContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IFieldInitializerListContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -3401,7 +3275,6 @@ func (s *CreateMessageContext) FieldInitializerList() IFieldInitializerListConte
return t.(IFieldInitializerListContext)
}
-
func (s *CreateMessageContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCreateMessage(s)
@@ -3424,17 +3297,16 @@ func (s *CreateMessageContext) Accept(visitor antlr.ParseTreeVisitor) interface{
}
}
-
-type IdentOrGlobalCallContext struct {
+type GlobalCallContext struct {
PrimaryContext
leadingDot antlr.Token
- id antlr.Token
- op antlr.Token
- args IExprListContext
+ id antlr.Token
+ op antlr.Token
+ args IExprListContext
}
-func NewIdentOrGlobalCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IdentOrGlobalCallContext {
- var p = new(IdentOrGlobalCallContext)
+func NewGlobalCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GlobalCallContext {
+ var p = new(GlobalCallContext)
InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
@@ -3443,51 +3315,47 @@ func NewIdentOrGlobalCallContext(parser antlr.Parser, ctx antlr.ParserRuleContex
return p
}
+func (s *GlobalCallContext) GetLeadingDot() antlr.Token { return s.leadingDot }
-func (s *IdentOrGlobalCallContext) GetLeadingDot() antlr.Token { return s.leadingDot }
+func (s *GlobalCallContext) GetId() antlr.Token { return s.id }
-func (s *IdentOrGlobalCallContext) GetId() antlr.Token { return s.id }
+func (s *GlobalCallContext) GetOp() antlr.Token { return s.op }
-func (s *IdentOrGlobalCallContext) GetOp() antlr.Token { return s.op }
+func (s *GlobalCallContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v }
+func (s *GlobalCallContext) SetId(v antlr.Token) { s.id = v }
-func (s *IdentOrGlobalCallContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v }
+func (s *GlobalCallContext) SetOp(v antlr.Token) { s.op = v }
-func (s *IdentOrGlobalCallContext) SetId(v antlr.Token) { s.id = v }
+func (s *GlobalCallContext) GetArgs() IExprListContext { return s.args }
-func (s *IdentOrGlobalCallContext) SetOp(v antlr.Token) { s.op = v }
+func (s *GlobalCallContext) SetArgs(v IExprListContext) { s.args = v }
-
-func (s *IdentOrGlobalCallContext) GetArgs() IExprListContext { return s.args }
-
-
-func (s *IdentOrGlobalCallContext) SetArgs(v IExprListContext) { s.args = v }
-
-func (s *IdentOrGlobalCallContext) GetRuleContext() antlr.RuleContext {
+func (s *GlobalCallContext) GetRuleContext() antlr.RuleContext {
return s
}
-func (s *IdentOrGlobalCallContext) IDENTIFIER() antlr.TerminalNode {
+func (s *GlobalCallContext) IDENTIFIER() antlr.TerminalNode {
return s.GetToken(CELParserIDENTIFIER, 0)
}
-func (s *IdentOrGlobalCallContext) RPAREN() antlr.TerminalNode {
+func (s *GlobalCallContext) RPAREN() antlr.TerminalNode {
return s.GetToken(CELParserRPAREN, 0)
}
-func (s *IdentOrGlobalCallContext) DOT() antlr.TerminalNode {
- return s.GetToken(CELParserDOT, 0)
+func (s *GlobalCallContext) LPAREN() antlr.TerminalNode {
+ return s.GetToken(CELParserLPAREN, 0)
}
-func (s *IdentOrGlobalCallContext) LPAREN() antlr.TerminalNode {
- return s.GetToken(CELParserLPAREN, 0)
+func (s *GlobalCallContext) DOT() antlr.TerminalNode {
+ return s.GetToken(CELParserDOT, 0)
}
-func (s *IdentOrGlobalCallContext) ExprList() IExprListContext {
- var t antlr.RuleContext;
+func (s *GlobalCallContext) ExprList() IExprListContext {
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprListContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -3499,37 +3367,34 @@ func (s *IdentOrGlobalCallContext) ExprList() IExprListContext {
return t.(IExprListContext)
}
-
-func (s *IdentOrGlobalCallContext) EnterRule(listener antlr.ParseTreeListener) {
+func (s *GlobalCallContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
- listenerT.EnterIdentOrGlobalCall(s)
+ listenerT.EnterGlobalCall(s)
}
}
-func (s *IdentOrGlobalCallContext) ExitRule(listener antlr.ParseTreeListener) {
+func (s *GlobalCallContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
- listenerT.ExitIdentOrGlobalCall(s)
+ listenerT.ExitGlobalCall(s)
}
}
-func (s *IdentOrGlobalCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
+func (s *GlobalCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case CELVisitor:
- return t.VisitIdentOrGlobalCall(s)
+ return t.VisitGlobalCall(s)
default:
return t.VisitChildren(s)
}
}
-
-
func (p *CELParser) Primary() (localctx IPrimaryContext) {
localctx = NewPrimaryContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 16, CELParserRULE_primary)
var _la int
- p.SetState(180)
+ p.SetState(184)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
@@ -3537,386 +3402,393 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) {
case 1:
- localctx = NewIdentOrGlobalCallContext(p, localctx)
+ localctx = NewIdentContext(p, localctx)
p.EnterOuterAlt(localctx, 1)
- p.SetState(130)
+ p.SetState(132)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserDOT {
{
- p.SetState(129)
+ p.SetState(131)
var _m = p.Match(CELParserDOT)
- localctx.(*IdentOrGlobalCallContext).leadingDot = _m
+ localctx.(*IdentContext).leadingDot = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(132)
+ p.SetState(134)
var _m = p.Match(CELParserIDENTIFIER)
- localctx.(*IdentOrGlobalCallContext).id = _m
+ localctx.(*IdentContext).id = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
- p.SetState(138)
- p.GetErrorHandler().Sync(p)
+ case 2:
+ localctx = NewGlobalCallContext(p, localctx)
+ p.EnterOuterAlt(localctx, 2)
+ p.SetState(136)
+ p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
+ _la = p.GetTokenStream().LA(1)
- if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 {
+ if _la == CELParserDOT {
{
- p.SetState(133)
+ p.SetState(135)
- var _m = p.Match(CELParserLPAREN)
+ var _m = p.Match(CELParserDOT)
- localctx.(*IdentOrGlobalCallContext).op = _m
+ localctx.(*GlobalCallContext).leadingDot = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
- p.SetState(135)
- p.GetErrorHandler().Sync(p)
+
+ }
+ {
+ p.SetState(138)
+
+ var _m = p.Match(CELParserIDENTIFIER)
+
+ localctx.(*GlobalCallContext).id = _m
if p.HasError() {
+ // Recognition error - abort rule
goto errorExit
}
- _la = p.GetTokenStream().LA(1)
+ }
+ {
+ p.SetState(139)
- if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135762105344) != 0) {
- {
- p.SetState(134)
+ var _m = p.Match(CELParserLPAREN)
- var _x = p.ExprList()
+ localctx.(*GlobalCallContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
+ }
+ p.SetState(141)
+ p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
+ _la = p.GetTokenStream().LA(1)
+ if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135762105344) != 0 {
+ {
+ p.SetState(140)
- localctx.(*IdentOrGlobalCallContext).args = _x
- }
+ var _x = p.ExprList()
- }
- {
- p.SetState(137)
- p.Match(CELParserRPAREN)
- if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
- }
+ localctx.(*GlobalCallContext).args = _x
}
- } else if p.HasError() { // JIM
+ }
+ {
+ p.SetState(143)
+ p.Match(CELParserRPAREN)
+ if p.HasError() {
+ // Recognition error - abort rule
goto errorExit
+ }
}
-
- case 2:
+ case 3:
localctx = NewNestedContext(p, localctx)
- p.EnterOuterAlt(localctx, 2)
+ p.EnterOuterAlt(localctx, 3)
{
- p.SetState(140)
+ p.SetState(144)
p.Match(CELParserLPAREN)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
{
- p.SetState(141)
+ p.SetState(145)
var _x = p.Expr()
-
localctx.(*NestedContext).e = _x
}
{
- p.SetState(142)
+ p.SetState(146)
p.Match(CELParserRPAREN)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
- case 3:
+ case 4:
localctx = NewCreateListContext(p, localctx)
- p.EnterOuterAlt(localctx, 3)
+ p.EnterOuterAlt(localctx, 4)
{
- p.SetState(144)
+ p.SetState(148)
var _m = p.Match(CELParserLBRACKET)
localctx.(*CreateListContext).op = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
- p.SetState(146)
+ p.SetState(150)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
- if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135763153920) != 0) {
+ if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135763153920) != 0 {
{
- p.SetState(145)
+ p.SetState(149)
var _x = p.ListInit()
-
localctx.(*CreateListContext).elems = _x
}
}
- p.SetState(149)
+ p.SetState(153)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserCOMMA {
{
- p.SetState(148)
+ p.SetState(152)
p.Match(CELParserCOMMA)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(151)
+ p.SetState(155)
p.Match(CELParserRPRACKET)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
- case 4:
+ case 5:
localctx = NewCreateStructContext(p, localctx)
- p.EnterOuterAlt(localctx, 4)
+ p.EnterOuterAlt(localctx, 5)
{
- p.SetState(152)
+ p.SetState(156)
var _m = p.Match(CELParserLBRACE)
localctx.(*CreateStructContext).op = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
- p.SetState(154)
+ p.SetState(158)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
- if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135763153920) != 0) {
+ if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135763153920) != 0 {
{
- p.SetState(153)
+ p.SetState(157)
var _x = p.MapInitializerList()
-
localctx.(*CreateStructContext).entries = _x
}
}
- p.SetState(157)
+ p.SetState(161)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserCOMMA {
{
- p.SetState(156)
+ p.SetState(160)
p.Match(CELParserCOMMA)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(159)
+ p.SetState(163)
p.Match(CELParserRBRACE)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
- case 5:
+ case 6:
localctx = NewCreateMessageContext(p, localctx)
- p.EnterOuterAlt(localctx, 5)
- p.SetState(161)
+ p.EnterOuterAlt(localctx, 6)
+ p.SetState(165)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserDOT {
{
- p.SetState(160)
+ p.SetState(164)
var _m = p.Match(CELParserDOT)
localctx.(*CreateMessageContext).leadingDot = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(163)
+ p.SetState(167)
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*CreateMessageContext)._IDENTIFIER = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
localctx.(*CreateMessageContext).ids = append(localctx.(*CreateMessageContext).ids, localctx.(*CreateMessageContext)._IDENTIFIER)
- p.SetState(168)
+ p.SetState(172)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
for _la == CELParserDOT {
{
- p.SetState(164)
+ p.SetState(168)
var _m = p.Match(CELParserDOT)
localctx.(*CreateMessageContext).s16 = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
localctx.(*CreateMessageContext).ops = append(localctx.(*CreateMessageContext).ops, localctx.(*CreateMessageContext).s16)
{
- p.SetState(165)
+ p.SetState(169)
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*CreateMessageContext)._IDENTIFIER = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
localctx.(*CreateMessageContext).ids = append(localctx.(*CreateMessageContext).ids, localctx.(*CreateMessageContext)._IDENTIFIER)
-
- p.SetState(170)
+ p.SetState(174)
p.GetErrorHandler().Sync(p)
if p.HasError() {
- goto errorExit
- }
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
{
- p.SetState(171)
+ p.SetState(175)
var _m = p.Match(CELParserLBRACE)
localctx.(*CreateMessageContext).op = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
- p.SetState(173)
+ p.SetState(177)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
- if _la == CELParserQUESTIONMARK || _la == CELParserIDENTIFIER {
+ if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&206159478784) != 0 {
{
- p.SetState(172)
+ p.SetState(176)
var _x = p.FieldInitializerList()
-
localctx.(*CreateMessageContext).entries = _x
}
}
- p.SetState(176)
+ p.SetState(180)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserCOMMA {
{
- p.SetState(175)
+ p.SetState(179)
p.Match(CELParserCOMMA)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(178)
+ p.SetState(182)
p.Match(CELParserRBRACE)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
- case 6:
+ case 7:
localctx = NewConstantLiteralContext(p, localctx)
- p.EnterOuterAlt(localctx, 6)
+ p.EnterOuterAlt(localctx, 7)
{
- p.SetState(179)
+ p.SetState(183)
p.Literal()
}
@@ -3924,7 +3796,6 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
goto errorExit
}
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -3938,7 +3809,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IExprListContext is an interface to support dynamic dispatch.
type IExprListContext interface {
antlr.ParserRuleContext
@@ -3949,18 +3819,14 @@ type IExprListContext interface {
// Get_expr returns the _expr rule contexts.
Get_expr() IExprContext
-
// Set_expr sets the _expr rule contexts.
Set_expr(IExprContext)
-
// GetE returns the e rule context list.
GetE() []IExprContext
-
// SetE sets the e rule context list.
- SetE([]IExprContext)
-
+ SetE([]IExprContext)
// Getter signatures
AllExpr() []IExprContext
@@ -3975,8 +3841,8 @@ type IExprListContext interface {
type ExprListContext struct {
antlr.BaseParserRuleContext
parser antlr.Parser
- _expr IExprContext
- e []IExprContext
+ _expr IExprContext
+ e []IExprContext
}
func NewEmptyExprListContext() *ExprListContext {
@@ -3986,7 +3852,7 @@ func NewEmptyExprListContext() *ExprListContext {
return p
}
-func InitEmptyExprListContext(p *ExprListContext) {
+func InitEmptyExprListContext(p *ExprListContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_exprList
}
@@ -4008,16 +3874,12 @@ func (s *ExprListContext) GetParser() antlr.Parser { return s.parser }
func (s *ExprListContext) Get_expr() IExprContext { return s._expr }
-
func (s *ExprListContext) Set_expr(v IExprContext) { s._expr = v }
-
func (s *ExprListContext) GetE() []IExprContext { return s.e }
-
func (s *ExprListContext) SetE(v []IExprContext) { s.e = v }
-
func (s *ExprListContext) AllExpr() []IExprContext {
children := s.GetChildren()
len := 0
@@ -4040,12 +3902,12 @@ func (s *ExprListContext) AllExpr() []IExprContext {
}
func (s *ExprListContext) Expr(i int) IExprContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
@@ -4075,7 +3937,6 @@ func (s *ExprListContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *ExprListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterExprList(s)
@@ -4098,9 +3959,6 @@ func (s *ExprListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
-
func (p *CELParser) ExprList() (localctx IExprListContext) {
localctx = NewExprListContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 18, CELParserRULE_exprList)
@@ -4108,52 +3966,46 @@ func (p *CELParser) ExprList() (localctx IExprListContext) {
p.EnterOuterAlt(localctx, 1)
{
- p.SetState(182)
+ p.SetState(186)
var _x = p.Expr()
-
localctx.(*ExprListContext)._expr = _x
}
localctx.(*ExprListContext).e = append(localctx.(*ExprListContext).e, localctx.(*ExprListContext)._expr)
- p.SetState(187)
+ p.SetState(191)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
for _la == CELParserCOMMA {
{
- p.SetState(183)
+ p.SetState(187)
p.Match(CELParserCOMMA)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
{
- p.SetState(184)
+ p.SetState(188)
var _x = p.Expr()
-
localctx.(*ExprListContext)._expr = _x
}
localctx.(*ExprListContext).e = append(localctx.(*ExprListContext).e, localctx.(*ExprListContext)._expr)
-
- p.SetState(189)
+ p.SetState(193)
p.GetErrorHandler().Sync(p)
if p.HasError() {
- goto errorExit
- }
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
-
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -4167,7 +4019,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IListInitContext is an interface to support dynamic dispatch.
type IListInitContext interface {
antlr.ParserRuleContext
@@ -4178,18 +4029,14 @@ type IListInitContext interface {
// Get_optExpr returns the _optExpr rule contexts.
Get_optExpr() IOptExprContext
-
// Set_optExpr sets the _optExpr rule contexts.
Set_optExpr(IOptExprContext)
-
// GetElems returns the elems rule context list.
GetElems() []IOptExprContext
-
// SetElems sets the elems rule context list.
- SetElems([]IOptExprContext)
-
+ SetElems([]IOptExprContext)
// Getter signatures
AllOptExpr() []IOptExprContext
@@ -4203,9 +4050,9 @@ type IListInitContext interface {
type ListInitContext struct {
antlr.BaseParserRuleContext
- parser antlr.Parser
- _optExpr IOptExprContext
- elems []IOptExprContext
+ parser antlr.Parser
+ _optExpr IOptExprContext
+ elems []IOptExprContext
}
func NewEmptyListInitContext() *ListInitContext {
@@ -4215,7 +4062,7 @@ func NewEmptyListInitContext() *ListInitContext {
return p
}
-func InitEmptyListInitContext(p *ListInitContext) {
+func InitEmptyListInitContext(p *ListInitContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_listInit
}
@@ -4237,16 +4084,12 @@ func (s *ListInitContext) GetParser() antlr.Parser { return s.parser }
func (s *ListInitContext) Get_optExpr() IOptExprContext { return s._optExpr }
-
func (s *ListInitContext) Set_optExpr(v IOptExprContext) { s._optExpr = v }
-
func (s *ListInitContext) GetElems() []IOptExprContext { return s.elems }
-
func (s *ListInitContext) SetElems(v []IOptExprContext) { s.elems = v }
-
func (s *ListInitContext) AllOptExpr() []IOptExprContext {
children := s.GetChildren()
len := 0
@@ -4269,12 +4112,12 @@ func (s *ListInitContext) AllOptExpr() []IOptExprContext {
}
func (s *ListInitContext) OptExpr(i int) IOptExprContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IOptExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
@@ -4304,7 +4147,6 @@ func (s *ListInitContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *ListInitContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterListInit(s)
@@ -4327,9 +4169,6 @@ func (s *ListInitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
-
func (p *CELParser) ListInit() (localctx IListInitContext) {
localctx = NewListInitContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 20, CELParserRULE_listInit)
@@ -4337,15 +4176,14 @@ func (p *CELParser) ListInit() (localctx IListInitContext) {
p.EnterOuterAlt(localctx, 1)
{
- p.SetState(190)
+ p.SetState(194)
var _x = p.OptExpr()
-
localctx.(*ListInitContext)._optExpr = _x
}
localctx.(*ListInitContext).elems = append(localctx.(*ListInitContext).elems, localctx.(*ListInitContext)._optExpr)
- p.SetState(195)
+ p.SetState(199)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
@@ -4357,38 +4195,34 @@ func (p *CELParser) ListInit() (localctx IListInitContext) {
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
{
- p.SetState(191)
+ p.SetState(195)
p.Match(CELParserCOMMA)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
{
- p.SetState(192)
+ p.SetState(196)
var _x = p.OptExpr()
-
localctx.(*ListInitContext)._optExpr = _x
}
localctx.(*ListInitContext).elems = append(localctx.(*ListInitContext).elems, localctx.(*ListInitContext)._optExpr)
-
}
- p.SetState(197)
+ p.SetState(201)
p.GetErrorHandler().Sync(p)
if p.HasError() {
- goto errorExit
- }
+ goto errorExit
+ }
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext())
if p.HasError() {
goto errorExit
}
}
-
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -4402,7 +4236,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IFieldInitializerListContext is an interface to support dynamic dispatch.
type IFieldInitializerListContext interface {
antlr.ParserRuleContext
@@ -4411,48 +4244,40 @@ type IFieldInitializerListContext interface {
GetParser() antlr.Parser
// GetS21 returns the s21 token.
- GetS21() antlr.Token
-
+ GetS21() antlr.Token
// SetS21 sets the s21 token.
- SetS21(antlr.Token)
-
+ SetS21(antlr.Token)
// GetCols returns the cols token list.
GetCols() []antlr.Token
-
// SetCols sets the cols token list.
SetCols([]antlr.Token)
-
// Get_optField returns the _optField rule contexts.
Get_optField() IOptFieldContext
// Get_expr returns the _expr rule contexts.
Get_expr() IExprContext
-
// Set_optField sets the _optField rule contexts.
Set_optField(IOptFieldContext)
// Set_expr sets the _expr rule contexts.
Set_expr(IExprContext)
-
// GetFields returns the fields rule context list.
GetFields() []IOptFieldContext
// GetValues returns the values rule context list.
GetValues() []IExprContext
-
// SetFields sets the fields rule context list.
- SetFields([]IOptFieldContext)
+ SetFields([]IOptFieldContext)
// SetValues sets the values rule context list.
- SetValues([]IExprContext)
-
+ SetValues([]IExprContext)
// Getter signatures
AllOptField() []IOptFieldContext
@@ -4470,13 +4295,13 @@ type IFieldInitializerListContext interface {
type FieldInitializerListContext struct {
antlr.BaseParserRuleContext
- parser antlr.Parser
- _optField IOptFieldContext
- fields []IOptFieldContext
- s21 antlr.Token
- cols []antlr.Token
- _expr IExprContext
- values []IExprContext
+ parser antlr.Parser
+ _optField IOptFieldContext
+ fields []IOptFieldContext
+ s21 antlr.Token
+ cols []antlr.Token
+ _expr IExprContext
+ values []IExprContext
}
func NewEmptyFieldInitializerListContext() *FieldInitializerListContext {
@@ -4486,7 +4311,7 @@ func NewEmptyFieldInitializerListContext() *FieldInitializerListContext {
return p
}
-func InitEmptyFieldInitializerListContext(p *FieldInitializerListContext) {
+func InitEmptyFieldInitializerListContext(p *FieldInitializerListContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_fieldInitializerList
}
@@ -4508,36 +4333,28 @@ func (s *FieldInitializerListContext) GetParser() antlr.Parser { return s.parser
func (s *FieldInitializerListContext) GetS21() antlr.Token { return s.s21 }
-
func (s *FieldInitializerListContext) SetS21(v antlr.Token) { s.s21 = v }
-
func (s *FieldInitializerListContext) GetCols() []antlr.Token { return s.cols }
-
func (s *FieldInitializerListContext) SetCols(v []antlr.Token) { s.cols = v }
-
func (s *FieldInitializerListContext) Get_optField() IOptFieldContext { return s._optField }
func (s *FieldInitializerListContext) Get_expr() IExprContext { return s._expr }
-
func (s *FieldInitializerListContext) Set_optField(v IOptFieldContext) { s._optField = v }
func (s *FieldInitializerListContext) Set_expr(v IExprContext) { s._expr = v }
-
func (s *FieldInitializerListContext) GetFields() []IOptFieldContext { return s.fields }
func (s *FieldInitializerListContext) GetValues() []IExprContext { return s.values }
-
func (s *FieldInitializerListContext) SetFields(v []IOptFieldContext) { s.fields = v }
func (s *FieldInitializerListContext) SetValues(v []IExprContext) { s.values = v }
-
func (s *FieldInitializerListContext) AllOptField() []IOptFieldContext {
children := s.GetChildren()
len := 0
@@ -4560,12 +4377,12 @@ func (s *FieldInitializerListContext) AllOptField() []IOptFieldContext {
}
func (s *FieldInitializerListContext) OptField(i int) IOptFieldContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IOptFieldContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
@@ -4609,12 +4426,12 @@ func (s *FieldInitializerListContext) AllExpr() []IExprContext {
}
func (s *FieldInitializerListContext) Expr(i int) IExprContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
@@ -4644,7 +4461,6 @@ func (s *FieldInitializerListContext) ToStringTree(ruleNames []string, recog ant
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *FieldInitializerListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterFieldInitializerList(s)
@@ -4667,9 +4483,6 @@ func (s *FieldInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) int
}
}
-
-
-
func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContext) {
localctx = NewFieldInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 22, CELParserRULE_fieldInitializerList)
@@ -4677,36 +4490,34 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
p.EnterOuterAlt(localctx, 1)
{
- p.SetState(198)
+ p.SetState(202)
var _x = p.OptField()
-
localctx.(*FieldInitializerListContext)._optField = _x
}
localctx.(*FieldInitializerListContext).fields = append(localctx.(*FieldInitializerListContext).fields, localctx.(*FieldInitializerListContext)._optField)
{
- p.SetState(199)
+ p.SetState(203)
var _m = p.Match(CELParserCOLON)
localctx.(*FieldInitializerListContext).s21 = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
localctx.(*FieldInitializerListContext).cols = append(localctx.(*FieldInitializerListContext).cols, localctx.(*FieldInitializerListContext).s21)
{
- p.SetState(200)
+ p.SetState(204)
var _x = p.Expr()
-
localctx.(*FieldInitializerListContext)._expr = _x
}
localctx.(*FieldInitializerListContext).values = append(localctx.(*FieldInitializerListContext).values, localctx.(*FieldInitializerListContext)._expr)
- p.SetState(208)
+ p.SetState(212)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
@@ -4718,59 +4529,54 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
{
- p.SetState(201)
+ p.SetState(205)
p.Match(CELParserCOMMA)
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
{
- p.SetState(202)
+ p.SetState(206)
var _x = p.OptField()
-
localctx.(*FieldInitializerListContext)._optField = _x
}
localctx.(*FieldInitializerListContext).fields = append(localctx.(*FieldInitializerListContext).fields, localctx.(*FieldInitializerListContext)._optField)
{
- p.SetState(203)
+ p.SetState(207)
var _m = p.Match(CELParserCOLON)
localctx.(*FieldInitializerListContext).s21 = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
localctx.(*FieldInitializerListContext).cols = append(localctx.(*FieldInitializerListContext).cols, localctx.(*FieldInitializerListContext).s21)
{
- p.SetState(204)
+ p.SetState(208)
var _x = p.Expr()
-
localctx.(*FieldInitializerListContext)._expr = _x
}
localctx.(*FieldInitializerListContext).values = append(localctx.(*FieldInitializerListContext).values, localctx.(*FieldInitializerListContext)._expr)
-
}
- p.SetState(210)
+ p.SetState(214)
p.GetErrorHandler().Sync(p)
if p.HasError() {
- goto errorExit
- }
+ goto errorExit
+ }
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext())
if p.HasError() {
goto errorExit
}
}
-
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -4784,7 +4590,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IOptFieldContext is an interface to support dynamic dispatch.
type IOptFieldContext interface {
antlr.ParserRuleContext
@@ -4793,15 +4598,13 @@ type IOptFieldContext interface {
GetParser() antlr.Parser
// GetOpt returns the opt token.
- GetOpt() antlr.Token
-
+ GetOpt() antlr.Token
// SetOpt sets the opt token.
- SetOpt(antlr.Token)
-
+ SetOpt(antlr.Token)
// Getter signatures
- IDENTIFIER() antlr.TerminalNode
+ EscapeIdent() IEscapeIdentContext
QUESTIONMARK() antlr.TerminalNode
// IsOptFieldContext differentiates from other interfaces.
@@ -4811,7 +4614,7 @@ type IOptFieldContext interface {
type OptFieldContext struct {
antlr.BaseParserRuleContext
parser antlr.Parser
- opt antlr.Token
+ opt antlr.Token
}
func NewEmptyOptFieldContext() *OptFieldContext {
@@ -4821,7 +4624,7 @@ func NewEmptyOptFieldContext() *OptFieldContext {
return p
}
-func InitEmptyOptFieldContext(p *OptFieldContext) {
+func InitEmptyOptFieldContext(p *OptFieldContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_optField
}
@@ -4843,12 +4646,22 @@ func (s *OptFieldContext) GetParser() antlr.Parser { return s.parser }
func (s *OptFieldContext) GetOpt() antlr.Token { return s.opt }
-
func (s *OptFieldContext) SetOpt(v antlr.Token) { s.opt = v }
+func (s *OptFieldContext) EscapeIdent() IEscapeIdentContext {
+ var t antlr.RuleContext
+ for _, ctx := range s.GetChildren() {
+ if _, ok := ctx.(IEscapeIdentContext); ok {
+ t = ctx.(antlr.RuleContext)
+ break
+ }
+ }
-func (s *OptFieldContext) IDENTIFIER() antlr.TerminalNode {
- return s.GetToken(CELParserIDENTIFIER, 0)
+ if t == nil {
+ return nil
+ }
+
+ return t.(IEscapeIdentContext)
}
func (s *OptFieldContext) QUESTIONMARK() antlr.TerminalNode {
@@ -4863,7 +4676,6 @@ func (s *OptFieldContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *OptFieldContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterOptField(s)
@@ -4886,48 +4698,38 @@ func (s *OptFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
-
func (p *CELParser) OptField() (localctx IOptFieldContext) {
localctx = NewOptFieldContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 24, CELParserRULE_optField)
var _la int
p.EnterOuterAlt(localctx, 1)
- p.SetState(212)
+ p.SetState(216)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserQUESTIONMARK {
{
- p.SetState(211)
+ p.SetState(215)
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*OptFieldContext).opt = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(214)
- p.Match(CELParserIDENTIFIER)
- if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
- }
+ p.SetState(218)
+ p.EscapeIdent()
}
-
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -4941,7 +4743,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IMapInitializerListContext is an interface to support dynamic dispatch.
type IMapInitializerListContext interface {
antlr.ParserRuleContext
@@ -4950,48 +4751,40 @@ type IMapInitializerListContext interface {
GetParser() antlr.Parser
// GetS21 returns the s21 token.
- GetS21() antlr.Token
-
+ GetS21() antlr.Token
// SetS21 sets the s21 token.
- SetS21(antlr.Token)
-
+ SetS21(antlr.Token)
// GetCols returns the cols token list.
GetCols() []antlr.Token
-
// SetCols sets the cols token list.
SetCols([]antlr.Token)
-
// Get_optExpr returns the _optExpr rule contexts.
Get_optExpr() IOptExprContext
// Get_expr returns the _expr rule contexts.
Get_expr() IExprContext
-
// Set_optExpr sets the _optExpr rule contexts.
Set_optExpr(IOptExprContext)
// Set_expr sets the _expr rule contexts.
Set_expr(IExprContext)
-
// GetKeys returns the keys rule context list.
GetKeys() []IOptExprContext
// GetValues returns the values rule context list.
GetValues() []IExprContext
-
// SetKeys sets the keys rule context list.
- SetKeys([]IOptExprContext)
+ SetKeys([]IOptExprContext)
// SetValues sets the values rule context list.
- SetValues([]IExprContext)
-
+ SetValues([]IExprContext)
// Getter signatures
AllOptExpr() []IOptExprContext
@@ -5009,13 +4802,13 @@ type IMapInitializerListContext interface {
type MapInitializerListContext struct {
antlr.BaseParserRuleContext
- parser antlr.Parser
- _optExpr IOptExprContext
- keys []IOptExprContext
- s21 antlr.Token
- cols []antlr.Token
- _expr IExprContext
- values []IExprContext
+ parser antlr.Parser
+ _optExpr IOptExprContext
+ keys []IOptExprContext
+ s21 antlr.Token
+ cols []antlr.Token
+ _expr IExprContext
+ values []IExprContext
}
func NewEmptyMapInitializerListContext() *MapInitializerListContext {
@@ -5025,7 +4818,7 @@ func NewEmptyMapInitializerListContext() *MapInitializerListContext {
return p
}
-func InitEmptyMapInitializerListContext(p *MapInitializerListContext) {
+func InitEmptyMapInitializerListContext(p *MapInitializerListContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_mapInitializerList
}
@@ -5047,36 +4840,28 @@ func (s *MapInitializerListContext) GetParser() antlr.Parser { return s.parser }
func (s *MapInitializerListContext) GetS21() antlr.Token { return s.s21 }
-
func (s *MapInitializerListContext) SetS21(v antlr.Token) { s.s21 = v }
-
func (s *MapInitializerListContext) GetCols() []antlr.Token { return s.cols }
-
func (s *MapInitializerListContext) SetCols(v []antlr.Token) { s.cols = v }
-
func (s *MapInitializerListContext) Get_optExpr() IOptExprContext { return s._optExpr }
func (s *MapInitializerListContext) Get_expr() IExprContext { return s._expr }
-
func (s *MapInitializerListContext) Set_optExpr(v IOptExprContext) { s._optExpr = v }
func (s *MapInitializerListContext) Set_expr(v IExprContext) { s._expr = v }
-
func (s *MapInitializerListContext) GetKeys() []IOptExprContext { return s.keys }
func (s *MapInitializerListContext) GetValues() []IExprContext { return s.values }
-
func (s *MapInitializerListContext) SetKeys(v []IOptExprContext) { s.keys = v }
func (s *MapInitializerListContext) SetValues(v []IExprContext) { s.values = v }
-
func (s *MapInitializerListContext) AllOptExpr() []IOptExprContext {
children := s.GetChildren()
len := 0
@@ -5099,12 +4884,12 @@ func (s *MapInitializerListContext) AllOptExpr() []IOptExprContext {
}
func (s *MapInitializerListContext) OptExpr(i int) IOptExprContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IOptExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
@@ -5148,167 +4933,366 @@ func (s *MapInitializerListContext) AllExpr() []IExprContext {
}
func (s *MapInitializerListContext) Expr(i int) IExprContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
j++
}
}
- if t == nil {
- return nil
- }
+ if t == nil {
+ return nil
+ }
+
+ return t.(IExprContext)
+}
+
+func (s *MapInitializerListContext) AllCOMMA() []antlr.TerminalNode {
+ return s.GetTokens(CELParserCOMMA)
+}
+
+func (s *MapInitializerListContext) COMMA(i int) antlr.TerminalNode {
+ return s.GetToken(CELParserCOMMA, i)
+}
+
+func (s *MapInitializerListContext) GetRuleContext() antlr.RuleContext {
+ return s
+}
+
+func (s *MapInitializerListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
+ return antlr.TreesStringTree(s, ruleNames, recog)
+}
+
+func (s *MapInitializerListContext) EnterRule(listener antlr.ParseTreeListener) {
+ if listenerT, ok := listener.(CELListener); ok {
+ listenerT.EnterMapInitializerList(s)
+ }
+}
+
+func (s *MapInitializerListContext) ExitRule(listener antlr.ParseTreeListener) {
+ if listenerT, ok := listener.(CELListener); ok {
+ listenerT.ExitMapInitializerList(s)
+ }
+}
+
+func (s *MapInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
+ switch t := visitor.(type) {
+ case CELVisitor:
+ return t.VisitMapInitializerList(s)
+
+ default:
+ return t.VisitChildren(s)
+ }
+}
+
+func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
+ localctx = NewMapInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
+ p.EnterRule(localctx, 26, CELParserRULE_mapInitializerList)
+ var _alt int
+
+ p.EnterOuterAlt(localctx, 1)
+ {
+ p.SetState(220)
+
+ var _x = p.OptExpr()
+
+ localctx.(*MapInitializerListContext)._optExpr = _x
+ }
+ localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr)
+ {
+ p.SetState(221)
+
+ var _m = p.Match(CELParserCOLON)
+
+ localctx.(*MapInitializerListContext).s21 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
+ }
+ localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s21)
+ {
+ p.SetState(222)
+
+ var _x = p.Expr()
+
+ localctx.(*MapInitializerListContext)._expr = _x
+ }
+ localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr)
+ p.SetState(230)
+ p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
+ if _alt == 1 {
+ {
+ p.SetState(223)
+ p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
+ }
+ {
+ p.SetState(224)
+
+ var _x = p.OptExpr()
+
+ localctx.(*MapInitializerListContext)._optExpr = _x
+ }
+ localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr)
+ {
+ p.SetState(225)
+
+ var _m = p.Match(CELParserCOLON)
+
+ localctx.(*MapInitializerListContext).s21 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
+ }
+ localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s21)
+ {
+ p.SetState(226)
+
+ var _x = p.Expr()
+
+ localctx.(*MapInitializerListContext)._expr = _x
+ }
+ localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr)
+
+ }
+ p.SetState(232)
+ p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ }
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
+ return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
+}
+
+// IEscapeIdentContext is an interface to support dynamic dispatch.
+type IEscapeIdentContext interface {
+ antlr.ParserRuleContext
+
+ // GetParser returns the parser.
+ GetParser() antlr.Parser
+ // IsEscapeIdentContext differentiates from other interfaces.
+ IsEscapeIdentContext()
+}
+
+type EscapeIdentContext struct {
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+}
+
+func NewEmptyEscapeIdentContext() *EscapeIdentContext {
+ var p = new(EscapeIdentContext)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_escapeIdent
+ return p
+}
+
+func InitEmptyEscapeIdentContext(p *EscapeIdentContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_escapeIdent
+}
+
+func (*EscapeIdentContext) IsEscapeIdentContext() {}
+
+func NewEscapeIdentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EscapeIdentContext {
+ var p = new(EscapeIdentContext)
+
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
+
+ p.parser = parser
+ p.RuleIndex = CELParserRULE_escapeIdent
+
+ return p
+}
+
+func (s *EscapeIdentContext) GetParser() antlr.Parser { return s.parser }
+
+func (s *EscapeIdentContext) CopyAll(ctx *EscapeIdentContext) {
+ s.CopyFrom(&ctx.BaseParserRuleContext)
+}
+
+func (s *EscapeIdentContext) GetRuleContext() antlr.RuleContext {
+ return s
+}
- return t.(IExprContext)
+func (s *EscapeIdentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
+ return antlr.TreesStringTree(s, ruleNames, recog)
}
-func (s *MapInitializerListContext) AllCOMMA() []antlr.TerminalNode {
- return s.GetTokens(CELParserCOMMA)
+type EscapedIdentifierContext struct {
+ EscapeIdentContext
+ id antlr.Token
}
-func (s *MapInitializerListContext) COMMA(i int) antlr.TerminalNode {
- return s.GetToken(CELParserCOMMA, i)
+func NewEscapedIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EscapedIdentifierContext {
+ var p = new(EscapedIdentifierContext)
+
+ InitEmptyEscapeIdentContext(&p.EscapeIdentContext)
+ p.parser = parser
+ p.CopyAll(ctx.(*EscapeIdentContext))
+
+ return p
}
-func (s *MapInitializerListContext) GetRuleContext() antlr.RuleContext {
+func (s *EscapedIdentifierContext) GetId() antlr.Token { return s.id }
+
+func (s *EscapedIdentifierContext) SetId(v antlr.Token) { s.id = v }
+
+func (s *EscapedIdentifierContext) GetRuleContext() antlr.RuleContext {
return s
}
-func (s *MapInitializerListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
+func (s *EscapedIdentifierContext) ESC_IDENTIFIER() antlr.TerminalNode {
+ return s.GetToken(CELParserESC_IDENTIFIER, 0)
}
-
-func (s *MapInitializerListContext) EnterRule(listener antlr.ParseTreeListener) {
+func (s *EscapedIdentifierContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
- listenerT.EnterMapInitializerList(s)
+ listenerT.EnterEscapedIdentifier(s)
}
}
-func (s *MapInitializerListContext) ExitRule(listener antlr.ParseTreeListener) {
+func (s *EscapedIdentifierContext) ExitRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
- listenerT.ExitMapInitializerList(s)
+ listenerT.ExitEscapedIdentifier(s)
}
}
-func (s *MapInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
+func (s *EscapedIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case CELVisitor:
- return t.VisitMapInitializerList(s)
+ return t.VisitEscapedIdentifier(s)
default:
return t.VisitChildren(s)
}
}
+type SimpleIdentifierContext struct {
+ EscapeIdentContext
+ id antlr.Token
+}
+func NewSimpleIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SimpleIdentifierContext {
+ var p = new(SimpleIdentifierContext)
+ InitEmptyEscapeIdentContext(&p.EscapeIdentContext)
+ p.parser = parser
+ p.CopyAll(ctx.(*EscapeIdentContext))
-func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
- localctx = NewMapInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 26, CELParserRULE_mapInitializerList)
- var _alt int
-
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(216)
+ return p
+}
- var _x = p.OptExpr()
+func (s *SimpleIdentifierContext) GetId() antlr.Token { return s.id }
+func (s *SimpleIdentifierContext) SetId(v antlr.Token) { s.id = v }
- localctx.(*MapInitializerListContext)._optExpr = _x
- }
- localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr)
- {
- p.SetState(217)
+func (s *SimpleIdentifierContext) GetRuleContext() antlr.RuleContext {
+ return s
+}
- var _m = p.Match(CELParserCOLON)
+func (s *SimpleIdentifierContext) IDENTIFIER() antlr.TerminalNode {
+ return s.GetToken(CELParserIDENTIFIER, 0)
+}
- localctx.(*MapInitializerListContext).s21 = _m
- if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
- }
+func (s *SimpleIdentifierContext) EnterRule(listener antlr.ParseTreeListener) {
+ if listenerT, ok := listener.(CELListener); ok {
+ listenerT.EnterSimpleIdentifier(s)
}
- localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s21)
- {
- p.SetState(218)
+}
- var _x = p.Expr()
+func (s *SimpleIdentifierContext) ExitRule(listener antlr.ParseTreeListener) {
+ if listenerT, ok := listener.(CELListener); ok {
+ listenerT.ExitSimpleIdentifier(s)
+ }
+}
+func (s *SimpleIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
+ switch t := visitor.(type) {
+ case CELVisitor:
+ return t.VisitSimpleIdentifier(s)
- localctx.(*MapInitializerListContext)._expr = _x
+ default:
+ return t.VisitChildren(s)
}
- localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr)
- p.SetState(226)
+}
+
+func (p *CELParser) EscapeIdent() (localctx IEscapeIdentContext) {
+ localctx = NewEscapeIdentContext(p, p.GetParserRuleContext(), p.GetState())
+ p.EnterRule(localctx, 28, CELParserRULE_escapeIdent)
+ p.SetState(235)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
- _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext())
- if p.HasError() {
- goto errorExit
- }
- for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
- if _alt == 1 {
- {
- p.SetState(219)
- p.Match(CELParserCOMMA)
- if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
- }
- }
- {
- p.SetState(220)
-
- var _x = p.OptExpr()
+ switch p.GetTokenStream().LA(1) {
+ case CELParserIDENTIFIER:
+ localctx = NewSimpleIdentifierContext(p, localctx)
+ p.EnterOuterAlt(localctx, 1)
+ {
+ p.SetState(233)
- localctx.(*MapInitializerListContext)._optExpr = _x
- }
- localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr)
- {
- p.SetState(221)
-
- var _m = p.Match(CELParserCOLON)
+ var _m = p.Match(CELParserIDENTIFIER)
- localctx.(*MapInitializerListContext).s21 = _m
- if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
- }
+ localctx.(*SimpleIdentifierContext).id = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
}
- localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s21)
- {
- p.SetState(222)
+ }
- var _x = p.Expr()
+ case CELParserESC_IDENTIFIER:
+ localctx = NewEscapedIdentifierContext(p, localctx)
+ p.EnterOuterAlt(localctx, 2)
+ {
+ p.SetState(234)
+ var _m = p.Match(CELParserESC_IDENTIFIER)
- localctx.(*MapInitializerListContext)._expr = _x
+ localctx.(*EscapedIdentifierContext).id = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
}
- localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr)
-
-
- }
- p.SetState(228)
- p.GetErrorHandler().Sync(p)
- if p.HasError() {
- goto errorExit
- }
- _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext())
- if p.HasError() {
- goto errorExit
}
- }
-
+ default:
+ p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
+ goto errorExit
+ }
errorExit:
if p.HasError() {
@@ -5323,7 +5307,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// IOptExprContext is an interface to support dynamic dispatch.
type IOptExprContext interface {
antlr.ParserRuleContext
@@ -5332,21 +5315,17 @@ type IOptExprContext interface {
GetParser() antlr.Parser
// GetOpt returns the opt token.
- GetOpt() antlr.Token
-
+ GetOpt() antlr.Token
// SetOpt sets the opt token.
- SetOpt(antlr.Token)
-
+ SetOpt(antlr.Token)
// GetE returns the e rule contexts.
GetE() IExprContext
-
// SetE sets the e rule contexts.
SetE(IExprContext)
-
// Getter signatures
Expr() IExprContext
QUESTIONMARK() antlr.TerminalNode
@@ -5358,8 +5337,8 @@ type IOptExprContext interface {
type OptExprContext struct {
antlr.BaseParserRuleContext
parser antlr.Parser
- opt antlr.Token
- e IExprContext
+ opt antlr.Token
+ e IExprContext
}
func NewEmptyOptExprContext() *OptExprContext {
@@ -5369,7 +5348,7 @@ func NewEmptyOptExprContext() *OptExprContext {
return p
}
-func InitEmptyOptExprContext(p *OptExprContext) {
+func InitEmptyOptExprContext(p *OptExprContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_optExpr
}
@@ -5391,21 +5370,17 @@ func (s *OptExprContext) GetParser() antlr.Parser { return s.parser }
func (s *OptExprContext) GetOpt() antlr.Token { return s.opt }
-
func (s *OptExprContext) SetOpt(v antlr.Token) { s.opt = v }
-
func (s *OptExprContext) GetE() IExprContext { return s.e }
-
func (s *OptExprContext) SetE(v IExprContext) { s.e = v }
-
func (s *OptExprContext) Expr() IExprContext {
- var t antlr.RuleContext;
+ var t antlr.RuleContext
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext);
+ t = ctx.(antlr.RuleContext)
break
}
}
@@ -5429,7 +5404,6 @@ func (s *OptExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
func (s *OptExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterOptExpr(s)
@@ -5452,48 +5426,41 @@ func (s *OptExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
-
func (p *CELParser) OptExpr() (localctx IOptExprContext) {
localctx = NewOptExprContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 28, CELParserRULE_optExpr)
+ p.EnterRule(localctx, 30, CELParserRULE_optExpr)
var _la int
p.EnterOuterAlt(localctx, 1)
- p.SetState(230)
+ p.SetState(238)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserQUESTIONMARK {
{
- p.SetState(229)
+ p.SetState(237)
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*OptExprContext).opt = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(232)
+ p.SetState(240)
var _x = p.Expr()
-
localctx.(*OptExprContext).e = _x
}
-
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -5507,7 +5474,6 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
// ILiteralContext is an interface to support dynamic dispatch.
type ILiteralContext interface {
antlr.ParserRuleContext
@@ -5530,7 +5496,7 @@ func NewEmptyLiteralContext() *LiteralContext {
return p
}
-func InitEmptyLiteralContext(p *LiteralContext) {
+func InitEmptyLiteralContext(p *LiteralContext) {
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_literal
}
@@ -5562,9 +5528,6 @@ func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
-
-
-
type BytesContext struct {
LiteralContext
tok antlr.Token
@@ -5580,10 +5543,8 @@ func NewBytesContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BytesCon
return p
}
-
func (s *BytesContext) GetTok() antlr.Token { return s.tok }
-
func (s *BytesContext) SetTok(v antlr.Token) { s.tok = v }
func (s *BytesContext) GetRuleContext() antlr.RuleContext {
@@ -5594,7 +5555,6 @@ func (s *BytesContext) BYTES() antlr.TerminalNode {
return s.GetToken(CELParserBYTES, 0)
}
-
func (s *BytesContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterBytes(s)
@@ -5617,7 +5577,6 @@ func (s *BytesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type UintContext struct {
LiteralContext
tok antlr.Token
@@ -5633,10 +5592,8 @@ func NewUintContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UintConte
return p
}
-
func (s *UintContext) GetTok() antlr.Token { return s.tok }
-
func (s *UintContext) SetTok(v antlr.Token) { s.tok = v }
func (s *UintContext) GetRuleContext() antlr.RuleContext {
@@ -5647,7 +5604,6 @@ func (s *UintContext) NUM_UINT() antlr.TerminalNode {
return s.GetToken(CELParserNUM_UINT, 0)
}
-
func (s *UintContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterUint(s)
@@ -5670,7 +5626,6 @@ func (s *UintContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type NullContext struct {
LiteralContext
tok antlr.Token
@@ -5686,10 +5641,8 @@ func NewNullContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NullConte
return p
}
-
func (s *NullContext) GetTok() antlr.Token { return s.tok }
-
func (s *NullContext) SetTok(v antlr.Token) { s.tok = v }
func (s *NullContext) GetRuleContext() antlr.RuleContext {
@@ -5700,7 +5653,6 @@ func (s *NullContext) NUL() antlr.TerminalNode {
return s.GetToken(CELParserNUL, 0)
}
-
func (s *NullContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterNull(s)
@@ -5723,7 +5675,6 @@ func (s *NullContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type BoolFalseContext struct {
LiteralContext
tok antlr.Token
@@ -5739,10 +5690,8 @@ func NewBoolFalseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *Bool
return p
}
-
func (s *BoolFalseContext) GetTok() antlr.Token { return s.tok }
-
func (s *BoolFalseContext) SetTok(v antlr.Token) { s.tok = v }
func (s *BoolFalseContext) GetRuleContext() antlr.RuleContext {
@@ -5753,7 +5702,6 @@ func (s *BoolFalseContext) CEL_FALSE() antlr.TerminalNode {
return s.GetToken(CELParserCEL_FALSE, 0)
}
-
func (s *BoolFalseContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterBoolFalse(s)
@@ -5776,7 +5724,6 @@ func (s *BoolFalseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type StringContext struct {
LiteralContext
tok antlr.Token
@@ -5792,10 +5739,8 @@ func NewStringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringC
return p
}
-
func (s *StringContext) GetTok() antlr.Token { return s.tok }
-
func (s *StringContext) SetTok(v antlr.Token) { s.tok = v }
func (s *StringContext) GetRuleContext() antlr.RuleContext {
@@ -5806,7 +5751,6 @@ func (s *StringContext) STRING() antlr.TerminalNode {
return s.GetToken(CELParserSTRING, 0)
}
-
func (s *StringContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterString(s)
@@ -5829,11 +5773,10 @@ func (s *StringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type DoubleContext struct {
LiteralContext
sign antlr.Token
- tok antlr.Token
+ tok antlr.Token
}
func NewDoubleContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DoubleContext {
@@ -5846,12 +5789,10 @@ func NewDoubleContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DoubleC
return p
}
-
func (s *DoubleContext) GetSign() antlr.Token { return s.sign }
func (s *DoubleContext) GetTok() antlr.Token { return s.tok }
-
func (s *DoubleContext) SetSign(v antlr.Token) { s.sign = v }
func (s *DoubleContext) SetTok(v antlr.Token) { s.tok = v }
@@ -5868,7 +5809,6 @@ func (s *DoubleContext) MINUS() antlr.TerminalNode {
return s.GetToken(CELParserMINUS, 0)
}
-
func (s *DoubleContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterDouble(s)
@@ -5891,7 +5831,6 @@ func (s *DoubleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type BoolTrueContext struct {
LiteralContext
tok antlr.Token
@@ -5907,10 +5846,8 @@ func NewBoolTrueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolT
return p
}
-
func (s *BoolTrueContext) GetTok() antlr.Token { return s.tok }
-
func (s *BoolTrueContext) SetTok(v antlr.Token) { s.tok = v }
func (s *BoolTrueContext) GetRuleContext() antlr.RuleContext {
@@ -5921,7 +5858,6 @@ func (s *BoolTrueContext) CEL_TRUE() antlr.TerminalNode {
return s.GetToken(CELParserCEL_TRUE, 0)
}
-
func (s *BoolTrueContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterBoolTrue(s)
@@ -5944,11 +5880,10 @@ func (s *BoolTrueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
type IntContext struct {
LiteralContext
sign antlr.Token
- tok antlr.Token
+ tok antlr.Token
}
func NewIntContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntContext {
@@ -5961,12 +5896,10 @@ func NewIntContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntContext
return p
}
-
func (s *IntContext) GetSign() antlr.Token { return s.sign }
func (s *IntContext) GetTok() antlr.Token { return s.tok }
-
func (s *IntContext) SetSign(v antlr.Token) { s.sign = v }
func (s *IntContext) SetTok(v antlr.Token) { s.tok = v }
@@ -5983,7 +5916,6 @@ func (s *IntContext) MINUS() antlr.TerminalNode {
return s.GetToken(CELParserMINUS, 0)
}
-
func (s *IntContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterInt(s)
@@ -6006,188 +5938,177 @@ func (s *IntContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-
-
func (p *CELParser) Literal() (localctx ILiteralContext) {
localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 30, CELParserRULE_literal)
+ p.EnterRule(localctx, 32, CELParserRULE_literal)
var _la int
- p.SetState(248)
+ p.SetState(256)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
- switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 34, p.GetParserRuleContext()) {
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 35, p.GetParserRuleContext()) {
case 1:
localctx = NewIntContext(p, localctx)
p.EnterOuterAlt(localctx, 1)
- p.SetState(235)
+ p.SetState(243)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserMINUS {
{
- p.SetState(234)
+ p.SetState(242)
var _m = p.Match(CELParserMINUS)
localctx.(*IntContext).sign = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(237)
+ p.SetState(245)
var _m = p.Match(CELParserNUM_INT)
localctx.(*IntContext).tok = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
case 2:
localctx = NewUintContext(p, localctx)
p.EnterOuterAlt(localctx, 2)
{
- p.SetState(238)
+ p.SetState(246)
var _m = p.Match(CELParserNUM_UINT)
localctx.(*UintContext).tok = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
case 3:
localctx = NewDoubleContext(p, localctx)
p.EnterOuterAlt(localctx, 3)
- p.SetState(240)
+ p.SetState(248)
p.GetErrorHandler().Sync(p)
if p.HasError() {
goto errorExit
}
_la = p.GetTokenStream().LA(1)
-
if _la == CELParserMINUS {
{
- p.SetState(239)
+ p.SetState(247)
var _m = p.Match(CELParserMINUS)
localctx.(*DoubleContext).sign = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
}
{
- p.SetState(242)
+ p.SetState(250)
var _m = p.Match(CELParserNUM_FLOAT)
localctx.(*DoubleContext).tok = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
case 4:
localctx = NewStringContext(p, localctx)
p.EnterOuterAlt(localctx, 4)
{
- p.SetState(243)
+ p.SetState(251)
var _m = p.Match(CELParserSTRING)
localctx.(*StringContext).tok = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
case 5:
localctx = NewBytesContext(p, localctx)
p.EnterOuterAlt(localctx, 5)
{
- p.SetState(244)
+ p.SetState(252)
var _m = p.Match(CELParserBYTES)
localctx.(*BytesContext).tok = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
case 6:
localctx = NewBoolTrueContext(p, localctx)
p.EnterOuterAlt(localctx, 6)
{
- p.SetState(245)
+ p.SetState(253)
var _m = p.Match(CELParserCEL_TRUE)
localctx.(*BoolTrueContext).tok = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
case 7:
localctx = NewBoolFalseContext(p, localctx)
p.EnterOuterAlt(localctx, 7)
{
- p.SetState(246)
+ p.SetState(254)
var _m = p.Match(CELParserCEL_FALSE)
localctx.(*BoolFalseContext).tok = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
-
case 8:
localctx = NewNullContext(p, localctx)
p.EnterOuterAlt(localctx, 8)
{
- p.SetState(247)
+ p.SetState(255)
var _m = p.Match(CELParserNUL)
localctx.(*NullContext).tok = _m
if p.HasError() {
- // Recognition error - abort rule
- goto errorExit
+ // Recognition error - abort rule
+ goto errorExit
}
}
@@ -6195,7 +6116,6 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
goto errorExit
}
-
errorExit:
if p.HasError() {
v := p.GetError()
@@ -6209,24 +6129,28 @@ errorExit:
goto errorExit // Trick to prevent compiler error if the label is not used
}
-
func (p *CELParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool {
switch ruleIndex {
case 4:
- var t *RelationContext = nil
- if localctx != nil { t = localctx.(*RelationContext) }
- return p.Relation_Sempred(t, predIndex)
+ var t *RelationContext = nil
+ if localctx != nil {
+ t = localctx.(*RelationContext)
+ }
+ return p.Relation_Sempred(t, predIndex)
case 5:
- var t *CalcContext = nil
- if localctx != nil { t = localctx.(*CalcContext) }
- return p.Calc_Sempred(t, predIndex)
+ var t *CalcContext = nil
+ if localctx != nil {
+ t = localctx.(*CalcContext)
+ }
+ return p.Calc_Sempred(t, predIndex)
case 7:
- var t *MemberContext = nil
- if localctx != nil { t = localctx.(*MemberContext) }
- return p.Member_Sempred(t, predIndex)
-
+ var t *MemberContext = nil
+ if localctx != nil {
+ t = localctx.(*MemberContext)
+ }
+ return p.Member_Sempred(t, predIndex)
default:
panic("No predicate with index: " + fmt.Sprint(ruleIndex))
@@ -6236,7 +6160,7 @@ func (p *CELParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int
func (p *CELParser) Relation_Sempred(localctx antlr.RuleContext, predIndex int) bool {
switch predIndex {
case 0:
- return p.Precpred(p.GetParserRuleContext(), 1)
+ return p.Precpred(p.GetParserRuleContext(), 1)
default:
panic("No predicate with index: " + fmt.Sprint(predIndex))
@@ -6246,10 +6170,10 @@ func (p *CELParser) Relation_Sempred(localctx antlr.RuleContext, predIndex int)
func (p *CELParser) Calc_Sempred(localctx antlr.RuleContext, predIndex int) bool {
switch predIndex {
case 1:
- return p.Precpred(p.GetParserRuleContext(), 2)
+ return p.Precpred(p.GetParserRuleContext(), 2)
case 2:
- return p.Precpred(p.GetParserRuleContext(), 1)
+ return p.Precpred(p.GetParserRuleContext(), 1)
default:
panic("No predicate with index: " + fmt.Sprint(predIndex))
@@ -6259,16 +6183,15 @@ func (p *CELParser) Calc_Sempred(localctx antlr.RuleContext, predIndex int) bool
func (p *CELParser) Member_Sempred(localctx antlr.RuleContext, predIndex int) bool {
switch predIndex {
case 3:
- return p.Precpred(p.GetParserRuleContext(), 3)
+ return p.Precpred(p.GetParserRuleContext(), 3)
case 4:
- return p.Precpred(p.GetParserRuleContext(), 2)
+ return p.Precpred(p.GetParserRuleContext(), 2)
case 5:
- return p.Precpred(p.GetParserRuleContext(), 1)
+ return p.Precpred(p.GetParserRuleContext(), 1)
default:
panic("No predicate with index: " + fmt.Sprint(predIndex))
}
}
-
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go b/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go
index d2fbd563a..7cefe5c57 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go
@@ -1,9 +1,8 @@
-// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
+// Code generated from /usr/local/google/home/jdtatum/github/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
import "github.com/antlr4-go/antlr/v4"
-
// A complete Visitor for a parse tree produced by CELParser.
type CELVisitor interface {
antlr.ParseTreeVisitor
@@ -47,8 +46,11 @@ type CELVisitor interface {
// Visit a parse tree produced by CELParser#Index.
VisitIndex(ctx *IndexContext) interface{}
- // Visit a parse tree produced by CELParser#IdentOrGlobalCall.
- VisitIdentOrGlobalCall(ctx *IdentOrGlobalCallContext) interface{}
+ // Visit a parse tree produced by CELParser#Ident.
+ VisitIdent(ctx *IdentContext) interface{}
+
+ // Visit a parse tree produced by CELParser#GlobalCall.
+ VisitGlobalCall(ctx *GlobalCallContext) interface{}
// Visit a parse tree produced by CELParser#Nested.
VisitNested(ctx *NestedContext) interface{}
@@ -80,6 +82,12 @@ type CELVisitor interface {
// Visit a parse tree produced by CELParser#mapInitializerList.
VisitMapInitializerList(ctx *MapInitializerListContext) interface{}
+ // Visit a parse tree produced by CELParser#SimpleIdentifier.
+ VisitSimpleIdentifier(ctx *SimpleIdentifierContext) interface{}
+
+ // Visit a parse tree produced by CELParser#EscapedIdentifier.
+ VisitEscapedIdentifier(ctx *EscapedIdentifierContext) interface{}
+
// Visit a parse tree produced by CELParser#optExpr.
VisitOptExpr(ctx *OptExprContext) interface{}
@@ -106,5 +114,4 @@ type CELVisitor interface {
// Visit a parse tree produced by CELParser#Null.
VisitNull(ctx *NullContext) interface{}
-
-}
\ No newline at end of file
+}
diff --git a/vendor/github.com/google/cel-go/parser/helper.go b/vendor/github.com/google/cel-go/parser/helper.go
index 9f09ead0e..c13296dd5 100644
--- a/vendor/github.com/google/cel-go/parser/helper.go
+++ b/vendor/github.com/google/cel-go/parser/helper.go
@@ -470,6 +470,11 @@ func (e *exprHelper) NewAccuIdent() ast.Expr {
return e.exprFactory.NewAccuIdent(e.nextMacroID())
}
+// AccuIdentName implements the ExprHelper interface method.
+func (e *exprHelper) AccuIdentName() string {
+ return e.exprFactory.AccuIdentName()
+}
+
// NewGlobalCall implements the ExprHelper interface method.
func (e *exprHelper) NewCall(function string, args ...ast.Expr) ast.Expr {
return e.exprFactory.NewCall(e.nextMacroID(), function, args...)
diff --git a/vendor/github.com/google/cel-go/parser/macro.go b/vendor/github.com/google/cel-go/parser/macro.go
index dcd232254..1ef43c4b5 100644
--- a/vendor/github.com/google/cel-go/parser/macro.go
+++ b/vendor/github.com/google/cel-go/parser/macro.go
@@ -24,38 +24,74 @@ import (
"github.com/google/cel-go/common/types/ref"
)
+// MacroOpt defines a functional option for configuring macro behavior.
+type MacroOpt func(*macro) *macro
+
+// MacroDocs configures a list of strings into a multiline description for the macro.
+func MacroDocs(docs ...string) MacroOpt {
+ return func(m *macro) *macro {
+ m.doc = common.MultilineDescription(docs...)
+ return m
+ }
+}
+
+// MacroExamples configures a list of examples, either as a string or common.MultilineString,
+// into an example set to be provided with the macro Documentation() call.
+func MacroExamples(examples ...string) MacroOpt {
+ return func(m *macro) *macro {
+ m.examples = examples
+ return m
+ }
+}
+
// NewGlobalMacro creates a Macro for a global function with the specified arg count.
-func NewGlobalMacro(function string, argCount int, expander MacroExpander) Macro {
- return ¯o{
+func NewGlobalMacro(function string, argCount int, expander MacroExpander, opts ...MacroOpt) Macro {
+ m := ¯o{
function: function,
argCount: argCount,
expander: expander}
+ for _, opt := range opts {
+ m = opt(m)
+ }
+ return m
}
// NewReceiverMacro creates a Macro for a receiver function matching the specified arg count.
-func NewReceiverMacro(function string, argCount int, expander MacroExpander) Macro {
- return ¯o{
+func NewReceiverMacro(function string, argCount int, expander MacroExpander, opts ...MacroOpt) Macro {
+ m := ¯o{
function: function,
argCount: argCount,
expander: expander,
receiverStyle: true}
+ for _, opt := range opts {
+ m = opt(m)
+ }
+ return m
}
// NewGlobalVarArgMacro creates a Macro for a global function with a variable arg count.
-func NewGlobalVarArgMacro(function string, expander MacroExpander) Macro {
- return ¯o{
+func NewGlobalVarArgMacro(function string, expander MacroExpander, opts ...MacroOpt) Macro {
+ m := ¯o{
function: function,
expander: expander,
varArgStyle: true}
+ for _, opt := range opts {
+ m = opt(m)
+ }
+ return m
}
// NewReceiverVarArgMacro creates a Macro for a receiver function matching a variable arg count.
-func NewReceiverVarArgMacro(function string, expander MacroExpander) Macro {
- return ¯o{
+func NewReceiverVarArgMacro(function string, expander MacroExpander, opts ...MacroOpt) Macro {
+ m := ¯o{
function: function,
expander: expander,
receiverStyle: true,
varArgStyle: true}
+ for _, opt := range opts {
+ m = opt(m)
+ }
+ return m
}
// Macro interface for describing the function signature to match and the MacroExpander to apply.
@@ -95,6 +131,8 @@ type macro struct {
varArgStyle bool
argCount int
expander MacroExpander
+ doc string
+ examples []string
}
// Function returns the macro's function name (i.e. the function whose syntax it mimics).
@@ -125,6 +163,15 @@ func (m *macro) MacroKey() string {
return makeMacroKey(m.function, m.argCount, m.receiverStyle)
}
+// Documentation generates documentation and examples for the macro.
+func (m *macro) Documentation() *common.Doc {
+ examples := make([]*common.Doc, len(m.examples))
+ for i, ex := range m.examples {
+ examples[i] = common.NewExampleDoc(ex)
+ }
+ return common.NewMacroDoc(m.Function(), m.doc, examples...)
+}
+
func makeMacroKey(name string, args int, receiverStyle bool) string {
return fmt.Sprintf("%s:%d:%v", name, args, receiverStyle)
}
@@ -225,6 +272,9 @@ type ExprHelper interface {
// NewAccuIdent returns an accumulator identifier for use with comprehension results.
NewAccuIdent() ast.Expr
+ // AccuIdentName returns the name of the accumulator identifier.
+ AccuIdentName() string
+
// NewCall creates a function call Expr value for a global (free) function.
NewCall(function string, args ...ast.Expr) ast.Expr
@@ -247,37 +297,139 @@ type ExprHelper interface {
var (
// HasMacro expands "has(m.f)" which tests the presence of a field, avoiding the need to
// specify the field as a string.
- HasMacro = NewGlobalMacro(operators.Has, 1, MakeHas)
+ HasMacro = NewGlobalMacro(operators.Has, 1, MakeHas,
+ MacroDocs(
+ `check a protocol buffer message for the presence of a field, or check a map`,
+ `for the presence of a string key.`,
+ `Only map accesses using the select notation are supported.`),
+ MacroExamples(
+ common.MultilineDescription(
+ `// true if the 'address' field exists in the 'user' message`,
+ `has(user.address)`),
+ common.MultilineDescription(
+ `// test whether the 'key_name' is set on the map which defines it`,
+ `has({'key_name': 'value'}.key_name) // true`),
+ common.MultilineDescription(
+ `// test whether the 'id' field is set to a non-default value on the Expr{} message literal`,
+ `has(Expr{}.id) // false`),
+ ))
// AllMacro expands "range.all(var, predicate)" into a comprehension which ensures that all
// elements in the range satisfy the predicate.
- AllMacro = NewReceiverMacro(operators.All, 2, MakeAll)
+ AllMacro = NewReceiverMacro(operators.All, 2, MakeAll,
+ MacroDocs(`tests whether all elements in the input list or all keys in a map`,
+ `satisfy the given predicate. The all macro behaves in a manner consistent with`,
+ `the Logical AND operator including in how it absorbs errors and short-circuits.`),
+ MacroExamples(
+ `[1, 2, 3].all(x, x > 0) // true`,
+ `[1, 2, 0].all(x, x > 0) // false`,
+ `['apple', 'banana', 'cherry'].all(fruit, fruit.size() > 3) // true`,
+ `[3.14, 2.71, 1.61].all(num, num < 3.0) // false`,
+ `{'a': 1, 'b': 2, 'c': 3}.all(key, key != 'b') // false`,
+ common.MultilineDescription(
+ `// an empty list or map as the range will result in a trivially true result`,
+ `[].all(x, x > 0) // true`),
+ ))
// ExistsMacro expands "range.exists(var, predicate)" into a comprehension which ensures that
// some element in the range satisfies the predicate.
- ExistsMacro = NewReceiverMacro(operators.Exists, 2, MakeExists)
+ ExistsMacro = NewReceiverMacro(operators.Exists, 2, MakeExists,
+ MacroDocs(`tests whether any value in the list or any key in the map`,
+ `satisfies the predicate expression. The exists macro behaves in a manner`,
+ `consistent with the Logical OR operator including in how it absorbs errors and`,
+ `short-circuits.`),
+ MacroExamples(
+ `[1, 2, 3].exists(i, i % 2 != 0) // true`,
+ `[0, -1, 5].exists(num, num < 0) // true`,
+ `{'x': 'foo', 'y': 'bar'}.exists(key, key.startsWith('z')) // false`,
+ common.MultilineDescription(
+ `// an empty list or map as the range will result in a trivially false result`,
+ `[].exists(i, i > 0) // false`),
+ common.MultilineDescription(
+ `// test whether a key name equalling 'iss' exists in the map and the`,
+ `// value contains the substring 'cel.dev'`,
+ `// tokens = {'sub': 'me', 'iss': 'https://issuer.cel.dev'}`,
+ `tokens.exists(k, k == 'iss' && tokens[k].contains('cel.dev'))`),
+ ))
// ExistsOneMacro expands "range.exists_one(var, predicate)", which is true if for exactly one
// element in range the predicate holds.
// Deprecated: Use ExistsOneMacroNew
- ExistsOneMacro = NewReceiverMacro(operators.ExistsOne, 2, MakeExistsOne)
+ ExistsOneMacro = NewReceiverMacro(operators.ExistsOne, 2, MakeExistsOne,
+ MacroDocs(`tests whether exactly one list element or map key satisfies`,
+ `the predicate expression. This macro does not short-circuit in order to remain`,
+ `consistent with logical operators being the only operators which can absorb`,
+ `errors within CEL.`),
+ MacroExamples(
+ `[1, 2, 2].exists_one(i, i < 2) // true`,
+ `{'a': 'hello', 'aa': 'hellohello'}.exists_one(k, k.startsWith('a')) // false`,
+ `[1, 2, 3, 4].exists_one(num, num % 2 == 0) // false`,
+ common.MultilineDescription(
+ `// ensure exactly one key in the map ends in @acme.co`,
+ `{'wiley@acme.co': 'coyote', 'aa@milne.co': 'bear'}.exists_one(k, k.endsWith('@acme.co')) // true`),
+ ))
// ExistsOneMacroNew expands "range.existsOne(var, predicate)", which is true if for exactly one
// element in range the predicate holds.
- ExistsOneMacroNew = NewReceiverMacro("existsOne", 2, MakeExistsOne)
+ ExistsOneMacroNew = NewReceiverMacro("existsOne", 2, MakeExistsOne,
+ MacroDocs(
+ `tests whether exactly one list element or map key satisfies the predicate`,
+ `expression. This macro does not short-circuit in order to remain consistent`,
+ `with logical operators being the only operators which can absorb errors`,
+ `within CEL.`),
+ MacroExamples(
+ `[1, 2, 2].existsOne(i, i < 2) // true`,
+ `{'a': 'hello', 'aa': 'hellohello'}.existsOne(k, k.startsWith('a')) // false`,
+ `[1, 2, 3, 4].existsOne(num, num % 2 == 0) // false`,
+ common.MultilineDescription(
+ `// ensure exactly one key in the map ends in @acme.co`,
+ `{'wiley@acme.co': 'coyote', 'aa@milne.co': 'bear'}.existsOne(k, k.endsWith('@acme.co')) // true`),
+ ))
// MapMacro expands "range.map(var, function)" into a comprehension which applies the function
// to each element in the range to produce a new list.
- MapMacro = NewReceiverMacro(operators.Map, 2, MakeMap)
+ MapMacro = NewReceiverMacro(operators.Map, 2, MakeMap,
+ MacroDocs("the three-argument form of map transforms all elements in the input range."),
+ MacroExamples(
+ `[1, 2, 3].map(x, x * 2) // [2, 4, 6]`,
+ `[5, 10, 15].map(x, x / 5) // [1, 2, 3]`,
+ `['apple', 'banana'].map(fruit, fruit.upperAscii()) // ['APPLE', 'BANANA']`,
+ common.MultilineDescription(
+ `// Combine all map key-value pairs into a list`,
+ `{'hi': 'you', 'howzit': 'bruv'}.map(k,`,
+ ` k + ":" + {'hi': 'you', 'howzit': 'bruv'}[k]) // ['hi:you', 'howzit:bruv']`),
+ ))
// MapFilterMacro expands "range.map(var, predicate, function)" into a comprehension which
// first filters the elements in the range by the predicate, then applies the transform function
// to produce a new list.
- MapFilterMacro = NewReceiverMacro(operators.Map, 3, MakeMap)
+ MapFilterMacro = NewReceiverMacro(operators.Map, 3, MakeMap,
+ MacroDocs(`the four-argument form of the map transforms only elements which satisfy`,
+ `the predicate which is equivalent to chaining the filter and three-argument`,
+ `map macros together.`),
+ MacroExamples(
+ common.MultilineDescription(
+ `// multiply only numbers divisible two, by 2`,
+ `[1, 2, 3, 4].map(num, num % 2 == 0, num * 2) // [4, 8]`),
+ ))
// FilterMacro expands "range.filter(var, predicate)" into a comprehension which filters
// elements in the range, producing a new list from the elements that satisfy the predicate.
- FilterMacro = NewReceiverMacro(operators.Filter, 2, MakeFilter)
+ FilterMacro = NewReceiverMacro(operators.Filter, 2, MakeFilter,
+ MacroDocs(`returns a list containing only the elements from the input list`,
+ `that satisfy the given predicate`),
+ MacroExamples(
+ `[1, 2, 3].filter(x, x > 1) // [2, 3]`,
+ `['cat', 'dog', 'bird', 'fish'].filter(pet, pet.size() == 3) // ['cat', 'dog']`,
+ `[{'a': 10, 'b': 5, 'c': 20}].map(m, m.filter(key, m[key] > 10)) // [['c']]`,
+ common.MultilineDescription(
+ `// filter a list to select only emails with the @cel.dev suffix`,
+ `['alice@buf.io', 'tristan@cel.dev'].filter(v, v.endsWith('@cel.dev')) // ['tristan@cel.dev']`),
+ common.MultilineDescription(
+ `// filter a map into a list, selecting only the values for keys that start with 'http-auth'`,
+ `{'http-auth-agent': 'secret', 'user-agent': 'mozilla'}.filter(k,`,
+ ` k.startsWith('http-auth')) // ['secret']`),
+ ))
// AllMacros includes the list of all spec-supported macros.
AllMacros = []Macro{
@@ -298,6 +450,11 @@ var (
// AccumulatorName is the traditional variable name assigned to the fold accumulator variable.
const AccumulatorName = "__result__"
+// HiddenAccumulatorName is a proposed update to the default fold accumlator variable.
+// @result is not normally accessible from source, preventing accidental or intentional collisions
+// in user expressions.
+const HiddenAccumulatorName = "@result"
+
type quantifierKind int
const (
@@ -342,7 +499,8 @@ func MakeMap(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common
if !found {
return nil, eh.NewError(args[0].ID(), "argument is not an identifier")
}
- if v == AccumulatorName {
+ accu := eh.AccuIdentName()
+ if v == accu || v == AccumulatorName {
return nil, eh.NewError(args[0].ID(), "iteration variable overwrites accumulator variable")
}
@@ -364,7 +522,7 @@ func MakeMap(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common
if filter != nil {
step = eh.NewCall(operators.Conditional, filter, step, eh.NewAccuIdent())
}
- return eh.NewComprehension(target, v, AccumulatorName, init, condition, step, eh.NewAccuIdent()), nil
+ return eh.NewComprehension(target, v, accu, init, condition, step, eh.NewAccuIdent()), nil
}
// MakeFilter expands the input call arguments into a comprehension which produces a list which contains
@@ -375,7 +533,8 @@ func MakeFilter(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *com
if !found {
return nil, eh.NewError(args[0].ID(), "argument is not an identifier")
}
- if v == AccumulatorName {
+ accu := eh.AccuIdentName()
+ if v == accu || v == AccumulatorName {
return nil, eh.NewError(args[0].ID(), "iteration variable overwrites accumulator variable")
}
@@ -384,7 +543,7 @@ func MakeFilter(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *com
condition := eh.NewLiteral(types.True)
step := eh.NewCall(operators.Add, eh.NewAccuIdent(), eh.NewList(args[0]))
step = eh.NewCall(operators.Conditional, filter, step, eh.NewAccuIdent())
- return eh.NewComprehension(target, v, AccumulatorName, init, condition, step, eh.NewAccuIdent()), nil
+ return eh.NewComprehension(target, v, accu, init, condition, step, eh.NewAccuIdent()), nil
}
// MakeHas expands the input call arguments into a presence test, e.g. has(.field)
@@ -401,7 +560,8 @@ func makeQuantifier(kind quantifierKind, eh ExprHelper, target ast.Expr, args []
if !found {
return nil, eh.NewError(args[0].ID(), "argument must be a simple name")
}
- if v == AccumulatorName {
+ accu := eh.AccuIdentName()
+ if v == accu || v == AccumulatorName {
return nil, eh.NewError(args[0].ID(), "iteration variable overwrites accumulator variable")
}
@@ -431,7 +591,7 @@ func makeQuantifier(kind quantifierKind, eh ExprHelper, target ast.Expr, args []
default:
return nil, eh.NewError(args[0].ID(), fmt.Sprintf("unrecognized quantifier '%v'", kind))
}
- return eh.NewComprehension(target, v, AccumulatorName, init, condition, step, result), nil
+ return eh.NewComprehension(target, v, accu, init, condition, step, result), nil
}
func extractIdent(e ast.Expr) (string, bool) {
diff --git a/vendor/github.com/google/cel-go/parser/options.go b/vendor/github.com/google/cel-go/parser/options.go
index 61fc3adec..4eb30f83e 100644
--- a/vendor/github.com/google/cel-go/parser/options.go
+++ b/vendor/github.com/google/cel-go/parser/options.go
@@ -26,6 +26,8 @@ type options struct {
populateMacroCalls bool
enableOptionalSyntax bool
enableVariadicOperatorASTs bool
+ enableIdentEscapeSyntax bool
+ enableHiddenAccumulatorName bool
}
// Option configures the behavior of the parser.
@@ -127,6 +129,27 @@ func EnableOptionalSyntax(optionalSyntax bool) Option {
}
}
+// EnableIdentEscapeSyntax enables backtick (`) escaped field identifiers. This
+// supports extended types of characters in identifiers, e.g. foo.`baz-bar`.
+func EnableIdentEscapeSyntax(enableIdentEscapeSyntax bool) Option {
+ return func(opts *options) error {
+ opts.enableIdentEscapeSyntax = enableIdentEscapeSyntax
+ return nil
+ }
+}
+
+// EnableHiddenAccumulatorName uses an accumulator variable name that is not a
+// normally accessible identifier in source for comprehension macros. Compatibility notes:
+// with this option enabled, a parsed AST would be semantically the same as if disabled, but would
+// have different internal identifiers in any of the built-in comprehension sub-expressions. When
+// disabled, it is possible but almost certainly a logic error to access the accumulator variable.
+func EnableHiddenAccumulatorName(enabled bool) Option {
+ return func(opts *options) error {
+ opts.enableHiddenAccumulatorName = enabled
+ return nil
+ }
+}
+
// EnableVariadicOperatorASTs enables a compact representation of chained like-kind commutative
// operators. e.g. `a || b || c || d` -> `call(op='||', args=[a, b, c, d])`
//
diff --git a/vendor/github.com/google/cel-go/parser/parser.go b/vendor/github.com/google/cel-go/parser/parser.go
index 5cbb17672..b5ec73ec6 100644
--- a/vendor/github.com/google/cel-go/parser/parser.go
+++ b/vendor/github.com/google/cel-go/parser/parser.go
@@ -17,6 +17,7 @@
package parser
import (
+ "errors"
"fmt"
"regexp"
"strconv"
@@ -40,6 +41,7 @@ type Parser struct {
// NewParser builds and returns a new Parser using the provided options.
func NewParser(opts ...Option) (*Parser, error) {
p := &Parser{}
+ p.enableHiddenAccumulatorName = true
for _, opt := range opts {
if err := opt(&p.options); err != nil {
return nil, err
@@ -88,7 +90,11 @@ func mustNewParser(opts ...Option) *Parser {
// Parse parses the expression represented by source and returns the result.
func (p *Parser) Parse(source common.Source) (*ast.AST, *common.Errors) {
errs := common.NewErrors(source)
- fac := ast.NewExprFactory()
+ accu := AccumulatorName
+ if p.enableHiddenAccumulatorName {
+ accu = HiddenAccumulatorName
+ }
+ fac := ast.NewExprFactoryWithAccumulator(accu)
impl := parser{
errors: &parseErrors{errs},
exprFactory: fac,
@@ -101,6 +107,7 @@ func (p *Parser) Parse(source common.Source) (*ast.AST, *common.Errors) {
populateMacroCalls: p.populateMacroCalls,
enableOptionalSyntax: p.enableOptionalSyntax,
enableVariadicOperatorASTs: p.enableVariadicOperatorASTs,
+ enableIdentEscapeSyntax: p.enableIdentEscapeSyntax,
}
buf, ok := source.(runes.Buffer)
if !ok {
@@ -143,6 +150,27 @@ var reservedIds = map[string]struct{}{
"while": {},
}
+func unescapeIdent(in string) (string, error) {
+ if len(in) <= 2 {
+ return "", errors.New("invalid escaped identifier: underflow")
+ }
+ return in[1 : len(in)-1], nil
+}
+
+// normalizeIdent returns the interpreted identifier.
+func (p *parser) normalizeIdent(ctx gen.IEscapeIdentContext) (string, error) {
+ switch ident := ctx.(type) {
+ case *gen.SimpleIdentifierContext:
+ return ident.GetId().GetText(), nil
+ case *gen.EscapedIdentifierContext:
+ if !p.enableIdentEscapeSyntax {
+ return "", errors.New("unsupported syntax: '`'")
+ }
+ return unescapeIdent(ident.GetId().GetText())
+ }
+ return "", errors.New("unsupported ident kind")
+}
+
// Parse converts a source input a parsed expression.
// This function calls ParseWithMacros with AllMacros.
//
@@ -296,6 +324,7 @@ type parser struct {
populateMacroCalls bool
enableOptionalSyntax bool
enableVariadicOperatorASTs bool
+ enableIdentEscapeSyntax bool
}
var _ gen.CELVisitor = (*parser)(nil)
@@ -369,8 +398,10 @@ func (p *parser) Visit(tree antlr.ParseTree) any {
return out
case *gen.LogicalNotContext:
return p.VisitLogicalNot(tree)
- case *gen.IdentOrGlobalCallContext:
- return p.VisitIdentOrGlobalCall(tree)
+ case *gen.IdentContext:
+ return p.VisitIdent(tree)
+ case *gen.GlobalCallContext:
+ return p.VisitGlobalCall(tree)
case *gen.SelectContext:
p.checkAndIncrementRecursionDepth()
out := p.VisitSelect(tree)
@@ -538,7 +569,10 @@ func (p *parser) VisitSelect(ctx *gen.SelectContext) any {
if ctx.GetId() == nil || ctx.GetOp() == nil {
return p.helper.newExpr(ctx)
}
- id := ctx.GetId().GetText()
+ id, err := p.normalizeIdent(ctx.GetId())
+ if err != nil {
+ p.reportError(ctx.GetId(), "%v", err)
+ }
if ctx.GetOpt() != nil {
if !p.enableOptionalSyntax {
return p.reportError(ctx.GetOp(), "unsupported syntax '.?'")
@@ -622,12 +656,14 @@ func (p *parser) VisitIFieldInitializerList(ctx gen.IFieldInitializerListContext
p.reportError(optField, "unsupported syntax '?'")
continue
}
+
// The field may be empty due to a prior error.
- id := optField.IDENTIFIER()
- if id == nil {
- return []ast.EntryExpr{}
+ fieldName, err := p.normalizeIdent(optField.EscapeIdent())
+ if err != nil {
+ p.reportError(ctx, "%v", err)
+ continue
}
- fieldName := id.GetText()
+
value := p.Visit(vals[i]).(ast.Expr)
field := p.helper.newObjectField(initID, fieldName, value, optional)
result[i] = field
@@ -635,8 +671,8 @@ func (p *parser) VisitIFieldInitializerList(ctx gen.IFieldInitializerListContext
return result
}
-// Visit a parse tree produced by CELParser#IdentOrGlobalCall.
-func (p *parser) VisitIdentOrGlobalCall(ctx *gen.IdentOrGlobalCallContext) any {
+// Visit a parse tree produced by CELParser#Ident.
+func (p *parser) VisitIdent(ctx *gen.IdentContext) any {
identName := ""
if ctx.GetLeadingDot() != nil {
identName = "."
@@ -651,13 +687,30 @@ func (p *parser) VisitIdentOrGlobalCall(ctx *gen.IdentOrGlobalCallContext) any {
return p.reportError(ctx, "reserved identifier: %s", id)
}
identName += id
- if ctx.GetOp() != nil {
- opID := p.helper.id(ctx.GetOp())
- return p.globalCallOrMacro(opID, identName, p.visitExprList(ctx.GetArgs())...)
- }
return p.helper.newIdent(ctx.GetId(), identName)
}
+// Visit a parse tree produced by CELParser#GlobalCallContext.
+func (p *parser) VisitGlobalCall(ctx *gen.GlobalCallContext) any {
+ identName := ""
+ if ctx.GetLeadingDot() != nil {
+ identName = "."
+ }
+ // Handle the error case where no valid identifier is specified.
+ if ctx.GetId() == nil {
+ return p.helper.newExpr(ctx)
+ }
+ // Handle reserved identifiers.
+ id := ctx.GetId().GetText()
+ if _, ok := reservedIds[id]; ok {
+ return p.reportError(ctx, "reserved identifier: %s", id)
+ }
+ identName += id
+ opID := p.helper.id(ctx.GetOp())
+ return p.globalCallOrMacro(opID, identName, p.visitExprList(ctx.GetArgs())...)
+
+}
+
// Visit a parse tree produced by CELParser#CreateList.
func (p *parser) VisitCreateList(ctx *gen.CreateListContext) any {
listID := p.helper.id(ctx.GetOp())
@@ -756,7 +809,7 @@ func (p *parser) VisitDouble(ctx *gen.DoubleContext) any {
// Visit a parse tree produced by CELParser#String.
func (p *parser) VisitString(ctx *gen.StringContext) any {
- s := p.unquote(ctx, ctx.GetText(), false)
+ s := p.unquote(ctx, ctx.GetTok().GetText(), false)
return p.helper.newLiteralString(ctx, s)
}
@@ -922,7 +975,7 @@ func (p *parser) expandMacro(exprID int64, function string, target ast.Expr, arg
loc = p.helper.getLocation(exprID)
}
p.helper.deleteID(exprID)
- return p.reportError(loc, err.Message), true
+ return p.reportError(loc, "%s", err.Message), true
}
// A nil value from the macro indicates that the macro implementation decided that
// an expansion should not be performed.
diff --git a/vendor/github.com/google/cel-go/parser/unescape.go b/vendor/github.com/google/cel-go/parser/unescape.go
index 27c57a9f3..43cc9b901 100644
--- a/vendor/github.com/google/cel-go/parser/unescape.go
+++ b/vendor/github.com/google/cel-go/parser/unescape.go
@@ -15,7 +15,7 @@
package parser
import (
- "fmt"
+ "errors"
"strings"
"unicode/utf8"
)
@@ -30,7 +30,7 @@ func unescape(value string, isBytes bool) (string, error) {
// Nothing to unescape / decode.
if n < 2 {
- return value, fmt.Errorf("unable to unescape string")
+ return value, errors.New("unable to unescape string")
}
// Raw string preceded by the 'r|R' prefix.
@@ -43,7 +43,7 @@ func unescape(value string, isBytes bool) (string, error) {
// Quoted string of some form, must have same first and last char.
if value[0] != value[n-1] || (value[0] != '"' && value[0] != '\'') {
- return value, fmt.Errorf("unable to unescape string")
+ return value, errors.New("unable to unescape string")
}
// Normalize the multi-line CEL string representation to a standard
@@ -51,12 +51,12 @@ func unescape(value string, isBytes bool) (string, error) {
if n >= 6 {
if strings.HasPrefix(value, "'''") {
if !strings.HasSuffix(value, "'''") {
- return value, fmt.Errorf("unable to unescape string")
+ return value, errors.New("unable to unescape string")
}
value = "\"" + value[3:n-3] + "\""
} else if strings.HasPrefix(value, `"""`) {
if !strings.HasSuffix(value, `"""`) {
- return value, fmt.Errorf("unable to unescape string")
+ return value, errors.New("unable to unescape string")
}
value = "\"" + value[3:n-3] + "\""
}
@@ -90,10 +90,10 @@ func unescape(value string, isBytes bool) (string, error) {
// unescapeChar takes a string input and returns the following info:
//
-// value - the escaped unicode rune at the front of the string.
-// encode - the value should be unicode-encoded
-// tail - the remainder of the input string.
-// err - error value, if the character could not be unescaped.
+// value - the escaped unicode rune at the front of the string.
+// encode - the value should be unicode-encoded
+// tail - the remainder of the input string.
+// err - error value, if the character could not be unescaped.
//
// When encode is true the return value may still fit within a single byte,
// but unicode encoding is attempted which is more expensive than when the
@@ -113,7 +113,7 @@ func unescapeChar(s string, isBytes bool) (value rune, encode bool, tail string,
// 2. Last character is the start of an escape sequence.
if len(s) <= 1 {
- err = fmt.Errorf("unable to unescape string, found '\\' as last character")
+ err = errors.New("unable to unescape string, found '\\' as last character")
return
}
@@ -157,32 +157,32 @@ func unescapeChar(s string, isBytes bool) (value rune, encode bool, tail string,
case 'u':
n = 4
if isBytes {
- err = fmt.Errorf("unable to unescape string")
+ err = errors.New("unable to unescape string")
return
}
case 'U':
n = 8
if isBytes {
- err = fmt.Errorf("unable to unescape string")
+ err = errors.New("unable to unescape string")
return
}
}
var v rune
if len(s) < n {
- err = fmt.Errorf("unable to unescape string")
+ err = errors.New("unable to unescape string")
return
}
for j := 0; j < n; j++ {
x, ok := unhex(s[j])
if !ok {
- err = fmt.Errorf("unable to unescape string")
+ err = errors.New("unable to unescape string")
return
}
v = v<<4 | x
}
s = s[n:]
- if !isBytes && v > utf8.MaxRune {
- err = fmt.Errorf("unable to unescape string")
+ if !isBytes && !utf8.ValidRune(v) {
+ err = errors.New("invalid unicode code point")
return
}
value = v
@@ -190,20 +190,20 @@ func unescapeChar(s string, isBytes bool) (value rune, encode bool, tail string,
// 5. Octal escape sequences, must be three digits \[0-3][0-7][0-7]
case '0', '1', '2', '3':
if len(s) < 2 {
- err = fmt.Errorf("unable to unescape octal sequence in string")
+ err = errors.New("unable to unescape octal sequence in string")
return
}
v := rune(c - '0')
for j := 0; j < 2; j++ {
x := s[j]
if x < '0' || x > '7' {
- err = fmt.Errorf("unable to unescape octal sequence in string")
+ err = errors.New("unable to unescape octal sequence in string")
return
}
v = v*8 + rune(x-'0')
}
- if !isBytes && v > utf8.MaxRune {
- err = fmt.Errorf("unable to unescape string")
+ if !isBytes && !utf8.ValidRune(v) {
+ err = errors.New("invalid unicode code point")
return
}
value = v
@@ -212,7 +212,7 @@ func unescapeChar(s string, isBytes bool) (value rune, encode bool, tail string,
// Unknown escape sequence.
default:
- err = fmt.Errorf("unable to unescape string")
+ err = errors.New("unable to unescape string")
}
tail = s
diff --git a/vendor/github.com/google/cel-go/parser/unparser.go b/vendor/github.com/google/cel-go/parser/unparser.go
index 91cf72944..ffd5b18e4 100644
--- a/vendor/github.com/google/cel-go/parser/unparser.go
+++ b/vendor/github.com/google/cel-go/parser/unparser.go
@@ -17,12 +17,14 @@ package parser
import (
"errors"
"fmt"
+ "regexp"
"strconv"
"strings"
"github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
)
// Unparse takes an input expression and source position information and generates a human-readable
@@ -65,6 +67,15 @@ func Unparse(expr ast.Expr, info *ast.SourceInfo, opts ...UnparserOption) (strin
return un.str.String(), nil
}
+var identifierPartPattern *regexp.Regexp = regexp.MustCompile(`^[A-Za-z_][0-9A-Za-z_]*$`)
+
+func maybeQuoteField(field string) string {
+ if !identifierPartPattern.MatchString(field) || field == "in" {
+ return "`" + field + "`"
+ }
+ return field
+}
+
// unparser visits an expression to reconstruct a human-readable string from an AST.
type unparser struct {
str strings.Builder
@@ -263,8 +274,17 @@ func (un *unparser) visitCallUnary(expr ast.Expr) error {
return un.visitMaybeNested(args[0], nested)
}
-func (un *unparser) visitConst(expr ast.Expr) error {
- val := expr.AsLiteral()
+func (un *unparser) visitConstVal(val ref.Val) error {
+ optional := false
+ if optVal, ok := val.(*types.Optional); ok {
+ if !optVal.HasValue() {
+ un.str.WriteString("optional.none()")
+ return nil
+ }
+ optional = true
+ un.str.WriteString("optional.of(")
+ val = optVal.GetValue()
+ }
switch val := val.(type) {
case types.Bool:
un.str.WriteString(strconv.FormatBool(bool(val)))
@@ -293,7 +313,21 @@ func (un *unparser) visitConst(expr ast.Expr) error {
ui := strconv.FormatUint(uint64(val), 10)
un.str.WriteString(ui)
un.str.WriteString("u")
+ case *types.Optional:
+ if err := un.visitConstVal(val); err != nil {
+ return err
+ }
default:
+ return errors.New("unsupported constant")
+ }
+ if optional {
+ un.str.WriteString(")")
+ }
+ return nil
+}
+func (un *unparser) visitConst(expr ast.Expr) error {
+ val := expr.AsLiteral()
+ if err := un.visitConstVal(val); err != nil {
return fmt.Errorf("unsupported constant: %v", expr)
}
return nil
@@ -352,7 +386,7 @@ func (un *unparser) visitSelectInternal(operand ast.Expr, testOnly bool, op stri
return err
}
un.str.WriteString(op)
- un.str.WriteString(field)
+ un.str.WriteString(maybeQuoteField(field))
if testOnly {
un.str.WriteString(")")
}
@@ -370,7 +404,7 @@ func (un *unparser) visitStructMsg(expr ast.Expr) error {
if field.IsOptional() {
un.str.WriteString("?")
}
- un.str.WriteString(f)
+ un.str.WriteString(maybeQuoteField(f))
un.str.WriteString(": ")
v := field.Value()
err := un.visit(v)
diff --git a/vendor/github.com/google/gofuzz/.travis.yml b/vendor/github.com/google/gofuzz/.travis.yml
deleted file mode 100644
index 061d72ae0..000000000
--- a/vendor/github.com/google/gofuzz/.travis.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-language: go
-
-go:
- - 1.11.x
- - 1.12.x
- - 1.13.x
- - master
-
-script:
- - go test -cover
diff --git a/vendor/github.com/google/gofuzz/CONTRIBUTING.md b/vendor/github.com/google/gofuzz/CONTRIBUTING.md
deleted file mode 100644
index 97c1b34fd..000000000
--- a/vendor/github.com/google/gofuzz/CONTRIBUTING.md
+++ /dev/null
@@ -1,67 +0,0 @@
-# How to contribute #
-
-We'd love to accept your patches and contributions to this project. There are
-just a few small guidelines you need to follow.
-
-
-## Contributor License Agreement ##
-
-Contributions to any Google project must be accompanied by a Contributor
-License Agreement. This is not a copyright **assignment**, it simply gives
-Google permission to use and redistribute your contributions as part of the
-project.
-
- * If you are an individual writing original source code and you're sure you
- own the intellectual property, then you'll need to sign an [individual
- CLA][].
-
- * If you work for a company that wants to allow you to contribute your work,
- then you'll need to sign a [corporate CLA][].
-
-You generally only need to submit a CLA once, so if you've already submitted
-one (even if it was for a different project), you probably don't need to do it
-again.
-
-[individual CLA]: https://developers.google.com/open-source/cla/individual
-[corporate CLA]: https://developers.google.com/open-source/cla/corporate
-
-
-## Submitting a patch ##
-
- 1. It's generally best to start by opening a new issue describing the bug or
- feature you're intending to fix. Even if you think it's relatively minor,
- it's helpful to know what people are working on. Mention in the initial
- issue that you are planning to work on that bug or feature so that it can
- be assigned to you.
-
- 1. Follow the normal process of [forking][] the project, and setup a new
- branch to work in. It's important that each group of changes be done in
- separate branches in order to ensure that a pull request only includes the
- commits related to that bug or feature.
-
- 1. Go makes it very simple to ensure properly formatted code, so always run
- `go fmt` on your code before committing it. You should also run
- [golint][] over your code. As noted in the [golint readme][], it's not
- strictly necessary that your code be completely "lint-free", but this will
- help you find common style issues.
-
- 1. Any significant changes should almost always be accompanied by tests. The
- project already has good test coverage, so look at some of the existing
- tests if you're unsure how to go about it. [gocov][] and [gocov-html][]
- are invaluable tools for seeing which parts of your code aren't being
- exercised by your tests.
-
- 1. Do your best to have [well-formed commit messages][] for each change.
- This provides consistency throughout the project, and ensures that commit
- messages are able to be formatted properly by various git tools.
-
- 1. Finally, push the commits to your fork and submit a [pull request][].
-
-[forking]: https://help.github.com/articles/fork-a-repo
-[golint]: https://github.com/golang/lint
-[golint readme]: https://github.com/golang/lint/blob/master/README
-[gocov]: https://github.com/axw/gocov
-[gocov-html]: https://github.com/matm/gocov-html
-[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
-[squash]: http://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits
-[pull request]: https://help.github.com/articles/creating-a-pull-request
diff --git a/vendor/github.com/google/gofuzz/README.md b/vendor/github.com/google/gofuzz/README.md
deleted file mode 100644
index b503aae7d..000000000
--- a/vendor/github.com/google/gofuzz/README.md
+++ /dev/null
@@ -1,89 +0,0 @@
-gofuzz
-======
-
-gofuzz is a library for populating go objects with random values.
-
-[](https://godoc.org/github.com/google/gofuzz)
-[](https://travis-ci.org/google/gofuzz)
-
-This is useful for testing:
-
-* Do your project's objects really serialize/unserialize correctly in all cases?
-* Is there an incorrectly formatted object that will cause your project to panic?
-
-Import with ```import "github.com/google/gofuzz"```
-
-You can use it on single variables:
-```go
-f := fuzz.New()
-var myInt int
-f.Fuzz(&myInt) // myInt gets a random value.
-```
-
-You can use it on maps:
-```go
-f := fuzz.New().NilChance(0).NumElements(1, 1)
-var myMap map[ComplexKeyType]string
-f.Fuzz(&myMap) // myMap will have exactly one element.
-```
-
-Customize the chance of getting a nil pointer:
-```go
-f := fuzz.New().NilChance(.5)
-var fancyStruct struct {
- A, B, C, D *string
-}
-f.Fuzz(&fancyStruct) // About half the pointers should be set.
-```
-
-You can even customize the randomization completely if needed:
-```go
-type MyEnum string
-const (
- A MyEnum = "A"
- B MyEnum = "B"
-)
-type MyInfo struct {
- Type MyEnum
- AInfo *string
- BInfo *string
-}
-
-f := fuzz.New().NilChance(0).Funcs(
- func(e *MyInfo, c fuzz.Continue) {
- switch c.Intn(2) {
- case 0:
- e.Type = A
- c.Fuzz(&e.AInfo)
- case 1:
- e.Type = B
- c.Fuzz(&e.BInfo)
- }
- },
-)
-
-var myObject MyInfo
-f.Fuzz(&myObject) // Type will correspond to whether A or B info is set.
-```
-
-See more examples in ```example_test.go```.
-
-You can use this library for easier [go-fuzz](https://github.com/dvyukov/go-fuzz)ing.
-go-fuzz provides the user a byte-slice, which should be converted to different inputs
-for the tested function. This library can help convert the byte slice. Consider for
-example a fuzz test for a the function `mypackage.MyFunc` that takes an int arguments:
-```go
-// +build gofuzz
-package mypackage
-
-import fuzz "github.com/google/gofuzz"
-
-func Fuzz(data []byte) int {
- var i int
- fuzz.NewFromGoFuzz(data).Fuzz(&i)
- MyFunc(i)
- return 0
-}
-```
-
-Happy testing!
diff --git a/vendor/github.com/google/gofuzz/bytesource/bytesource.go b/vendor/github.com/google/gofuzz/bytesource/bytesource.go
deleted file mode 100644
index 5bb365949..000000000
--- a/vendor/github.com/google/gofuzz/bytesource/bytesource.go
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-Copyright 2014 Google Inc. All rights reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Package bytesource provides a rand.Source64 that is determined by a slice of bytes.
-package bytesource
-
-import (
- "bytes"
- "encoding/binary"
- "io"
- "math/rand"
-)
-
-// ByteSource implements rand.Source64 determined by a slice of bytes. The random numbers are
-// generated from each 8 bytes in the slice, until the last bytes are consumed, from which a
-// fallback pseudo random source is created in case more random numbers are required.
-// It also exposes a `bytes.Reader` API, which lets callers consume the bytes directly.
-type ByteSource struct {
- *bytes.Reader
- fallback rand.Source
-}
-
-// New returns a new ByteSource from a given slice of bytes.
-func New(input []byte) *ByteSource {
- s := &ByteSource{
- Reader: bytes.NewReader(input),
- fallback: rand.NewSource(0),
- }
- if len(input) > 0 {
- s.fallback = rand.NewSource(int64(s.consumeUint64()))
- }
- return s
-}
-
-func (s *ByteSource) Uint64() uint64 {
- // Return from input if it was not exhausted.
- if s.Len() > 0 {
- return s.consumeUint64()
- }
-
- // Input was exhausted, return random number from fallback (in this case fallback should not be
- // nil). Try first having a Uint64 output (Should work in current rand implementation),
- // otherwise return a conversion of Int63.
- if s64, ok := s.fallback.(rand.Source64); ok {
- return s64.Uint64()
- }
- return uint64(s.fallback.Int63())
-}
-
-func (s *ByteSource) Int63() int64 {
- return int64(s.Uint64() >> 1)
-}
-
-func (s *ByteSource) Seed(seed int64) {
- s.fallback = rand.NewSource(seed)
- s.Reader = bytes.NewReader(nil)
-}
-
-// consumeUint64 reads 8 bytes from the input and convert them to a uint64. It assumes that the the
-// bytes reader is not empty.
-func (s *ByteSource) consumeUint64() uint64 {
- var bytes [8]byte
- _, err := s.Read(bytes[:])
- if err != nil && err != io.EOF {
- panic("failed reading source") // Should not happen.
- }
- return binary.BigEndian.Uint64(bytes[:])
-}
diff --git a/vendor/github.com/google/gofuzz/doc.go b/vendor/github.com/google/gofuzz/doc.go
deleted file mode 100644
index 9f9956d4a..000000000
--- a/vendor/github.com/google/gofuzz/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2014 Google Inc. All rights reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Package fuzz is a library for populating go objects with random values.
-package fuzz
diff --git a/vendor/github.com/google/gofuzz/fuzz.go b/vendor/github.com/google/gofuzz/fuzz.go
deleted file mode 100644
index 761520a8c..000000000
--- a/vendor/github.com/google/gofuzz/fuzz.go
+++ /dev/null
@@ -1,605 +0,0 @@
-/*
-Copyright 2014 Google Inc. All rights reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package fuzz
-
-import (
- "fmt"
- "math/rand"
- "reflect"
- "regexp"
- "time"
-
- "github.com/google/gofuzz/bytesource"
- "strings"
-)
-
-// fuzzFuncMap is a map from a type to a fuzzFunc that handles that type.
-type fuzzFuncMap map[reflect.Type]reflect.Value
-
-// Fuzzer knows how to fill any object with random fields.
-type Fuzzer struct {
- fuzzFuncs fuzzFuncMap
- defaultFuzzFuncs fuzzFuncMap
- r *rand.Rand
- nilChance float64
- minElements int
- maxElements int
- maxDepth int
- skipFieldPatterns []*regexp.Regexp
-}
-
-// New returns a new Fuzzer. Customize your Fuzzer further by calling Funcs,
-// RandSource, NilChance, or NumElements in any order.
-func New() *Fuzzer {
- return NewWithSeed(time.Now().UnixNano())
-}
-
-func NewWithSeed(seed int64) *Fuzzer {
- f := &Fuzzer{
- defaultFuzzFuncs: fuzzFuncMap{
- reflect.TypeOf(&time.Time{}): reflect.ValueOf(fuzzTime),
- },
-
- fuzzFuncs: fuzzFuncMap{},
- r: rand.New(rand.NewSource(seed)),
- nilChance: .2,
- minElements: 1,
- maxElements: 10,
- maxDepth: 100,
- }
- return f
-}
-
-// NewFromGoFuzz is a helper function that enables using gofuzz (this
-// project) with go-fuzz (https://github.com/dvyukov/go-fuzz) for continuous
-// fuzzing. Essentially, it enables translating the fuzzing bytes from
-// go-fuzz to any Go object using this library.
-//
-// This implementation promises a constant translation from a given slice of
-// bytes to the fuzzed objects. This promise will remain over future
-// versions of Go and of this library.
-//
-// Note: the returned Fuzzer should not be shared between multiple goroutines,
-// as its deterministic output will no longer be available.
-//
-// Example: use go-fuzz to test the function `MyFunc(int)` in the package
-// `mypackage`. Add the file: "mypacakge_fuzz.go" with the content:
-//
-// // +build gofuzz
-// package mypacakge
-// import fuzz "github.com/google/gofuzz"
-// func Fuzz(data []byte) int {
-// var i int
-// fuzz.NewFromGoFuzz(data).Fuzz(&i)
-// MyFunc(i)
-// return 0
-// }
-func NewFromGoFuzz(data []byte) *Fuzzer {
- return New().RandSource(bytesource.New(data))
-}
-
-// Funcs adds each entry in fuzzFuncs as a custom fuzzing function.
-//
-// Each entry in fuzzFuncs must be a function taking two parameters.
-// The first parameter must be a pointer or map. It is the variable that
-// function will fill with random data. The second parameter must be a
-// fuzz.Continue, which will provide a source of randomness and a way
-// to automatically continue fuzzing smaller pieces of the first parameter.
-//
-// These functions are called sensibly, e.g., if you wanted custom string
-// fuzzing, the function `func(s *string, c fuzz.Continue)` would get
-// called and passed the address of strings. Maps and pointers will always
-// be made/new'd for you, ignoring the NilChange option. For slices, it
-// doesn't make much sense to pre-create them--Fuzzer doesn't know how
-// long you want your slice--so take a pointer to a slice, and make it
-// yourself. (If you don't want your map/pointer type pre-made, take a
-// pointer to it, and make it yourself.) See the examples for a range of
-// custom functions.
-func (f *Fuzzer) Funcs(fuzzFuncs ...interface{}) *Fuzzer {
- for i := range fuzzFuncs {
- v := reflect.ValueOf(fuzzFuncs[i])
- if v.Kind() != reflect.Func {
- panic("Need only funcs!")
- }
- t := v.Type()
- if t.NumIn() != 2 || t.NumOut() != 0 {
- panic("Need 2 in and 0 out params!")
- }
- argT := t.In(0)
- switch argT.Kind() {
- case reflect.Ptr, reflect.Map:
- default:
- panic("fuzzFunc must take pointer or map type")
- }
- if t.In(1) != reflect.TypeOf(Continue{}) {
- panic("fuzzFunc's second parameter must be type fuzz.Continue")
- }
- f.fuzzFuncs[argT] = v
- }
- return f
-}
-
-// RandSource causes f to get values from the given source of randomness.
-// Use if you want deterministic fuzzing.
-func (f *Fuzzer) RandSource(s rand.Source) *Fuzzer {
- f.r = rand.New(s)
- return f
-}
-
-// NilChance sets the probability of creating a nil pointer, map, or slice to
-// 'p'. 'p' should be between 0 (no nils) and 1 (all nils), inclusive.
-func (f *Fuzzer) NilChance(p float64) *Fuzzer {
- if p < 0 || p > 1 {
- panic("p should be between 0 and 1, inclusive.")
- }
- f.nilChance = p
- return f
-}
-
-// NumElements sets the minimum and maximum number of elements that will be
-// added to a non-nil map or slice.
-func (f *Fuzzer) NumElements(atLeast, atMost int) *Fuzzer {
- if atLeast > atMost {
- panic("atLeast must be <= atMost")
- }
- if atLeast < 0 {
- panic("atLeast must be >= 0")
- }
- f.minElements = atLeast
- f.maxElements = atMost
- return f
-}
-
-func (f *Fuzzer) genElementCount() int {
- if f.minElements == f.maxElements {
- return f.minElements
- }
- return f.minElements + f.r.Intn(f.maxElements-f.minElements+1)
-}
-
-func (f *Fuzzer) genShouldFill() bool {
- return f.r.Float64() >= f.nilChance
-}
-
-// MaxDepth sets the maximum number of recursive fuzz calls that will be made
-// before stopping. This includes struct members, pointers, and map and slice
-// elements.
-func (f *Fuzzer) MaxDepth(d int) *Fuzzer {
- f.maxDepth = d
- return f
-}
-
-// Skip fields which match the supplied pattern. Call this multiple times if needed
-// This is useful to skip XXX_ fields generated by protobuf
-func (f *Fuzzer) SkipFieldsWithPattern(pattern *regexp.Regexp) *Fuzzer {
- f.skipFieldPatterns = append(f.skipFieldPatterns, pattern)
- return f
-}
-
-// Fuzz recursively fills all of obj's fields with something random. First
-// this tries to find a custom fuzz function (see Funcs). If there is no
-// custom function this tests whether the object implements fuzz.Interface and,
-// if so, calls Fuzz on it to fuzz itself. If that fails, this will see if
-// there is a default fuzz function provided by this package. If all of that
-// fails, this will generate random values for all primitive fields and then
-// recurse for all non-primitives.
-//
-// This is safe for cyclic or tree-like structs, up to a limit. Use the
-// MaxDepth method to adjust how deep you need it to recurse.
-//
-// obj must be a pointer. Only exported (public) fields can be set (thanks,
-// golang :/ ) Intended for tests, so will panic on bad input or unimplemented
-// fields.
-func (f *Fuzzer) Fuzz(obj interface{}) {
- v := reflect.ValueOf(obj)
- if v.Kind() != reflect.Ptr {
- panic("needed ptr!")
- }
- v = v.Elem()
- f.fuzzWithContext(v, 0)
-}
-
-// FuzzNoCustom is just like Fuzz, except that any custom fuzz function for
-// obj's type will not be called and obj will not be tested for fuzz.Interface
-// conformance. This applies only to obj and not other instances of obj's
-// type.
-// Not safe for cyclic or tree-like structs!
-// obj must be a pointer. Only exported (public) fields can be set (thanks, golang :/ )
-// Intended for tests, so will panic on bad input or unimplemented fields.
-func (f *Fuzzer) FuzzNoCustom(obj interface{}) {
- v := reflect.ValueOf(obj)
- if v.Kind() != reflect.Ptr {
- panic("needed ptr!")
- }
- v = v.Elem()
- f.fuzzWithContext(v, flagNoCustomFuzz)
-}
-
-const (
- // Do not try to find a custom fuzz function. Does not apply recursively.
- flagNoCustomFuzz uint64 = 1 << iota
-)
-
-func (f *Fuzzer) fuzzWithContext(v reflect.Value, flags uint64) {
- fc := &fuzzerContext{fuzzer: f}
- fc.doFuzz(v, flags)
-}
-
-// fuzzerContext carries context about a single fuzzing run, which lets Fuzzer
-// be thread-safe.
-type fuzzerContext struct {
- fuzzer *Fuzzer
- curDepth int
-}
-
-func (fc *fuzzerContext) doFuzz(v reflect.Value, flags uint64) {
- if fc.curDepth >= fc.fuzzer.maxDepth {
- return
- }
- fc.curDepth++
- defer func() { fc.curDepth-- }()
-
- if !v.CanSet() {
- return
- }
-
- if flags&flagNoCustomFuzz == 0 {
- // Check for both pointer and non-pointer custom functions.
- if v.CanAddr() && fc.tryCustom(v.Addr()) {
- return
- }
- if fc.tryCustom(v) {
- return
- }
- }
-
- if fn, ok := fillFuncMap[v.Kind()]; ok {
- fn(v, fc.fuzzer.r)
- return
- }
-
- switch v.Kind() {
- case reflect.Map:
- if fc.fuzzer.genShouldFill() {
- v.Set(reflect.MakeMap(v.Type()))
- n := fc.fuzzer.genElementCount()
- for i := 0; i < n; i++ {
- key := reflect.New(v.Type().Key()).Elem()
- fc.doFuzz(key, 0)
- val := reflect.New(v.Type().Elem()).Elem()
- fc.doFuzz(val, 0)
- v.SetMapIndex(key, val)
- }
- return
- }
- v.Set(reflect.Zero(v.Type()))
- case reflect.Ptr:
- if fc.fuzzer.genShouldFill() {
- v.Set(reflect.New(v.Type().Elem()))
- fc.doFuzz(v.Elem(), 0)
- return
- }
- v.Set(reflect.Zero(v.Type()))
- case reflect.Slice:
- if fc.fuzzer.genShouldFill() {
- n := fc.fuzzer.genElementCount()
- v.Set(reflect.MakeSlice(v.Type(), n, n))
- for i := 0; i < n; i++ {
- fc.doFuzz(v.Index(i), 0)
- }
- return
- }
- v.Set(reflect.Zero(v.Type()))
- case reflect.Array:
- if fc.fuzzer.genShouldFill() {
- n := v.Len()
- for i := 0; i < n; i++ {
- fc.doFuzz(v.Index(i), 0)
- }
- return
- }
- v.Set(reflect.Zero(v.Type()))
- case reflect.Struct:
- for i := 0; i < v.NumField(); i++ {
- skipField := false
- fieldName := v.Type().Field(i).Name
- for _, pattern := range fc.fuzzer.skipFieldPatterns {
- if pattern.MatchString(fieldName) {
- skipField = true
- break
- }
- }
- if !skipField {
- fc.doFuzz(v.Field(i), 0)
- }
- }
- case reflect.Chan:
- fallthrough
- case reflect.Func:
- fallthrough
- case reflect.Interface:
- fallthrough
- default:
- panic(fmt.Sprintf("Can't handle %#v", v.Interface()))
- }
-}
-
-// tryCustom searches for custom handlers, and returns true iff it finds a match
-// and successfully randomizes v.
-func (fc *fuzzerContext) tryCustom(v reflect.Value) bool {
- // First: see if we have a fuzz function for it.
- doCustom, ok := fc.fuzzer.fuzzFuncs[v.Type()]
- if !ok {
- // Second: see if it can fuzz itself.
- if v.CanInterface() {
- intf := v.Interface()
- if fuzzable, ok := intf.(Interface); ok {
- fuzzable.Fuzz(Continue{fc: fc, Rand: fc.fuzzer.r})
- return true
- }
- }
- // Finally: see if there is a default fuzz function.
- doCustom, ok = fc.fuzzer.defaultFuzzFuncs[v.Type()]
- if !ok {
- return false
- }
- }
-
- switch v.Kind() {
- case reflect.Ptr:
- if v.IsNil() {
- if !v.CanSet() {
- return false
- }
- v.Set(reflect.New(v.Type().Elem()))
- }
- case reflect.Map:
- if v.IsNil() {
- if !v.CanSet() {
- return false
- }
- v.Set(reflect.MakeMap(v.Type()))
- }
- default:
- return false
- }
-
- doCustom.Call([]reflect.Value{v, reflect.ValueOf(Continue{
- fc: fc,
- Rand: fc.fuzzer.r,
- })})
- return true
-}
-
-// Interface represents an object that knows how to fuzz itself. Any time we
-// find a type that implements this interface we will delegate the act of
-// fuzzing itself.
-type Interface interface {
- Fuzz(c Continue)
-}
-
-// Continue can be passed to custom fuzzing functions to allow them to use
-// the correct source of randomness and to continue fuzzing their members.
-type Continue struct {
- fc *fuzzerContext
-
- // For convenience, Continue implements rand.Rand via embedding.
- // Use this for generating any randomness if you want your fuzzing
- // to be repeatable for a given seed.
- *rand.Rand
-}
-
-// Fuzz continues fuzzing obj. obj must be a pointer.
-func (c Continue) Fuzz(obj interface{}) {
- v := reflect.ValueOf(obj)
- if v.Kind() != reflect.Ptr {
- panic("needed ptr!")
- }
- v = v.Elem()
- c.fc.doFuzz(v, 0)
-}
-
-// FuzzNoCustom continues fuzzing obj, except that any custom fuzz function for
-// obj's type will not be called and obj will not be tested for fuzz.Interface
-// conformance. This applies only to obj and not other instances of obj's
-// type.
-func (c Continue) FuzzNoCustom(obj interface{}) {
- v := reflect.ValueOf(obj)
- if v.Kind() != reflect.Ptr {
- panic("needed ptr!")
- }
- v = v.Elem()
- c.fc.doFuzz(v, flagNoCustomFuzz)
-}
-
-// RandString makes a random string up to 20 characters long. The returned string
-// may include a variety of (valid) UTF-8 encodings.
-func (c Continue) RandString() string {
- return randString(c.Rand)
-}
-
-// RandUint64 makes random 64 bit numbers.
-// Weirdly, rand doesn't have a function that gives you 64 random bits.
-func (c Continue) RandUint64() uint64 {
- return randUint64(c.Rand)
-}
-
-// RandBool returns true or false randomly.
-func (c Continue) RandBool() bool {
- return randBool(c.Rand)
-}
-
-func fuzzInt(v reflect.Value, r *rand.Rand) {
- v.SetInt(int64(randUint64(r)))
-}
-
-func fuzzUint(v reflect.Value, r *rand.Rand) {
- v.SetUint(randUint64(r))
-}
-
-func fuzzTime(t *time.Time, c Continue) {
- var sec, nsec int64
- // Allow for about 1000 years of random time values, which keeps things
- // like JSON parsing reasonably happy.
- sec = c.Rand.Int63n(1000 * 365 * 24 * 60 * 60)
- c.Fuzz(&nsec)
- *t = time.Unix(sec, nsec)
-}
-
-var fillFuncMap = map[reflect.Kind]func(reflect.Value, *rand.Rand){
- reflect.Bool: func(v reflect.Value, r *rand.Rand) {
- v.SetBool(randBool(r))
- },
- reflect.Int: fuzzInt,
- reflect.Int8: fuzzInt,
- reflect.Int16: fuzzInt,
- reflect.Int32: fuzzInt,
- reflect.Int64: fuzzInt,
- reflect.Uint: fuzzUint,
- reflect.Uint8: fuzzUint,
- reflect.Uint16: fuzzUint,
- reflect.Uint32: fuzzUint,
- reflect.Uint64: fuzzUint,
- reflect.Uintptr: fuzzUint,
- reflect.Float32: func(v reflect.Value, r *rand.Rand) {
- v.SetFloat(float64(r.Float32()))
- },
- reflect.Float64: func(v reflect.Value, r *rand.Rand) {
- v.SetFloat(r.Float64())
- },
- reflect.Complex64: func(v reflect.Value, r *rand.Rand) {
- v.SetComplex(complex128(complex(r.Float32(), r.Float32())))
- },
- reflect.Complex128: func(v reflect.Value, r *rand.Rand) {
- v.SetComplex(complex(r.Float64(), r.Float64()))
- },
- reflect.String: func(v reflect.Value, r *rand.Rand) {
- v.SetString(randString(r))
- },
- reflect.UnsafePointer: func(v reflect.Value, r *rand.Rand) {
- panic("unimplemented")
- },
-}
-
-// randBool returns true or false randomly.
-func randBool(r *rand.Rand) bool {
- return r.Int31()&(1<<30) == 0
-}
-
-type int63nPicker interface {
- Int63n(int64) int64
-}
-
-// UnicodeRange describes a sequential range of unicode characters.
-// Last must be numerically greater than First.
-type UnicodeRange struct {
- First, Last rune
-}
-
-// UnicodeRanges describes an arbitrary number of sequential ranges of unicode characters.
-// To be useful, each range must have at least one character (First <= Last) and
-// there must be at least one range.
-type UnicodeRanges []UnicodeRange
-
-// choose returns a random unicode character from the given range, using the
-// given randomness source.
-func (ur UnicodeRange) choose(r int63nPicker) rune {
- count := int64(ur.Last - ur.First + 1)
- return ur.First + rune(r.Int63n(count))
-}
-
-// CustomStringFuzzFunc constructs a FuzzFunc which produces random strings.
-// Each character is selected from the range ur. If there are no characters
-// in the range (cr.Last < cr.First), this will panic.
-func (ur UnicodeRange) CustomStringFuzzFunc() func(s *string, c Continue) {
- ur.check()
- return func(s *string, c Continue) {
- *s = ur.randString(c.Rand)
- }
-}
-
-// check is a function that used to check whether the first of ur(UnicodeRange)
-// is greater than the last one.
-func (ur UnicodeRange) check() {
- if ur.Last < ur.First {
- panic("The last encoding must be greater than the first one.")
- }
-}
-
-// randString of UnicodeRange makes a random string up to 20 characters long.
-// Each character is selected form ur(UnicodeRange).
-func (ur UnicodeRange) randString(r *rand.Rand) string {
- n := r.Intn(20)
- sb := strings.Builder{}
- sb.Grow(n)
- for i := 0; i < n; i++ {
- sb.WriteRune(ur.choose(r))
- }
- return sb.String()
-}
-
-// defaultUnicodeRanges sets a default unicode range when user do not set
-// CustomStringFuzzFunc() but wants fuzz string.
-var defaultUnicodeRanges = UnicodeRanges{
- {' ', '~'}, // ASCII characters
- {'\u00a0', '\u02af'}, // Multi-byte encoded characters
- {'\u4e00', '\u9fff'}, // Common CJK (even longer encodings)
-}
-
-// CustomStringFuzzFunc constructs a FuzzFunc which produces random strings.
-// Each character is selected from one of the ranges of ur(UnicodeRanges).
-// Each range has an equal probability of being chosen. If there are no ranges,
-// or a selected range has no characters (.Last < .First), this will panic.
-// Do not modify any of the ranges in ur after calling this function.
-func (ur UnicodeRanges) CustomStringFuzzFunc() func(s *string, c Continue) {
- // Check unicode ranges slice is empty.
- if len(ur) == 0 {
- panic("UnicodeRanges is empty.")
- }
- // if not empty, each range should be checked.
- for i := range ur {
- ur[i].check()
- }
- return func(s *string, c Continue) {
- *s = ur.randString(c.Rand)
- }
-}
-
-// randString of UnicodeRanges makes a random string up to 20 characters long.
-// Each character is selected form one of the ranges of ur(UnicodeRanges),
-// and each range has an equal probability of being chosen.
-func (ur UnicodeRanges) randString(r *rand.Rand) string {
- n := r.Intn(20)
- sb := strings.Builder{}
- sb.Grow(n)
- for i := 0; i < n; i++ {
- sb.WriteRune(ur[r.Intn(len(ur))].choose(r))
- }
- return sb.String()
-}
-
-// randString makes a random string up to 20 characters long. The returned string
-// may include a variety of (valid) UTF-8 encodings.
-func randString(r *rand.Rand) string {
- return defaultUnicodeRanges.randString(r)
-}
-
-// randUint64 makes random 64 bit numbers.
-// Weirdly, rand doesn't have a function that gives you 64 random bits.
-func randUint64(r *rand.Rand) uint64 {
- return uint64(r.Uint32())<<32 | uint64(r.Uint32())
-}
diff --git a/vendor/github.com/google/shlex/README b/vendor/github.com/google/shlex/README
deleted file mode 100644
index c86bcc066..000000000
--- a/vendor/github.com/google/shlex/README
+++ /dev/null
@@ -1,2 +0,0 @@
-go-shlex is a simple lexer for go that supports shell-style quoting,
-commenting, and escaping.
diff --git a/vendor/github.com/google/shlex/shlex.go b/vendor/github.com/google/shlex/shlex.go
deleted file mode 100644
index d98308bce..000000000
--- a/vendor/github.com/google/shlex/shlex.go
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
-Copyright 2012 Google Inc. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-/*
-Package shlex implements a simple lexer which splits input in to tokens using
-shell-style rules for quoting and commenting.
-
-The basic use case uses the default ASCII lexer to split a string into sub-strings:
-
- shlex.Split("one \"two three\" four") -> []string{"one", "two three", "four"}
-
-To process a stream of strings:
-
- l := NewLexer(os.Stdin)
- for ; token, err := l.Next(); err != nil {
- // process token
- }
-
-To access the raw token stream (which includes tokens for comments):
-
- t := NewTokenizer(os.Stdin)
- for ; token, err := t.Next(); err != nil {
- // process token
- }
-
-*/
-package shlex
-
-import (
- "bufio"
- "fmt"
- "io"
- "strings"
-)
-
-// TokenType is a top-level token classification: A word, space, comment, unknown.
-type TokenType int
-
-// runeTokenClass is the type of a UTF-8 character classification: A quote, space, escape.
-type runeTokenClass int
-
-// the internal state used by the lexer state machine
-type lexerState int
-
-// Token is a (type, value) pair representing a lexographical token.
-type Token struct {
- tokenType TokenType
- value string
-}
-
-// Equal reports whether tokens a, and b, are equal.
-// Two tokens are equal if both their types and values are equal. A nil token can
-// never be equal to another token.
-func (a *Token) Equal(b *Token) bool {
- if a == nil || b == nil {
- return false
- }
- if a.tokenType != b.tokenType {
- return false
- }
- return a.value == b.value
-}
-
-// Named classes of UTF-8 runes
-const (
- spaceRunes = " \t\r\n"
- escapingQuoteRunes = `"`
- nonEscapingQuoteRunes = "'"
- escapeRunes = `\`
- commentRunes = "#"
-)
-
-// Classes of rune token
-const (
- unknownRuneClass runeTokenClass = iota
- spaceRuneClass
- escapingQuoteRuneClass
- nonEscapingQuoteRuneClass
- escapeRuneClass
- commentRuneClass
- eofRuneClass
-)
-
-// Classes of lexographic token
-const (
- UnknownToken TokenType = iota
- WordToken
- SpaceToken
- CommentToken
-)
-
-// Lexer state machine states
-const (
- startState lexerState = iota // no runes have been seen
- inWordState // processing regular runes in a word
- escapingState // we have just consumed an escape rune; the next rune is literal
- escapingQuotedState // we have just consumed an escape rune within a quoted string
- quotingEscapingState // we are within a quoted string that supports escaping ("...")
- quotingState // we are within a string that does not support escaping ('...')
- commentState // we are within a comment (everything following an unquoted or unescaped #
-)
-
-// tokenClassifier is used for classifying rune characters.
-type tokenClassifier map[rune]runeTokenClass
-
-func (typeMap tokenClassifier) addRuneClass(runes string, tokenType runeTokenClass) {
- for _, runeChar := range runes {
- typeMap[runeChar] = tokenType
- }
-}
-
-// newDefaultClassifier creates a new classifier for ASCII characters.
-func newDefaultClassifier() tokenClassifier {
- t := tokenClassifier{}
- t.addRuneClass(spaceRunes, spaceRuneClass)
- t.addRuneClass(escapingQuoteRunes, escapingQuoteRuneClass)
- t.addRuneClass(nonEscapingQuoteRunes, nonEscapingQuoteRuneClass)
- t.addRuneClass(escapeRunes, escapeRuneClass)
- t.addRuneClass(commentRunes, commentRuneClass)
- return t
-}
-
-// ClassifyRune classifiees a rune
-func (t tokenClassifier) ClassifyRune(runeVal rune) runeTokenClass {
- return t[runeVal]
-}
-
-// Lexer turns an input stream into a sequence of tokens. Whitespace and comments are skipped.
-type Lexer Tokenizer
-
-// NewLexer creates a new lexer from an input stream.
-func NewLexer(r io.Reader) *Lexer {
-
- return (*Lexer)(NewTokenizer(r))
-}
-
-// Next returns the next word, or an error. If there are no more words,
-// the error will be io.EOF.
-func (l *Lexer) Next() (string, error) {
- for {
- token, err := (*Tokenizer)(l).Next()
- if err != nil {
- return "", err
- }
- switch token.tokenType {
- case WordToken:
- return token.value, nil
- case CommentToken:
- // skip comments
- default:
- return "", fmt.Errorf("Unknown token type: %v", token.tokenType)
- }
- }
-}
-
-// Tokenizer turns an input stream into a sequence of typed tokens
-type Tokenizer struct {
- input bufio.Reader
- classifier tokenClassifier
-}
-
-// NewTokenizer creates a new tokenizer from an input stream.
-func NewTokenizer(r io.Reader) *Tokenizer {
- input := bufio.NewReader(r)
- classifier := newDefaultClassifier()
- return &Tokenizer{
- input: *input,
- classifier: classifier}
-}
-
-// scanStream scans the stream for the next token using the internal state machine.
-// It will panic if it encounters a rune which it does not know how to handle.
-func (t *Tokenizer) scanStream() (*Token, error) {
- state := startState
- var tokenType TokenType
- var value []rune
- var nextRune rune
- var nextRuneType runeTokenClass
- var err error
-
- for {
- nextRune, _, err = t.input.ReadRune()
- nextRuneType = t.classifier.ClassifyRune(nextRune)
-
- if err == io.EOF {
- nextRuneType = eofRuneClass
- err = nil
- } else if err != nil {
- return nil, err
- }
-
- switch state {
- case startState: // no runes read yet
- {
- switch nextRuneType {
- case eofRuneClass:
- {
- return nil, io.EOF
- }
- case spaceRuneClass:
- {
- }
- case escapingQuoteRuneClass:
- {
- tokenType = WordToken
- state = quotingEscapingState
- }
- case nonEscapingQuoteRuneClass:
- {
- tokenType = WordToken
- state = quotingState
- }
- case escapeRuneClass:
- {
- tokenType = WordToken
- state = escapingState
- }
- case commentRuneClass:
- {
- tokenType = CommentToken
- state = commentState
- }
- default:
- {
- tokenType = WordToken
- value = append(value, nextRune)
- state = inWordState
- }
- }
- }
- case inWordState: // in a regular word
- {
- switch nextRuneType {
- case eofRuneClass:
- {
- token := &Token{
- tokenType: tokenType,
- value: string(value)}
- return token, err
- }
- case spaceRuneClass:
- {
- token := &Token{
- tokenType: tokenType,
- value: string(value)}
- return token, err
- }
- case escapingQuoteRuneClass:
- {
- state = quotingEscapingState
- }
- case nonEscapingQuoteRuneClass:
- {
- state = quotingState
- }
- case escapeRuneClass:
- {
- state = escapingState
- }
- default:
- {
- value = append(value, nextRune)
- }
- }
- }
- case escapingState: // the rune after an escape character
- {
- switch nextRuneType {
- case eofRuneClass:
- {
- err = fmt.Errorf("EOF found after escape character")
- token := &Token{
- tokenType: tokenType,
- value: string(value)}
- return token, err
- }
- default:
- {
- state = inWordState
- value = append(value, nextRune)
- }
- }
- }
- case escapingQuotedState: // the next rune after an escape character, in double quotes
- {
- switch nextRuneType {
- case eofRuneClass:
- {
- err = fmt.Errorf("EOF found after escape character")
- token := &Token{
- tokenType: tokenType,
- value: string(value)}
- return token, err
- }
- default:
- {
- state = quotingEscapingState
- value = append(value, nextRune)
- }
- }
- }
- case quotingEscapingState: // in escaping double quotes
- {
- switch nextRuneType {
- case eofRuneClass:
- {
- err = fmt.Errorf("EOF found when expecting closing quote")
- token := &Token{
- tokenType: tokenType,
- value: string(value)}
- return token, err
- }
- case escapingQuoteRuneClass:
- {
- state = inWordState
- }
- case escapeRuneClass:
- {
- state = escapingQuotedState
- }
- default:
- {
- value = append(value, nextRune)
- }
- }
- }
- case quotingState: // in non-escaping single quotes
- {
- switch nextRuneType {
- case eofRuneClass:
- {
- err = fmt.Errorf("EOF found when expecting closing quote")
- token := &Token{
- tokenType: tokenType,
- value: string(value)}
- return token, err
- }
- case nonEscapingQuoteRuneClass:
- {
- state = inWordState
- }
- default:
- {
- value = append(value, nextRune)
- }
- }
- }
- case commentState: // in a comment
- {
- switch nextRuneType {
- case eofRuneClass:
- {
- token := &Token{
- tokenType: tokenType,
- value: string(value)}
- return token, err
- }
- case spaceRuneClass:
- {
- if nextRune == '\n' {
- state = startState
- token := &Token{
- tokenType: tokenType,
- value: string(value)}
- return token, err
- } else {
- value = append(value, nextRune)
- }
- }
- default:
- {
- value = append(value, nextRune)
- }
- }
- }
- default:
- {
- return nil, fmt.Errorf("Unexpected state: %v", state)
- }
- }
- }
-}
-
-// Next returns the next token in the stream.
-func (t *Tokenizer) Next() (*Token, error) {
- return t.scanStream()
-}
-
-// Split partitions a string into a slice of strings.
-func Split(s string) ([]string, error) {
- l := NewLexer(strings.NewReader(s))
- subStrings := make([]string, 0)
- for {
- word, err := l.Next()
- if err != nil {
- if err == io.EOF {
- return subStrings, nil
- }
- return subStrings, err
- }
- subStrings = append(subStrings, word)
- }
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.gitignore b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.gitignore
deleted file mode 100644
index 2233cff9d..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.gitignore
+++ /dev/null
@@ -1,201 +0,0 @@
-#vendor
-vendor/
-
-# Created by .ignore support plugin (hsz.mobi)
-coverage.txt
-### Go template
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-*.test
-*.prof
-### Windows template
-# Windows image file caches
-Thumbs.db
-ehthumbs.db
-
-# Folder config file
-Desktop.ini
-
-# Recycle Bin used on file shares
-$RECYCLE.BIN/
-
-# Windows Installer files
-*.cab
-*.msi
-*.msm
-*.msp
-
-# Windows shortcuts
-*.lnk
-### Kate template
-# Swap Files #
-.*.kate-swp
-.swp.*
-### SublimeText template
-# cache files for sublime text
-*.tmlanguage.cache
-*.tmPreferences.cache
-*.stTheme.cache
-
-# workspace files are user-specific
-*.sublime-workspace
-
-# project files should be checked into the repository, unless a significant
-# proportion of contributors will probably not be using SublimeText
-# *.sublime-project
-
-# sftp configuration file
-sftp-config.json
-### Linux template
-*~
-
-# temporary files which can be created if a process still has a handle open of a deleted file
-.fuse_hidden*
-
-# KDE directory preferences
-.directory
-
-# Linux trash folder which might appear on any partition or disk
-.Trash-*
-### JetBrains template
-# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
-# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
-
-# User-specific stuff:
-.idea
-.idea/tasks.xml
-.idea/dictionaries
-.idea/vcs.xml
-.idea/jsLibraryMappings.xml
-
-# Sensitive or high-churn files:
-.idea/dataSources.ids
-.idea/dataSources.xml
-.idea/dataSources.local.xml
-.idea/sqlDataSources.xml
-.idea/dynamic.xml
-.idea/uiDesigner.xml
-
-# Gradle:
-.idea/gradle.xml
-.idea/libraries
-
-# Mongo Explorer plugin:
-.idea/mongoSettings.xml
-
-## File-based project format:
-*.iws
-
-## Plugin-specific files:
-
-# IntelliJ
-/out/
-
-# mpeltonen/sbt-idea plugin
-.idea_modules/
-
-# JIRA plugin
-atlassian-ide-plugin.xml
-
-# Crashlytics plugin (for Android Studio and IntelliJ)
-com_crashlytics_export_strings.xml
-crashlytics.properties
-crashlytics-build.properties
-fabric.properties
-### Xcode template
-# Xcode
-#
-# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
-
-## Build generated
-build/
-DerivedData/
-
-## Various settings
-*.pbxuser
-!default.pbxuser
-*.mode1v3
-!default.mode1v3
-*.mode2v3
-!default.mode2v3
-*.perspectivev3
-!default.perspectivev3
-xcuserdata/
-
-## Other
-*.moved-aside
-*.xccheckout
-*.xcscmblueprint
-### Eclipse template
-
-.metadata
-bin/
-tmp/
-*.tmp
-*.bak
-*.swp
-*~.nib
-local.properties
-.settings/
-.loadpath
-.recommenders
-
-# Eclipse Core
-.project
-
-# External tool builders
-.externalToolBuilders/
-
-# Locally stored "Eclipse launch configurations"
-*.launch
-
-# PyDev specific (Python IDE for Eclipse)
-*.pydevproject
-
-# CDT-specific (C/C++ Development Tooling)
-.cproject
-
-# JDT-specific (Eclipse Java Development Tools)
-.classpath
-
-# Java annotation processor (APT)
-.factorypath
-
-# PDT-specific (PHP Development Tools)
-.buildpath
-
-# sbteclipse plugin
-.target
-
-# Tern plugin
-.tern-project
-
-# TeXlipse plugin
-.texlipse
-
-# STS (Spring Tool Suite)
-.springBeans
-
-# Code Recommenders
-.recommenders/
-
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.travis.yml b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.travis.yml
deleted file mode 100644
index 2a845b96a..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.travis.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-sudo: false
-language: go
-# * github.com/grpc/grpc-go still supports go1.6
-# - When we drop support for go1.6 we can remove golang.org/x/net/context
-# below as it is part of the Go std library since go1.7
-# * github.com/prometheus/client_golang already requires at least go1.7 since
-# September 2017
-go:
- - 1.6.x
- - 1.7.x
- - 1.8.x
- - 1.9.x
- - 1.10.x
- - master
-
-install:
- - go get github.com/prometheus/client_golang/prometheus
- - go get google.golang.org/grpc
- - go get golang.org/x/net/context
- - go get github.com/stretchr/testify
-script:
- - make test
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/CHANGELOG.md b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/CHANGELOG.md
deleted file mode 100644
index 19a8059e1..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/CHANGELOG.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# Changelog
-All notable changes to this project will be documented in this file.
-
-The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
-and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
-
-## [Unreleased]
-
-## [1.2.0](https://github.com/grpc-ecosystem/go-grpc-prometheus/releases/tag/v1.2.0) - 2018-06-04
-
-### Added
-
-* Provide metrics object as `prometheus.Collector`, for conventional metric registration.
-* Support non-default/global Prometheus registry.
-* Allow configuring counters with `prometheus.CounterOpts`.
-
-### Changed
-
-* Remove usage of deprecated `grpc.Code()`.
-* Remove usage of deprecated `grpc.Errorf` and replace with `status.Errorf`.
-
----
-
-This changelog was started with version `v1.2.0`, for earlier versions refer to the respective [GitHub releases](https://github.com/grpc-ecosystem/go-grpc-prometheus/releases).
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE
deleted file mode 100644
index b2b065037..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/README.md b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/README.md
deleted file mode 100644
index 499c58355..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/README.md
+++ /dev/null
@@ -1,247 +0,0 @@
-# Go gRPC Interceptors for Prometheus monitoring
-
-[](https://travis-ci.org/grpc-ecosystem/go-grpc-prometheus)
-[](http://goreportcard.com/report/grpc-ecosystem/go-grpc-prometheus)
-[](https://godoc.org/github.com/grpc-ecosystem/go-grpc-prometheus)
-[](https://sourcegraph.com/github.com/grpc-ecosystem/go-grpc-prometheus/?badge)
-[](https://codecov.io/gh/grpc-ecosystem/go-grpc-prometheus)
-[](LICENSE)
-
-[Prometheus](https://prometheus.io/) monitoring for your [gRPC Go](https://github.com/grpc/grpc-go) servers and clients.
-
-A sister implementation for [gRPC Java](https://github.com/grpc/grpc-java) (same metrics, same semantics) is in [grpc-ecosystem/java-grpc-prometheus](https://github.com/grpc-ecosystem/java-grpc-prometheus).
-
-## Interceptors
-
-[gRPC Go](https://github.com/grpc/grpc-go) recently acquired support for Interceptors, i.e. middleware that is executed
-by a gRPC Server before the request is passed onto the user's application logic. It is a perfect way to implement
-common patterns: auth, logging and... monitoring.
-
-To use Interceptors in chains, please see [`go-grpc-middleware`](https://github.com/mwitkow/go-grpc-middleware).
-
-## Usage
-
-There are two types of interceptors: client-side and server-side. This package provides monitoring Interceptors for both.
-
-### Server-side
-
-```go
-import "github.com/grpc-ecosystem/go-grpc-prometheus"
-...
- // Initialize your gRPC server's interceptor.
- myServer := grpc.NewServer(
- grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor),
- grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),
- )
- // Register your gRPC service implementations.
- myservice.RegisterMyServiceServer(s.server, &myServiceImpl{})
- // After all your registrations, make sure all of the Prometheus metrics are initialized.
- grpc_prometheus.Register(myServer)
- // Register Prometheus metrics handler.
- http.Handle("/metrics", promhttp.Handler())
-...
-```
-
-### Client-side
-
-```go
-import "github.com/grpc-ecosystem/go-grpc-prometheus"
-...
- clientConn, err = grpc.Dial(
- address,
- grpc.WithUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor),
- grpc.WithStreamInterceptor(grpc_prometheus.StreamClientInterceptor)
- )
- client = pb_testproto.NewTestServiceClient(clientConn)
- resp, err := client.PingEmpty(s.ctx, &myservice.Request{Msg: "hello"})
-...
-```
-
-# Metrics
-
-## Labels
-
-All server-side metrics start with `grpc_server` as Prometheus subsystem name. All client-side metrics start with `grpc_client`. Both of them have mirror-concepts. Similarly all methods
-contain the same rich labels:
-
- * `grpc_service` - the [gRPC service](http://www.grpc.io/docs/#defining-a-service) name, which is the combination of protobuf `package` and
- the `grpc_service` section name. E.g. for `package = mwitkow.testproto` and
- `service TestService` the label will be `grpc_service="mwitkow.testproto.TestService"`
- * `grpc_method` - the name of the method called on the gRPC service. E.g.
- `grpc_method="Ping"`
- * `grpc_type` - the gRPC [type of request](http://www.grpc.io/docs/guides/concepts.html#rpc-life-cycle).
- Differentiating between the two is important especially for latency measurements.
-
- - `unary` is single request, single response RPC
- - `client_stream` is a multi-request, single response RPC
- - `server_stream` is a single request, multi-response RPC
- - `bidi_stream` is a multi-request, multi-response RPC
-
-
-Additionally for completed RPCs, the following labels are used:
-
- * `grpc_code` - the human-readable [gRPC status code](https://github.com/grpc/grpc-go/blob/master/codes/codes.go).
- The list of all statuses is to long, but here are some common ones:
-
- - `OK` - means the RPC was successful
- - `IllegalArgument` - RPC contained bad values
- - `Internal` - server-side error not disclosed to the clients
-
-## Counters
-
-The counters and their up to date documentation is in [server_reporter.go](server_reporter.go) and [client_reporter.go](client_reporter.go)
-the respective Prometheus handler (usually `/metrics`).
-
-For the purpose of this documentation we will only discuss `grpc_server` metrics. The `grpc_client` ones contain mirror concepts.
-
-For simplicity, let's assume we're tracking a single server-side RPC call of [`mwitkow.testproto.TestService`](examples/testproto/test.proto),
-calling the method `PingList`. The call succeeds and returns 20 messages in the stream.
-
-First, immediately after the server receives the call it will increment the
-`grpc_server_started_total` and start the handling time clock (if histograms are enabled).
-
-```jsoniq
-grpc_server_started_total{grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1
-```
-
-Then the user logic gets invoked. It receives one message from the client containing the request
-(it's a `server_stream`):
-
-```jsoniq
-grpc_server_msg_received_total{grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1
-```
-
-The user logic may return an error, or send multiple messages back to the client. In this case, on
-each of the 20 messages sent back, a counter will be incremented:
-
-```jsoniq
-grpc_server_msg_sent_total{grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 20
-```
-
-After the call completes, its status (`OK` or other [gRPC status code](https://github.com/grpc/grpc-go/blob/master/codes/codes.go))
-and the relevant call labels increment the `grpc_server_handled_total` counter.
-
-```jsoniq
-grpc_server_handled_total{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1
-```
-
-## Histograms
-
-[Prometheus histograms](https://prometheus.io/docs/concepts/metric_types/#histogram) are a great way
-to measure latency distributions of your RPCs. However, since it is bad practice to have metrics
-of [high cardinality](https://prometheus.io/docs/practices/instrumentation/#do-not-overuse-labels)
-the latency monitoring metrics are disabled by default. To enable them please call the following
-in your server initialization code:
-
-```jsoniq
-grpc_prometheus.EnableHandlingTimeHistogram()
-```
-
-After the call completes, its handling time will be recorded in a [Prometheus histogram](https://prometheus.io/docs/concepts/metric_types/#histogram)
-variable `grpc_server_handling_seconds`. The histogram variable contains three sub-metrics:
-
- * `grpc_server_handling_seconds_count` - the count of all completed RPCs by status and method
- * `grpc_server_handling_seconds_sum` - cumulative time of RPCs by status and method, useful for
- calculating average handling times
- * `grpc_server_handling_seconds_bucket` - contains the counts of RPCs by status and method in respective
- handling-time buckets. These buckets can be used by Prometheus to estimate SLAs (see [here](https://prometheus.io/docs/practices/histograms/))
-
-The counter values will look as follows:
-
-```jsoniq
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.005"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.01"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.025"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.05"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.1"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.25"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.5"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="1"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="2.5"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="5"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="10"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="+Inf"} 1
-grpc_server_handling_seconds_sum{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 0.0003866430000000001
-grpc_server_handling_seconds_count{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1
-```
-
-
-## Useful query examples
-
-Prometheus philosophy is to provide raw metrics to the monitoring system, and
-let the aggregations be handled there. The verbosity of above metrics make it possible to have that
-flexibility. Here's a couple of useful monitoring queries:
-
-
-### request inbound rate
-```jsoniq
-sum(rate(grpc_server_started_total{job="foo"}[1m])) by (grpc_service)
-```
-For `job="foo"` (common label to differentiate between Prometheus monitoring targets), calculate the
-rate of requests per second (1 minute window) for each gRPC `grpc_service` that the job has. Please note
-how the `grpc_method` is being omitted here: all methods of a given gRPC service will be summed together.
-
-### unary request error rate
-```jsoniq
-sum(rate(grpc_server_handled_total{job="foo",grpc_type="unary",grpc_code!="OK"}[1m])) by (grpc_service)
-```
-For `job="foo"`, calculate the per-`grpc_service` rate of `unary` (1:1) RPCs that failed, i.e. the
-ones that didn't finish with `OK` code.
-
-### unary request error percentage
-```jsoniq
-sum(rate(grpc_server_handled_total{job="foo",grpc_type="unary",grpc_code!="OK"}[1m])) by (grpc_service)
- /
-sum(rate(grpc_server_started_total{job="foo",grpc_type="unary"}[1m])) by (grpc_service)
- * 100.0
-```
-For `job="foo"`, calculate the percentage of failed requests by service. It's easy to notice that
-this is a combination of the two above examples. This is an example of a query you would like to
-[alert on](https://prometheus.io/docs/alerting/rules/) in your system for SLA violations, e.g.
-"no more than 1% requests should fail".
-
-### average response stream size
-```jsoniq
-sum(rate(grpc_server_msg_sent_total{job="foo",grpc_type="server_stream"}[10m])) by (grpc_service)
- /
-sum(rate(grpc_server_started_total{job="foo",grpc_type="server_stream"}[10m])) by (grpc_service)
-```
-For `job="foo"` what is the `grpc_service`-wide `10m` average of messages returned for all `
-server_stream` RPCs. This allows you to track the stream sizes returned by your system, e.g. allows
-you to track when clients started to send "wide" queries that ret
-Note the divisor is the number of started RPCs, in order to account for in-flight requests.
-
-### 99%-tile latency of unary requests
-```jsoniq
-histogram_quantile(0.99,
- sum(rate(grpc_server_handling_seconds_bucket{job="foo",grpc_type="unary"}[5m])) by (grpc_service,le)
-)
-```
-For `job="foo"`, returns an 99%-tile [quantile estimation](https://prometheus.io/docs/practices/histograms/#quantiles)
-of the handling time of RPCs per service. Please note the `5m` rate, this means that the quantile
-estimation will take samples in a rolling `5m` window. When combined with other quantiles
-(e.g. 50%, 90%), this query gives you tremendous insight into the responsiveness of your system
-(e.g. impact of caching).
-
-### percentage of slow unary queries (>250ms)
-```jsoniq
-100.0 - (
-sum(rate(grpc_server_handling_seconds_bucket{job="foo",grpc_type="unary",le="0.25"}[5m])) by (grpc_service)
- /
-sum(rate(grpc_server_handling_seconds_count{job="foo",grpc_type="unary"}[5m])) by (grpc_service)
-) * 100.0
-```
-For `job="foo"` calculate the by-`grpc_service` fraction of slow requests that took longer than `0.25`
-seconds. This query is relatively complex, since the Prometheus aggregations use `le` (less or equal)
-buckets, meaning that counting "fast" requests fractions is easier. However, simple maths helps.
-This is an example of a query you would like to alert on in your system for SLA violations,
-e.g. "less than 1% of requests are slower than 250ms".
-
-
-## Status
-
-This code has been used since August 2015 as the basis for monitoring of *production* gRPC micro services at [Improbable](https://improbable.io).
-
-## License
-
-`go-grpc-prometheus` is released under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client.go
deleted file mode 100644
index 751a4c72d..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-// gRPC Prometheus monitoring interceptors for client-side gRPC.
-
-package grpc_prometheus
-
-import (
- prom "github.com/prometheus/client_golang/prometheus"
-)
-
-var (
- // DefaultClientMetrics is the default instance of ClientMetrics. It is
- // intended to be used in conjunction the default Prometheus metrics
- // registry.
- DefaultClientMetrics = NewClientMetrics()
-
- // UnaryClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Unary RPCs.
- UnaryClientInterceptor = DefaultClientMetrics.UnaryClientInterceptor()
-
- // StreamClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Streaming RPCs.
- StreamClientInterceptor = DefaultClientMetrics.StreamClientInterceptor()
-)
-
-func init() {
- prom.MustRegister(DefaultClientMetrics.clientStartedCounter)
- prom.MustRegister(DefaultClientMetrics.clientHandledCounter)
- prom.MustRegister(DefaultClientMetrics.clientStreamMsgReceived)
- prom.MustRegister(DefaultClientMetrics.clientStreamMsgSent)
-}
-
-// EnableClientHandlingTimeHistogram turns on recording of handling time of
-// RPCs. Histogram metrics can be very expensive for Prometheus to retain and
-// query. This function acts on the DefaultClientMetrics variable and the
-// default Prometheus metrics registry.
-func EnableClientHandlingTimeHistogram(opts ...HistogramOption) {
- DefaultClientMetrics.EnableClientHandlingTimeHistogram(opts...)
- prom.Register(DefaultClientMetrics.clientHandledHistogram)
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_metrics.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_metrics.go
deleted file mode 100644
index 9b476f983..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_metrics.go
+++ /dev/null
@@ -1,170 +0,0 @@
-package grpc_prometheus
-
-import (
- "io"
-
- prom "github.com/prometheus/client_golang/prometheus"
- "golang.org/x/net/context"
- "google.golang.org/grpc"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
-)
-
-// ClientMetrics represents a collection of metrics to be registered on a
-// Prometheus metrics registry for a gRPC client.
-type ClientMetrics struct {
- clientStartedCounter *prom.CounterVec
- clientHandledCounter *prom.CounterVec
- clientStreamMsgReceived *prom.CounterVec
- clientStreamMsgSent *prom.CounterVec
- clientHandledHistogramEnabled bool
- clientHandledHistogramOpts prom.HistogramOpts
- clientHandledHistogram *prom.HistogramVec
-}
-
-// NewClientMetrics returns a ClientMetrics object. Use a new instance of
-// ClientMetrics when not using the default Prometheus metrics registry, for
-// example when wanting to control which metrics are added to a registry as
-// opposed to automatically adding metrics via init functions.
-func NewClientMetrics(counterOpts ...CounterOption) *ClientMetrics {
- opts := counterOptions(counterOpts)
- return &ClientMetrics{
- clientStartedCounter: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_client_started_total",
- Help: "Total number of RPCs started on the client.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
-
- clientHandledCounter: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_client_handled_total",
- Help: "Total number of RPCs completed by the client, regardless of success or failure.",
- }), []string{"grpc_type", "grpc_service", "grpc_method", "grpc_code"}),
-
- clientStreamMsgReceived: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_client_msg_received_total",
- Help: "Total number of RPC stream messages received by the client.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
-
- clientStreamMsgSent: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_client_msg_sent_total",
- Help: "Total number of gRPC stream messages sent by the client.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
-
- clientHandledHistogramEnabled: false,
- clientHandledHistogramOpts: prom.HistogramOpts{
- Name: "grpc_client_handling_seconds",
- Help: "Histogram of response latency (seconds) of the gRPC until it is finished by the application.",
- Buckets: prom.DefBuckets,
- },
- clientHandledHistogram: nil,
- }
-}
-
-// Describe sends the super-set of all possible descriptors of metrics
-// collected by this Collector to the provided channel and returns once
-// the last descriptor has been sent.
-func (m *ClientMetrics) Describe(ch chan<- *prom.Desc) {
- m.clientStartedCounter.Describe(ch)
- m.clientHandledCounter.Describe(ch)
- m.clientStreamMsgReceived.Describe(ch)
- m.clientStreamMsgSent.Describe(ch)
- if m.clientHandledHistogramEnabled {
- m.clientHandledHistogram.Describe(ch)
- }
-}
-
-// Collect is called by the Prometheus registry when collecting
-// metrics. The implementation sends each collected metric via the
-// provided channel and returns once the last metric has been sent.
-func (m *ClientMetrics) Collect(ch chan<- prom.Metric) {
- m.clientStartedCounter.Collect(ch)
- m.clientHandledCounter.Collect(ch)
- m.clientStreamMsgReceived.Collect(ch)
- m.clientStreamMsgSent.Collect(ch)
- if m.clientHandledHistogramEnabled {
- m.clientHandledHistogram.Collect(ch)
- }
-}
-
-// EnableClientHandlingTimeHistogram turns on recording of handling time of RPCs.
-// Histogram metrics can be very expensive for Prometheus to retain and query.
-func (m *ClientMetrics) EnableClientHandlingTimeHistogram(opts ...HistogramOption) {
- for _, o := range opts {
- o(&m.clientHandledHistogramOpts)
- }
- if !m.clientHandledHistogramEnabled {
- m.clientHandledHistogram = prom.NewHistogramVec(
- m.clientHandledHistogramOpts,
- []string{"grpc_type", "grpc_service", "grpc_method"},
- )
- }
- m.clientHandledHistogramEnabled = true
-}
-
-// UnaryClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Unary RPCs.
-func (m *ClientMetrics) UnaryClientInterceptor() func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
- return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
- monitor := newClientReporter(m, Unary, method)
- monitor.SentMessage()
- err := invoker(ctx, method, req, reply, cc, opts...)
- if err != nil {
- monitor.ReceivedMessage()
- }
- st, _ := status.FromError(err)
- monitor.Handled(st.Code())
- return err
- }
-}
-
-// StreamClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Streaming RPCs.
-func (m *ClientMetrics) StreamClientInterceptor() func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
- return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
- monitor := newClientReporter(m, clientStreamType(desc), method)
- clientStream, err := streamer(ctx, desc, cc, method, opts...)
- if err != nil {
- st, _ := status.FromError(err)
- monitor.Handled(st.Code())
- return nil, err
- }
- return &monitoredClientStream{clientStream, monitor}, nil
- }
-}
-
-func clientStreamType(desc *grpc.StreamDesc) grpcType {
- if desc.ClientStreams && !desc.ServerStreams {
- return ClientStream
- } else if !desc.ClientStreams && desc.ServerStreams {
- return ServerStream
- }
- return BidiStream
-}
-
-// monitoredClientStream wraps grpc.ClientStream allowing each Sent/Recv of message to increment counters.
-type monitoredClientStream struct {
- grpc.ClientStream
- monitor *clientReporter
-}
-
-func (s *monitoredClientStream) SendMsg(m interface{}) error {
- err := s.ClientStream.SendMsg(m)
- if err == nil {
- s.monitor.SentMessage()
- }
- return err
-}
-
-func (s *monitoredClientStream) RecvMsg(m interface{}) error {
- err := s.ClientStream.RecvMsg(m)
- if err == nil {
- s.monitor.ReceivedMessage()
- } else if err == io.EOF {
- s.monitor.Handled(codes.OK)
- } else {
- st, _ := status.FromError(err)
- s.monitor.Handled(st.Code())
- }
- return err
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_reporter.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_reporter.go
deleted file mode 100644
index cbf153229..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_reporter.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-package grpc_prometheus
-
-import (
- "time"
-
- "google.golang.org/grpc/codes"
-)
-
-type clientReporter struct {
- metrics *ClientMetrics
- rpcType grpcType
- serviceName string
- methodName string
- startTime time.Time
-}
-
-func newClientReporter(m *ClientMetrics, rpcType grpcType, fullMethod string) *clientReporter {
- r := &clientReporter{
- metrics: m,
- rpcType: rpcType,
- }
- if r.metrics.clientHandledHistogramEnabled {
- r.startTime = time.Now()
- }
- r.serviceName, r.methodName = splitMethodName(fullMethod)
- r.metrics.clientStartedCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
- return r
-}
-
-func (r *clientReporter) ReceivedMessage() {
- r.metrics.clientStreamMsgReceived.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
-}
-
-func (r *clientReporter) SentMessage() {
- r.metrics.clientStreamMsgSent.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
-}
-
-func (r *clientReporter) Handled(code codes.Code) {
- r.metrics.clientHandledCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName, code.String()).Inc()
- if r.metrics.clientHandledHistogramEnabled {
- r.metrics.clientHandledHistogram.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Observe(time.Since(r.startTime).Seconds())
- }
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/makefile b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/makefile
deleted file mode 100644
index 74c084223..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-SHELL="/bin/bash"
-
-GOFILES_NOVENDOR = $(shell go list ./... | grep -v /vendor/)
-
-all: vet fmt test
-
-fmt:
- go fmt $(GOFILES_NOVENDOR)
-
-vet:
- go vet $(GOFILES_NOVENDOR)
-
-test: vet
- ./scripts/test_all.sh
-
-.PHONY: all vet test
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/metric_options.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/metric_options.go
deleted file mode 100644
index 9d51aec98..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/metric_options.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package grpc_prometheus
-
-import (
- prom "github.com/prometheus/client_golang/prometheus"
-)
-
-// A CounterOption lets you add options to Counter metrics using With* funcs.
-type CounterOption func(*prom.CounterOpts)
-
-type counterOptions []CounterOption
-
-func (co counterOptions) apply(o prom.CounterOpts) prom.CounterOpts {
- for _, f := range co {
- f(&o)
- }
- return o
-}
-
-// WithConstLabels allows you to add ConstLabels to Counter metrics.
-func WithConstLabels(labels prom.Labels) CounterOption {
- return func(o *prom.CounterOpts) {
- o.ConstLabels = labels
- }
-}
-
-// A HistogramOption lets you add options to Histogram metrics using With*
-// funcs.
-type HistogramOption func(*prom.HistogramOpts)
-
-// WithHistogramBuckets allows you to specify custom bucket ranges for histograms if EnableHandlingTimeHistogram is on.
-func WithHistogramBuckets(buckets []float64) HistogramOption {
- return func(o *prom.HistogramOpts) { o.Buckets = buckets }
-}
-
-// WithHistogramConstLabels allows you to add custom ConstLabels to
-// histograms metrics.
-func WithHistogramConstLabels(labels prom.Labels) HistogramOption {
- return func(o *prom.HistogramOpts) {
- o.ConstLabels = labels
- }
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server.go
deleted file mode 100644
index 322f99046..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-// gRPC Prometheus monitoring interceptors for server-side gRPC.
-
-package grpc_prometheus
-
-import (
- prom "github.com/prometheus/client_golang/prometheus"
- "google.golang.org/grpc"
-)
-
-var (
- // DefaultServerMetrics is the default instance of ServerMetrics. It is
- // intended to be used in conjunction the default Prometheus metrics
- // registry.
- DefaultServerMetrics = NewServerMetrics()
-
- // UnaryServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Unary RPCs.
- UnaryServerInterceptor = DefaultServerMetrics.UnaryServerInterceptor()
-
- // StreamServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Streaming RPCs.
- StreamServerInterceptor = DefaultServerMetrics.StreamServerInterceptor()
-)
-
-func init() {
- prom.MustRegister(DefaultServerMetrics.serverStartedCounter)
- prom.MustRegister(DefaultServerMetrics.serverHandledCounter)
- prom.MustRegister(DefaultServerMetrics.serverStreamMsgReceived)
- prom.MustRegister(DefaultServerMetrics.serverStreamMsgSent)
-}
-
-// Register takes a gRPC server and pre-initializes all counters to 0. This
-// allows for easier monitoring in Prometheus (no missing metrics), and should
-// be called *after* all services have been registered with the server. This
-// function acts on the DefaultServerMetrics variable.
-func Register(server *grpc.Server) {
- DefaultServerMetrics.InitializeMetrics(server)
-}
-
-// EnableHandlingTimeHistogram turns on recording of handling time
-// of RPCs. Histogram metrics can be very expensive for Prometheus
-// to retain and query. This function acts on the DefaultServerMetrics
-// variable and the default Prometheus metrics registry.
-func EnableHandlingTimeHistogram(opts ...HistogramOption) {
- DefaultServerMetrics.EnableHandlingTimeHistogram(opts...)
- prom.Register(DefaultServerMetrics.serverHandledHistogram)
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go
deleted file mode 100644
index 5b1467e7a..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go
+++ /dev/null
@@ -1,185 +0,0 @@
-package grpc_prometheus
-
-import (
- prom "github.com/prometheus/client_golang/prometheus"
- "golang.org/x/net/context"
- "google.golang.org/grpc"
- "google.golang.org/grpc/status"
-)
-
-// ServerMetrics represents a collection of metrics to be registered on a
-// Prometheus metrics registry for a gRPC server.
-type ServerMetrics struct {
- serverStartedCounter *prom.CounterVec
- serverHandledCounter *prom.CounterVec
- serverStreamMsgReceived *prom.CounterVec
- serverStreamMsgSent *prom.CounterVec
- serverHandledHistogramEnabled bool
- serverHandledHistogramOpts prom.HistogramOpts
- serverHandledHistogram *prom.HistogramVec
-}
-
-// NewServerMetrics returns a ServerMetrics object. Use a new instance of
-// ServerMetrics when not using the default Prometheus metrics registry, for
-// example when wanting to control which metrics are added to a registry as
-// opposed to automatically adding metrics via init functions.
-func NewServerMetrics(counterOpts ...CounterOption) *ServerMetrics {
- opts := counterOptions(counterOpts)
- return &ServerMetrics{
- serverStartedCounter: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_server_started_total",
- Help: "Total number of RPCs started on the server.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
- serverHandledCounter: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_server_handled_total",
- Help: "Total number of RPCs completed on the server, regardless of success or failure.",
- }), []string{"grpc_type", "grpc_service", "grpc_method", "grpc_code"}),
- serverStreamMsgReceived: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_server_msg_received_total",
- Help: "Total number of RPC stream messages received on the server.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
- serverStreamMsgSent: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_server_msg_sent_total",
- Help: "Total number of gRPC stream messages sent by the server.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
- serverHandledHistogramEnabled: false,
- serverHandledHistogramOpts: prom.HistogramOpts{
- Name: "grpc_server_handling_seconds",
- Help: "Histogram of response latency (seconds) of gRPC that had been application-level handled by the server.",
- Buckets: prom.DefBuckets,
- },
- serverHandledHistogram: nil,
- }
-}
-
-// EnableHandlingTimeHistogram enables histograms being registered when
-// registering the ServerMetrics on a Prometheus registry. Histograms can be
-// expensive on Prometheus servers. It takes options to configure histogram
-// options such as the defined buckets.
-func (m *ServerMetrics) EnableHandlingTimeHistogram(opts ...HistogramOption) {
- for _, o := range opts {
- o(&m.serverHandledHistogramOpts)
- }
- if !m.serverHandledHistogramEnabled {
- m.serverHandledHistogram = prom.NewHistogramVec(
- m.serverHandledHistogramOpts,
- []string{"grpc_type", "grpc_service", "grpc_method"},
- )
- }
- m.serverHandledHistogramEnabled = true
-}
-
-// Describe sends the super-set of all possible descriptors of metrics
-// collected by this Collector to the provided channel and returns once
-// the last descriptor has been sent.
-func (m *ServerMetrics) Describe(ch chan<- *prom.Desc) {
- m.serverStartedCounter.Describe(ch)
- m.serverHandledCounter.Describe(ch)
- m.serverStreamMsgReceived.Describe(ch)
- m.serverStreamMsgSent.Describe(ch)
- if m.serverHandledHistogramEnabled {
- m.serverHandledHistogram.Describe(ch)
- }
-}
-
-// Collect is called by the Prometheus registry when collecting
-// metrics. The implementation sends each collected metric via the
-// provided channel and returns once the last metric has been sent.
-func (m *ServerMetrics) Collect(ch chan<- prom.Metric) {
- m.serverStartedCounter.Collect(ch)
- m.serverHandledCounter.Collect(ch)
- m.serverStreamMsgReceived.Collect(ch)
- m.serverStreamMsgSent.Collect(ch)
- if m.serverHandledHistogramEnabled {
- m.serverHandledHistogram.Collect(ch)
- }
-}
-
-// UnaryServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Unary RPCs.
-func (m *ServerMetrics) UnaryServerInterceptor() func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
- return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
- monitor := newServerReporter(m, Unary, info.FullMethod)
- monitor.ReceivedMessage()
- resp, err := handler(ctx, req)
- st, _ := status.FromError(err)
- monitor.Handled(st.Code())
- if err == nil {
- monitor.SentMessage()
- }
- return resp, err
- }
-}
-
-// StreamServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Streaming RPCs.
-func (m *ServerMetrics) StreamServerInterceptor() func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
- return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
- monitor := newServerReporter(m, streamRPCType(info), info.FullMethod)
- err := handler(srv, &monitoredServerStream{ss, monitor})
- st, _ := status.FromError(err)
- monitor.Handled(st.Code())
- return err
- }
-}
-
-// InitializeMetrics initializes all metrics, with their appropriate null
-// value, for all gRPC methods registered on a gRPC server. This is useful, to
-// ensure that all metrics exist when collecting and querying.
-func (m *ServerMetrics) InitializeMetrics(server *grpc.Server) {
- serviceInfo := server.GetServiceInfo()
- for serviceName, info := range serviceInfo {
- for _, mInfo := range info.Methods {
- preRegisterMethod(m, serviceName, &mInfo)
- }
- }
-}
-
-func streamRPCType(info *grpc.StreamServerInfo) grpcType {
- if info.IsClientStream && !info.IsServerStream {
- return ClientStream
- } else if !info.IsClientStream && info.IsServerStream {
- return ServerStream
- }
- return BidiStream
-}
-
-// monitoredStream wraps grpc.ServerStream allowing each Sent/Recv of message to increment counters.
-type monitoredServerStream struct {
- grpc.ServerStream
- monitor *serverReporter
-}
-
-func (s *monitoredServerStream) SendMsg(m interface{}) error {
- err := s.ServerStream.SendMsg(m)
- if err == nil {
- s.monitor.SentMessage()
- }
- return err
-}
-
-func (s *monitoredServerStream) RecvMsg(m interface{}) error {
- err := s.ServerStream.RecvMsg(m)
- if err == nil {
- s.monitor.ReceivedMessage()
- }
- return err
-}
-
-// preRegisterMethod is invoked on Register of a Server, allowing all gRPC services labels to be pre-populated.
-func preRegisterMethod(metrics *ServerMetrics, serviceName string, mInfo *grpc.MethodInfo) {
- methodName := mInfo.Name
- methodType := string(typeFromMethodInfo(mInfo))
- // These are just references (no increments), as just referencing will create the labels but not set values.
- metrics.serverStartedCounter.GetMetricWithLabelValues(methodType, serviceName, methodName)
- metrics.serverStreamMsgReceived.GetMetricWithLabelValues(methodType, serviceName, methodName)
- metrics.serverStreamMsgSent.GetMetricWithLabelValues(methodType, serviceName, methodName)
- if metrics.serverHandledHistogramEnabled {
- metrics.serverHandledHistogram.GetMetricWithLabelValues(methodType, serviceName, methodName)
- }
- for _, code := range allCodes {
- metrics.serverHandledCounter.GetMetricWithLabelValues(methodType, serviceName, methodName, code.String())
- }
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_reporter.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_reporter.go
deleted file mode 100644
index aa9db5401..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_reporter.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-package grpc_prometheus
-
-import (
- "time"
-
- "google.golang.org/grpc/codes"
-)
-
-type serverReporter struct {
- metrics *ServerMetrics
- rpcType grpcType
- serviceName string
- methodName string
- startTime time.Time
-}
-
-func newServerReporter(m *ServerMetrics, rpcType grpcType, fullMethod string) *serverReporter {
- r := &serverReporter{
- metrics: m,
- rpcType: rpcType,
- }
- if r.metrics.serverHandledHistogramEnabled {
- r.startTime = time.Now()
- }
- r.serviceName, r.methodName = splitMethodName(fullMethod)
- r.metrics.serverStartedCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
- return r
-}
-
-func (r *serverReporter) ReceivedMessage() {
- r.metrics.serverStreamMsgReceived.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
-}
-
-func (r *serverReporter) SentMessage() {
- r.metrics.serverStreamMsgSent.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
-}
-
-func (r *serverReporter) Handled(code codes.Code) {
- r.metrics.serverHandledCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName, code.String()).Inc()
- if r.metrics.serverHandledHistogramEnabled {
- r.metrics.serverHandledHistogram.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Observe(time.Since(r.startTime).Seconds())
- }
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go
deleted file mode 100644
index 7987de35f..000000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-package grpc_prometheus
-
-import (
- "strings"
-
- "google.golang.org/grpc"
- "google.golang.org/grpc/codes"
-)
-
-type grpcType string
-
-const (
- Unary grpcType = "unary"
- ClientStream grpcType = "client_stream"
- ServerStream grpcType = "server_stream"
- BidiStream grpcType = "bidi_stream"
-)
-
-var (
- allCodes = []codes.Code{
- codes.OK, codes.Canceled, codes.Unknown, codes.InvalidArgument, codes.DeadlineExceeded, codes.NotFound,
- codes.AlreadyExists, codes.PermissionDenied, codes.Unauthenticated, codes.ResourceExhausted,
- codes.FailedPrecondition, codes.Aborted, codes.OutOfRange, codes.Unimplemented, codes.Internal,
- codes.Unavailable, codes.DataLoss,
- }
-)
-
-func splitMethodName(fullMethodName string) (string, string) {
- fullMethodName = strings.TrimPrefix(fullMethodName, "/") // remove leading slash
- if i := strings.Index(fullMethodName, "/"); i >= 0 {
- return fullMethodName[:i], fullMethodName[i+1:]
- }
- return "unknown", "unknown"
-}
-
-func typeFromMethodInfo(mInfo *grpc.MethodInfo) grpcType {
- if !mInfo.IsClientStream && !mInfo.IsServerStream {
- return Unary
- }
- if mInfo.IsClientStream && !mInfo.IsServerStream {
- return ClientStream
- }
- if !mInfo.IsClientStream && mInfo.IsServerStream {
- return ServerStream
- }
- return BidiStream
-}
diff --git a/vendor/github.com/hashicorp/go-version/LICENSE b/vendor/github.com/hashicorp/go-version/LICENSE
index 1409d6ab9..bb1e9a486 100644
--- a/vendor/github.com/hashicorp/go-version/LICENSE
+++ b/vendor/github.com/hashicorp/go-version/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014 HashiCorp, Inc.
+Copyright IBM Corp. 2014, 2025
Mozilla Public License, version 2.0
diff --git a/vendor/github.com/hashicorp/go-version/README.md b/vendor/github.com/hashicorp/go-version/README.md
index 4b7806cd9..83a8249f7 100644
--- a/vendor/github.com/hashicorp/go-version/README.md
+++ b/vendor/github.com/hashicorp/go-version/README.md
@@ -1,6 +1,7 @@
# Versioning Library for Go
+

-[](https://godoc.org/github.com/hashicorp/go-version)
+[](https://pkg.go.dev/github.com/hashicorp/go-version)
go-version is a library for parsing versions and version constraints,
and verifying versions against a set of constraints. go-version
@@ -12,7 +13,7 @@ Versions used with go-version must follow [SemVer](http://semver.org/).
## Installation and Usage
Package documentation can be found on
-[GoDoc](http://godoc.org/github.com/hashicorp/go-version).
+[Go Reference](https://pkg.go.dev/github.com/hashicorp/go-version).
Installation can be done with a normal `go get`:
diff --git a/vendor/github.com/hashicorp/go-version/constraint.go b/vendor/github.com/hashicorp/go-version/constraint.go
index 29bdc4d2b..3964da070 100644
--- a/vendor/github.com/hashicorp/go-version/constraint.go
+++ b/vendor/github.com/hashicorp/go-version/constraint.go
@@ -1,4 +1,4 @@
-// Copyright (c) HashiCorp, Inc.
+// Copyright IBM Corp. 2014, 2025
// SPDX-License-Identifier: MPL-2.0
package version
@@ -8,8 +8,26 @@ import (
"regexp"
"sort"
"strings"
+ "sync"
)
+var (
+ constraintRegexp *regexp.Regexp
+ constraintRegexpOnce sync.Once
+)
+
+func getConstraintRegexp() *regexp.Regexp {
+ constraintRegexpOnce.Do(func() {
+ // This heavy lifting only happens the first time this function is called
+ constraintRegexp = regexp.MustCompile(fmt.Sprintf(
+ `^\s*(%s)\s*(%s)\s*$`,
+ `<=|>=|!=|~>|<|>|=|`,
+ VersionRegexpRaw,
+ ))
+ })
+ return constraintRegexp
+}
+
// Constraint represents a single constraint for a version, such as
// ">= 1.0".
type Constraint struct {
@@ -29,38 +47,11 @@ type Constraints []*Constraint
type constraintFunc func(v, c *Version) bool
-var constraintOperators map[string]constraintOperation
-
type constraintOperation struct {
op operator
f constraintFunc
}
-var constraintRegexp *regexp.Regexp
-
-func init() {
- constraintOperators = map[string]constraintOperation{
- "": {op: equal, f: constraintEqual},
- "=": {op: equal, f: constraintEqual},
- "!=": {op: notEqual, f: constraintNotEqual},
- ">": {op: greaterThan, f: constraintGreaterThan},
- "<": {op: lessThan, f: constraintLessThan},
- ">=": {op: greaterThanEqual, f: constraintGreaterThanEqual},
- "<=": {op: lessThanEqual, f: constraintLessThanEqual},
- "~>": {op: pessimistic, f: constraintPessimistic},
- }
-
- ops := make([]string, 0, len(constraintOperators))
- for k := range constraintOperators {
- ops = append(ops, regexp.QuoteMeta(k))
- }
-
- constraintRegexp = regexp.MustCompile(fmt.Sprintf(
- `^\s*(%s)\s*(%s)\s*$`,
- strings.Join(ops, "|"),
- VersionRegexpRaw))
-}
-
// NewConstraint will parse one or more constraints from the given
// constraint string. The string must be a comma-separated list of
// constraints.
@@ -107,7 +98,7 @@ func (cs Constraints) Check(v *Version) bool {
// to '>0.2' it is *NOT* treated as equal.
//
// Missing operator is treated as equal to '=', whitespaces
-// are ignored and constraints are sorted before comaparison.
+// are ignored and constraints are sorted before comparison.
func (cs Constraints) Equals(c Constraints) bool {
if len(cs) != len(c) {
return false
@@ -176,9 +167,9 @@ func (c *Constraint) String() string {
}
func parseSingle(v string) (*Constraint, error) {
- matches := constraintRegexp.FindStringSubmatch(v)
+ matches := getConstraintRegexp().FindStringSubmatch(v)
if matches == nil {
- return nil, fmt.Errorf("Malformed constraint: %s", v)
+ return nil, fmt.Errorf("malformed constraint: %s", v)
}
check, err := NewVersion(matches[2])
@@ -186,7 +177,25 @@ func parseSingle(v string) (*Constraint, error) {
return nil, err
}
- cop := constraintOperators[matches[1]]
+ var cop constraintOperation
+ switch matches[1] {
+ case "=":
+ cop = constraintOperation{op: equal, f: constraintEqual}
+ case "!=":
+ cop = constraintOperation{op: notEqual, f: constraintNotEqual}
+ case ">":
+ cop = constraintOperation{op: greaterThan, f: constraintGreaterThan}
+ case "<":
+ cop = constraintOperation{op: lessThan, f: constraintLessThan}
+ case ">=":
+ cop = constraintOperation{op: greaterThanEqual, f: constraintGreaterThanEqual}
+ case "<=":
+ cop = constraintOperation{op: lessThanEqual, f: constraintLessThanEqual}
+ case "~>":
+ cop = constraintOperation{op: pessimistic, f: constraintPessimistic}
+ default:
+ cop = constraintOperation{op: equal, f: constraintEqual}
+ }
return &Constraint{
f: cop.f,
diff --git a/vendor/github.com/hashicorp/go-version/version.go b/vendor/github.com/hashicorp/go-version/version.go
index 7c683c281..17b29732e 100644
--- a/vendor/github.com/hashicorp/go-version/version.go
+++ b/vendor/github.com/hashicorp/go-version/version.go
@@ -1,23 +1,39 @@
-// Copyright (c) HashiCorp, Inc.
+// Copyright IBM Corp. 2014, 2025
// SPDX-License-Identifier: MPL-2.0
package version
import (
- "bytes"
"database/sql/driver"
"fmt"
"regexp"
"strconv"
"strings"
+ "sync"
)
// The compiled regular expression used to test the validity of a version.
var (
- versionRegexp *regexp.Regexp
- semverRegexp *regexp.Regexp
+ versionRegexp *regexp.Regexp
+ versionRegexpOnce sync.Once
+ semverRegexp *regexp.Regexp
+ semverRegexpOnce sync.Once
)
+func getVersionRegexp() *regexp.Regexp {
+ versionRegexpOnce.Do(func() {
+ versionRegexp = regexp.MustCompile("^" + VersionRegexpRaw + "$")
+ })
+ return versionRegexp
+}
+
+func getSemverRegexp() *regexp.Regexp {
+ semverRegexpOnce.Do(func() {
+ semverRegexp = regexp.MustCompile("^" + SemverRegexpRaw + "$")
+ })
+ return semverRegexp
+}
+
// The raw regular expression string used for testing the validity
// of a version.
const (
@@ -42,28 +58,23 @@ type Version struct {
original string
}
-func init() {
- versionRegexp = regexp.MustCompile("^" + VersionRegexpRaw + "$")
- semverRegexp = regexp.MustCompile("^" + SemverRegexpRaw + "$")
-}
-
// NewVersion parses the given version and returns a new
// Version.
func NewVersion(v string) (*Version, error) {
- return newVersion(v, versionRegexp)
+ return newVersion(v, getVersionRegexp())
}
// NewSemver parses the given version and returns a new
// Version that adheres strictly to SemVer specs
// https://semver.org/
func NewSemver(v string) (*Version, error) {
- return newVersion(v, semverRegexp)
+ return newVersion(v, getSemverRegexp())
}
func newVersion(v string, pattern *regexp.Regexp) (*Version, error) {
matches := pattern.FindStringSubmatch(v)
if matches == nil {
- return nil, fmt.Errorf("Malformed version: %s", v)
+ return nil, fmt.Errorf("malformed version: %s", v)
}
segmentsStr := strings.Split(matches[1], ".")
segments := make([]int64, len(segmentsStr))
@@ -71,7 +82,7 @@ func newVersion(v string, pattern *regexp.Regexp) (*Version, error) {
val, err := strconv.ParseInt(str, 10, 64)
if err != nil {
return nil, fmt.Errorf(
- "Error parsing version: %s", err)
+ "error parsing version: %s", err)
}
segments[i] = val
@@ -174,7 +185,7 @@ func (v *Version) Compare(other *Version) int {
} else if lhs < rhs {
return -1
}
- // Otherwis, rhs was > lhs, they're not equal
+ // Otherwise, rhs was > lhs, they're not equal
return 1
}
@@ -382,22 +393,29 @@ func (v *Version) Segments64() []int64 {
// missing parts (1.0 => 1.0.0) will be made into a canonicalized form
// as shown in the parenthesized examples.
func (v *Version) String() string {
- var buf bytes.Buffer
- fmtParts := make([]string, len(v.segments))
+ return string(v.bytes())
+}
+
+func (v *Version) bytes() []byte {
+ var buf []byte
for i, s := range v.segments {
- // We can ignore err here since we've pre-parsed the values in segments
- str := strconv.FormatInt(s, 10)
- fmtParts[i] = str
+ if i > 0 {
+ buf = append(buf, '.')
+ }
+ buf = strconv.AppendInt(buf, s, 10)
}
- fmt.Fprintf(&buf, strings.Join(fmtParts, "."))
+
if v.pre != "" {
- fmt.Fprintf(&buf, "-%s", v.pre)
+ buf = append(buf, '-')
+ buf = append(buf, v.pre...)
}
+
if v.metadata != "" {
- fmt.Fprintf(&buf, "+%s", v.metadata)
+ buf = append(buf, '+')
+ buf = append(buf, v.metadata...)
}
- return buf.String()
+ return buf
}
// Original returns the original parsed version as-is, including any
diff --git a/vendor/github.com/hashicorp/go-version/version_collection.go b/vendor/github.com/hashicorp/go-version/version_collection.go
index 83547fe13..11bc8b1c5 100644
--- a/vendor/github.com/hashicorp/go-version/version_collection.go
+++ b/vendor/github.com/hashicorp/go-version/version_collection.go
@@ -1,4 +1,4 @@
-// Copyright (c) HashiCorp, Inc.
+// Copyright IBM Corp. 2014, 2025
// SPDX-License-Identifier: MPL-2.0
package version
diff --git a/vendor/github.com/kylelemons/godebug/diff/diff.go b/vendor/github.com/kylelemons/godebug/diff/diff.go
deleted file mode 100644
index 200e596c6..000000000
--- a/vendor/github.com/kylelemons/godebug/diff/diff.go
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright 2013 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package diff implements a linewise diff algorithm.
-package diff
-
-import (
- "bytes"
- "fmt"
- "strings"
-)
-
-// Chunk represents a piece of the diff. A chunk will not have both added and
-// deleted lines. Equal lines are always after any added or deleted lines.
-// A Chunk may or may not have any lines in it, especially for the first or last
-// chunk in a computation.
-type Chunk struct {
- Added []string
- Deleted []string
- Equal []string
-}
-
-func (c *Chunk) empty() bool {
- return len(c.Added) == 0 && len(c.Deleted) == 0 && len(c.Equal) == 0
-}
-
-// Diff returns a string containing a line-by-line unified diff of the linewise
-// changes required to make A into B. Each line is prefixed with '+', '-', or
-// ' ' to indicate if it should be added, removed, or is correct respectively.
-func Diff(A, B string) string {
- aLines := strings.Split(A, "\n")
- bLines := strings.Split(B, "\n")
-
- chunks := DiffChunks(aLines, bLines)
-
- buf := new(bytes.Buffer)
- for _, c := range chunks {
- for _, line := range c.Added {
- fmt.Fprintf(buf, "+%s\n", line)
- }
- for _, line := range c.Deleted {
- fmt.Fprintf(buf, "-%s\n", line)
- }
- for _, line := range c.Equal {
- fmt.Fprintf(buf, " %s\n", line)
- }
- }
- return strings.TrimRight(buf.String(), "\n")
-}
-
-// DiffChunks uses an O(D(N+M)) shortest-edit-script algorithm
-// to compute the edits required from A to B and returns the
-// edit chunks.
-func DiffChunks(a, b []string) []Chunk {
- // algorithm: http://www.xmailserver.org/diff2.pdf
-
- // We'll need these quantities a lot.
- alen, blen := len(a), len(b) // M, N
-
- // At most, it will require len(a) deletions and len(b) additions
- // to transform a into b.
- maxPath := alen + blen // MAX
- if maxPath == 0 {
- // degenerate case: two empty lists are the same
- return nil
- }
-
- // Store the endpoint of the path for diagonals.
- // We store only the a index, because the b index on any diagonal
- // (which we know during the loop below) is aidx-diag.
- // endpoint[maxPath] represents the 0 diagonal.
- //
- // Stated differently:
- // endpoint[d] contains the aidx of a furthest reaching path in diagonal d
- endpoint := make([]int, 2*maxPath+1) // V
-
- saved := make([][]int, 0, 8) // Vs
- save := func() {
- dup := make([]int, len(endpoint))
- copy(dup, endpoint)
- saved = append(saved, dup)
- }
-
- var editDistance int // D
-dLoop:
- for editDistance = 0; editDistance <= maxPath; editDistance++ {
- // The 0 diag(onal) represents equality of a and b. Each diagonal to
- // the left is numbered one lower, to the right is one higher, from
- // -alen to +blen. Negative diagonals favor differences from a,
- // positive diagonals favor differences from b. The edit distance to a
- // diagonal d cannot be shorter than d itself.
- //
- // The iterations of this loop cover either odds or evens, but not both,
- // If odd indices are inputs, even indices are outputs and vice versa.
- for diag := -editDistance; diag <= editDistance; diag += 2 { // k
- var aidx int // x
- switch {
- case diag == -editDistance:
- // This is a new diagonal; copy from previous iter
- aidx = endpoint[maxPath-editDistance+1] + 0
- case diag == editDistance:
- // This is a new diagonal; copy from previous iter
- aidx = endpoint[maxPath+editDistance-1] + 1
- case endpoint[maxPath+diag+1] > endpoint[maxPath+diag-1]:
- // diagonal d+1 was farther along, so use that
- aidx = endpoint[maxPath+diag+1] + 0
- default:
- // diagonal d-1 was farther (or the same), so use that
- aidx = endpoint[maxPath+diag-1] + 1
- }
- // On diagonal d, we can compute bidx from aidx.
- bidx := aidx - diag // y
- // See how far we can go on this diagonal before we find a difference.
- for aidx < alen && bidx < blen && a[aidx] == b[bidx] {
- aidx++
- bidx++
- }
- // Store the end of the current edit chain.
- endpoint[maxPath+diag] = aidx
- // If we've found the end of both inputs, we're done!
- if aidx >= alen && bidx >= blen {
- save() // save the final path
- break dLoop
- }
- }
- save() // save the current path
- }
- if editDistance == 0 {
- return nil
- }
- chunks := make([]Chunk, editDistance+1)
-
- x, y := alen, blen
- for d := editDistance; d > 0; d-- {
- endpoint := saved[d]
- diag := x - y
- insert := diag == -d || (diag != d && endpoint[maxPath+diag-1] < endpoint[maxPath+diag+1])
-
- x1 := endpoint[maxPath+diag]
- var x0, xM, kk int
- if insert {
- kk = diag + 1
- x0 = endpoint[maxPath+kk]
- xM = x0
- } else {
- kk = diag - 1
- x0 = endpoint[maxPath+kk]
- xM = x0 + 1
- }
- y0 := x0 - kk
-
- var c Chunk
- if insert {
- c.Added = b[y0:][:1]
- } else {
- c.Deleted = a[x0:][:1]
- }
- if xM < x1 {
- c.Equal = a[xM:][:x1-xM]
- }
-
- x, y = x0, y0
- chunks[d] = c
- }
- if x > 0 {
- chunks[0].Equal = a[:x]
- }
- if chunks[0].empty() {
- chunks = chunks[1:]
- }
- if len(chunks) == 0 {
- return nil
- }
- return chunks
-}
diff --git a/vendor/github.com/mailru/easyjson/.gitignore b/vendor/github.com/mailru/easyjson/.gitignore
new file mode 100644
index 000000000..fbfaf7a3f
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/.gitignore
@@ -0,0 +1,6 @@
+.root
+*_easyjson.go
+*.iml
+.idea
+*.swp
+bin/*
diff --git a/vendor/github.com/mailru/easyjson/Makefile b/vendor/github.com/mailru/easyjson/Makefile
new file mode 100644
index 000000000..cc5ebbad3
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/Makefile
@@ -0,0 +1,72 @@
+all: test
+
+clean:
+ rm -rf bin
+ rm -rf tests/*_easyjson.go
+ rm -rf benchmark/*_easyjson.go
+
+build:
+ go build -o ./bin/easyjson ./easyjson
+
+generate: build
+ bin/easyjson -stubs \
+ ./tests/snake.go \
+ ./tests/data.go \
+ ./tests/omitempty.go \
+ ./tests/nothing.go \
+ ./tests/named_type.go \
+ ./tests/custom_map_key_type.go \
+ ./tests/embedded_type.go \
+ ./tests/reference_to_pointer.go \
+ ./tests/html.go \
+ ./tests/unknown_fields.go \
+ ./tests/type_declaration.go \
+ ./tests/type_declaration_skip.go \
+ ./tests/members_escaped.go \
+ ./tests/members_unescaped.go \
+ ./tests/intern.go \
+ ./tests/nocopy.go \
+ ./tests/escaping.go
+ bin/easyjson -all \
+ ./tests/data.go \
+ ./tests/nothing.go \
+ ./tests/errors.go \
+ ./tests/html.go \
+ ./tests/type_declaration_skip.go
+ bin/easyjson \
+ ./tests/nested_easy.go \
+ ./tests/named_type.go \
+ ./tests/custom_map_key_type.go \
+ ./tests/embedded_type.go \
+ ./tests/reference_to_pointer.go \
+ ./tests/key_marshaler_map.go \
+ ./tests/unknown_fields.go \
+ ./tests/type_declaration.go \
+ ./tests/members_escaped.go \
+ ./tests/intern.go \
+ ./tests/nocopy.go \
+ ./tests/escaping.go \
+ ./tests/nested_marshaler.go
+ bin/easyjson -snake_case ./tests/snake.go
+ bin/easyjson -omit_empty ./tests/omitempty.go
+ bin/easyjson -build_tags=use_easyjson -disable_members_unescape ./benchmark/data.go
+ bin/easyjson -disallow_unknown_fields ./tests/disallow_unknown.go
+ bin/easyjson -disable_members_unescape ./tests/members_unescaped.go
+
+test: generate
+ go test \
+ ./tests \
+ ./jlexer \
+ ./gen \
+ ./buffer
+ cd benchmark && go test -benchmem -tags use_easyjson -bench .
+ golint -set_exit_status ./tests/*_easyjson.go
+
+bench-other: generate
+ cd benchmark && make
+
+bench-python:
+ benchmark/ujson.sh
+
+
+.PHONY: clean generate test build
diff --git a/vendor/github.com/mailru/easyjson/README.md b/vendor/github.com/mailru/easyjson/README.md
new file mode 100644
index 000000000..943b9e4ce
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/README.md
@@ -0,0 +1,408 @@
+# easyjson [](https://github.com/mailru/easyjson/actions/workflows/easyjson.yml) [](https://goreportcard.com/report/github.com/mailru/easyjson)
+
+Package easyjson provides a fast and easy way to marshal/unmarshal Go structs
+to/from JSON without the use of reflection. In performance tests, easyjson
+outperforms the standard `encoding/json` package by a factor of 4-5x, and other
+JSON encoding packages by a factor of 2-3x.
+
+easyjson aims to keep generated Go code simple enough so that it can be easily
+optimized or fixed. Another goal is to provide users with the ability to
+customize the generated code by providing options not available with the
+standard `encoding/json` package, such as generating "snake_case" names or
+enabling `omitempty` behavior by default.
+
+## Usage
+### Install:
+```sh
+# for Go < 1.17
+go get -u github.com/mailru/easyjson/...
+```
+#### or
+```sh
+# for Go >= 1.17
+go get github.com/mailru/easyjson && go install github.com/mailru/easyjson/...@latest
+```
+### Run:
+```sh
+easyjson -all .go
+```
+
+The above will generate `_easyjson.go` containing the appropriate marshaler and
+unmarshaler funcs for all structs contained in `.go`.
+
+Please note that easyjson requires a full Go build environment and the `GOPATH`
+environment variable to be set. This is because easyjson code generation
+invokes `go run` on a temporary file (an approach to code generation borrowed
+from [ffjson](https://github.com/pquerna/ffjson)).
+
+### Serialize
+```go
+someStruct := &SomeStruct{Field1: "val1", Field2: "val2"}
+rawBytes, err := easyjson.Marshal(someStruct)
+```
+
+### Deserialize
+```go
+someStruct := &SomeStruct{}
+err := easyjson.Unmarshal(rawBytes, someStruct)
+```
+
+Please see the [GoDoc](https://godoc.org/github.com/mailru/easyjson)
+for more information and features.
+## Options
+```txt
+Usage of easyjson:
+ -all
+ generate marshaler/unmarshalers for all structs in a file
+ -build_tags string
+ build tags to add to generated file
+ -gen_build_flags string
+ build flags when running the generator while bootstrapping
+ -byte
+ use simple bytes instead of Base64Bytes for slice of bytes
+ -leave_temps
+ do not delete temporary files
+ -no_std_marshalers
+ don't generate MarshalJSON/UnmarshalJSON funcs
+ -noformat
+ do not run 'gofmt -w' on output file
+ -omit_empty
+ omit empty fields by default
+ -output_filename string
+ specify the filename of the output
+ -pkg
+ process the whole package instead of just the given file
+ -snake_case
+ use snake_case names instead of CamelCase by default
+ -lower_camel_case
+ use lowerCamelCase instead of CamelCase by default
+ -stubs
+ only generate stubs for marshaler/unmarshaler funcs
+ -disallow_unknown_fields
+ return error if some unknown field in json appeared
+ -disable_members_unescape
+ disable unescaping of \uXXXX string sequences in member names
+```
+
+Using `-all` will generate marshalers/unmarshalers for all Go structs in the
+file excluding those structs whose preceding comment starts with `easyjson:skip`.
+For example:
+
+```go
+//easyjson:skip
+type A struct {}
+```
+
+If `-all` is not provided, then only those structs whose preceding
+comment starts with `easyjson:json` will have marshalers/unmarshalers
+generated. For example:
+
+```go
+//easyjson:json
+type A struct {}
+```
+
+Additional option notes:
+
+* `-snake_case` tells easyjson to generate snake\_case field names by default
+ (unless overridden by a field tag). The CamelCase to snake\_case conversion
+ algorithm should work in most cases (ie, HTTPVersion will be converted to
+ "http_version").
+
+* `-build_tags` will add the specified build tags to generated Go sources.
+
+* `-gen_build_flags` will execute the easyjson bootstapping code to launch the
+ actual generator command with provided flags. Multiple arguments should be
+ separated by space e.g. `-gen_build_flags="-mod=mod -x"`.
+
+## Structure json tag options
+
+Besides standard json tag options like 'omitempty' the following are supported:
+
+* 'nocopy' - disables allocation and copying of string values, making them
+ refer to original json buffer memory. This works great for short lived
+ objects which are not hold in memory after decoding and immediate usage.
+ Note if string requires unescaping it will be processed as normally.
+* 'intern' - string "interning" (deduplication) to save memory when the very
+ same string dictionary values are often met all over the structure.
+ See below for more details.
+
+## Generated Marshaler/Unmarshaler Funcs
+
+For Go struct types, easyjson generates the funcs `MarshalEasyJSON` /
+`UnmarshalEasyJSON` for marshaling/unmarshaling JSON. In turn, these satisfy
+the `easyjson.Marshaler` and `easyjson.Unmarshaler` interfaces and when used in
+conjunction with `easyjson.Marshal` / `easyjson.Unmarshal` avoid unnecessary
+reflection / type assertions during marshaling/unmarshaling to/from JSON for Go
+structs.
+
+easyjson also generates `MarshalJSON` and `UnmarshalJSON` funcs for Go struct
+types compatible with the standard `json.Marshaler` and `json.Unmarshaler`
+interfaces. Please be aware that using the standard `json.Marshal` /
+`json.Unmarshal` for marshaling/unmarshaling will incur a significant
+performance penalty when compared to using `easyjson.Marshal` /
+`easyjson.Unmarshal`.
+
+Additionally, easyjson exposes utility funcs that use the `MarshalEasyJSON` and
+`UnmarshalEasyJSON` for marshaling/unmarshaling to and from standard readers
+and writers. For example, easyjson provides `easyjson.MarshalToHTTPResponseWriter`
+which marshals to the standard `http.ResponseWriter`. Please see the [GoDoc
+listing](https://godoc.org/github.com/mailru/easyjson) for the full listing of
+utility funcs that are available.
+
+## Controlling easyjson Marshaling and Unmarshaling Behavior
+
+Go types can provide their own `MarshalEasyJSON` and `UnmarshalEasyJSON` funcs
+that satisfy the `easyjson.Marshaler` / `easyjson.Unmarshaler` interfaces.
+These will be used by `easyjson.Marshal` and `easyjson.Unmarshal` when defined
+for a Go type.
+
+Go types can also satisfy the `easyjson.Optional` interface, which allows the
+type to define its own `omitempty` logic.
+
+## Type Wrappers
+
+easyjson provides additional type wrappers defined in the `easyjson/opt`
+package. These wrap the standard Go primitives and in turn satisfy the
+easyjson interfaces.
+
+The `easyjson/opt` type wrappers are useful when needing to distinguish between
+a missing value and/or when needing to specifying a default value. Type
+wrappers allow easyjson to avoid additional pointers and heap allocations and
+can significantly increase performance when used properly.
+
+## Memory Pooling
+
+easyjson uses a buffer pool that allocates data in increasing chunks from 128
+to 32768 bytes. Chunks of 512 bytes and larger will be reused with the help of
+`sync.Pool`. The maximum size of a chunk is bounded to reduce redundant memory
+allocation and to allow larger reusable buffers.
+
+easyjson's custom allocation buffer pool is defined in the `easyjson/buffer`
+package, and the default behavior pool behavior can be modified (if necessary)
+through a call to `buffer.Init()` prior to any marshaling or unmarshaling.
+Please see the [GoDoc listing](https://godoc.org/github.com/mailru/easyjson/buffer)
+for more information.
+
+## String interning
+
+During unmarshaling, `string` field values can be optionally
+[interned](https://en.wikipedia.org/wiki/String_interning) to reduce memory
+allocations and usage by deduplicating strings in memory, at the expense of slightly
+increased CPU usage.
+
+This will work effectively only for `string` fields being decoded that have frequently
+the same value (e.g. if you have a string field that can only assume a small number
+of possible values).
+
+To enable string interning, add the `intern` keyword tag to your `json` tag on `string`
+fields, e.g.:
+
+```go
+type Foo struct {
+ UUID string `json:"uuid"` // will not be interned during unmarshaling
+ State string `json:"state,intern"` // will be interned during unmarshaling
+}
+```
+
+## Issues, Notes, and Limitations
+
+* easyjson is still early in its development. As such, there are likely to be
+ bugs and missing features when compared to `encoding/json`. In the case of a
+ missing feature or bug, please create a GitHub issue. Pull requests are
+ welcome!
+
+* Unlike `encoding/json`, object keys are case-sensitive. Case-insensitive
+ matching is not currently provided due to the significant performance hit
+ when doing case-insensitive key matching. In the future, case-insensitive
+ object key matching may be provided via an option to the generator.
+
+* easyjson makes use of `unsafe`, which simplifies the code and
+ provides significant performance benefits by allowing no-copy
+ conversion from `[]byte` to `string`. That said, `unsafe` is used
+ only when unmarshaling and parsing JSON, and any `unsafe` operations
+ / memory allocations done will be safely deallocated by
+ easyjson. Set the build tag `easyjson_nounsafe` to compile it
+ without `unsafe`.
+
+* easyjson is compatible with Google App Engine. The `appengine` build
+ tag (set by App Engine's environment) will automatically disable the
+ use of `unsafe`, which is not allowed in App Engine's Standard
+ Environment. Note that the use with App Engine is still experimental.
+
+* Floats are formatted using the default precision from Go's `strconv` package.
+ As such, easyjson will not correctly handle high precision floats when
+ marshaling/unmarshaling JSON. Note, however, that there are very few/limited
+ uses where this behavior is not sufficient for general use. That said, a
+ different package may be needed if precise marshaling/unmarshaling of high
+ precision floats to/from JSON is required.
+
+* While unmarshaling, the JSON parser does the minimal amount of work needed to
+ skip over unmatching parens, and as such full validation is not done for the
+ entire JSON value being unmarshaled/parsed.
+
+* Currently there is no true streaming support for encoding/decoding as
+ typically for many uses/protocols the final, marshaled length of the JSON
+ needs to be known prior to sending the data. Currently this is not possible
+ with easyjson's architecture.
+
+* easyjson parser and codegen based on reflection, so it won't work on `package main`
+ files, because they cant be imported by parser.
+
+## Benchmarks
+
+Most benchmarks were done using the example
+[13kB example JSON](https://dev.twitter.com/rest/reference/get/search/tweets)
+(9k after eliminating whitespace). This example is similar to real-world data,
+is well-structured, and contains a healthy variety of different types, making
+it ideal for JSON serialization benchmarks.
+
+Note:
+
+* For small request benchmarks, an 80 byte portion of the above example was
+ used.
+
+* For large request marshaling benchmarks, a struct containing 50 regular
+ samples was used, making a ~500kB output JSON.
+
+* Benchmarks are showing the results of easyjson's default behaviour,
+ which makes use of `unsafe`.
+
+Benchmarks are available in the repository and can be run by invoking `make`.
+
+### easyjson vs. encoding/json
+
+easyjson is roughly 5-6 times faster than the standard `encoding/json` for
+unmarshaling, and 3-4 times faster for non-concurrent marshaling. Concurrent
+marshaling is 6-7x faster if marshaling to a writer.
+
+### easyjson vs. ffjson
+
+easyjson uses the same approach for JSON marshaling as
+[ffjson](https://github.com/pquerna/ffjson), but takes a significantly
+different approach to lexing and parsing JSON during unmarshaling. This means
+easyjson is roughly 2-3x faster for unmarshaling and 1.5-2x faster for
+non-concurrent unmarshaling.
+
+As of this writing, `ffjson` seems to have issues when used concurrently:
+specifically, large request pooling hurts `ffjson`'s performance and causes
+scalability issues. These issues with `ffjson` can likely be fixed, but as of
+writing remain outstanding/known issues with `ffjson`.
+
+easyjson and `ffjson` have similar performance for small requests, however
+easyjson outperforms `ffjson` by roughly 2-5x times for large requests when
+used with a writer.
+
+### easyjson vs. go/codec
+
+[go/codec](https://github.com/ugorji/go) provides
+compile-time helpers for JSON generation. In this case, helpers do not work
+like marshalers as they are encoding-independent.
+
+easyjson is generally 2x faster than `go/codec` for non-concurrent benchmarks
+and about 3x faster for concurrent encoding (without marshaling to a writer).
+
+In an attempt to measure marshaling performance of `go/codec` (as opposed to
+allocations/memcpy/writer interface invocations), a benchmark was done with
+resetting length of a byte slice rather than resetting the whole slice to nil.
+However, the optimization in this exact form may not be applicable in practice,
+since the memory is not freed between marshaling operations.
+
+### easyjson vs 'ujson' python module
+
+[ujson](https://github.com/esnme/ultrajson) is using C code for parsing, so it
+is interesting to see how plain golang compares to that. It is important to note
+that the resulting object for python is slower to access, since the library
+parses JSON object into dictionaries.
+
+easyjson is slightly faster for unmarshaling and 2-3x faster than `ujson` for
+marshaling.
+
+### Benchmark Results
+
+`ffjson` results are from February 4th, 2016, using the latest `ffjson` and go1.6.
+`go/codec` results are from March 4th, 2016, using the latest `go/codec` and go1.6.
+
+#### Unmarshaling
+
+| lib | json size | MB/s | allocs/op | B/op |
+|:---------|:----------|-----:|----------:|------:|
+| standard | regular | 22 | 218 | 10229 |
+| standard | small | 9.7 | 14 | 720 |
+| | | | | |
+| easyjson | regular | 125 | 128 | 9794 |
+| easyjson | small | 67 | 3 | 128 |
+| | | | | |
+| ffjson | regular | 66 | 141 | 9985 |
+| ffjson | small | 17.6 | 10 | 488 |
+| | | | | |
+| codec | regular | 55 | 434 | 19299 |
+| codec | small | 29 | 7 | 336 |
+| | | | | |
+| ujson | regular | 103 | N/A | N/A |
+
+#### Marshaling, one goroutine.
+
+| lib | json size | MB/s | allocs/op | B/op |
+|:----------|:----------|-----:|----------:|------:|
+| standard | regular | 75 | 9 | 23256 |
+| standard | small | 32 | 3 | 328 |
+| standard | large | 80 | 17 | 1.2M |
+| | | | | |
+| easyjson | regular | 213 | 9 | 10260 |
+| easyjson* | regular | 263 | 8 | 742 |
+| easyjson | small | 125 | 1 | 128 |
+| easyjson | large | 212 | 33 | 490k |
+| easyjson* | large | 262 | 25 | 2879 |
+| | | | | |
+| ffjson | regular | 122 | 153 | 21340 |
+| ffjson** | regular | 146 | 152 | 4897 |
+| ffjson | small | 36 | 5 | 384 |
+| ffjson** | small | 64 | 4 | 128 |
+| ffjson | large | 134 | 7317 | 818k |
+| ffjson** | large | 125 | 7320 | 827k |
+| | | | | |
+| codec | regular | 80 | 17 | 33601 |
+| codec*** | regular | 108 | 9 | 1153 |
+| codec | small | 42 | 3 | 304 |
+| codec*** | small | 56 | 1 | 48 |
+| codec | large | 73 | 483 | 2.5M |
+| codec*** | large | 103 | 451 | 66007 |
+| | | | | |
+| ujson | regular | 92 | N/A | N/A |
+
+\* marshaling to a writer,
+\*\* using `ffjson.Pool()`,
+\*\*\* reusing output slice instead of resetting it to nil
+
+#### Marshaling, concurrent.
+
+| lib | json size | MB/s | allocs/op | B/op |
+|:----------|:----------|-----:|----------:|------:|
+| standard | regular | 252 | 9 | 23257 |
+| standard | small | 124 | 3 | 328 |
+| standard | large | 289 | 17 | 1.2M |
+| | | | | |
+| easyjson | regular | 792 | 9 | 10597 |
+| easyjson* | regular | 1748 | 8 | 779 |
+| easyjson | small | 333 | 1 | 128 |
+| easyjson | large | 718 | 36 | 548k |
+| easyjson* | large | 2134 | 25 | 4957 |
+| | | | | |
+| ffjson | regular | 301 | 153 | 21629 |
+| ffjson** | regular | 707 | 152 | 5148 |
+| ffjson | small | 62 | 5 | 384 |
+| ffjson** | small | 282 | 4 | 128 |
+| ffjson | large | 438 | 7330 | 1.0M |
+| ffjson** | large | 131 | 7319 | 820k |
+| | | | | |
+| codec | regular | 183 | 17 | 33603 |
+| codec*** | regular | 671 | 9 | 1157 |
+| codec | small | 147 | 3 | 304 |
+| codec*** | small | 299 | 1 | 48 |
+| codec | large | 190 | 483 | 2.5M |
+| codec*** | large | 752 | 451 | 77574 |
+
+\* marshaling to a writer,
+\*\* using `ffjson.Pool()`,
+\*\*\* reusing output slice instead of resetting it to nil
diff --git a/vendor/github.com/mailru/easyjson/helpers.go b/vendor/github.com/mailru/easyjson/helpers.go
new file mode 100644
index 000000000..efe34bf2a
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/helpers.go
@@ -0,0 +1,114 @@
+// Package easyjson contains marshaler/unmarshaler interfaces and helper functions.
+package easyjson
+
+import (
+ "io"
+ "io/ioutil"
+ "net/http"
+ "strconv"
+ "unsafe"
+
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// Marshaler is an easyjson-compatible marshaler interface.
+type Marshaler interface {
+ MarshalEasyJSON(w *jwriter.Writer)
+}
+
+// Unmarshaler is an easyjson-compatible unmarshaler interface.
+type Unmarshaler interface {
+ UnmarshalEasyJSON(w *jlexer.Lexer)
+}
+
+// MarshalerUnmarshaler is an easyjson-compatible marshaler/unmarshaler interface.
+type MarshalerUnmarshaler interface {
+ Marshaler
+ Unmarshaler
+}
+
+// Optional defines an undefined-test method for a type to integrate with 'omitempty' logic.
+type Optional interface {
+ IsDefined() bool
+}
+
+// UnknownsUnmarshaler provides a method to unmarshal unknown struct fileds and save them as you want
+type UnknownsUnmarshaler interface {
+ UnmarshalUnknown(in *jlexer.Lexer, key string)
+}
+
+// UnknownsMarshaler provides a method to write additional struct fields
+type UnknownsMarshaler interface {
+ MarshalUnknowns(w *jwriter.Writer, first bool)
+}
+
+func isNilInterface(i interface{}) bool {
+ return (*[2]uintptr)(unsafe.Pointer(&i))[1] == 0
+}
+
+// Marshal returns data as a single byte slice. Method is suboptimal as the data is likely to be copied
+// from a chain of smaller chunks.
+func Marshal(v Marshaler) ([]byte, error) {
+ if isNilInterface(v) {
+ return nullBytes, nil
+ }
+
+ w := jwriter.Writer{}
+ v.MarshalEasyJSON(&w)
+ return w.BuildBytes()
+}
+
+// MarshalToWriter marshals the data to an io.Writer.
+func MarshalToWriter(v Marshaler, w io.Writer) (written int, err error) {
+ if isNilInterface(v) {
+ return w.Write(nullBytes)
+ }
+
+ jw := jwriter.Writer{}
+ v.MarshalEasyJSON(&jw)
+ return jw.DumpTo(w)
+}
+
+// MarshalToHTTPResponseWriter sets Content-Length and Content-Type headers for the
+// http.ResponseWriter, and send the data to the writer. started will be equal to
+// false if an error occurred before any http.ResponseWriter methods were actually
+// invoked (in this case a 500 reply is possible).
+func MarshalToHTTPResponseWriter(v Marshaler, w http.ResponseWriter) (started bool, written int, err error) {
+ if isNilInterface(v) {
+ w.Header().Set("Content-Type", "application/json")
+ w.Header().Set("Content-Length", strconv.Itoa(len(nullBytes)))
+ written, err = w.Write(nullBytes)
+ return true, written, err
+ }
+
+ jw := jwriter.Writer{}
+ v.MarshalEasyJSON(&jw)
+ if jw.Error != nil {
+ return false, 0, jw.Error
+ }
+ w.Header().Set("Content-Type", "application/json")
+ w.Header().Set("Content-Length", strconv.Itoa(jw.Size()))
+
+ started = true
+ written, err = jw.DumpTo(w)
+ return
+}
+
+// Unmarshal decodes the JSON in data into the object.
+func Unmarshal(data []byte, v Unmarshaler) error {
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
+
+// UnmarshalFromReader reads all the data in the reader and decodes as JSON into the object.
+func UnmarshalFromReader(r io.Reader, v Unmarshaler) error {
+ data, err := ioutil.ReadAll(r)
+ if err != nil {
+ return err
+ }
+ l := jlexer.Lexer{Data: data}
+ v.UnmarshalEasyJSON(&l)
+ return l.Error()
+}
diff --git a/vendor/github.com/mailru/easyjson/raw.go b/vendor/github.com/mailru/easyjson/raw.go
new file mode 100644
index 000000000..ee7367ae5
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/raw.go
@@ -0,0 +1,46 @@
+package easyjson
+
+import (
+ "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// RawMessage is a raw piece of JSON (number, string, bool, object, array or
+// null) that is extracted without parsing and output as is during marshaling.
+type RawMessage []byte
+
+// MarshalEasyJSON does JSON marshaling using easyjson interface.
+func (v *RawMessage) MarshalEasyJSON(w *jwriter.Writer) {
+ if len(*v) == 0 {
+ w.RawString("null")
+ } else {
+ w.Raw(*v, nil)
+ }
+}
+
+// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
+func (v *RawMessage) UnmarshalEasyJSON(l *jlexer.Lexer) {
+ *v = RawMessage(l.Raw())
+}
+
+// UnmarshalJSON implements encoding/json.Unmarshaler interface.
+func (v *RawMessage) UnmarshalJSON(data []byte) error {
+ *v = make([]byte, len(data))
+ copy(*v, data)
+ return nil
+}
+
+var nullBytes = []byte("null")
+
+// MarshalJSON implements encoding/json.Marshaler interface.
+func (v RawMessage) MarshalJSON() ([]byte, error) {
+ if len(v) == 0 {
+ return nullBytes, nil
+ }
+ return v, nil
+}
+
+// IsDefined is required for integration with omitempty easyjson logic.
+func (v *RawMessage) IsDefined() bool {
+ return len(*v) > 0
+}
diff --git a/vendor/github.com/mailru/easyjson/unknown_fields.go b/vendor/github.com/mailru/easyjson/unknown_fields.go
new file mode 100644
index 000000000..55538eac9
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/unknown_fields.go
@@ -0,0 +1,32 @@
+package easyjson
+
+import (
+ jlexer "github.com/mailru/easyjson/jlexer"
+ "github.com/mailru/easyjson/jwriter"
+)
+
+// UnknownFieldsProxy implemets UnknownsUnmarshaler and UnknownsMarshaler
+// use it as embedded field in your structure to parse and then serialize unknown struct fields
+type UnknownFieldsProxy struct {
+ unknownFields map[string][]byte
+}
+
+func (s *UnknownFieldsProxy) UnmarshalUnknown(in *jlexer.Lexer, key string) {
+ if s.unknownFields == nil {
+ s.unknownFields = make(map[string][]byte, 1)
+ }
+ s.unknownFields[key] = in.Raw()
+}
+
+func (s UnknownFieldsProxy) MarshalUnknowns(out *jwriter.Writer, first bool) {
+ for key, val := range s.unknownFields {
+ if first {
+ first = false
+ } else {
+ out.RawByte(',')
+ }
+ out.String(string(key))
+ out.RawByte(':')
+ out.Raw(val, nil)
+ }
+}
diff --git a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/.gitignore b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/.gitignore
index 1597f12b7..070b2a1fc 100644
--- a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/.gitignore
+++ b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/.gitignore
@@ -30,3 +30,4 @@ integration/testdata/output
*.profile
*.bench
/.vscode
+.DS_Store
diff --git a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md
index db70f92c2..dd3689898 100644
--- a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md
+++ b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md
@@ -20,25 +20,14 @@ If you are having problems with `counterfeiter` and are not using a supported ve
Typically, `counterfeiter` is used in `go generate` directives. It can be frustrating when you change your interface declaration and suddenly all of your generated code is suddenly out-of-date. The best practice here is to use the [`go generate` command](https://blog.golang.org/generate) to make it easier to keep your test doubles up to date.
-#### Step 1 - Create `tools.go`
+⚠️ If you are working with go 1.23 or earlier, please refer to an [older version of this README](https://github.com/maxbrunsfeld/counterfeiter/blob/e39cbe6aaa94a0b6718cf3d413cd5319c3a1f6fa/README.md#using-counterfeiter), as the instructions below assume go 1.24 (which added `go tool` support) and later.
-You can take a dependency on tools by creating a `tools.go` file, as described in [How can I track tool dependencies for a module?](https://go.dev/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module). This ensures that everyone working with your module is using the same version of each tool you use.
+#### Step 1 - Add `counterfeiter` as a tool dependency
-```shell
-$ cat tools/tools.go
-```
-
-```go
-//go:build tools
+Establish a tool dependency on counterfeiter by running the following command:
-package tools
-
-import (
- _ "github.com/maxbrunsfeld/counterfeiter/v6"
-)
-
-// This file imports packages that are used when running go generate, or used
-// during the development process but not otherwise depended on by built code.
+```shell
+go get -tool github.com/maxbrunsfeld/counterfeiter/v6
```
#### Step 2a - Add `go:generate` Directives
@@ -52,7 +41,7 @@ $ cat myinterface.go
```go
package foo
-//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . MySpecialInterface
+//go:generate go tool counterfeiter . MySpecialInterface
type MySpecialInterface interface {
DoThings(string, uint64) (int, error)
@@ -67,8 +56,8 @@ Writing `FakeMySpecialInterface` to `foofakes/fake_my_special_interface.go`... D
#### Step 2b - Add `counterfeiter:generate` Directives
If you plan to have many directives in a single package, consider using this
-option. You can add directives right next to your interface definitions
-(or not), in any `.go` file in your module.
+option, as it will speed things up considerably. You can add directives right
+next to your interface definitions (or not), in any `.go` file in your module.
```shell
$ cat myinterface.go
@@ -78,7 +67,7 @@ $ cat myinterface.go
package foo
// You only need **one** of these per package!
-//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
+//go:generate go tool counterfeiter -generate
// You will add lots of directives like these in the same package...
//counterfeiter:generate . MySpecialInterface
@@ -112,7 +101,7 @@ $ go generate ./...
You can use the following command to invoke `counterfeiter` from within a go module:
```shell
-$ go run github.com/maxbrunsfeld/counterfeiter/v6
+$ go tool counterfeiter
USAGE
counterfeiter
@@ -153,7 +142,7 @@ type MySpecialInterface interface {
```
```shell
-$ go run github.com/maxbrunsfeld/counterfeiter/v6 path/to/foo MySpecialInterface
+$ go tool counterfeiter path/to/foo MySpecialInterface
Wrote `FakeMySpecialInterface` to `path/to/foo/foofakes/fake_my_special_interface.go`
```
@@ -196,7 +185,7 @@ For more examples of using the `counterfeiter` API, look at [some of the provide
For third party interfaces, you can specify the interface using the alternative syntax `.`, for example:
```shell
-$ go run github.com/maxbrunsfeld/counterfeiter/v6 github.com/go-redis/redis.Pipeliner
+$ go tool counterfeiter github.com/go-redis/redis.Pipeliner
```
### Running The Tests For `counterfeiter`
diff --git a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/fake.go b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/fake.go
index 5c2a6fd1a..fbdad7b35 100644
--- a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/fake.go
+++ b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/fake.go
@@ -104,6 +104,72 @@ func (f *Fake) IsFunction() bool {
return ok
}
+// IsConstraintInterface indicates whether the interface is a constraint interface
+// (contains type constraints like ~string) which cannot be implemented by concrete types.
+func (f *Fake) IsConstraintInterface() bool {
+ if !f.IsInterface() {
+ return false
+ }
+
+ iface, ok := f.Target.Type().Underlying().(*types.Interface)
+ if !ok {
+ return false
+ }
+
+ // check if the interface has any type constraints
+ for i := 0; i < iface.NumEmbeddeds(); i++ {
+ if _, ok := iface.EmbeddedType(i).(*types.Union); ok {
+ return true
+ }
+ }
+
+ // check for approximation constraints by examining the string representation
+ // a bit of a hack, but the Go types API doesn't expose type constraints cleanly
+ return strings.Contains(iface.String(), "~")
+}
+
+// HasConstraintInterface indicates whether any of the generic type constraints
+// are constraint interfaces that cannot be used in type assertions.
+func (f *Fake) HasConstraintInterface() bool {
+ if f.Target == nil || f.Target.Type() == nil {
+ return false
+ }
+
+ named, ok := f.Target.Type().(*types.Named)
+ if !ok {
+ return false
+ }
+
+ typeParams := named.TypeParams()
+ if typeParams.Len() == 0 {
+ return false
+ }
+
+ for i := 0; i < typeParams.Len(); i++ {
+ param := typeParams.At(i)
+ constraint := param.Constraint()
+
+ // check if the constraint is a constraint interface
+ if iface, ok := constraint.Underlying().(*types.Interface); ok {
+ // check if this interface contains type constraints
+ for j := 0; j < iface.NumEmbeddeds(); j++ {
+ if _, ok := iface.EmbeddedType(j).(*types.Union); ok {
+ return true
+ }
+ }
+
+ // check for approximation constraints by examining the string representation
+ // a bit of a hack, but the Go types API doesn't expose type constraints cleanly
+ constraintStr := constraint.String()
+ if strings.Contains(constraintStr, "~") {
+ return true
+ }
+ }
+ }
+
+ return false
+}
+
func unexport(s string) string {
s = strings.TrimSpace(s)
if s == "" {
diff --git a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/interface_template.go b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/interface_template.go
index 3be9c1a5c..1a946f807 100644
--- a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/interface_template.go
+++ b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/interface_template.go
@@ -10,12 +10,15 @@ import (
var title = cases.Title(language.Und, cases.NoLower)
+var hasConstraintInterface = func(f *Fake) bool { return f.HasConstraintInterface() }
+
var interfaceFuncs = template.FuncMap{
- "ToLower": strings.ToLower,
- "UnExport": unexport,
- "Replace": strings.Replace,
- "IsExported": isExported,
- "Title": title.String,
+ "ToLower": strings.ToLower,
+ "UnExport": unexport,
+ "Replace": strings.Replace,
+ "IsExported": isExported,
+ "Title": title.String,
+ "HasConstraintInterface": hasConstraintInterface,
}
const interfaceTemplate string = `{{.Header}}// Code generated by counterfeiter. DO NOT EDIT.
@@ -147,10 +150,6 @@ func (fake *{{$.Name}}{{$.GenericTypeParameters}}) {{Title .Name}}ReturnsOnCall(
func (fake *{{.Name}}{{$.GenericTypeParameters}}) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
- {{- range .Methods}}
- fake.{{UnExport .Name}}Mutex.RLock()
- defer fake.{{UnExport .Name}}Mutex.RUnlock()
- {{- end}}
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
@@ -171,6 +170,8 @@ func (fake *{{.Name}}{{$.GenericTypeParameters}}) recordInvocation(key string, a
}
{{if IsExported .TargetName -}}
+{{if not (HasConstraintInterface .) -}}
var _ {{.TargetAlias}}.{{.TargetName}}{{.GenericTypeConstraints}} = new({{.Name}}{{.GenericTypeConstraints}})
{{- end}}
+{{- end}}
`
diff --git a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/loader.go b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/loader.go
index 106ddfbd5..08233b0d6 100644
--- a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/loader.go
+++ b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/loader.go
@@ -138,6 +138,10 @@ func (f *Fake) findPackage() error {
if !f.IsInterface() && !f.IsFunction() {
return fmt.Errorf("cannot generate a fake for %s because it is not an interface or function", f.TargetName)
}
+
+ if f.IsConstraintInterface() {
+ return fmt.Errorf("cannot generate a fake for %s because it is a constraint interface (contains type constraints like ~string) which cannot be implemented by concrete types", f.TargetName)
+ }
}
if f.IsInterface() {
diff --git a/vendor/github.com/mgechev/revive/config/config.go b/vendor/github.com/mgechev/revive/config/config.go
index e03d337ff..224644479 100644
--- a/vendor/github.com/mgechev/revive/config/config.go
+++ b/vendor/github.com/mgechev/revive/config/config.go
@@ -113,6 +113,9 @@ var allRules = append([]lint.Rule{
&rule.PackageDirectoryMismatchRule{},
&rule.UseWaitGroupGoRule{},
&rule.UnsecureURLSchemeRule{},
+ &rule.InefficientMapLookupRule{},
+ &rule.ForbiddenCallInWgGoRule{},
+ &rule.UnnecessaryIfRule{},
}, defaultRules...)
// allFormatters is a list of all available formatters to output the linting results.
@@ -207,19 +210,22 @@ func normalizeConfig(config *lint.Config) {
if len(config.Rules) == 0 {
config.Rules = map[string]lint.RuleConfig{}
}
- if config.EnableAllRules {
- // Add to the configuration all rules not yet present in it
- for _, r := range allRules {
+
+ addRules := func(config *lint.Config, rules []lint.Rule) {
+ for _, r := range rules {
ruleName := r.Name()
- _, alreadyInConf := config.Rules[ruleName]
- if alreadyInConf {
- continue
+ if _, ok := config.Rules[ruleName]; !ok {
+ config.Rules[ruleName] = lint.RuleConfig{}
}
- // Add the rule with an empty conf for
- config.Rules[ruleName] = lint.RuleConfig{}
}
}
+ if config.EnableAllRules {
+ addRules(config, allRules)
+ } else if config.EnableDefaultRules {
+ addRules(config, defaultRules)
+ }
+
severity := config.Severity
if severity != "" {
for k, v := range config.Rules {
diff --git a/vendor/github.com/mgechev/revive/lint/config.go b/vendor/github.com/mgechev/revive/lint/config.go
index ae9a20a7c..3047fd29d 100644
--- a/vendor/github.com/mgechev/revive/lint/config.go
+++ b/vendor/github.com/mgechev/revive/lint/config.go
@@ -60,6 +60,7 @@ type Config struct {
Confidence float64 `toml:"confidence"`
Severity Severity `toml:"severity"`
EnableAllRules bool `toml:"enableAllRules"`
+ EnableDefaultRules bool `toml:"enableDefaultRules"`
Rules RulesConfig `toml:"rule"`
ErrorCode int `toml:"errorCode"`
WarningCode int `toml:"warningCode"`
diff --git a/vendor/github.com/mgechev/revive/lint/failure.go b/vendor/github.com/mgechev/revive/lint/failure.go
index d9ff93e82..c25df4836 100644
--- a/vendor/github.com/mgechev/revive/lint/failure.go
+++ b/vendor/github.com/mgechev/revive/lint/failure.go
@@ -11,6 +11,8 @@ const (
// FailureCategoryBadPractice indicates bad practice issues.
FailureCategoryBadPractice FailureCategory = "bad practice"
// FailureCategoryCodeStyle indicates code style issues.
+ //
+ // Deprecated: use FailureCategoryStyle instead.
FailureCategoryCodeStyle FailureCategory = "code-style"
// FailureCategoryComments indicates comment issues.
FailureCategoryComments FailureCategory = "comments"
diff --git a/vendor/github.com/mgechev/revive/rule/confusing_naming.go b/vendor/github.com/mgechev/revive/rule/confusing_naming.go
index 774eb04ee..83f53a596 100644
--- a/vendor/github.com/mgechev/revive/rule/confusing_naming.go
+++ b/vendor/github.com/mgechev/revive/rule/confusing_naming.go
@@ -167,6 +167,11 @@ func checkStructFields(fields *ast.FieldList, structName string, w *lintConfusin
bl := make(map[string]bool, len(fields.List))
for _, f := range fields.List {
for _, id := range f.Names {
+ // Skip blank identifiers
+ if id.Name == "_" {
+ continue
+ }
+
normName := strings.ToUpper(id.Name)
if bl[normName] {
w.onFailure(lint.Failure{
diff --git a/vendor/github.com/mgechev/revive/rule/deep_exit.go b/vendor/github.com/mgechev/revive/rule/deep_exit.go
index 6f7acd305..ed3e34b53 100644
--- a/vendor/github.com/mgechev/revive/rule/deep_exit.go
+++ b/vendor/github.com/mgechev/revive/rule/deep_exit.go
@@ -7,6 +7,7 @@ import (
"unicode"
"unicode/utf8"
+ "github.com/mgechev/revive/internal/astutils"
"github.com/mgechev/revive/lint"
)
@@ -64,12 +65,18 @@ func (w *lintDeepExit) Visit(node ast.Node) ast.Visitor {
pkg := id.Name
fn := fc.Sel.Name
- if isCallToExitFunction(pkg, fn) {
+ if isCallToExitFunction(pkg, fn, ce.Args) {
+ msg := fmt.Sprintf("calls to %s.%s only in main() or init() functions", pkg, fn)
+
+ if pkg == "flag" && fn == "NewFlagSet" &&
+ len(ce.Args) == 2 && astutils.IsPkgDotName(ce.Args[1], "flag", "ExitOnError") {
+ msg = "calls to flag.NewFlagSet with flag.ExitOnError only in main() or init() functions"
+ }
w.onFailure(lint.Failure{
Confidence: 1,
Node: ce,
Category: lint.FailureCategoryBadPractice,
- Failure: fmt.Sprintf("calls to %s.%s only in main() or init() functions", pkg, fn),
+ Failure: msg,
})
}
diff --git a/vendor/github.com/mgechev/revive/rule/defer.go b/vendor/github.com/mgechev/revive/rule/defer.go
index 9cab004ae..a85336846 100644
--- a/vendor/github.com/mgechev/revive/rule/defer.go
+++ b/vendor/github.com/mgechev/revive/rule/defer.go
@@ -87,7 +87,7 @@ type lintDeferRule struct {
onFailure func(lint.Failure)
inALoop bool
inADefer bool
- inAFuncLit bool
+ inAFuncLit byte // 0 = not in func lit, 1 = in top-level func lit, >1 = nested func lit
allow map[string]bool
}
@@ -100,10 +100,10 @@ func (w lintDeferRule) Visit(node ast.Node) ast.Visitor {
w.visitSubtree(n.Body, w.inADefer, true, w.inAFuncLit)
return nil
case *ast.FuncLit:
- w.visitSubtree(n.Body, w.inADefer, false, true)
+ w.visitSubtree(n.Body, w.inADefer, false, w.inAFuncLit+1)
return nil
case *ast.ReturnStmt:
- if len(n.Results) != 0 && w.inADefer && w.inAFuncLit {
+ if len(n.Results) != 0 && w.inADefer && w.inAFuncLit == 1 {
w.newFailure("return in a defer function has no effect", n, 1.0, lint.FailureCategoryLogic, deferOptionReturn)
}
case *ast.CallExpr:
@@ -114,7 +114,7 @@ func (w lintDeferRule) Visit(node ast.Node) ast.Visitor {
//
// confidence is not 1 because recover can be in a function that is deferred elsewhere
w.newFailure("recover must be called inside a deferred function", n, 0.8, lint.FailureCategoryLogic, deferOptionRecover)
- case w.inADefer && !w.inAFuncLit && isCallToRecover:
+ case w.inADefer && w.inAFuncLit == 0 && isCallToRecover:
// defer helper(recover())
//
// confidence is not truly 1 because this could be in a correctly-deferred func,
@@ -130,13 +130,13 @@ func (w lintDeferRule) Visit(node ast.Node) ast.Visitor {
// but normally this doesn't suppress a panic, and even if it did it would silently discard the value.
w.newFailure("recover must be called inside a deferred function, this is executing recover immediately", n, 1, lint.FailureCategoryLogic, deferOptionImmediateRecover)
}
- w.visitSubtree(n.Call.Fun, true, false, false)
+ w.visitSubtree(n.Call.Fun, true, false, 0)
for _, a := range n.Call.Args {
switch a.(type) {
case *ast.FuncLit:
continue // too hard to analyze deferred calls with func literals args
default:
- w.visitSubtree(a, true, false, false) // check arguments, they should not contain recover()
+ w.visitSubtree(a, true, false, 0) // check arguments, they should not contain recover()
}
}
@@ -162,7 +162,7 @@ func (w lintDeferRule) Visit(node ast.Node) ast.Visitor {
return w
}
-func (w lintDeferRule) visitSubtree(n ast.Node, inADefer, inALoop, inAFuncLit bool) {
+func (w lintDeferRule) visitSubtree(n ast.Node, inADefer, inALoop bool, inAFuncLit byte) {
nw := lintDeferRule{
onFailure: w.onFailure,
inADefer: inADefer,
diff --git a/vendor/github.com/mgechev/revive/rule/file_length_limit.go b/vendor/github.com/mgechev/revive/rule/file_length_limit.go
index a9b4e8da9..c24db4353 100644
--- a/vendor/github.com/mgechev/revive/rule/file_length_limit.go
+++ b/vendor/github.com/mgechev/revive/rule/file_length_limit.go
@@ -57,7 +57,7 @@ func (r *FileLengthLimitRule) Apply(file *lint.File, _ lint.Arguments) []lint.Fa
return []lint.Failure{
{
- Category: lint.FailureCategoryCodeStyle,
+ Category: lint.FailureCategoryStyle,
Confidence: 1,
Position: lint.FailurePosition{
Start: token.Position{
diff --git a/vendor/github.com/mgechev/revive/rule/forbidden_call_in_wg_go.go b/vendor/github.com/mgechev/revive/rule/forbidden_call_in_wg_go.go
new file mode 100644
index 000000000..63088e554
--- /dev/null
+++ b/vendor/github.com/mgechev/revive/rule/forbidden_call_in_wg_go.go
@@ -0,0 +1,113 @@
+package rule
+
+import (
+ "fmt"
+ "go/ast"
+ "strings"
+
+ "github.com/mgechev/revive/internal/astutils"
+ "github.com/mgechev/revive/lint"
+)
+
+// ForbiddenCallInWgGoRule spots calls to panic or wg.Done when using WaitGroup.Go.
+type ForbiddenCallInWgGoRule struct{}
+
+// Apply applies the rule to given file.
+func (*ForbiddenCallInWgGoRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
+ if !file.Pkg.IsAtLeastGoVersion(lint.Go125) {
+ return nil // skip analysis if Go version < 1.25
+ }
+
+ var failures []lint.Failure
+
+ onFailure := func(failure lint.Failure) {
+ failures = append(failures, failure)
+ }
+
+ w := &lintForbiddenCallInWgGo{
+ onFailure: onFailure,
+ }
+
+ // Iterate over declarations looking for function declarations
+ for _, decl := range file.AST.Decls {
+ fn, ok := decl.(*ast.FuncDecl)
+ if !ok {
+ continue // not a function
+ }
+
+ if fn.Body == nil {
+ continue // external (no-Go) function
+ }
+
+ // Analyze the function body
+ ast.Walk(w, fn.Body)
+ }
+
+ return failures
+}
+
+// Name returns the rule name.
+func (*ForbiddenCallInWgGoRule) Name() string {
+ return "forbidden-call-in-wg-go"
+}
+
+type lintForbiddenCallInWgGo struct {
+ onFailure func(lint.Failure)
+}
+
+func (w *lintForbiddenCallInWgGo) Visit(node ast.Node) ast.Visitor {
+ call, ok := node.(*ast.CallExpr)
+ if !ok {
+ return w // not a call of statements
+ }
+
+ if !astutils.IsPkgDotName(call.Fun, "wg", "Go") {
+ return w // not a call to wg.Go
+ }
+
+ if len(call.Args) != 1 {
+ return nil // no argument (impossible)
+ }
+
+ funcLit, ok := call.Args[0].(*ast.FuncLit)
+ if !ok {
+ return nil // the argument is not a function literal
+ }
+
+ var callee string
+
+ forbiddenCallPicker := func(n ast.Node) bool {
+ call, ok := n.(*ast.CallExpr)
+ if !ok {
+ return false
+ }
+
+ if astutils.IsPkgDotName(call.Fun, "wg", "Done") ||
+ astutils.IsIdent(call.Fun, "panic") ||
+ astutils.IsPkgDotName(call.Fun, "log", "Panic") ||
+ astutils.IsPkgDotName(call.Fun, "log", "Panicf") ||
+ astutils.IsPkgDotName(call.Fun, "log", "Panicln") {
+ callee = astutils.GoFmt(n)
+ callee, _, _ = strings.Cut(callee, "(")
+ return true
+ }
+
+ return false
+ }
+
+ // search a forbidden call in the body of the function literal
+ forbiddenCall := astutils.SeekNode[*ast.CallExpr](funcLit.Body, forbiddenCallPicker)
+ if forbiddenCall == nil {
+ return nil // there is no forbidden call in the call to wg.Go
+ }
+
+ msg := fmt.Sprintf("do not call %s inside wg.Go", callee)
+ w.onFailure(lint.Failure{
+ Confidence: 1,
+ Node: forbiddenCall,
+ Category: lint.FailureCategoryErrors,
+ Failure: msg,
+ })
+
+ return nil
+}
diff --git a/vendor/github.com/mgechev/revive/rule/import_shadowing.go b/vendor/github.com/mgechev/revive/rule/import_shadowing.go
index 09520785c..0028d9673 100644
--- a/vendor/github.com/mgechev/revive/rule/import_shadowing.go
+++ b/vendor/github.com/mgechev/revive/rule/import_shadowing.go
@@ -13,12 +13,12 @@ import (
type ImportShadowingRule struct{}
// Apply applies the rule to given file.
-func (*ImportShadowingRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
+func (r *ImportShadowingRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
var failures []lint.Failure
importNames := map[string]struct{}{}
for _, imp := range file.AST.Imports {
- importNames[getName(imp)] = struct{}{}
+ importNames[r.getName(imp)] = struct{}{}
}
fileAst := file.AST
@@ -42,20 +42,23 @@ func (*ImportShadowingRule) Name() string {
return "import-shadowing"
}
-func getName(imp *ast.ImportSpec) string {
+func (r *ImportShadowingRule) getName(imp *ast.ImportSpec) string {
const pathSep = "/"
const strDelim = `"`
if imp.Name != nil {
return imp.Name.Name
}
- path := imp.Path.Value
- i := strings.LastIndex(path, pathSep)
- if i == -1 {
- return strings.Trim(path, strDelim)
+ path := strings.Trim(imp.Path.Value, strDelim)
+ parts := strings.Split(path, pathSep)
+
+ lastSegment := parts[len(parts)-1]
+ if r.isVersion(lastSegment) && len(parts) >= 2 {
+ // Use the previous segment when current is a version (v1, v2, etc.).
+ return parts[len(parts)-2]
}
- return strings.Trim(path[i+1:], strDelim)
+ return lastSegment
}
type importShadowing struct {
@@ -113,3 +116,17 @@ func (w importShadowing) Visit(n ast.Node) ast.Visitor {
return w
}
+
+func (*ImportShadowingRule) isVersion(name string) bool {
+ if len(name) < 2 || (name[0] != 'v' && name[0] != 'V') {
+ return false
+ }
+
+ for i := 1; i < len(name); i++ {
+ if name[i] < '0' || name[i] > '9' {
+ return false
+ }
+ }
+
+ return true
+}
diff --git a/vendor/github.com/mgechev/revive/rule/inefficient_map_lookup.go b/vendor/github.com/mgechev/revive/rule/inefficient_map_lookup.go
new file mode 100644
index 000000000..b6e4bf921
--- /dev/null
+++ b/vendor/github.com/mgechev/revive/rule/inefficient_map_lookup.go
@@ -0,0 +1,169 @@
+package rule
+
+import (
+ "fmt"
+ "go/ast"
+ "go/token"
+ "strings"
+
+ "github.com/mgechev/revive/internal/astutils"
+ "github.com/mgechev/revive/lint"
+)
+
+// InefficientMapLookupRule spots potential inefficient map lookups.
+type InefficientMapLookupRule struct{}
+
+// Apply applies the rule to given file.
+func (*InefficientMapLookupRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
+ var failures []lint.Failure
+
+ onFailure := func(failure lint.Failure) {
+ failures = append(failures, failure)
+ }
+
+ w := &lintInefficientMapLookup{
+ file: file,
+ onFailure: onFailure,
+ }
+
+ if err := file.Pkg.TypeCheck(); err != nil {
+ return []lint.Failure{
+ lint.NewInternalFailure(fmt.Sprintf("Unable to type check file %q: %v", file.Name, err)),
+ }
+ }
+
+ // Iterate over declarations looking for function declarations
+ for _, decl := range file.AST.Decls {
+ fn, ok := decl.(*ast.FuncDecl)
+ if !ok {
+ continue // not a function
+ }
+
+ if fn.Body == nil {
+ continue // external (no-Go) function
+ }
+
+ // Analyze the function body
+ ast.Walk(w, fn.Body)
+ }
+
+ return failures
+}
+
+// Name returns the rule name.
+func (*InefficientMapLookupRule) Name() string {
+ return "inefficient-map-lookup"
+}
+
+type lintInefficientMapLookup struct {
+ file *lint.File
+ onFailure func(lint.Failure)
+}
+
+func (w *lintInefficientMapLookup) Visit(node ast.Node) ast.Visitor {
+ // Only interested in blocks of statements
+ block, ok := node.(*ast.BlockStmt)
+ if !ok {
+ return w // not a block of statements
+ }
+
+ w.analyzeBlock(block)
+
+ return w
+}
+
+// analyzeBlock searches AST subtrees with the following form
+//
+// for := range