diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db3f34c..5a41caa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ permissions: jobs: ci: name: Build & Test - runs-on: ubuntu-latest + runs-on: ubuntu-24.04-arm steps: - name: Checkout uses: actions/checkout@v4 @@ -34,6 +34,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . + platforms: linux/arm64 push: false cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/cache:main secrets: | @@ -44,6 +45,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . + platforms: linux/arm64 push: false cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/cache:main cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/cache:main,mode=max diff --git a/.gitignore b/.gitignore index fca399c..0f84266 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,17 @@ # Ignore generated protobuf Java sources vendored during local build openfeature-provider/java/src/main/java/com/spotify/confidence/wasm/Messages.java + +# Ignore compiled Go binaries +openfeature-provider/go/demo/demo .DS_Store *.stamp .idea/ .java-version target/ +# Ignore WASM in root wasm/ directory (build artifact) wasm/confidence_resolver.wasm +# But DO track WASM embedded in Go provider (committed for go:embed) +!openfeature-provider/go/wasm/confidence_resolver.wasm diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 22e5102..fb61e02 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1,9 @@ -{"confidence-resolver":"0.6.0","confidence-cloudflare-resolver":"0.3.0","wasm-msg":"0.2.1","wasm/rust-guest":"0.1.9","openfeature-provider/java":"0.7.2","openfeature-provider/js":"0.1.1"} +{ + "confidence-resolver": "0.6.0", + "confidence-cloudflare-resolver": "0.3.0", + "wasm-msg": "0.2.1", + "wasm/rust-guest": "0.1.9", + "openfeature-provider/java": "0.7.2", + "openfeature-provider/js": "0.1.1", + "openfeature-provider/go": "0.0.0" +} diff --git a/Cargo.lock b/Cargo.lock index b23eb63..1d2d131 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -750,6 +750,13 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "openfeature-provider-go" +version = "0.0.0" +dependencies = [ + "rust-guest", +] + [[package]] name = "openfeature-provider-java" version = "0.7.2" diff --git a/Cargo.toml b/Cargo.toml index 50ca21e..8e878ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,8 @@ members = [ "confidence-resolver", "confidence-cloudflare-resolver", "openfeature-provider/java", - "openfeature-provider/js" + "openfeature-provider/js", + "openfeature-provider/go" ] # Exclude the Java provider from default workspace builds (cargo build --workspace) diff --git a/Dockerfile b/Dockerfile index ac8fb70..4fc3593 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,7 @@ COPY wasm-msg/Cargo.toml ./wasm-msg/ COPY wasm/rust-guest/Cargo.toml ./wasm/rust-guest/ COPY openfeature-provider/java/Cargo.toml ./openfeature-provider/java/ COPY openfeature-provider/js/Cargo.toml ./openfeature-provider/js/ +COPY openfeature-provider/go/Cargo.toml ./openfeature-provider/go/ # Copy proto files (needed by build.rs) COPY confidence-resolver/protos ./confidence-resolver/protos/ @@ -99,6 +100,7 @@ COPY wasm/rust-guest/ ./wasm/rust-guest/ COPY wasm/proto/ ./wasm/proto/ COPY openfeature-provider/java/Cargo.toml ./openfeature-provider/java/ COPY openfeature-provider/js/Cargo.toml ./openfeature-provider/js/ +COPY openfeature-provider/go/Cargo.toml ./openfeature-provider/go/ # Touch files to ensure rebuild (dependencies are cached) RUN find . -type f -name "*.rs" -exec touch {} + @@ -152,6 +154,7 @@ COPY wasm/rust-guest/ ./wasm/rust-guest/ COPY wasm/proto/ ./wasm/proto/ COPY openfeature-provider/java/Cargo.toml ./openfeature-provider/java/ COPY openfeature-provider/js/Cargo.toml ./openfeature-provider/js/ +COPY openfeature-provider/go/Cargo.toml ./openfeature-provider/go/ # Copy data directory (needed by confidence-cloudflare-resolver include_str! macros) COPY data/ ./data/ @@ -437,6 +440,92 @@ FROM scratch AS openfeature-provider-js.artifact COPY --from=openfeature-provider-js.pack /app/package.tgz /package.tgz +# ============================================================================== +# OpenFeature Provider (Go) - Build and test +# ============================================================================== +FROM golang:1.24-alpine AS openfeature-provider-go-base + +# Install make (needed for Makefile targets) +RUN apk add --no-cache make + +WORKDIR /app + +# Copy go.mod for dependency caching +COPY openfeature-provider/go/go.mod openfeature-provider/go/go.sum ./ +COPY openfeature-provider/go/Makefile ./ + +# Download Go dependencies (this layer will be cached) +RUN go mod download + +# Copy pre-generated protobuf files +COPY openfeature-provider/go/proto ./proto/ + +# Copy WASM module to embedded location +COPY --from=wasm-rust-guest.artifact /confidence_resolver.wasm ./wasm/confidence_resolver.wasm + +# Set environment variable +ENV IN_DOCKER_BUILD=1 + +# Copy source code +COPY openfeature-provider/go/*.go ./ + +# ============================================================================== +# Validate WASM sync for Go Provider +# ============================================================================== +FROM alpine:3.22 AS openfeature-provider-go.validate-wasm + +# Install diffutils for cmp command +RUN apk add --no-cache diffutils + +# Copy built WASM from artifact +COPY --from=wasm-rust-guest.artifact /confidence_resolver.wasm /built/confidence_resolver.wasm + +# Copy committed WASM from source +COPY openfeature-provider/go/wasm/confidence_resolver.wasm /committed/confidence_resolver.wasm + +# Compare files +RUN set -e; \ + echo "Validating WASM sync for Go provider..."; \ + if ! cmp -s /built/confidence_resolver.wasm /committed/confidence_resolver.wasm; then \ + echo ""; \ + echo "❌ ERROR: WASM files are out of sync!"; \ + echo ""; \ + echo "The WASM file in openfeature-provider/go/wasm/ doesn't match the built version."; \ + echo ""; \ + echo "To fix (using Docker to ensure correct dependencies):"; \ + echo " docker build --target wasm-rust-guest.artifact --output type=local,dest=. ."; \ + echo " cp confidence_resolver.wasm openfeature-provider/go/wasm/"; \ + echo " git add openfeature-provider/go/wasm/confidence_resolver.wasm"; \ + echo " git commit -m 'chore: sync WASM module for Go provider'"; \ + echo ""; \ + echo "Or use the Makefile target:"; \ + echo " make sync-wasm-go"; \ + echo ""; \ + exit 1; \ + fi; \ + echo "✅ WASM files are in sync" + +# ============================================================================== +# Test OpenFeature Provider (Go) +# ============================================================================== +FROM openfeature-provider-go-base AS openfeature-provider-go.test + +RUN make test + +# ============================================================================== +# Lint OpenFeature Provider (Go) +# ============================================================================== +FROM openfeature-provider-go-base AS openfeature-provider-go.lint + +RUN make lint + +# ============================================================================== +# Build OpenFeature Provider (Go) +# ============================================================================== +FROM openfeature-provider-go-base AS openfeature-provider-go.build + +RUN make build + # ============================================================================== # OpenFeature Provider (Java) - Build and test # ============================================================================== @@ -511,6 +600,10 @@ COPY --from=wasm-msg.test /workspace/Cargo.toml /markers/test-wasm-msg COPY --from=openfeature-provider-js.test /app/package.json /markers/test-openfeature-js COPY --from=openfeature-provider-js.test_e2e /app/package.json /markers/test-openfeature-js-e2e COPY --from=openfeature-provider-java.test /app/pom.xml /markers/test-openfeature-java +COPY --from=openfeature-provider-go.test /app/go.mod /markers/test-openfeature-go + +# Force validation stages to run +COPY --from=openfeature-provider-go.validate-wasm /built/confidence_resolver.wasm /markers/validate-wasm-go # Force integration test stages to run (host examples) COPY --from=node-host.test /app/package.json /markers/integration-node @@ -518,12 +611,14 @@ COPY --from=java-host.test /app/pom.xml /markers/integration-java COPY --from=go-host.test /app/go.mod /markers/integration-go COPY --from=python-host.test /app/Makefile /markers/integration-python -# Force lint stages to run by copying marker files +# Force lint stages to run by copying marker files COPY --from=confidence-resolver.lint /workspace/Cargo.toml /markers/lint-resolver COPY --from=wasm-msg.lint /workspace/Cargo.toml /markers/lint-wasm-msg COPY --from=wasm-rust-guest.lint /workspace/Cargo.toml /markers/lint-guest +COPY --from=openfeature-provider-go.lint /app/go.mod /markers/lint-openfeature-go +COPY --from=confidence-cloudflare-resolver.lint /workspace/Cargo.toml /markers/lint-cloudflare # Force build stages to run COPY --from=openfeature-provider-js.build /app/dist/index.node.js /artifacts/openfeature-js/ COPY --from=openfeature-provider-java.build /app/target/*.jar /artifacts/openfeature-java/ -COPY --from=confidence-cloudflare-resolver.lint /workspace/Cargo.toml /markers/lint-cloudflare +COPY --from=openfeature-provider-go.build /app/.build.stamp /artifacts/openfeature-go/ diff --git a/Makefile b/Makefile index 3ee9640..d45cf51 100644 --- a/Makefile +++ b/Makefile @@ -13,11 +13,27 @@ wasm/confidence_resolver.wasm: $(TARGET_WASM) @cp -p $(TARGET_WASM) $@ @echo "WASM size: $$(ls -lh $@ | awk '{print $$5}')" +# Sync WASM to Go provider using Docker to ensure correct toolchain +.PHONY: sync-wasm-go +sync-wasm-go: + @echo "Building WASM with Docker to ensure correct dependencies..." + @docker build --platform linux/arm64 --target wasm-rust-guest.artifact --output type=local,dest=. . + @echo "Copying to Go provider embedded location..." + @mkdir -p openfeature-provider/go/wasm + @cp confidence_resolver.wasm openfeature-provider/go/wasm/ + @rm confidence_resolver.wasm + @echo "✅ WASM synced to openfeature-provider/go/wasm/" + @echo "" + @echo "Don't forget to commit the change:" + @echo " git add openfeature-provider/go/wasm/confidence_resolver.wasm" + @echo " git commit -m 'chore: sync WASM module for Go provider'" + test: $(MAKE) -C confidence-resolver test $(MAKE) -C wasm-msg test $(MAKE) -C openfeature-provider/js test $(MAKE) -C openfeature-provider/java test + $(MAKE) -C openfeature-provider/go test integration-test: $(MAKE) -C wasm/node-host run @@ -32,11 +48,13 @@ lint: $(MAKE) -C wasm-msg lint $(MAKE) -C wasm/rust-guest lint $(MAKE) -C confidence-cloudflare-resolver lint + $(MAKE) -C openfeature-provider/go lint cargo fmt --check -p wasm-msg -p rust-guest -p confidence_resolver -p confidence-cloudflare-resolver build: wasm/confidence_resolver.wasm $(MAKE) -C openfeature-provider/js build $(MAKE) -C openfeature-provider/java build + $(MAKE) -C openfeature-provider/go build all: lint test build @echo "✅ All checks passed!" @@ -49,5 +67,6 @@ clean: $(MAKE) -C wasm/python-host clean $(MAKE) -C openfeature-provider/js clean $(MAKE) -C openfeature-provider/java clean + $(MAKE) -C openfeature-provider/go clean .DEFAULT_GOAL := all diff --git a/openfeature-provider/go/CHANGELOG.md b/openfeature-provider/go/CHANGELOG.md new file mode 100644 index 0000000..4dc68c6 --- /dev/null +++ b/openfeature-provider/go/CHANGELOG.md @@ -0,0 +1,2 @@ +# Changelog + diff --git a/openfeature-provider/go/Cargo.toml b/openfeature-provider/go/Cargo.toml new file mode 100644 index 0000000..62f1adf --- /dev/null +++ b/openfeature-provider/go/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "openfeature-provider-go" +version = "0.0.0" +edition = "2021" +publish = false + +# This is a dummy Cargo.toml to enable cargo-workspace plugin tracking +# in release-please. The actual package is built with Go (go.mod). +# This package depends on rust-guest's WASM output. +# +# Note: This dummy package is never actually built - it exists solely for +# release-please dependency tracking via the cargo-workspace plugin. + +[lib] +# Dummy library with no source - cargo won't try to build it +path = "Cargo.toml" +crate-type = [] + +[dependencies] +rust-guest = { path = "../../wasm/rust-guest", version = "0.1.9" } diff --git a/openfeature-provider/go/Makefile b/openfeature-provider/go/Makefile new file mode 100644 index 0000000..36a6ff4 --- /dev/null +++ b/openfeature-provider/go/Makefile @@ -0,0 +1,59 @@ +# openfeature-provider/go Makefile +# Go OpenFeature local provider + +ROOT := $(realpath $(CURDIR)/../..) + +# Stamps and directories +BUILD_STAMP := .build.stamp +PROTO_DIR := proto +WASM_ARTIFACT := $(ROOT)/wasm/confidence_resolver.wasm + +# Source files +GO_SRC := $(shell find . -name '*.go' -not -path './proto/*' -not -path './demo/*') +PROTO_GEN := $(shell find $(PROTO_DIR) -name '*.pb.go' 2>/dev/null) + +.PHONY: install build test lint clean proto + +# Always build wasm if not in docker +ifneq ($(IN_DOCKER_BUILD),1) +.PHONY: build-wasm +build-wasm: + @$(MAKE) -C $(ROOT) wasm/confidence_resolver.wasm +$(BUILD_STAMP): | build-wasm +endif + +# Install Go dependencies +install: + go mod download + go mod verify + +# Generate protobuf files +proto: + ./scripts/generate_proto.sh + +# Build (compile check) +$(BUILD_STAMP): go.mod go.sum $(GO_SRC) $(PROTO_GEN) + go build ./... + @touch $@ + +build: $(BUILD_STAMP) + +# Run tests +test: $(BUILD_STAMP) + go test -v ./... + +# Lint using gofmt and go vet +lint: + @echo "Checking gofmt..." + @test -z "$$(gofmt -l . | grep -v '^proto/' | tee /dev/stderr)" || (echo "Files need formatting. Run: gofmt -w ." && exit 1) + @echo "Running go vet..." + @go vet ./... + @echo "✅ Lint passed" + +# Clean build artifacts +clean: + rm -rf $(PROTO_DIR) + rm -f $(BUILD_STAMP) + go clean -cache -testcache -modcache + +.DEFAULT_GOAL := build diff --git a/openfeature-provider/go/README.md b/openfeature-provider/go/README.md new file mode 100644 index 0000000..6fb38de --- /dev/null +++ b/openfeature-provider/go/README.md @@ -0,0 +1,171 @@ +# Confidence OpenFeature Provider for Go + +![Status: Experimental](https://img.shields.io/badge/status-experimental-orange) + +A high-performance OpenFeature provider for [Confidence](https://confidence.spotify.com/) feature flags that evaluates flags locally for minimal latency. + +## Features + +- **Local Resolution**: Evaluates feature flags locally using WebAssembly (WASM) +- **Low Latency**: No network calls during flag evaluation +- **Automatic Sync**: Periodically syncs flag configurations from Confidence +- **Exposure Logging**: Fully supported exposure logging and resolve analytics +- **OpenFeature Compatible**: Works with the standard OpenFeature Go SDK + +## Installation + +```bash +go get github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence +``` + +## Requirements + +- Go 1.24+ +- OpenFeature Go SDK 1.16.0+ + +## Quick Start + +```go +package main + +import ( + "context" + "log" + + "github.com/open-feature/go-sdk/openfeature" + "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence" +) + +func main() { + ctx := context.Background() + + // Create provider with required credentials + provider, err := confidence.NewProvider(ctx, confidence.ProviderConfig{ + APIClientID: "your-api-client-id", + APIClientSecret: "your-api-client-secret", + ClientSecret: "your-client-secret", + }) + if err != nil { + log.Fatalf("Failed to create provider: %v", err) + } + + // Set the provider + openfeature.SetProviderAndWait(provider) + + // Get a client + client := openfeature.NewClient("my-app") + + // Evaluate a flag + evalCtx = openfeature.NewEvaluationContext("user-123", map[string]interface{}{ + "country": "US", + "plan": "premium", + }) + + value, err := client.BooleanValue(ctx, "my-flag.enabled", false, evalCtx) + if err != nil { + log.Printf("Flag evaluation failed: %v", err) + } + + log.Printf("Flag value: %v", value) +} +``` + +## Configuration + +### ProviderConfig + +The `ProviderConfig` struct contains all configuration options for the provider: + +#### Required Fields + +- `APIClientID` (string): OAuth client ID for Confidence IAM +- `APIClientSecret` (string): OAuth client secret for Confidence IAM +- `ClientSecret` (string): The flag client secret used during evaluation + +#### Optional Fields + +- `ResolverStateServiceAddr` (string): Custom address for the resolver state service. Defaults to `edge-grpc.spotify.com` +- `FlagLoggerServiceAddr` (string): Custom address for the flag logger service. Defaults to `edge-grpc.spotify.com` +- `AuthServiceAddr` (string): Custom address for the auth service. Defaults to `edge-grpc.spotify.com` + +> **Note**: The optional service address fields are for advanced use cases only. For production deployments, use the default global region by omitting these fields. + +#### Advanced: Testing with Custom State Provider + +For testing purposes only, you can provide a custom `StateProvider` to supply resolver state from local sources (e.g., a file cache): + +```go +// WARNING: This is for testing only. Do not use in production. +provider, err := confidence.NewProviderWithStateProvider(ctx, + confidence.ProviderConfigWithStateProvider{ + ClientSecret: "your-client-secret", + StateProvider: myCustomStateProvider, + AccountId: "your-account-id", + // WasmBytes: customWasmBytes, // Optional: custom WASM module + }, +) +``` + +**Important**: This configuration disables automatic state fetching and exposure logging. For production deployments, always use `NewProvider()` with `ProviderConfig`. + +## Credentials + +You need two types of credentials from your [Confidence dashboard](https://confidence.spotify.com/): + +1. **API Credentials** (for authenticating with the Confidence API): + - `APIClientID`: OAuth client ID for your Confidence application + - `APIClientSecret`: OAuth client secret for your Confidence application + +2. **Client Secret** (for flag resolution authentication): + - `ClientSecret`: Application-specific identifier for flag evaluation + + +## WebAssembly Module + +The WASM module (`confidence_resolver.wasm`) is embedded in the Go binary using Go 1.16+ embed directives. No external WASM file is required at runtime. + +## Flag Evaluation + +The provider supports all OpenFeature value types: + +```go +// Boolean flags +enabled, err := client.BooleanValue(ctx, "feature.enabled", false, evalCtx) + +// String flags +color, err := client.StringValue(ctx, "feature.button_color", "blue", evalCtx) + +// Integer flags +timeout, err := client.IntValue(ctx, "feature.timeout-ms", 5000, evalCtx) + +// Float flags +ratio, err := client.FloatValue(ctx, "feature.sampling_ratio", 0.5, evalCtx) + +// Object/structured flags +config, err := client.ObjectValue(ctx, "feature", map[string]interface{}{}, evalCtx) +``` + +## Troubleshooting + +### Provider Creation Fails + +If provider creation fails, verify: +- `APIClientID`, `APIClientSecret`, and `ClientSecret` are correct +- Your application has network access to `edge-grpc.spotify.com` (or custom service addresses if configured) +- Credentials have the necessary permissions in your Confidence dashboard + +### No Flag Evaluations Work + +Common issues: +- Ensure you've called `openfeature.SetProviderAndWait(provider)` before creating clients +- Check that your flags are published and active in Confidence + +### Performance Issues + +For optimal performance: +- Reuse the same `provider` instance across your application +- Create OpenFeature clients once and reuse them + +## License + +See the root `LICENSE` file. diff --git a/openfeature-provider/go/confidence/proto b/openfeature-provider/go/confidence/proto new file mode 120000 index 0000000..5c8d352 --- /dev/null +++ b/openfeature-provider/go/confidence/proto @@ -0,0 +1 @@ +../proto \ No newline at end of file diff --git a/openfeature-provider/go/demo/README.md b/openfeature-provider/go/demo/README.md new file mode 100644 index 0000000..6c8aff0 --- /dev/null +++ b/openfeature-provider/go/demo/README.md @@ -0,0 +1,28 @@ +# Confidence OpenFeature Provider Demo + +Demo application showing how to use the Confidence OpenFeature Local Provider in Go. + +## Prerequisites + +- Go 1.24+ +- Confidence API credentials + +## Setup + +Set the required environment variables: + +```bash +export CONFIDENCE_API_CLIENT_ID="your-api-client-id" +export CONFIDENCE_API_CLIENT_SECRET="your-api-client-secret" +export CONFIDENCE_CLIENT_SECRET="your-client-secret" +``` + +Get your credentials from the [Confidence dashboard](https://confidence.spotify.com/). + +## Run + +```bash +go run main.go +``` + +The demo runs concurrent flag evaluations to test performance and state synchronization. diff --git a/openfeature-provider/go/demo/go.mod b/openfeature-provider/go/demo/go.mod new file mode 100644 index 0000000..79322a7 --- /dev/null +++ b/openfeature-provider/go/demo/go.mod @@ -0,0 +1,24 @@ +module github.com/spotify/confidence-resolver-rust/openfeature-provider/go/demo + +go 1.24.0 + +require ( + github.com/open-feature/go-sdk v1.16.0 + github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence v0.0.0 +) + +require ( + github.com/go-logr/logr v1.4.3 // indirect + github.com/tetratelabs/wazero v1.9.0 // indirect + go.uber.org/mock v0.6.0 // indirect + golang.org/x/net v0.44.0 // indirect + golang.org/x/sys v0.36.0 // indirect + golang.org/x/text v0.29.0 // indirect + google.golang.org/genproto v0.0.0-20251029180050-ab9386a59fda // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20251029180050-ab9386a59fda // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f // indirect + google.golang.org/grpc v1.76.0 // indirect + google.golang.org/protobuf v1.36.10 // indirect +) + +replace github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence => ../ diff --git a/openfeature-provider/go/demo/go.sum b/openfeature-provider/go/demo/go.sum new file mode 100644 index 0000000..11db859 --- /dev/null +++ b/openfeature-provider/go/demo/go.sum @@ -0,0 +1,46 @@ +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +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/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +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/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/open-feature/go-sdk v1.16.0 h1:5NCHYv5slvNBIZhYXAzAufo0OI59OACZ5tczVqSE+Tg= +github.com/open-feature/go-sdk v1.16.0/go.mod h1:EIF40QcoYT1VbQkMPy2ZJH4kvZeY+qGUXAorzSWgKSo= +github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I= +github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM= +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/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/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.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= +golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= +golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= +golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= +golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= +golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= +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-20251029180050-ab9386a59fda h1:fQ3VVQ11pb84nu0o/8wD6oZq13Q6+HK30P+9GSRlrqk= +google.golang.org/genproto v0.0.0-20251029180050-ab9386a59fda/go.mod h1:1Ic78BnpzY8OaTCmzxJDP4qC9INZPbGZl+54RKjtyeI= +google.golang.org/genproto/googleapis/api v0.0.0-20251029180050-ab9386a59fda h1:+2XxjfsAu6vqFxwGBRcHiMaDCuZiqXGDUDVWVtrFAnE= +google.golang.org/genproto/googleapis/api v0.0.0-20251029180050-ab9386a59fda/go.mod h1:fDMmzKV90WSg1NbozdqrE64fkuTv6mlq2zxo9ad+3yo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f h1:1FTH6cpXFsENbPR5Bu8NQddPSaUUE6NA2XdZdDSAJK4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= +google.golang.org/grpc v1.76.0 h1:UnVkv1+uMLYXoIz6o7chp59WfQUYA2ex/BXQ9rHZu7A= +google.golang.org/grpc v1.76.0/go.mod h1:Ju12QI8M6iQJtbcsV+awF5a4hfJMLi4X0JLo94ULZ6c= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/openfeature-provider/go/demo/main.go b/openfeature-provider/go/demo/main.go new file mode 100644 index 0000000..340c4cb --- /dev/null +++ b/openfeature-provider/go/demo/main.go @@ -0,0 +1,200 @@ +package main + +import ( + "context" + "log" + "os" + "sync" + "sync/atomic" + "time" + + "github.com/open-feature/go-sdk/openfeature" + "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence" +) + +func main() { + ctx := context.Background() + + // Load configuration from environment variables + apiClientID := getEnvOrDefault("CONFIDENCE_API_CLIENT_ID", "API_ID") + apiClientSecret := getEnvOrDefault("CONFIDENCE_API_CLIENT_SECRET", "API_SECRET") + clientSecret := getEnvOrDefault("CONFIDENCE_CLIENT_SECRET", "CLIENT_SECRET") + + // Validate configuration - fail fast on placeholder credentials + if apiClientID == "API_ID" || apiClientSecret == "API_SECRET" || clientSecret == "CLIENT_SECRET" { + log.Fatalf("ERROR: Placeholder credentials detected. Please set environment variables:\n" + + " - CONFIDENCE_API_CLIENT_ID\n" + + " - CONFIDENCE_API_CLIENT_SECRET\n" + + " - CONFIDENCE_CLIENT_SECRET\n\n" + + "Example:\n" + + " export CONFIDENCE_API_CLIENT_ID=\"your-api-client-id\"\n" + + " export CONFIDENCE_API_CLIENT_SECRET=\"your-api-client-secret\"\n" + + " export CONFIDENCE_CLIENT_SECRET=\"your-client-secret\"\n") + } + + log.Println("Starting Confidence OpenFeature Local Provider Demo") + log.Println("") + + // Create provider with simple configuration + log.Println("Creating Confidence provider...") + + provider, err := confidence.NewProvider(ctx, confidence.ProviderConfig{ + APIClientID: apiClientID, + APIClientSecret: apiClientSecret, + ClientSecret: clientSecret, + }) + if err != nil { + log.Fatalf("Failed to create provider: %v", err) + } + defer provider.Shutdown() + log.Println("Confidence provider created successfully") + + // Register with OpenFeature + err = openfeature.SetProviderAndWait(provider) + if err != nil { + return + } + log.Println("OpenFeature provider registered") + log.Println("") + + // Create OpenFeature client + client := openfeature.NewClient("demo-app") + + // Demo: Evaluate flags with multiple concurrent threads + log.Println("=== Flag Evaluation Demo with 10 Concurrent Threads ===") + log.Println("") + + // Create evaluation context + evalCtx := openfeature.NewEvaluationContext( + "user-123", + map[string]interface{}{ + "user_id": "vahid", + "visitor_id": "vahid", + }, + ) + + // Run 5 concurrent threads continuously for 5 second + var wg sync.WaitGroup + numThreads := 5 + runDuration := 5 * time.Second + + log.Printf("Starting %d threads to run for %v to test reload and flush...", numThreads, runDuration) + log.Println("") + + startTime := time.Now() + stopTime := startTime.Add(runDuration) + + // Shared counters for throughput calculation + var totalSuccess, totalErrors int64 + + for i := 0; i < numThreads; i++ { + wg.Add(1) + threadID := i + go func() { + defer wg.Done() + + var successCount, errorCount int64 + iteration := 0 + + for time.Now().Before(stopTime) { + // Use ObjectValueDetails to get the full flag object + result, err := client.ObjectValueDetails(ctx, "mattias-boolean-flag", map[string]interface{}{}, evalCtx) + if err != nil { + errorCount++ + if iteration == 0 { // Only log first error per thread + log.Printf("Thread %d: Error: %v", threadID, err) + } + } else { + successCount++ + if iteration == 0 { // Only log first success per thread + log.Printf("Thread %d: First result - Value: %+v, Variant: %s, Reason: %s", + threadID, result.Value, result.Variant, result.Reason) + } + } + iteration++ + + // Small sleep to avoid tight loop + time.Sleep(1 * time.Millisecond) + } + + // Update shared counters atomically + atomic.AddInt64(&totalSuccess, successCount) + atomic.AddInt64(&totalErrors, errorCount) + + log.Printf("Thread %d complete after %v: %d successes, %d errors (%d total iterations)", + threadID, time.Since(startTime), successCount, errorCount, iteration) + }() + } + + // Wait for all threads to complete + wg.Wait() + + duration := time.Since(startTime) + totalRequests := totalSuccess + totalErrors + throughputPerSecond := float64(totalRequests) / duration.Seconds() + + log.Println("") + log.Println("=== Demo Complete ===") + log.Printf("Total time: %v", duration) + log.Printf("Throughput: %.2f requests/second", throughputPerSecond) + log.Printf("Average latency: %.2f ms/request", duration.Seconds()*1000/float64(totalRequests)) + log.Println("Check logs above for per-thread statistics and state reload/flush messages") + log.Println("") +} + +func getEnvOrDefault(key, defaultValue string) string { + if value := os.Getenv(key); value != "" { + return value + } + return defaultValue +} + +func printBooleanResult(result openfeature.BooleanEvaluationDetails) { + log.Printf(" Value: %v", result.Value) + log.Printf(" Variant: %s", result.Variant) + log.Printf(" Reason: %s", result.Reason) + if result.ErrorCode != "" { + log.Printf(" Error Code: %s", result.ErrorCode) + log.Printf(" Error Message: %s", result.ErrorMessage) + } +} + +func printStringResult(result openfeature.StringEvaluationDetails) { + log.Printf(" Value: %s", result.Value) + log.Printf(" Variant: %s", result.Variant) + log.Printf(" Reason: %s", result.Reason) + if result.ErrorCode != "" { + log.Printf(" Error Code: %s", result.ErrorCode) + log.Printf(" Error Message: %s", result.ErrorMessage) + } +} + +func printIntResult(result openfeature.IntEvaluationDetails) { + log.Printf(" Value: %d", result.Value) + log.Printf(" Variant: %s", result.Variant) + log.Printf(" Reason: %s", result.Reason) + if result.ErrorCode != "" { + log.Printf(" Error Code: %s", result.ErrorCode) + log.Printf(" Error Message: %s", result.ErrorMessage) + } +} + +func printFloatResult(result openfeature.FloatEvaluationDetails) { + log.Printf(" Value: %f", result.Value) + log.Printf(" Variant: %s", result.Variant) + log.Printf(" Reason: %s", result.Reason) + if result.ErrorCode != "" { + log.Printf(" Error Code: %s", result.ErrorCode) + log.Printf(" Error Message: %s", result.ErrorMessage) + } +} + +func printObjectResult(result openfeature.InterfaceEvaluationDetails) { + log.Printf(" Value: %+v", result.Value) + log.Printf(" Variant: %s", result.Variant) + log.Printf(" Reason: %s", result.Reason) + if result.ErrorCode != "" { + log.Printf(" Error Code: %s", result.ErrorCode) + log.Printf(" Error Message: %s", result.ErrorMessage) + } +} diff --git a/openfeature-provider/go/go.mod b/openfeature-provider/go/go.mod new file mode 100644 index 0000000..2476aca --- /dev/null +++ b/openfeature-provider/go/go.mod @@ -0,0 +1,23 @@ +module github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence + +go 1.24.0 + +require github.com/open-feature/go-sdk v1.16.0 + +require github.com/tetratelabs/wazero v1.9.0 + +require ( + google.golang.org/genproto v0.0.0-20251029180050-ab9386a59fda + google.golang.org/genproto/googleapis/api v0.0.0-20251029180050-ab9386a59fda + google.golang.org/grpc v1.75.1 + google.golang.org/protobuf v1.36.10 +) + +require ( + github.com/go-logr/logr v1.4.3 // indirect + go.uber.org/mock v0.6.0 // indirect + golang.org/x/net v0.44.0 // indirect + golang.org/x/sys v0.36.0 // indirect + golang.org/x/text v0.29.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f // indirect +) diff --git a/openfeature-provider/go/go.sum b/openfeature-provider/go/go.sum new file mode 100644 index 0000000..287d2f3 --- /dev/null +++ b/openfeature-provider/go/go.sum @@ -0,0 +1,48 @@ +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +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/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +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/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/open-feature/go-sdk v1.16.0 h1:5NCHYv5slvNBIZhYXAzAufo0OI59OACZ5tczVqSE+Tg= +github.com/open-feature/go-sdk v1.16.0/go.mod h1:EIF40QcoYT1VbQkMPy2ZJH4kvZeY+qGUXAorzSWgKSo= +github.com/tetratelabs/wazero v1.6.0 h1:z0H1iikCdP8t+q341xqepY4EWvHEw8Es7tlqiVzlP3g= +github.com/tetratelabs/wazero v1.6.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A= +github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I= +github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM= +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/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/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.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= +golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= +golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= +golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= +golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= +golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= +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-20251029180050-ab9386a59fda h1:fQ3VVQ11pb84nu0o/8wD6oZq13Q6+HK30P+9GSRlrqk= +google.golang.org/genproto v0.0.0-20251029180050-ab9386a59fda/go.mod h1:1Ic78BnpzY8OaTCmzxJDP4qC9INZPbGZl+54RKjtyeI= +google.golang.org/genproto/googleapis/api v0.0.0-20251029180050-ab9386a59fda h1:+2XxjfsAu6vqFxwGBRcHiMaDCuZiqXGDUDVWVtrFAnE= +google.golang.org/genproto/googleapis/api v0.0.0-20251029180050-ab9386a59fda/go.mod h1:fDMmzKV90WSg1NbozdqrE64fkuTv6mlq2zxo9ad+3yo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f h1:1FTH6cpXFsENbPR5Bu8NQddPSaUUE6NA2XdZdDSAJK4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= +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.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/openfeature-provider/go/grpc_wasm_flag_logger.go b/openfeature-provider/go/grpc_wasm_flag_logger.go new file mode 100644 index 0000000..eff7eba --- /dev/null +++ b/openfeature-provider/go/grpc_wasm_flag_logger.go @@ -0,0 +1,160 @@ +package confidence + +import ( + "context" + "log" + "sync" + "time" + + resolverv1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolverinternal" +) + +const ( + // MaxFlagAssignedPerChunk is the max number of flag_assigned entries per chunk + // to avoid exceeding gRPC max message size + MaxFlagAssignedPerChunk = 1000 +) + +// WasmFlagLogger is an interface for writing flag logs +type WasmFlagLogger interface { + Write(ctx context.Context, request *resolverv1.WriteFlagLogsRequest) error + Shutdown() +} + +// FlagLogWriter is a function type for writing flag logs +type FlagLogWriter func(ctx context.Context, request *resolverv1.WriteFlagLogsRequest) error + +// GrpcWasmFlagLogger implements WasmFlagLogger using gRPC +type GrpcWasmFlagLogger struct { + stub resolverv1.InternalFlagLoggerServiceClient + writer FlagLogWriter + wg sync.WaitGroup +} + +// NewGrpcWasmFlagLogger creates a new GrpcWasmFlagLogger +func NewGrpcWasmFlagLogger(stub resolverv1.InternalFlagLoggerServiceClient) *GrpcWasmFlagLogger { + logger := &GrpcWasmFlagLogger{ + stub: stub, + } + + // Set up the default writer that sends requests asynchronously + logger.writer = func(ctx context.Context, request *resolverv1.WriteFlagLogsRequest) error { + logger.wg.Add(1) + go func() { + defer logger.wg.Done() + // Create a context with timeout for the RPC + rpcCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + + if _, err := stub.WriteFlagLogs(rpcCtx, request); err != nil { + log.Printf("Failed to write flag logs: %v", err) + } else { + log.Printf("Successfully sent flag log with %d entries", len(request.FlagAssigned)) + } + }() + return nil + } + + return logger +} + +// NewGrpcWasmFlagLoggerWithWriter creates a new GrpcWasmFlagLogger with a custom writer (for testing) +func NewGrpcWasmFlagLoggerWithWriter(stub resolverv1.InternalFlagLoggerServiceClient, writer FlagLogWriter) *GrpcWasmFlagLogger { + return &GrpcWasmFlagLogger{ + stub: stub, + writer: writer, + } +} + +// Write writes flag logs, splitting into chunks if necessary +func (g *GrpcWasmFlagLogger) Write(ctx context.Context, request *resolverv1.WriteFlagLogsRequest) error { + flagAssignedCount := len(request.FlagAssigned) + clientResolveCount := len(request.ClientResolveInfo) + flagResolveCount := len(request.FlagResolveInfo) + + if clientResolveCount == 0 && flagAssignedCount == 0 && flagResolveCount == 0 { + log.Printf("Skipping empty flag log request") + return nil + } + + // Log total counts + log.Printf("Writing flag logs: %d flag_assigned, %d client_resolve_info, %d flag_resolve_info", + flagAssignedCount, clientResolveCount, flagResolveCount) + + // If flag_assigned list is small enough, send everything as-is + if flagAssignedCount <= MaxFlagAssignedPerChunk { + return g.sendAsync(ctx, request) + } + + // Split flag_assigned into chunks and send each chunk asynchronously + log.Printf("Splitting %d flag_assigned entries into chunks of %d", + flagAssignedCount, MaxFlagAssignedPerChunk) + + chunks := g.createFlagAssignedChunks(request) + for _, chunk := range chunks { + if err := g.sendAsync(ctx, chunk); err != nil { + return err + } + } + + return nil +} + +// createFlagAssignedChunks splits the WriteFlagLogsRequest into chunks +func (g *GrpcWasmFlagLogger) createFlagAssignedChunks(request *resolverv1.WriteFlagLogsRequest) []*resolverv1.WriteFlagLogsRequest { + chunks := make([]*resolverv1.WriteFlagLogsRequest, 0) + totalFlags := len(request.FlagAssigned) + + for i := 0; i < totalFlags; i += MaxFlagAssignedPerChunk { + end := i + MaxFlagAssignedPerChunk + if end > totalFlags { + end = totalFlags + } + + chunkBuilder := &resolverv1.WriteFlagLogsRequest{ + FlagAssigned: request.FlagAssigned[i:end], + } + + // Include telemetry and resolve info only in the first chunk + if i == 0 { + if request.TelemetryData != nil { + chunkBuilder.TelemetryData = request.TelemetryData + } + chunkBuilder.ClientResolveInfo = request.ClientResolveInfo + chunkBuilder.FlagResolveInfo = request.FlagResolveInfo + } + + chunks = append(chunks, chunkBuilder) + } + + return chunks +} + +// sendAsync sends the request asynchronously using the writer +func (g *GrpcWasmFlagLogger) sendAsync(ctx context.Context, request *resolverv1.WriteFlagLogsRequest) error { + return g.writer(ctx, request) +} + +// Shutdown waits for all pending async writes to complete +func (g *GrpcWasmFlagLogger) Shutdown() { + g.wg.Wait() +} + +// NoOpWasmFlagLogger is a flag logger that drops all requests (for disabled logging) +type NoOpWasmFlagLogger struct{} + +// NewNoOpWasmFlagLogger creates a new NoOpWasmFlagLogger +func NewNoOpWasmFlagLogger() *NoOpWasmFlagLogger { + return &NoOpWasmFlagLogger{} +} + +// Write drops the request without sending it +func (n *NoOpWasmFlagLogger) Write(ctx context.Context, request *resolverv1.WriteFlagLogsRequest) error { + // Drop the request - do nothing + return nil +} + +// Shutdown does nothing +func (n *NoOpWasmFlagLogger) Shutdown() { + // Nothing to shut down +} diff --git a/openfeature-provider/go/jwt_auth_interceptor.go b/openfeature-provider/go/jwt_auth_interceptor.go new file mode 100644 index 0000000..e359ea2 --- /dev/null +++ b/openfeature-provider/go/jwt_auth_interceptor.go @@ -0,0 +1,89 @@ +package confidence + +import ( + "context" + "fmt" + + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" +) + +// JwtAuthInterceptor is a gRPC unary interceptor that attaches JWT tokens to requests +type JwtAuthInterceptor struct { + tokenHolder *TokenHolder +} + +// NewJwtAuthInterceptor creates a new JWT auth interceptor +func NewJwtAuthInterceptor(tokenHolder *TokenHolder) *JwtAuthInterceptor { + return &JwtAuthInterceptor{ + tokenHolder: tokenHolder, + } +} + +// UnaryClientInterceptor returns a gRPC unary client interceptor that adds auth headers +func (i *JwtAuthInterceptor) UnaryClientInterceptor() grpc.UnaryClientInterceptor { + return func( + ctx context.Context, + method string, + req, reply interface{}, + cc *grpc.ClientConn, + invoker grpc.UnaryInvoker, + opts ...grpc.CallOption, + ) error { + // Get the token + token, err := i.tokenHolder.GetToken(ctx) + if err != nil { + return fmt.Errorf("failed to get auth token: %w", err) + } + + // Add Authorization header to metadata + md := metadata.New(map[string]string{ + "authorization": fmt.Sprintf("Bearer %s", token.AccessToken), + }) + + // Merge with existing metadata if present + if existingMd, ok := metadata.FromOutgoingContext(ctx); ok { + md = metadata.Join(existingMd, md) + } + + // Create new context with metadata + ctx = metadata.NewOutgoingContext(ctx, md) + + // Invoke the RPC + return invoker(ctx, method, req, reply, cc, opts...) + } +} + +// StreamClientInterceptor returns a gRPC stream client interceptor that adds auth headers +func (i *JwtAuthInterceptor) StreamClientInterceptor() grpc.StreamClientInterceptor { + return func( + ctx context.Context, + desc *grpc.StreamDesc, + cc *grpc.ClientConn, + method string, + streamer grpc.Streamer, + opts ...grpc.CallOption, + ) (grpc.ClientStream, error) { + // Get the token + token, err := i.tokenHolder.GetToken(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get auth token: %w", err) + } + + // Add Authorization header to metadata + md := metadata.New(map[string]string{ + "authorization": fmt.Sprintf("Bearer %s", token.AccessToken), + }) + + // Merge with existing metadata if present + if existingMd, ok := metadata.FromOutgoingContext(ctx); ok { + md = metadata.Join(existingMd, md) + } + + // Create new context with metadata + ctx = metadata.NewOutgoingContext(ctx, md) + + // Create the stream + return streamer(ctx, desc, cc, method, opts...) + } +} diff --git a/openfeature-provider/go/local_resolver_factory.go b/openfeature-provider/go/local_resolver_factory.go new file mode 100644 index 0000000..4ed09b8 --- /dev/null +++ b/openfeature-provider/go/local_resolver_factory.go @@ -0,0 +1,244 @@ +package confidence + +import ( + "context" + "fmt" + "log" + "os" + "strconv" + "time" + + adminv1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1" + resolverv1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolverinternal" + iamv1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/iam/v1" + "github.com/tetratelabs/wazero" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +const ( + defaultPollIntervalSeconds = 10 +) + +// StateProvider is an interface for providing resolver state +type StateProvider interface { + Provide(ctx context.Context) ([]byte, error) +} + +// LocalResolverFactory creates and manages local flag resolvers with scheduled state fetching +type LocalResolverFactory struct { + resolverAPI *SwapWasmResolverApi + stateProvider StateProvider + accountId string + flagLogger WasmFlagLogger + cancelFunc context.CancelFunc + logPollInterval time.Duration +} + +// NewLocalResolverFactory creates a new LocalResolverFactory with gRPC clients and WASM bytes +// If customStateProvider is not nil, it will be used; otherwise creates a FlagsAdminStateFetcher +// Exposure logging is automatically enabled with gRPC services, disabled with custom StateProvider +// accountId is required when using customStateProvider, otherwise it's extracted from the token +func NewLocalResolverFactory( + ctx context.Context, + runtime wazero.Runtime, + wasmBytes []byte, + resolverStateServiceAddr string, + flagLoggerServiceAddr string, + authServiceAddr string, + apiClientID string, + apiClientSecret string, + customStateProvider StateProvider, + accountId string, +) (*LocalResolverFactory, error) { + logPollInterval := getPollIntervalSeconds() + + var flagLogger WasmFlagLogger + var initialState []byte + var resolvedAccountId string + var stateProvider StateProvider + + // If custom StateProvider is provided, use it + if customStateProvider != nil { + // When using custom StateProvider, accountId must be provided + if accountId == "" { + return nil, fmt.Errorf("accountId is required when using custom StateProvider") + } + resolvedAccountId = accountId + stateProvider = customStateProvider + + // Get initial state from provider + var err error + initialState, err = customStateProvider.Provide(ctx) + if err != nil { + log.Printf("Initial state fetch from provider failed, using empty state: %v", err) + initialState = []byte{} + } + + // When using custom StateProvider, no gRPC logger service is available + // Exposure logging is disabled + flagLogger = NewNoOpWasmFlagLogger() + } else { + // Create FlagsAdminStateFetcher and use it as StateProvider + // Create TLS credentials for secure connections + tlsCreds := credentials.NewTLS(nil) + + // Create auth service connection (no auth interceptor for this one) + authConn, err := grpc.NewClient(authServiceAddr, grpc.WithTransportCredentials(tlsCreds)) + if err != nil { + return nil, err + } + authService := iamv1.NewAuthServiceClient(authConn) + + // Create token holder + tokenHolder := NewTokenHolder(apiClientID, apiClientSecret, authService) + + // Create JWT auth interceptor + authInterceptor := NewJwtAuthInterceptor(tokenHolder) + + // Create gRPC connection for resolver state service with auth + stateConn, err := grpc.NewClient( + resolverStateServiceAddr, + grpc.WithTransportCredentials(tlsCreds), + grpc.WithUnaryInterceptor(authInterceptor.UnaryClientInterceptor()), + grpc.WithStreamInterceptor(authInterceptor.StreamClientInterceptor()), + ) + if err != nil { + return nil, err + } + resolverStateService := adminv1.NewResolverStateServiceClient(stateConn) + + // Get account name from token + token, err := tokenHolder.GetToken(ctx) + if err != nil { + log.Printf("Warning: failed to get initial token, account name will be unknown: %v", err) + // TODO should we return an error here? + // return nil, fmt.Errorf("failed to get initial token: %w", err) + } + accountName := "unknown" + if token != nil { + accountName = token.Account + } + + // Create state fetcher (which implements StateProvider) + stateFetcher := NewFlagsAdminStateFetcher(resolverStateService, accountName) + stateProvider = stateFetcher + + // Get initial state using StateProvider interface + initialState, err = stateProvider.Provide(ctx) + if err != nil { + log.Printf("Initial state fetch failed, using empty state: %v", err) + // TODO should we return an error here? + // return nil, fmt.Errorf("failed to get initial state: %w", err) + } + if initialState == nil { + initialState = []byte{} + } + + resolvedAccountId = stateFetcher.GetAccountID() + if resolvedAccountId == "" { + resolvedAccountId = "unknown" + } + + // Create gRPC connection for flag logger service with auth + // Exposure logging is always enabled when using gRPC services + loggerConn, err := grpc.NewClient( + flagLoggerServiceAddr, + grpc.WithTransportCredentials(tlsCreds), + grpc.WithUnaryInterceptor(authInterceptor.UnaryClientInterceptor()), + grpc.WithStreamInterceptor(authInterceptor.StreamClientInterceptor()), + ) + if err != nil { + return nil, err + } + flagLoggerService := resolverv1.NewInternalFlagLoggerServiceClient(loggerConn) + flagLogger = NewGrpcWasmFlagLogger(flagLoggerService) + } + + // Create SwapWasmResolverApi with initial state + resolverAPI, err := NewSwapWasmResolverApi(ctx, runtime, wasmBytes, flagLogger, initialState, resolvedAccountId) + if err != nil { + return nil, err + } + + // Create factory + factory := &LocalResolverFactory{ + resolverAPI: resolverAPI, + stateProvider: stateProvider, + accountId: resolvedAccountId, + flagLogger: flagLogger, + logPollInterval: logPollInterval, + } + + // Start scheduled tasks + factory.startScheduledTasks(ctx) + + return factory, nil +} + +// startScheduledTasks starts the background tasks for state fetching and log polling +func (f *LocalResolverFactory) startScheduledTasks(parentCtx context.Context) { + ctx, cancel := context.WithCancel(parentCtx) + f.cancelFunc = cancel + + // Ticker for state fetching and log flushing using StateProvider + go func() { + ticker := time.NewTicker(f.logPollInterval) + defer ticker.Stop() + + for { + select { + case <-ticker.C: + // Fetch latest state + state, err := f.stateProvider.Provide(ctx) + if err != nil { + log.Printf("State fetch failed: %v", err) + } + + // Update state and flush logs (even if state fetch failed, use cached state) + if state != nil && f.accountId != "" { + if err := f.resolverAPI.UpdateStateAndFlushLogs(state, f.accountId); err != nil { + log.Printf("Failed to update state and flush logs: %v", err) + } else { + log.Printf("Updated resolver state and flushed logs for account %s", f.accountId) + } + } + case <-ctx.Done(): + return + } + } + }() +} + +// Shutdown stops all scheduled tasks and cleans up resources +func (f *LocalResolverFactory) Shutdown(ctx context.Context) { + if f.cancelFunc != nil { + f.cancelFunc() + } + if f.flagLogger != nil { + f.flagLogger.Shutdown() + } + if f.resolverAPI != nil { + f.resolverAPI.Close(ctx) + } +} + +// GetSwapResolverAPI returns the SwapWasmResolverApi +func (f *LocalResolverFactory) GetSwapResolverAPI() *SwapWasmResolverApi { + return f.resolverAPI +} + +// GetFlagLogger returns the flag logger +func (f *LocalResolverFactory) GetFlagLogger() WasmFlagLogger { + return f.flagLogger +} + +// getPollIntervalSeconds gets the poll interval from environment or returns default +func getPollIntervalSeconds() time.Duration { + if envVal := os.Getenv("CONFIDENCE_RESOLVER_POLL_INTERVAL_SECONDS"); envVal != "" { + if seconds, err := strconv.ParseInt(envVal, 10, 64); err == nil { + return time.Duration(seconds) * time.Second + } + } + return time.Duration(defaultPollIntervalSeconds) * time.Second +} diff --git a/openfeature-provider/go/local_resolver_provider.go b/openfeature-provider/go/local_resolver_provider.go new file mode 100644 index 0000000..9ce14f6 --- /dev/null +++ b/openfeature-provider/go/local_resolver_provider.go @@ -0,0 +1,454 @@ +package confidence + +import ( + "context" + "fmt" + "log" + "strings" + + "github.com/open-feature/go-sdk/openfeature" + "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/resolver" + "google.golang.org/protobuf/types/known/structpb" +) + +// LocalResolverProvider implements the OpenFeature FeatureProvider interface +// for local flag resolution using the Confidence WASM resolver +type LocalResolverProvider struct { + factory *LocalResolverFactory + clientSecret string +} + +// NewLocalResolverProvider creates a new LocalResolverProvider +func NewLocalResolverProvider(factory *LocalResolverFactory, clientSecret string) *LocalResolverProvider { + return &LocalResolverProvider{ + factory: factory, + clientSecret: clientSecret, + } +} + +// Metadata returns the provider metadata +func (p *LocalResolverProvider) Metadata() openfeature.Metadata { + return openfeature.Metadata{ + Name: "confidence-sdk-go-local", + } +} + +// BooleanEvaluation evaluates a boolean flag +func (p *LocalResolverProvider) BooleanEvaluation( + ctx context.Context, + flag string, + defaultValue bool, + evalCtx openfeature.FlattenedContext, +) openfeature.BoolResolutionDetail { + result := p.ObjectEvaluation(ctx, flag, defaultValue, evalCtx) + + if result.Value == nil { + return openfeature.BoolResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: result.Reason, + ResolutionError: result.ResolutionError, + }, + } + } + + boolVal, ok := result.Value.(bool) + if !ok { + return openfeature.BoolResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: openfeature.ErrorReason, + ResolutionError: openfeature.NewTypeMismatchResolutionError("value is not a boolean"), + }, + } + } + + return openfeature.BoolResolutionDetail{ + Value: boolVal, + ProviderResolutionDetail: result.ProviderResolutionDetail, + } +} + +// StringEvaluation evaluates a string flag +func (p *LocalResolverProvider) StringEvaluation( + ctx context.Context, + flag string, + defaultValue string, + evalCtx openfeature.FlattenedContext, +) openfeature.StringResolutionDetail { + result := p.ObjectEvaluation(ctx, flag, defaultValue, evalCtx) + + if result.Value == nil { + return openfeature.StringResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: result.Reason, + ResolutionError: result.ResolutionError, + }, + } + } + + strVal, ok := result.Value.(string) + if !ok { + return openfeature.StringResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: openfeature.ErrorReason, + ResolutionError: openfeature.NewTypeMismatchResolutionError("value is not a string"), + }, + } + } + + return openfeature.StringResolutionDetail{ + Value: strVal, + ProviderResolutionDetail: result.ProviderResolutionDetail, + } +} + +// FloatEvaluation evaluates a float flag +func (p *LocalResolverProvider) FloatEvaluation( + ctx context.Context, + flag string, + defaultValue float64, + evalCtx openfeature.FlattenedContext, +) openfeature.FloatResolutionDetail { + result := p.ObjectEvaluation(ctx, flag, defaultValue, evalCtx) + + if result.Value == nil { + return openfeature.FloatResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: result.Reason, + ResolutionError: result.ResolutionError, + }, + } + } + + floatVal, ok := result.Value.(float64) + if !ok { + return openfeature.FloatResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: openfeature.ErrorReason, + ResolutionError: openfeature.NewTypeMismatchResolutionError("value is not a float"), + }, + } + } + + return openfeature.FloatResolutionDetail{ + Value: floatVal, + ProviderResolutionDetail: result.ProviderResolutionDetail, + } +} + +// IntEvaluation evaluates an int flag +func (p *LocalResolverProvider) IntEvaluation( + ctx context.Context, + flag string, + defaultValue int64, + evalCtx openfeature.FlattenedContext, +) openfeature.IntResolutionDetail { + result := p.ObjectEvaluation(ctx, flag, defaultValue, evalCtx) + + if result.Value == nil { + return openfeature.IntResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: result.Reason, + ResolutionError: result.ResolutionError, + }, + } + } + + // Handle both int64 and float64 (JSON numbers are float64) + switch v := result.Value.(type) { + case int64: + return openfeature.IntResolutionDetail{ + Value: v, + ProviderResolutionDetail: result.ProviderResolutionDetail, + } + case float64: + return openfeature.IntResolutionDetail{ + Value: int64(v), + ProviderResolutionDetail: result.ProviderResolutionDetail, + } + default: + return openfeature.IntResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: openfeature.ErrorReason, + ResolutionError: openfeature.NewTypeMismatchResolutionError("value is not an integer"), + }, + } + } +} + +// ObjectEvaluation evaluates an object flag (core implementation) +func (p *LocalResolverProvider) ObjectEvaluation( + ctx context.Context, + flag string, + defaultValue interface{}, + evalCtx openfeature.FlattenedContext, +) openfeature.InterfaceResolutionDetail { + // Parse flag path (supports "flag.path.to.value" syntax) + flagPath, path := parseFlagPath(flag) + + // Process targeting key (convert "targetingKey" to "targeting_key") + processedCtx := processTargetingKey(evalCtx) + + // Convert evaluation context to protobuf Struct + protoCtx, err := flattenedContextToProto(processedCtx) + if err != nil { + log.Printf("Failed to convert evaluation context to proto: %v", err) + return openfeature.InterfaceResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: openfeature.ErrorReason, + ResolutionError: openfeature.NewGeneralResolutionError(fmt.Sprintf("failed to convert context: %v", err)), + }, + } + } + + // Build resolve request + requestFlagName := "flags/" + flagPath + request := &resolver.ResolveFlagsRequest{ + Flags: []string{requestFlagName}, + Apply: true, + ClientSecret: p.clientSecret, + EvaluationContext: protoCtx, + } + + // Get resolver API from factory + resolverAPI := p.factory.GetSwapResolverAPI() + + // Resolve flags + response, err := resolverAPI.Resolve(request) + if err != nil { + log.Printf("Failed to resolve flag '%s': %v", flagPath, err) + return openfeature.InterfaceResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: openfeature.ErrorReason, + ResolutionError: openfeature.NewGeneralResolutionError(fmt.Sprintf("resolve failed: %v", err)), + }, + } + } + + // Check if flag was found + if len(response.ResolvedFlags) == 0 { + log.Printf("No active flag '%s' was found", flagPath) + return openfeature.InterfaceResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: openfeature.ErrorReason, + ResolutionError: openfeature.NewFlagNotFoundResolutionError(fmt.Sprintf("flag '%s' not found", flagPath)), + }, + } + } + + resolvedFlag := response.ResolvedFlags[0] + + // Verify flag name matches + if resolvedFlag.Flag != requestFlagName { + log.Printf("Unexpected flag '%s' from resolver", resolvedFlag.Flag) + return openfeature.InterfaceResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Reason: openfeature.ErrorReason, + ResolutionError: openfeature.NewFlagNotFoundResolutionError("unexpected flag returned"), + }, + } + } + + // Check if variant is assigned + if resolvedFlag.Variant == "" { + return openfeature.InterfaceResolutionDetail{ + Value: defaultValue, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + ResolutionError: openfeature.ResolutionError{}, + Reason: openfeature.Reason(resolvedFlag.Reason.String()), + }, + } + } + + // Convert protobuf struct to Go interface{} + value := protoStructToGo(resolvedFlag.Value) + + // If a path was specified, extract the nested value + if path != "" { + value = getValueForPath(path, value) + } + + // If value is nil, use default + if value == nil { + value = defaultValue + } + + return openfeature.InterfaceResolutionDetail{ + Value: value, + ProviderResolutionDetail: openfeature.ProviderResolutionDetail{ + Variant: resolvedFlag.Variant, + ResolutionError: openfeature.ResolutionError{}, + Reason: openfeature.Reason(resolvedFlag.Reason.String()), + }, + } +} + +// Hooks returns provider hooks (none for this implementation) +func (p *LocalResolverProvider) Hooks() []openfeature.Hook { + return []openfeature.Hook{} +} + +// Shutdown closes the provider and cleans up resources +func (p *LocalResolverProvider) Shutdown() { + if p.factory != nil { + p.factory.Shutdown(context.Background()) + } +} + +// parseFlagPath splits a flag key into flag name and path +// e.g., "my-flag.nested.value" -> ("my-flag", "nested.value") +func parseFlagPath(key string) (flagName string, path string) { + parts := strings.SplitN(key, ".", 2) + if len(parts) == 1 { + return parts[0], "" + } + return parts[0], parts[1] +} + +// processTargetingKey converts "targetingKey" to "targeting_key" in the context +func processTargetingKey(evalCtx openfeature.FlattenedContext) openfeature.FlattenedContext { + newEvalContext := make(openfeature.FlattenedContext) + for k, v := range evalCtx { + newEvalContext[k] = v + } + + if targetingKey, exists := evalCtx["targetingKey"]; exists { + newEvalContext["targeting_key"] = targetingKey + delete(newEvalContext, "targetingKey") + } + + return newEvalContext +} + +// flattenedContextToProto converts OpenFeature FlattenedContext to protobuf Struct +func flattenedContextToProto(ctx openfeature.FlattenedContext) (*structpb.Struct, error) { + fields := make(map[string]*structpb.Value) + + for key, value := range ctx { + protoValue, err := goValueToProto(value) + if err != nil { + return nil, fmt.Errorf("failed to convert field '%s': %w", key, err) + } + fields[key] = protoValue + } + + return &structpb.Struct{Fields: fields}, nil +} + +// goValueToProto converts a Go value to protobuf Value +func goValueToProto(value interface{}) (*structpb.Value, error) { + switch v := value.(type) { + case nil: + return structpb.NewNullValue(), nil + case bool: + return structpb.NewBoolValue(v), nil + case int: + return structpb.NewNumberValue(float64(v)), nil + case int64: + return structpb.NewNumberValue(float64(v)), nil + case float64: + return structpb.NewNumberValue(v), nil + case string: + return structpb.NewStringValue(v), nil + case []interface{}: + values := make([]*structpb.Value, len(v)) + for i, item := range v { + val, err := goValueToProto(item) + if err != nil { + return nil, err + } + values[i] = val + } + return structpb.NewListValue(&structpb.ListValue{Values: values}), nil + case map[string]interface{}: + fields := make(map[string]*structpb.Value) + for key, val := range v { + protoVal, err := goValueToProto(val) + if err != nil { + return nil, err + } + fields[key] = protoVal + } + return structpb.NewStructValue(&structpb.Struct{Fields: fields}), nil + default: + return nil, fmt.Errorf("unsupported type: %T", v) + } +} + +// protoStructToGo converts protobuf Struct to Go map[string]interface{} +func protoStructToGo(s *structpb.Struct) interface{} { + if s == nil { + return nil + } + + result := make(map[string]interface{}) + for key, val := range s.Fields { + result[key] = protoValueToGo(val) + } + return result +} + +// protoValueToGo converts protobuf Value to Go interface{} +func protoValueToGo(value *structpb.Value) interface{} { + if value == nil { + return nil + } + + switch v := value.Kind.(type) { + case *structpb.Value_NullValue: + return nil + case *structpb.Value_BoolValue: + return v.BoolValue + case *structpb.Value_NumberValue: + return v.NumberValue + case *structpb.Value_StringValue: + return v.StringValue + case *structpb.Value_ListValue: + result := make([]interface{}, len(v.ListValue.Values)) + for i, val := range v.ListValue.Values { + result[i] = protoValueToGo(val) + } + return result + case *structpb.Value_StructValue: + result := make(map[string]interface{}) + for key, val := range v.StructValue.Fields { + result[key] = protoValueToGo(val) + } + return result + default: + return nil + } +} + +// getValueForPath extracts a nested value from a map using dot notation +// e.g., "nested.value" from map{"nested": map{"value": 42}} returns 42 +func getValueForPath(path string, value interface{}) interface{} { + if path == "" { + return value + } + + parts := strings.Split(path, ".") + current := value + + for _, part := range parts { + switch v := current.(type) { + case map[string]interface{}: + current = v[part] + default: + return nil + } + } + + return current +} diff --git a/openfeature-provider/go/proto/confidence/api/annotations.pb.go b/openfeature-provider/go/proto/confidence/api/annotations.pb.go new file mode 100644 index 0000000..ac7e7ca --- /dev/null +++ b/openfeature-provider/go/proto/confidence/api/annotations.pb.go @@ -0,0 +1,317 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/api/annotations.proto + +package api + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Resource struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Resource) Reset() { + *x = Resource{} + mi := &file_confidence_api_annotations_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Resource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Resource) ProtoMessage() {} + +func (x *Resource) ProtoReflect() protoreflect.Message { + mi := &file_confidence_api_annotations_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Resource.ProtoReflect.Descriptor instead. +func (*Resource) Descriptor() ([]byte, []int) { + return file_confidence_api_annotations_proto_rawDescGZIP(), []int{0} +} + +func (x *Resource) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +// Rate limit specification that is applied on global rates per account +type RateLimitSpec struct { + state protoimpl.MessageState `protogen:"open.v1"` + RpsLimit int32 `protobuf:"varint,1,opt,name=rps_limit,json=rpsLimit,proto3" json:"rps_limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RateLimitSpec) Reset() { + *x = RateLimitSpec{} + mi := &file_confidence_api_annotations_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RateLimitSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RateLimitSpec) ProtoMessage() {} + +func (x *RateLimitSpec) ProtoReflect() protoreflect.Message { + mi := &file_confidence_api_annotations_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RateLimitSpec.ProtoReflect.Descriptor instead. +func (*RateLimitSpec) Descriptor() ([]byte, []int) { + return file_confidence_api_annotations_proto_rawDescGZIP(), []int{1} +} + +func (x *RateLimitSpec) GetRpsLimit() int32 { + if x != nil { + return x.RpsLimit + } + return 0 +} + +type ValidationSpec struct { + state protoimpl.MessageState `protogen:"open.v1"` + Regex string `protobuf:"bytes,1,opt,name=regex,proto3" json:"regex,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidationSpec) Reset() { + *x = ValidationSpec{} + mi := &file_confidence_api_annotations_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidationSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidationSpec) ProtoMessage() {} + +func (x *ValidationSpec) ProtoReflect() protoreflect.Message { + mi := &file_confidence_api_annotations_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidationSpec.ProtoReflect.Descriptor instead. +func (*ValidationSpec) Descriptor() ([]byte, []int) { + return file_confidence_api_annotations_proto_rawDescGZIP(), []int{2} +} + +func (x *ValidationSpec) GetRegex() string { + if x != nil { + return x.Regex + } + return "" +} + +var file_confidence_api_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.MethodOptions)(nil), + ExtensionType: (*Resource)(nil), + Field: 4399226, + Name: "confidence.api.resource_method", + Tag: "bytes,4399226,opt,name=resource_method", + Filename: "confidence/api/annotations.proto", + }, + { + ExtendedType: (*descriptorpb.MethodOptions)(nil), + ExtensionType: (*RateLimitSpec)(nil), + Field: 4399227, + Name: "confidence.api.rate_limit", + Tag: "bytes,4399227,opt,name=rate_limit", + Filename: "confidence/api/annotations.proto", + }, + { + ExtendedType: (*descriptorpb.ServiceOptions)(nil), + ExtensionType: (*string)(nil), + Field: 4399229, + Name: "confidence.api.service_name", + Tag: "bytes,4399229,opt,name=service_name", + Filename: "confidence/api/annotations.proto", + }, + { + ExtendedType: (*descriptorpb.ServiceOptions)(nil), + ExtensionType: ([]string)(nil), + Field: 4399228, + Name: "confidence.api.hosts", + Tag: "bytes,4399228,rep,name=hosts", + Filename: "confidence/api/annotations.proto", + }, + { + ExtendedType: (*descriptorpb.ServiceOptions)(nil), + ExtensionType: (*RateLimitSpec)(nil), + Field: 4399230, + Name: "confidence.api.service_rate_limit", + Tag: "bytes,4399230,opt,name=service_rate_limit", + Filename: "confidence/api/annotations.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*ValidationSpec)(nil), + Field: 4324223, + Name: "confidence.api.validation", + Tag: "bytes,4324223,opt,name=validation", + Filename: "confidence/api/annotations.proto", + }, +} + +// Extension fields to descriptorpb.MethodOptions. +var ( + // optional confidence.api.Resource resource_method = 4399226; + E_ResourceMethod = &file_confidence_api_annotations_proto_extTypes[0] + // optional confidence.api.RateLimitSpec rate_limit = 4399227; + E_RateLimit = &file_confidence_api_annotations_proto_extTypes[1] +) + +// Extension fields to descriptorpb.ServiceOptions. +var ( + // optional string service_name = 4399229; + E_ServiceName = &file_confidence_api_annotations_proto_extTypes[2] + // repeated string hosts = 4399228; + E_Hosts = &file_confidence_api_annotations_proto_extTypes[3] + // optional confidence.api.RateLimitSpec service_rate_limit = 4399230; + E_ServiceRateLimit = &file_confidence_api_annotations_proto_extTypes[4] +) + +// Extension fields to descriptorpb.FieldOptions. +var ( + // optional confidence.api.ValidationSpec validation = 4324223; + E_Validation = &file_confidence_api_annotations_proto_extTypes[5] +) + +var File_confidence_api_annotations_proto protoreflect.FileDescriptor + +const file_confidence_api_annotations_proto_rawDesc = "" + + "\n" + + " confidence/api/annotations.proto\x12\x0econfidence.api\x1a google/protobuf/descriptor.proto\"\x1e\n" + + "\bResource\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\",\n" + + "\rRateLimitSpec\x12\x1b\n" + + "\trps_limit\x18\x01 \x01(\x05R\brpsLimit\"&\n" + + "\x0eValidationSpec\x12\x14\n" + + "\x05regex\x18\x01 \x01(\tR\x05regex:d\n" + + "\x0fresource_method\x12\x1e.google.protobuf.MethodOptions\x18\xfa\xc0\x8c\x02 \x01(\v2\x18.confidence.api.ResourceR\x0eresourceMethod:_\n" + + "\n" + + "rate_limit\x12\x1e.google.protobuf.MethodOptions\x18\xfb\xc0\x8c\x02 \x01(\v2\x1d.confidence.api.RateLimitSpecR\trateLimit:E\n" + + "\fservice_name\x12\x1f.google.protobuf.ServiceOptions\x18\xfd\xc0\x8c\x02 \x01(\tR\vserviceName:8\n" + + "\x05hosts\x12\x1f.google.protobuf.ServiceOptions\x18\xfc\xc0\x8c\x02 \x03(\tR\x05hosts:o\n" + + "\x12service_rate_limit\x12\x1f.google.protobuf.ServiceOptions\x18\xfe\xc0\x8c\x02 \x01(\v2\x1d.confidence.api.RateLimitSpecR\x10serviceRateLimit:`\n" + + "\n" + + "validation\x12\x1d.google.protobuf.FieldOptions\x18\xff\xf6\x87\x02 \x01(\v2\x1e.confidence.api.ValidationSpecR\n" + + "validationB3\n" + + "\x1acom.spotify.confidence.apiB\x13ApiAnnotationsProtoP\x01b\x06proto3" + +var ( + file_confidence_api_annotations_proto_rawDescOnce sync.Once + file_confidence_api_annotations_proto_rawDescData []byte +) + +func file_confidence_api_annotations_proto_rawDescGZIP() []byte { + file_confidence_api_annotations_proto_rawDescOnce.Do(func() { + file_confidence_api_annotations_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_api_annotations_proto_rawDesc), len(file_confidence_api_annotations_proto_rawDesc))) + }) + return file_confidence_api_annotations_proto_rawDescData +} + +var file_confidence_api_annotations_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_confidence_api_annotations_proto_goTypes = []any{ + (*Resource)(nil), // 0: confidence.api.Resource + (*RateLimitSpec)(nil), // 1: confidence.api.RateLimitSpec + (*ValidationSpec)(nil), // 2: confidence.api.ValidationSpec + (*descriptorpb.MethodOptions)(nil), // 3: google.protobuf.MethodOptions + (*descriptorpb.ServiceOptions)(nil), // 4: google.protobuf.ServiceOptions + (*descriptorpb.FieldOptions)(nil), // 5: google.protobuf.FieldOptions +} +var file_confidence_api_annotations_proto_depIdxs = []int32{ + 3, // 0: confidence.api.resource_method:extendee -> google.protobuf.MethodOptions + 3, // 1: confidence.api.rate_limit:extendee -> google.protobuf.MethodOptions + 4, // 2: confidence.api.service_name:extendee -> google.protobuf.ServiceOptions + 4, // 3: confidence.api.hosts:extendee -> google.protobuf.ServiceOptions + 4, // 4: confidence.api.service_rate_limit:extendee -> google.protobuf.ServiceOptions + 5, // 5: confidence.api.validation:extendee -> google.protobuf.FieldOptions + 0, // 6: confidence.api.resource_method:type_name -> confidence.api.Resource + 1, // 7: confidence.api.rate_limit:type_name -> confidence.api.RateLimitSpec + 1, // 8: confidence.api.service_rate_limit:type_name -> confidence.api.RateLimitSpec + 2, // 9: confidence.api.validation:type_name -> confidence.api.ValidationSpec + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 6, // [6:10] is the sub-list for extension type_name + 0, // [0:6] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_confidence_api_annotations_proto_init() } +func file_confidence_api_annotations_proto_init() { + if File_confidence_api_annotations_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_api_annotations_proto_rawDesc), len(file_confidence_api_annotations_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 6, + NumServices: 0, + }, + GoTypes: file_confidence_api_annotations_proto_goTypes, + DependencyIndexes: file_confidence_api_annotations_proto_depIdxs, + MessageInfos: file_confidence_api_annotations_proto_msgTypes, + ExtensionInfos: file_confidence_api_annotations_proto_extTypes, + }.Build() + File_confidence_api_annotations_proto = out.File + file_confidence_api_annotations_proto_goTypes = nil + file_confidence_api_annotations_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/auth/v1/auth.pb.go b/openfeature-provider/go/proto/confidence/auth/v1/auth.pb.go new file mode 100644 index 0000000..2174866 --- /dev/null +++ b/openfeature-provider/go/proto/confidence/auth/v1/auth.pb.go @@ -0,0 +1,978 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/auth/v1/auth.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Permission int32 + +const ( + Permission_UNKNOWN_PERMISSION Permission = 0 + // workflows + Permission_READ_WORKFLOWS Permission = 1 + Permission_LIST_WORKFLOWS Permission = 2 + Permission_CREATE_WORKFLOWS Permission = 3 + Permission_UPDATE_WORKFLOWS Permission = 4 + // workflow instances + Permission_READ_WORKFLOW_INSTANCES Permission = 10 + Permission_LIST_WORKFLOW_INSTANCES Permission = 11 + Permission_CREATE_WORKFLOW_INSTANCES Permission = 12 + Permission_UPDATE_WORKFLOW_INSTANCES Permission = 13 + // checks + Permission_READ_CHECKS Permission = 20 + Permission_LIST_CHECKS Permission = 21 + Permission_CREATE_CHECKS Permission = 22 + Permission_UPDATE_CHECKS Permission = 23 + // flags + Permission_READ_FLAGS Permission = 30 + Permission_LIST_FLAGS Permission = 31 + Permission_CREATE_FLAGS Permission = 32 + Permission_UPDATE_FLAGS Permission = 33 + // segments + Permission_READ_SEGMENTS Permission = 40 + Permission_LIST_SEGMENTS Permission = 41 + Permission_CREATE_SEGMENTS Permission = 42 + Permission_UPDATE_SEGMENTS Permission = 43 + // clients + Permission_READ_CLIENTS Permission = 50 + Permission_LIST_CLIENTS Permission = 51 + Permission_CREATE_CLIENTS Permission = 52 + Permission_UPDATE_CLIENTS Permission = 53 + // client credentials + Permission_READ_CLIENT_CREDENTIALS Permission = 60 + Permission_LIST_CLIENT_CREDENTIALS Permission = 61 + Permission_CREATE_CLIENT_CREDENTIALS Permission = 62 + Permission_UPDATE_CLIENT_CREDENTIALS Permission = 63 + // entities + Permission_READ_ENTITIES Permission = 70 + Permission_LIST_ENTITIES Permission = 71 + Permission_CREATE_ENTITIES Permission = 72 + Permission_UPDATE_ENTITIES Permission = 73 + Permission_DELETE_ENTITIES Permission = 74 + // fact tables + Permission_READ_FACT_TABLES Permission = 80 + Permission_LIST_FACT_TABLES Permission = 81 + Permission_CREATE_FACT_TABLES Permission = 82 + Permission_UPDATE_FACT_TABLES Permission = 83 + Permission_DELETE_FACT_TABLES Permission = 84 + // assignment tables + Permission_READ_ASSIGNMENT_TABLES Permission = 90 + Permission_LIST_ASSIGNMENT_TABLES Permission = 91 + Permission_CREATE_ASSIGNMENT_TABLES Permission = 92 + Permission_UPDATE_ASSIGNMENT_TABLES Permission = 93 + Permission_DELETE_ASSIGNMENT_TABLES Permission = 94 + // dimension tables + Permission_READ_DIMENSION_TABLES Permission = 100 + Permission_LIST_DIMENSION_TABLES Permission = 101 + Permission_CREATE_DIMENSION_TABLES Permission = 102 + Permission_UPDATE_DIMENSION_TABLES Permission = 103 + Permission_DELETE_DIMENSION_TABLES Permission = 104 + // metrics + Permission_READ_METRICS Permission = 110 + Permission_LIST_METRICS Permission = 111 + Permission_CREATE_METRICS Permission = 112 + Permission_UPDATE_METRICS Permission = 113 + Permission_DELETE_METRICS Permission = 114 + // scheduled metric calculations + Permission_READ_SCHEDULED_METRIC_CALCULATIONS Permission = 120 + Permission_LIST_SCHEDULED_METRIC_CALCULATIONS Permission = 121 + Permission_CREATE_SCHEDULED_METRIC_CALCULATIONS Permission = 122 + Permission_UPDATE_SCHEDULED_METRIC_CALCULATIONS Permission = 123 + // metric calculations + Permission_READ_METRIC_CALCULATIONS Permission = 130 + Permission_LIST_METRIC_CALCULATIONS Permission = 131 + Permission_CREATE_METRIC_CALCULATIONS Permission = 132 + Permission_UPDATE_METRIC_CALCULATIONS Permission = 133 + // exposure tables + Permission_READ_EXPOSURE_TABLES Permission = 140 + Permission_LIST_EXPOSURE_TABLES Permission = 141 + Permission_CREATE_EXPOSURE_TABLES Permission = 142 + Permission_UPDATE_EXPOSURE_TABLES Permission = 143 + // sql jobs + Permission_READ_SQL_JOBS Permission = 150 + Permission_LIST_SQL_JOBS Permission = 151 + Permission_CREATE_SQL_JOBS Permission = 152 + Permission_UPDATE_SQL_JOBS Permission = 153 + // metrics query + Permission_PREVIEW_SQL_QUERY Permission = 160 + // event types + Permission_LIST_EVENT_TYPES Permission = 170 + Permission_READ_EVENT_TYPES Permission = 171 + // connections + Permission_READ_CONNECTIONS Permission = 180 + Permission_LIST_CONNECTIONS Permission = 181 + Permission_CREATE_CONNECTIONS Permission = 182 + Permission_UPDATE_CONNECTIONS Permission = 183 + // scheduled exposure calculations + Permission_READ_SCHEDULED_EXPOSURE_CALCULATIONS Permission = 190 + Permission_LIST_SCHEDULED_EXPOSURE_CALCULATIONS Permission = 191 + Permission_CREATE_SCHEDULED_EXPOSURE_CALCULATIONS Permission = 192 + Permission_UPDATE_SCHEDULED_EXPOSURE_CALCULATIONS Permission = 193 + // operations + Permission_READ_OPERATIONS Permission = 200 + Permission_LIST_OPERATIONS Permission = 201 + Permission_CREATE_OPERATIONS Permission = 202 + Permission_UPDATE_OPERATIONS Permission = 203 + // data warehouse + Permission_READ_DATA_WAREHOUSES Permission = 210 + Permission_LIST_DATA_WAREHOUSES Permission = 211 + Permission_CREATE_DATA_WAREHOUSES Permission = 212 + Permission_UPDATE_DATA_WAREHOUSES Permission = 213 + // users + Permission_READ_USERS Permission = 220 + Permission_LIST_USERS Permission = 221 + Permission_CREATE_USERS Permission = 222 + Permission_UPDATE_USERS Permission = 223 + // roles + Permission_READ_ROLES Permission = 230 + Permission_LIST_ROLES Permission = 231 + Permission_CREATE_ROLES Permission = 232 + Permission_UPDATE_ROLES Permission = 233 + // api clients + Permission_READ_API_CLIENTS Permission = 240 + Permission_LIST_API_CLIENTS Permission = 241 + Permission_CREATE_API_CLIENTS Permission = 242 + Permission_UPDATE_API_CLIENTS Permission = 243 + Permission_DELETE_API_CLIENTS Permission = 244 + // events + Permission_LIST_EVENTS Permission = 250 + Permission_READ_EVENTS Permission = 251 + Permission_READ_CLIENT_SCHEMA Permission = 260 + // event ingestion + Permission_READ_EVENT_DEFINITIONS Permission = 270 + Permission_LIST_EVENT_DEFINITIONS Permission = 271 + Permission_CREATE_EVENT_DEFINITIONS Permission = 272 + Permission_UPDATE_EVENT_DEFINITIONS Permission = 273 + Permission_DELETE_EVENT_DEFINITIONS Permission = 274 + // billing skus + Permission_READ_SKUS Permission = 280 + Permission_LIST_SKUS Permission = 281 + // usage reports + Permission_READ_USAGE_REPORTS Permission = 290 + // user invitations + Permission_READ_USER_INVITATIONS Permission = 300 + Permission_LIST_USER_INVITATIONS Permission = 301 + Permission_CREATE_USER_INVITATIONS Permission = 302 + Permission_DELETE_USER_INVITATIONS Permission = 304 + // user invitations + Permission_READ_OAUTH_APPS Permission = 310 + Permission_LIST_OAUTH_APPS Permission = 311 + Permission_CREATE_OAUTH_APPS Permission = 312 + Permission_UPDATE_OAUTH_APPS Permission = 313 + Permission_DELETE_OAUTH_APPS Permission = 314 + // workflow secrets + Permission_READ_WORKFLOW_SECRETS Permission = 320 + Permission_LIST_WORKFLOW_SECRETS Permission = 321 + Permission_CREATE_WORKFLOW_SECRETS Permission = 322 + Permission_UPDATE_WORKFLOW_SECRETS Permission = 323 + Permission_DELETE_WORKFLOW_SECRETS Permission = 324 + // workflow logs + Permission_LIST_WORKFLOW_LOGS Permission = 330 + Permission_READ_WORKFLOW_LOGS Permission = 331 + // exposure calculations + Permission_READ_EXPOSURE_CALCULATIONS Permission = 340 + Permission_LIST_EXPOSURE_CALCULATIONS Permission = 341 + Permission_CREATE_EXPOSURE_CALCULATIONS Permission = 342 + Permission_UPDATE_EXPOSURE_CALCULATIONS Permission = 343 + // crypto keys + Permission_READ_CRYPTO_KEYS Permission = 350 + Permission_LIST_CRYPTO_KEYS Permission = 351 + Permission_CREATE_CRYPTO_KEYS Permission = 352 + Permission_DELETE_CRYPTO_KEYS Permission = 353 + // resolve info + Permission_CREATE_RESOLVE_INFO Permission = 360 + // flag assigned + Permission_CREATE_FLAG_ASSIGNED Permission = 370 + // stats + Permission_STATS_TEST_HYPOTHESIS Permission = 380 + Permission_STATS_RUN_ANALYSIS Permission = 381 + Permission_STATS_RUN_EXPLORATORY_ANALYSIS Permission = 382 + Permission_STATS_RUN_POWER_ANALYSIS Permission = 383 + // Subgroup + Permission_READ_SUBGROUP_ANALYSES Permission = 390 + Permission_LIST_SUBGROUP_ANALYSES Permission = 391 + Permission_CREATE_SUBGROUP_ANALYSES Permission = 392 + Permission_DELETE_SUBGROUP_ANALYSES Permission = 393 + // Materialized segments + Permission_READ_MATERIALIZED_SEGMENTS Permission = 400 + Permission_LIST_MATERIALIZED_SEGMENTS Permission = 401 + Permission_CREATE_MATERIALIZED_SEGMENTS Permission = 402 + Permission_DELETE_MATERIALIZED_SEGMENTS Permission = 403 + Permission_UPDATE_MATERIALIZED_SEGMENTS Permission = 404 + // groups + Permission_READ_GROUPS Permission = 410 + Permission_LIST_GROUPS Permission = 411 + Permission_CREATE_GROUPS Permission = 412 + Permission_UPDATE_GROUPS Permission = 413 + Permission_DELETE_GROUPS Permission = 414 + // images + Permission_READ_IMAGES Permission = 420 + Permission_LIST_IMAGES Permission = 421 + Permission_CREATE_IMAGES Permission = 422 + Permission_UPDATE_IMAGES Permission = 423 + Permission_DELETE_IMAGES Permission = 424 + // surfaces + Permission_READ_SURFACES Permission = 430 + Permission_LIST_SURFACES Permission = 431 + Permission_CREATE_SURFACES Permission = 432 + Permission_UPDATE_SURFACES Permission = 433 + Permission_DELETE_SURFACES Permission = 434 +) + +// Enum value maps for Permission. +var ( + Permission_name = map[int32]string{ + 0: "UNKNOWN_PERMISSION", + 1: "READ_WORKFLOWS", + 2: "LIST_WORKFLOWS", + 3: "CREATE_WORKFLOWS", + 4: "UPDATE_WORKFLOWS", + 10: "READ_WORKFLOW_INSTANCES", + 11: "LIST_WORKFLOW_INSTANCES", + 12: "CREATE_WORKFLOW_INSTANCES", + 13: "UPDATE_WORKFLOW_INSTANCES", + 20: "READ_CHECKS", + 21: "LIST_CHECKS", + 22: "CREATE_CHECKS", + 23: "UPDATE_CHECKS", + 30: "READ_FLAGS", + 31: "LIST_FLAGS", + 32: "CREATE_FLAGS", + 33: "UPDATE_FLAGS", + 40: "READ_SEGMENTS", + 41: "LIST_SEGMENTS", + 42: "CREATE_SEGMENTS", + 43: "UPDATE_SEGMENTS", + 50: "READ_CLIENTS", + 51: "LIST_CLIENTS", + 52: "CREATE_CLIENTS", + 53: "UPDATE_CLIENTS", + 60: "READ_CLIENT_CREDENTIALS", + 61: "LIST_CLIENT_CREDENTIALS", + 62: "CREATE_CLIENT_CREDENTIALS", + 63: "UPDATE_CLIENT_CREDENTIALS", + 70: "READ_ENTITIES", + 71: "LIST_ENTITIES", + 72: "CREATE_ENTITIES", + 73: "UPDATE_ENTITIES", + 74: "DELETE_ENTITIES", + 80: "READ_FACT_TABLES", + 81: "LIST_FACT_TABLES", + 82: "CREATE_FACT_TABLES", + 83: "UPDATE_FACT_TABLES", + 84: "DELETE_FACT_TABLES", + 90: "READ_ASSIGNMENT_TABLES", + 91: "LIST_ASSIGNMENT_TABLES", + 92: "CREATE_ASSIGNMENT_TABLES", + 93: "UPDATE_ASSIGNMENT_TABLES", + 94: "DELETE_ASSIGNMENT_TABLES", + 100: "READ_DIMENSION_TABLES", + 101: "LIST_DIMENSION_TABLES", + 102: "CREATE_DIMENSION_TABLES", + 103: "UPDATE_DIMENSION_TABLES", + 104: "DELETE_DIMENSION_TABLES", + 110: "READ_METRICS", + 111: "LIST_METRICS", + 112: "CREATE_METRICS", + 113: "UPDATE_METRICS", + 114: "DELETE_METRICS", + 120: "READ_SCHEDULED_METRIC_CALCULATIONS", + 121: "LIST_SCHEDULED_METRIC_CALCULATIONS", + 122: "CREATE_SCHEDULED_METRIC_CALCULATIONS", + 123: "UPDATE_SCHEDULED_METRIC_CALCULATIONS", + 130: "READ_METRIC_CALCULATIONS", + 131: "LIST_METRIC_CALCULATIONS", + 132: "CREATE_METRIC_CALCULATIONS", + 133: "UPDATE_METRIC_CALCULATIONS", + 140: "READ_EXPOSURE_TABLES", + 141: "LIST_EXPOSURE_TABLES", + 142: "CREATE_EXPOSURE_TABLES", + 143: "UPDATE_EXPOSURE_TABLES", + 150: "READ_SQL_JOBS", + 151: "LIST_SQL_JOBS", + 152: "CREATE_SQL_JOBS", + 153: "UPDATE_SQL_JOBS", + 160: "PREVIEW_SQL_QUERY", + 170: "LIST_EVENT_TYPES", + 171: "READ_EVENT_TYPES", + 180: "READ_CONNECTIONS", + 181: "LIST_CONNECTIONS", + 182: "CREATE_CONNECTIONS", + 183: "UPDATE_CONNECTIONS", + 190: "READ_SCHEDULED_EXPOSURE_CALCULATIONS", + 191: "LIST_SCHEDULED_EXPOSURE_CALCULATIONS", + 192: "CREATE_SCHEDULED_EXPOSURE_CALCULATIONS", + 193: "UPDATE_SCHEDULED_EXPOSURE_CALCULATIONS", + 200: "READ_OPERATIONS", + 201: "LIST_OPERATIONS", + 202: "CREATE_OPERATIONS", + 203: "UPDATE_OPERATIONS", + 210: "READ_DATA_WAREHOUSES", + 211: "LIST_DATA_WAREHOUSES", + 212: "CREATE_DATA_WAREHOUSES", + 213: "UPDATE_DATA_WAREHOUSES", + 220: "READ_USERS", + 221: "LIST_USERS", + 222: "CREATE_USERS", + 223: "UPDATE_USERS", + 230: "READ_ROLES", + 231: "LIST_ROLES", + 232: "CREATE_ROLES", + 233: "UPDATE_ROLES", + 240: "READ_API_CLIENTS", + 241: "LIST_API_CLIENTS", + 242: "CREATE_API_CLIENTS", + 243: "UPDATE_API_CLIENTS", + 244: "DELETE_API_CLIENTS", + 250: "LIST_EVENTS", + 251: "READ_EVENTS", + 260: "READ_CLIENT_SCHEMA", + 270: "READ_EVENT_DEFINITIONS", + 271: "LIST_EVENT_DEFINITIONS", + 272: "CREATE_EVENT_DEFINITIONS", + 273: "UPDATE_EVENT_DEFINITIONS", + 274: "DELETE_EVENT_DEFINITIONS", + 280: "READ_SKUS", + 281: "LIST_SKUS", + 290: "READ_USAGE_REPORTS", + 300: "READ_USER_INVITATIONS", + 301: "LIST_USER_INVITATIONS", + 302: "CREATE_USER_INVITATIONS", + 304: "DELETE_USER_INVITATIONS", + 310: "READ_OAUTH_APPS", + 311: "LIST_OAUTH_APPS", + 312: "CREATE_OAUTH_APPS", + 313: "UPDATE_OAUTH_APPS", + 314: "DELETE_OAUTH_APPS", + 320: "READ_WORKFLOW_SECRETS", + 321: "LIST_WORKFLOW_SECRETS", + 322: "CREATE_WORKFLOW_SECRETS", + 323: "UPDATE_WORKFLOW_SECRETS", + 324: "DELETE_WORKFLOW_SECRETS", + 330: "LIST_WORKFLOW_LOGS", + 331: "READ_WORKFLOW_LOGS", + 340: "READ_EXPOSURE_CALCULATIONS", + 341: "LIST_EXPOSURE_CALCULATIONS", + 342: "CREATE_EXPOSURE_CALCULATIONS", + 343: "UPDATE_EXPOSURE_CALCULATIONS", + 350: "READ_CRYPTO_KEYS", + 351: "LIST_CRYPTO_KEYS", + 352: "CREATE_CRYPTO_KEYS", + 353: "DELETE_CRYPTO_KEYS", + 360: "CREATE_RESOLVE_INFO", + 370: "CREATE_FLAG_ASSIGNED", + 380: "STATS_TEST_HYPOTHESIS", + 381: "STATS_RUN_ANALYSIS", + 382: "STATS_RUN_EXPLORATORY_ANALYSIS", + 383: "STATS_RUN_POWER_ANALYSIS", + 390: "READ_SUBGROUP_ANALYSES", + 391: "LIST_SUBGROUP_ANALYSES", + 392: "CREATE_SUBGROUP_ANALYSES", + 393: "DELETE_SUBGROUP_ANALYSES", + 400: "READ_MATERIALIZED_SEGMENTS", + 401: "LIST_MATERIALIZED_SEGMENTS", + 402: "CREATE_MATERIALIZED_SEGMENTS", + 403: "DELETE_MATERIALIZED_SEGMENTS", + 404: "UPDATE_MATERIALIZED_SEGMENTS", + 410: "READ_GROUPS", + 411: "LIST_GROUPS", + 412: "CREATE_GROUPS", + 413: "UPDATE_GROUPS", + 414: "DELETE_GROUPS", + 420: "READ_IMAGES", + 421: "LIST_IMAGES", + 422: "CREATE_IMAGES", + 423: "UPDATE_IMAGES", + 424: "DELETE_IMAGES", + 430: "READ_SURFACES", + 431: "LIST_SURFACES", + 432: "CREATE_SURFACES", + 433: "UPDATE_SURFACES", + 434: "DELETE_SURFACES", + } + Permission_value = map[string]int32{ + "UNKNOWN_PERMISSION": 0, + "READ_WORKFLOWS": 1, + "LIST_WORKFLOWS": 2, + "CREATE_WORKFLOWS": 3, + "UPDATE_WORKFLOWS": 4, + "READ_WORKFLOW_INSTANCES": 10, + "LIST_WORKFLOW_INSTANCES": 11, + "CREATE_WORKFLOW_INSTANCES": 12, + "UPDATE_WORKFLOW_INSTANCES": 13, + "READ_CHECKS": 20, + "LIST_CHECKS": 21, + "CREATE_CHECKS": 22, + "UPDATE_CHECKS": 23, + "READ_FLAGS": 30, + "LIST_FLAGS": 31, + "CREATE_FLAGS": 32, + "UPDATE_FLAGS": 33, + "READ_SEGMENTS": 40, + "LIST_SEGMENTS": 41, + "CREATE_SEGMENTS": 42, + "UPDATE_SEGMENTS": 43, + "READ_CLIENTS": 50, + "LIST_CLIENTS": 51, + "CREATE_CLIENTS": 52, + "UPDATE_CLIENTS": 53, + "READ_CLIENT_CREDENTIALS": 60, + "LIST_CLIENT_CREDENTIALS": 61, + "CREATE_CLIENT_CREDENTIALS": 62, + "UPDATE_CLIENT_CREDENTIALS": 63, + "READ_ENTITIES": 70, + "LIST_ENTITIES": 71, + "CREATE_ENTITIES": 72, + "UPDATE_ENTITIES": 73, + "DELETE_ENTITIES": 74, + "READ_FACT_TABLES": 80, + "LIST_FACT_TABLES": 81, + "CREATE_FACT_TABLES": 82, + "UPDATE_FACT_TABLES": 83, + "DELETE_FACT_TABLES": 84, + "READ_ASSIGNMENT_TABLES": 90, + "LIST_ASSIGNMENT_TABLES": 91, + "CREATE_ASSIGNMENT_TABLES": 92, + "UPDATE_ASSIGNMENT_TABLES": 93, + "DELETE_ASSIGNMENT_TABLES": 94, + "READ_DIMENSION_TABLES": 100, + "LIST_DIMENSION_TABLES": 101, + "CREATE_DIMENSION_TABLES": 102, + "UPDATE_DIMENSION_TABLES": 103, + "DELETE_DIMENSION_TABLES": 104, + "READ_METRICS": 110, + "LIST_METRICS": 111, + "CREATE_METRICS": 112, + "UPDATE_METRICS": 113, + "DELETE_METRICS": 114, + "READ_SCHEDULED_METRIC_CALCULATIONS": 120, + "LIST_SCHEDULED_METRIC_CALCULATIONS": 121, + "CREATE_SCHEDULED_METRIC_CALCULATIONS": 122, + "UPDATE_SCHEDULED_METRIC_CALCULATIONS": 123, + "READ_METRIC_CALCULATIONS": 130, + "LIST_METRIC_CALCULATIONS": 131, + "CREATE_METRIC_CALCULATIONS": 132, + "UPDATE_METRIC_CALCULATIONS": 133, + "READ_EXPOSURE_TABLES": 140, + "LIST_EXPOSURE_TABLES": 141, + "CREATE_EXPOSURE_TABLES": 142, + "UPDATE_EXPOSURE_TABLES": 143, + "READ_SQL_JOBS": 150, + "LIST_SQL_JOBS": 151, + "CREATE_SQL_JOBS": 152, + "UPDATE_SQL_JOBS": 153, + "PREVIEW_SQL_QUERY": 160, + "LIST_EVENT_TYPES": 170, + "READ_EVENT_TYPES": 171, + "READ_CONNECTIONS": 180, + "LIST_CONNECTIONS": 181, + "CREATE_CONNECTIONS": 182, + "UPDATE_CONNECTIONS": 183, + "READ_SCHEDULED_EXPOSURE_CALCULATIONS": 190, + "LIST_SCHEDULED_EXPOSURE_CALCULATIONS": 191, + "CREATE_SCHEDULED_EXPOSURE_CALCULATIONS": 192, + "UPDATE_SCHEDULED_EXPOSURE_CALCULATIONS": 193, + "READ_OPERATIONS": 200, + "LIST_OPERATIONS": 201, + "CREATE_OPERATIONS": 202, + "UPDATE_OPERATIONS": 203, + "READ_DATA_WAREHOUSES": 210, + "LIST_DATA_WAREHOUSES": 211, + "CREATE_DATA_WAREHOUSES": 212, + "UPDATE_DATA_WAREHOUSES": 213, + "READ_USERS": 220, + "LIST_USERS": 221, + "CREATE_USERS": 222, + "UPDATE_USERS": 223, + "READ_ROLES": 230, + "LIST_ROLES": 231, + "CREATE_ROLES": 232, + "UPDATE_ROLES": 233, + "READ_API_CLIENTS": 240, + "LIST_API_CLIENTS": 241, + "CREATE_API_CLIENTS": 242, + "UPDATE_API_CLIENTS": 243, + "DELETE_API_CLIENTS": 244, + "LIST_EVENTS": 250, + "READ_EVENTS": 251, + "READ_CLIENT_SCHEMA": 260, + "READ_EVENT_DEFINITIONS": 270, + "LIST_EVENT_DEFINITIONS": 271, + "CREATE_EVENT_DEFINITIONS": 272, + "UPDATE_EVENT_DEFINITIONS": 273, + "DELETE_EVENT_DEFINITIONS": 274, + "READ_SKUS": 280, + "LIST_SKUS": 281, + "READ_USAGE_REPORTS": 290, + "READ_USER_INVITATIONS": 300, + "LIST_USER_INVITATIONS": 301, + "CREATE_USER_INVITATIONS": 302, + "DELETE_USER_INVITATIONS": 304, + "READ_OAUTH_APPS": 310, + "LIST_OAUTH_APPS": 311, + "CREATE_OAUTH_APPS": 312, + "UPDATE_OAUTH_APPS": 313, + "DELETE_OAUTH_APPS": 314, + "READ_WORKFLOW_SECRETS": 320, + "LIST_WORKFLOW_SECRETS": 321, + "CREATE_WORKFLOW_SECRETS": 322, + "UPDATE_WORKFLOW_SECRETS": 323, + "DELETE_WORKFLOW_SECRETS": 324, + "LIST_WORKFLOW_LOGS": 330, + "READ_WORKFLOW_LOGS": 331, + "READ_EXPOSURE_CALCULATIONS": 340, + "LIST_EXPOSURE_CALCULATIONS": 341, + "CREATE_EXPOSURE_CALCULATIONS": 342, + "UPDATE_EXPOSURE_CALCULATIONS": 343, + "READ_CRYPTO_KEYS": 350, + "LIST_CRYPTO_KEYS": 351, + "CREATE_CRYPTO_KEYS": 352, + "DELETE_CRYPTO_KEYS": 353, + "CREATE_RESOLVE_INFO": 360, + "CREATE_FLAG_ASSIGNED": 370, + "STATS_TEST_HYPOTHESIS": 380, + "STATS_RUN_ANALYSIS": 381, + "STATS_RUN_EXPLORATORY_ANALYSIS": 382, + "STATS_RUN_POWER_ANALYSIS": 383, + "READ_SUBGROUP_ANALYSES": 390, + "LIST_SUBGROUP_ANALYSES": 391, + "CREATE_SUBGROUP_ANALYSES": 392, + "DELETE_SUBGROUP_ANALYSES": 393, + "READ_MATERIALIZED_SEGMENTS": 400, + "LIST_MATERIALIZED_SEGMENTS": 401, + "CREATE_MATERIALIZED_SEGMENTS": 402, + "DELETE_MATERIALIZED_SEGMENTS": 403, + "UPDATE_MATERIALIZED_SEGMENTS": 404, + "READ_GROUPS": 410, + "LIST_GROUPS": 411, + "CREATE_GROUPS": 412, + "UPDATE_GROUPS": 413, + "DELETE_GROUPS": 414, + "READ_IMAGES": 420, + "LIST_IMAGES": 421, + "CREATE_IMAGES": 422, + "UPDATE_IMAGES": 423, + "DELETE_IMAGES": 424, + "READ_SURFACES": 430, + "LIST_SURFACES": 431, + "CREATE_SURFACES": 432, + "UPDATE_SURFACES": 433, + "DELETE_SURFACES": 434, + } +) + +func (x Permission) Enum() *Permission { + p := new(Permission) + *p = x + return p +} + +func (x Permission) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Permission) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_auth_v1_auth_proto_enumTypes[0].Descriptor() +} + +func (Permission) Type() protoreflect.EnumType { + return &file_confidence_auth_v1_auth_proto_enumTypes[0] +} + +func (x Permission) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Permission.Descriptor instead. +func (Permission) EnumDescriptor() ([]byte, []int) { + return file_confidence_auth_v1_auth_proto_rawDescGZIP(), []int{0} +} + +type Authorization struct { + state protoimpl.MessageState `protogen:"open.v1"` + RequiredPermission []Permission `protobuf:"varint,1,rep,packed,name=required_permission,json=requiredPermission,proto3,enum=confidence.auth.v1.Permission" json:"required_permission,omitempty"` + DisableAuthorization bool `protobuf:"varint,2,opt,name=disable_authorization,json=disableAuthorization,proto3" json:"disable_authorization,omitempty"` + AllowEmptyPermissions bool `protobuf:"varint,3,opt,name=allow_empty_permissions,json=allowEmptyPermissions,proto3" json:"allow_empty_permissions,omitempty"` + ObjectField string `protobuf:"bytes,4,opt,name=object_field,json=objectField,proto3" json:"object_field,omitempty"` + RequiredRelation string `protobuf:"bytes,5,opt,name=required_relation,json=requiredRelation,proto3" json:"required_relation,omitempty"` + AllowBasicAuth bool `protobuf:"varint,6,opt,name=allow_basic_auth,json=allowBasicAuth,proto3" json:"allow_basic_auth,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Authorization) Reset() { + *x = Authorization{} + mi := &file_confidence_auth_v1_auth_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Authorization) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Authorization) ProtoMessage() {} + +func (x *Authorization) ProtoReflect() protoreflect.Message { + mi := &file_confidence_auth_v1_auth_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Authorization.ProtoReflect.Descriptor instead. +func (*Authorization) Descriptor() ([]byte, []int) { + return file_confidence_auth_v1_auth_proto_rawDescGZIP(), []int{0} +} + +func (x *Authorization) GetRequiredPermission() []Permission { + if x != nil { + return x.RequiredPermission + } + return nil +} + +func (x *Authorization) GetDisableAuthorization() bool { + if x != nil { + return x.DisableAuthorization + } + return false +} + +func (x *Authorization) GetAllowEmptyPermissions() bool { + if x != nil { + return x.AllowEmptyPermissions + } + return false +} + +func (x *Authorization) GetObjectField() string { + if x != nil { + return x.ObjectField + } + return "" +} + +func (x *Authorization) GetRequiredRelation() string { + if x != nil { + return x.RequiredRelation + } + return "" +} + +func (x *Authorization) GetAllowBasicAuth() bool { + if x != nil { + return x.AllowBasicAuth + } + return false +} + +var file_confidence_auth_v1_auth_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.MethodOptions)(nil), + ExtensionType: (*Authorization)(nil), + Field: 4399225, + Name: "confidence.auth.v1.auth", + Tag: "bytes,4399225,opt,name=auth", + Filename: "confidence/auth/v1/auth.proto", + }, + { + ExtendedType: (*descriptorpb.EnumValueOptions)(nil), + ExtensionType: (*string)(nil), + Field: 4399294, + Name: "confidence.auth.v1.scope", + Tag: "bytes,4399294,opt,name=scope", + Filename: "confidence/auth/v1/auth.proto", + }, +} + +// Extension fields to descriptorpb.MethodOptions. +var ( + // optional confidence.auth.v1.Authorization auth = 4399225; + E_Auth = &file_confidence_auth_v1_auth_proto_extTypes[0] +) + +// Extension fields to descriptorpb.EnumValueOptions. +var ( + // optional string scope = 4399294; + E_Scope = &file_confidence_auth_v1_auth_proto_extTypes[1] +) + +var File_confidence_auth_v1_auth_proto protoreflect.FileDescriptor + +const file_confidence_auth_v1_auth_proto_rawDesc = "" + + "\n" + + "\x1dconfidence/auth/v1/auth.proto\x12\x12confidence.auth.v1\x1a google/protobuf/descriptor.proto\"\xc7\x02\n" + + "\rAuthorization\x12O\n" + + "\x13required_permission\x18\x01 \x03(\x0e2\x1e.confidence.auth.v1.PermissionR\x12requiredPermission\x123\n" + + "\x15disable_authorization\x18\x02 \x01(\bR\x14disableAuthorization\x126\n" + + "\x17allow_empty_permissions\x18\x03 \x01(\bR\x15allowEmptyPermissions\x12!\n" + + "\fobject_field\x18\x04 \x01(\tR\vobjectField\x12+\n" + + "\x11required_relation\x18\x05 \x01(\tR\x10requiredRelation\x12(\n" + + "\x10allow_basic_auth\x18\x06 \x01(\bR\x0eallowBasicAuth*\xd4A\n" + + "\n" + + "Permission\x12\x16\n" + + "\x12UNKNOWN_PERMISSION\x10\x00\x12'\n" + + "\x0eREAD_WORKFLOWS\x10\x01\x1a\x13\xf2\x8b\xe4\x10\x0eread:workflows\x12'\n" + + "\x0eLIST_WORKFLOWS\x10\x02\x1a\x13\xf2\x8b\xe4\x10\x0elist:workflows\x12+\n" + + "\x10CREATE_WORKFLOWS\x10\x03\x1a\x15\xf2\x8b\xe4\x10\x10create:workflows\x12+\n" + + "\x10UPDATE_WORKFLOWS\x10\x04\x1a\x15\xf2\x8b\xe4\x10\x10update:workflows\x128\n" + + "\x17READ_WORKFLOW_INSTANCES\x10\n" + + "\x1a\x1b\xf2\x8b\xe4\x10\x16read:workflowinstances\x128\n" + + "\x17LIST_WORKFLOW_INSTANCES\x10\v\x1a\x1b\xf2\x8b\xe4\x10\x16list:workflowinstances\x12<\n" + + "\x19CREATE_WORKFLOW_INSTANCES\x10\f\x1a\x1d\xf2\x8b\xe4\x10\x18create:workflowinstances\x12<\n" + + "\x19UPDATE_WORKFLOW_INSTANCES\x10\r\x1a\x1d\xf2\x8b\xe4\x10\x18update:workflowinstances\x12!\n" + + "\vREAD_CHECKS\x10\x14\x1a\x10\xf2\x8b\xe4\x10\vread:checks\x12!\n" + + "\vLIST_CHECKS\x10\x15\x1a\x10\xf2\x8b\xe4\x10\vlist:checks\x12%\n" + + "\rCREATE_CHECKS\x10\x16\x1a\x12\xf2\x8b\xe4\x10\rcreate:checks\x12%\n" + + "\rUPDATE_CHECKS\x10\x17\x1a\x12\xf2\x8b\xe4\x10\rupdate:checks\x12\x1f\n" + + "\n" + + "READ_FLAGS\x10\x1e\x1a\x0f\xf2\x8b\xe4\x10\n" + + "read:flags\x12\x1f\n" + + "\n" + + "LIST_FLAGS\x10\x1f\x1a\x0f\xf2\x8b\xe4\x10\n" + + "list:flags\x12#\n" + + "\fCREATE_FLAGS\x10 \x1a\x11\xf2\x8b\xe4\x10\fcreate:flags\x12#\n" + + "\fUPDATE_FLAGS\x10!\x1a\x11\xf2\x8b\xe4\x10\fupdate:flags\x12%\n" + + "\rREAD_SEGMENTS\x10(\x1a\x12\xf2\x8b\xe4\x10\rread:segments\x12%\n" + + "\rLIST_SEGMENTS\x10)\x1a\x12\xf2\x8b\xe4\x10\rlist:segments\x12)\n" + + "\x0fCREATE_SEGMENTS\x10*\x1a\x14\xf2\x8b\xe4\x10\x0fcreate:segments\x12)\n" + + "\x0fUPDATE_SEGMENTS\x10+\x1a\x14\xf2\x8b\xe4\x10\x0fupdate:segments\x12#\n" + + "\fREAD_CLIENTS\x102\x1a\x11\xf2\x8b\xe4\x10\fread:clients\x12#\n" + + "\fLIST_CLIENTS\x103\x1a\x11\xf2\x8b\xe4\x10\flist:clients\x12'\n" + + "\x0eCREATE_CLIENTS\x104\x1a\x13\xf2\x8b\xe4\x10\x0ecreate:clients\x12'\n" + + "\x0eUPDATE_CLIENTS\x105\x1a\x13\xf2\x8b\xe4\x10\x0eupdate:clients\x128\n" + + "\x17READ_CLIENT_CREDENTIALS\x10<\x1a\x1b\xf2\x8b\xe4\x10\x16read:clientcredentials\x128\n" + + "\x17LIST_CLIENT_CREDENTIALS\x10=\x1a\x1b\xf2\x8b\xe4\x10\x16list:clientcredentials\x12<\n" + + "\x19CREATE_CLIENT_CREDENTIALS\x10>\x1a\x1d\xf2\x8b\xe4\x10\x18create:clientcredentials\x12<\n" + + "\x19UPDATE_CLIENT_CREDENTIALS\x10?\x1a\x1d\xf2\x8b\xe4\x10\x18update:clientcredentials\x12%\n" + + "\rREAD_ENTITIES\x10F\x1a\x12\xf2\x8b\xe4\x10\rread:entities\x12%\n" + + "\rLIST_ENTITIES\x10G\x1a\x12\xf2\x8b\xe4\x10\rlist:entities\x12)\n" + + "\x0fCREATE_ENTITIES\x10H\x1a\x14\xf2\x8b\xe4\x10\x0fcreate:entities\x12)\n" + + "\x0fUPDATE_ENTITIES\x10I\x1a\x14\xf2\x8b\xe4\x10\x0fupdate:entities\x12)\n" + + "\x0fDELETE_ENTITIES\x10J\x1a\x14\xf2\x8b\xe4\x10\x0fdelete:entities\x12*\n" + + "\x10READ_FACT_TABLES\x10P\x1a\x14\xf2\x8b\xe4\x10\x0fread:facttables\x12*\n" + + "\x10LIST_FACT_TABLES\x10Q\x1a\x14\xf2\x8b\xe4\x10\x0flist:facttables\x12.\n" + + "\x12CREATE_FACT_TABLES\x10R\x1a\x16\xf2\x8b\xe4\x10\x11create:facttables\x12.\n" + + "\x12UPDATE_FACT_TABLES\x10S\x1a\x16\xf2\x8b\xe4\x10\x11update:facttables\x12.\n" + + "\x12DELETE_FACT_TABLES\x10T\x1a\x16\xf2\x8b\xe4\x10\x11delete:facttables\x126\n" + + "\x16READ_ASSIGNMENT_TABLES\x10Z\x1a\x1a\xf2\x8b\xe4\x10\x15read:assignmenttables\x126\n" + + "\x16LIST_ASSIGNMENT_TABLES\x10[\x1a\x1a\xf2\x8b\xe4\x10\x15list:assignmenttables\x12:\n" + + "\x18CREATE_ASSIGNMENT_TABLES\x10\\\x1a\x1c\xf2\x8b\xe4\x10\x17create:assignmenttables\x12:\n" + + "\x18UPDATE_ASSIGNMENT_TABLES\x10]\x1a\x1c\xf2\x8b\xe4\x10\x17update:assignmenttables\x12:\n" + + "\x18DELETE_ASSIGNMENT_TABLES\x10^\x1a\x1c\xf2\x8b\xe4\x10\x17delete:assignmenttables\x124\n" + + "\x15READ_DIMENSION_TABLES\x10d\x1a\x19\xf2\x8b\xe4\x10\x14read:dimensiontables\x124\n" + + "\x15LIST_DIMENSION_TABLES\x10e\x1a\x19\xf2\x8b\xe4\x10\x14list:dimensiontables\x128\n" + + "\x17CREATE_DIMENSION_TABLES\x10f\x1a\x1b\xf2\x8b\xe4\x10\x16create:dimensiontables\x128\n" + + "\x17UPDATE_DIMENSION_TABLES\x10g\x1a\x1b\xf2\x8b\xe4\x10\x16update:dimensiontables\x128\n" + + "\x17DELETE_DIMENSION_TABLES\x10h\x1a\x1b\xf2\x8b\xe4\x10\x16delete:dimensiontables\x12#\n" + + "\fREAD_METRICS\x10n\x1a\x11\xf2\x8b\xe4\x10\fread:metrics\x12#\n" + + "\fLIST_METRICS\x10o\x1a\x11\xf2\x8b\xe4\x10\flist:metrics\x12'\n" + + "\x0eCREATE_METRICS\x10p\x1a\x13\xf2\x8b\xe4\x10\x0ecreate:metrics\x12'\n" + + "\x0eUPDATE_METRICS\x10q\x1a\x13\xf2\x8b\xe4\x10\x0eupdate:metrics\x12'\n" + + "\x0eDELETE_METRICS\x10r\x1a\x13\xf2\x8b\xe4\x10\x0edelete:metrics\x12M\n" + + "\"READ_SCHEDULED_METRIC_CALCULATIONS\x10x\x1a%\xf2\x8b\xe4\x10 read:scheduledmetriccalculations\x12M\n" + + "\"LIST_SCHEDULED_METRIC_CALCULATIONS\x10y\x1a%\xf2\x8b\xe4\x10 list:scheduledmetriccalculations\x12Q\n" + + "$CREATE_SCHEDULED_METRIC_CALCULATIONS\x10z\x1a'\xf2\x8b\xe4\x10\"create:scheduledmetriccalculations\x12Q\n" + + "$UPDATE_SCHEDULED_METRIC_CALCULATIONS\x10{\x1a'\xf2\x8b\xe4\x10\"update:scheduledmetriccalculations\x12;\n" + + "\x18READ_METRIC_CALCULATIONS\x10\x82\x01\x1a\x1c\xf2\x8b\xe4\x10\x17read:metriccalculations\x12;\n" + + "\x18LIST_METRIC_CALCULATIONS\x10\x83\x01\x1a\x1c\xf2\x8b\xe4\x10\x17list:metriccalculations\x12?\n" + + "\x1aCREATE_METRIC_CALCULATIONS\x10\x84\x01\x1a\x1e\xf2\x8b\xe4\x10\x19create:metriccalculations\x12?\n" + + "\x1aUPDATE_METRIC_CALCULATIONS\x10\x85\x01\x1a\x1e\xf2\x8b\xe4\x10\x19update:metriccalculations\x123\n" + + "\x14READ_EXPOSURE_TABLES\x10\x8c\x01\x1a\x18\xf2\x8b\xe4\x10\x13read:exposuretables\x123\n" + + "\x14LIST_EXPOSURE_TABLES\x10\x8d\x01\x1a\x18\xf2\x8b\xe4\x10\x13list:exposuretables\x127\n" + + "\x16CREATE_EXPOSURE_TABLES\x10\x8e\x01\x1a\x1a\xf2\x8b\xe4\x10\x15create:exposuretables\x127\n" + + "\x16UPDATE_EXPOSURE_TABLES\x10\x8f\x01\x1a\x1a\xf2\x8b\xe4\x10\x15update:exposuretables\x12%\n" + + "\rREAD_SQL_JOBS\x10\x96\x01\x1a\x11\xf2\x8b\xe4\x10\fread:sqljobs\x12%\n" + + "\rLIST_SQL_JOBS\x10\x97\x01\x1a\x11\xf2\x8b\xe4\x10\flist:sqljobs\x12)\n" + + "\x0fCREATE_SQL_JOBS\x10\x98\x01\x1a\x13\xf2\x8b\xe4\x10\x0ecreate:sqljobs\x12)\n" + + "\x0fUPDATE_SQL_JOBS\x10\x99\x01\x1a\x13\xf2\x8b\xe4\x10\x0eupdate:sqljobs\x12-\n" + + "\x11PREVIEW_SQL_QUERY\x10\xa0\x01\x1a\x15\xf2\x8b\xe4\x10\x10preview:sqlquery\x12+\n" + + "\x10LIST_EVENT_TYPES\x10\xaa\x01\x1a\x14\xf2\x8b\xe4\x10\x0flist:eventtypes\x12+\n" + + "\x10READ_EVENT_TYPES\x10\xab\x01\x1a\x14\xf2\x8b\xe4\x10\x0fread:eventtypes\x12,\n" + + "\x10READ_CONNECTIONS\x10\xb4\x01\x1a\x15\xf2\x8b\xe4\x10\x10read:connections\x12,\n" + + "\x10LIST_CONNECTIONS\x10\xb5\x01\x1a\x15\xf2\x8b\xe4\x10\x10list:connections\x120\n" + + "\x12CREATE_CONNECTIONS\x10\xb6\x01\x1a\x17\xf2\x8b\xe4\x10\x12create:connections\x120\n" + + "\x12UPDATE_CONNECTIONS\x10\xb7\x01\x1a\x17\xf2\x8b\xe4\x10\x12update:connections\x12R\n" + + "$READ_SCHEDULED_EXPOSURE_CALCULATIONS\x10\xbe\x01\x1a'\xf2\x8b\xe4\x10\"read:scheduledexposurecalculations\x12R\n" + + "$LIST_SCHEDULED_EXPOSURE_CALCULATIONS\x10\xbf\x01\x1a'\xf2\x8b\xe4\x10\"list:scheduledexposurecalculations\x12V\n" + + "&CREATE_SCHEDULED_EXPOSURE_CALCULATIONS\x10\xc0\x01\x1a)\xf2\x8b\xe4\x10$create:scheduledexposurecalculations\x12V\n" + + "&UPDATE_SCHEDULED_EXPOSURE_CALCULATIONS\x10\xc1\x01\x1a)\xf2\x8b\xe4\x10$update:scheduledexposurecalculations\x12*\n" + + "\x0fREAD_OPERATIONS\x10\xc8\x01\x1a\x14\xf2\x8b\xe4\x10\x0fread:operations\x12*\n" + + "\x0fLIST_OPERATIONS\x10\xc9\x01\x1a\x14\xf2\x8b\xe4\x10\x0flist:operations\x12.\n" + + "\x11CREATE_OPERATIONS\x10\xca\x01\x1a\x16\xf2\x8b\xe4\x10\x11create:operations\x12.\n" + + "\x11UPDATE_OPERATIONS\x10\xcb\x01\x1a\x16\xf2\x8b\xe4\x10\x11update:operations\x123\n" + + "\x14READ_DATA_WAREHOUSES\x10\xd2\x01\x1a\x18\xf2\x8b\xe4\x10\x13read:datawarehouses\x123\n" + + "\x14LIST_DATA_WAREHOUSES\x10\xd3\x01\x1a\x18\xf2\x8b\xe4\x10\x13list:datawarehouses\x127\n" + + "\x16CREATE_DATA_WAREHOUSES\x10\xd4\x01\x1a\x1a\xf2\x8b\xe4\x10\x15create:datawarehouses\x127\n" + + "\x16UPDATE_DATA_WAREHOUSES\x10\xd5\x01\x1a\x1a\xf2\x8b\xe4\x10\x15update:datawarehouses\x12 \n" + + "\n" + + "READ_USERS\x10\xdc\x01\x1a\x0f\xf2\x8b\xe4\x10\n" + + "read:users\x12 \n" + + "\n" + + "LIST_USERS\x10\xdd\x01\x1a\x0f\xf2\x8b\xe4\x10\n" + + "list:users\x12$\n" + + "\fCREATE_USERS\x10\xde\x01\x1a\x11\xf2\x8b\xe4\x10\fcreate:users\x12$\n" + + "\fUPDATE_USERS\x10\xdf\x01\x1a\x11\xf2\x8b\xe4\x10\fupdate:users\x12 \n" + + "\n" + + "READ_ROLES\x10\xe6\x01\x1a\x0f\xf2\x8b\xe4\x10\n" + + "read:roles\x12 \n" + + "\n" + + "LIST_ROLES\x10\xe7\x01\x1a\x0f\xf2\x8b\xe4\x10\n" + + "list:roles\x12$\n" + + "\fCREATE_ROLES\x10\xe8\x01\x1a\x11\xf2\x8b\xe4\x10\fcreate:roles\x12$\n" + + "\fUPDATE_ROLES\x10\xe9\x01\x1a\x11\xf2\x8b\xe4\x10\fupdate:roles\x12+\n" + + "\x10READ_API_CLIENTS\x10\xf0\x01\x1a\x14\xf2\x8b\xe4\x10\x0fread:apiclients\x12+\n" + + "\x10LIST_API_CLIENTS\x10\xf1\x01\x1a\x14\xf2\x8b\xe4\x10\x0flist:apiclients\x12/\n" + + "\x12CREATE_API_CLIENTS\x10\xf2\x01\x1a\x16\xf2\x8b\xe4\x10\x11create:apiclients\x12/\n" + + "\x12UPDATE_API_CLIENTS\x10\xf3\x01\x1a\x16\xf2\x8b\xe4\x10\x11update:apiclients\x12/\n" + + "\x12DELETE_API_CLIENTS\x10\xf4\x01\x1a\x16\xf2\x8b\xe4\x10\x11delete:apiclients\x12\"\n" + + "\vLIST_EVENTS\x10\xfa\x01\x1a\x10\xf2\x8b\xe4\x10\vlist:events\x12\"\n" + + "\vREAD_EVENTS\x10\xfb\x01\x1a\x10\xf2\x8b\xe4\x10\vread:events\x12/\n" + + "\x12READ_CLIENT_SCHEMA\x10\x84\x02\x1a\x16\xf2\x8b\xe4\x10\x11read:clientschema\x127\n" + + "\x16READ_EVENT_DEFINITIONS\x10\x8e\x02\x1a\x1a\xf2\x8b\xe4\x10\x15read:eventdefinitions\x127\n" + + "\x16LIST_EVENT_DEFINITIONS\x10\x8f\x02\x1a\x1a\xf2\x8b\xe4\x10\x15list:eventdefinitions\x12;\n" + + "\x18CREATE_EVENT_DEFINITIONS\x10\x90\x02\x1a\x1c\xf2\x8b\xe4\x10\x17create:eventdefinitions\x12;\n" + + "\x18UPDATE_EVENT_DEFINITIONS\x10\x91\x02\x1a\x1c\xf2\x8b\xe4\x10\x17update:eventdefinitions\x12;\n" + + "\x18DELETE_EVENT_DEFINITIONS\x10\x92\x02\x1a\x1c\xf2\x8b\xe4\x10\x17delete:eventdefinitions\x12\x1e\n" + + "\tREAD_SKUS\x10\x98\x02\x1a\x0e\xf2\x8b\xe4\x10\tread:skus\x12\x1e\n" + + "\tLIST_SKUS\x10\x99\x02\x1a\x0e\xf2\x8b\xe4\x10\tlist:skus\x12/\n" + + "\x12READ_USAGE_REPORTS\x10\xa2\x02\x1a\x16\xf2\x8b\xe4\x10\x11read:usagereports\x125\n" + + "\x15READ_USER_INVITATIONS\x10\xac\x02\x1a\x19\xf2\x8b\xe4\x10\x14read:userinvitations\x125\n" + + "\x15LIST_USER_INVITATIONS\x10\xad\x02\x1a\x19\xf2\x8b\xe4\x10\x14list:userinvitations\x129\n" + + "\x17CREATE_USER_INVITATIONS\x10\xae\x02\x1a\x1b\xf2\x8b\xe4\x10\x16create:userinvitations\x129\n" + + "\x17DELETE_USER_INVITATIONS\x10\xb0\x02\x1a\x1b\xf2\x8b\xe4\x10\x16delete:userinvitations\x12)\n" + + "\x0fREAD_OAUTH_APPS\x10\xb6\x02\x1a\x13\xf2\x8b\xe4\x10\x0eread:oauthapps\x12)\n" + + "\x0fLIST_OAUTH_APPS\x10\xb7\x02\x1a\x13\xf2\x8b\xe4\x10\x0elist:oauthapps\x12-\n" + + "\x11CREATE_OAUTH_APPS\x10\xb8\x02\x1a\x15\xf2\x8b\xe4\x10\x10create:oauthapps\x12-\n" + + "\x11UPDATE_OAUTH_APPS\x10\xb9\x02\x1a\x15\xf2\x8b\xe4\x10\x10update:oauthapps\x12-\n" + + "\x11DELETE_OAUTH_APPS\x10\xba\x02\x1a\x15\xf2\x8b\xe4\x10\x10delete:oauthapps\x125\n" + + "\x15READ_WORKFLOW_SECRETS\x10\xc0\x02\x1a\x19\xf2\x8b\xe4\x10\x14read:workflowsecrets\x125\n" + + "\x15LIST_WORKFLOW_SECRETS\x10\xc1\x02\x1a\x19\xf2\x8b\xe4\x10\x14list:workflowsecrets\x129\n" + + "\x17CREATE_WORKFLOW_SECRETS\x10\xc2\x02\x1a\x1b\xf2\x8b\xe4\x10\x16create:workflowsecrets\x129\n" + + "\x17UPDATE_WORKFLOW_SECRETS\x10\xc3\x02\x1a\x1b\xf2\x8b\xe4\x10\x16update:workflowsecrets\x129\n" + + "\x17DELETE_WORKFLOW_SECRETS\x10\xc4\x02\x1a\x1b\xf2\x8b\xe4\x10\x16delete:workflowsecrets\x12/\n" + + "\x12LIST_WORKFLOW_LOGS\x10\xca\x02\x1a\x16\xf2\x8b\xe4\x10\x11list:workflowlogs\x12/\n" + + "\x12READ_WORKFLOW_LOGS\x10\xcb\x02\x1a\x16\xf2\x8b\xe4\x10\x11read:workflowlogs\x12?\n" + + "\x1aREAD_EXPOSURE_CALCULATIONS\x10\xd4\x02\x1a\x1e\xf2\x8b\xe4\x10\x19read:exposurecalculations\x12?\n" + + "\x1aLIST_EXPOSURE_CALCULATIONS\x10\xd5\x02\x1a\x1e\xf2\x8b\xe4\x10\x19list:exposurecalculations\x12C\n" + + "\x1cCREATE_EXPOSURE_CALCULATIONS\x10\xd6\x02\x1a \xf2\x8b\xe4\x10\x1bcreate:exposurecalculations\x12C\n" + + "\x1cUPDATE_EXPOSURE_CALCULATIONS\x10\xd7\x02\x1a \xf2\x8b\xe4\x10\x1bupdate:exposurecalculations\x12+\n" + + "\x10READ_CRYPTO_KEYS\x10\xde\x02\x1a\x14\xf2\x8b\xe4\x10\x0fread:cryptokeys\x12+\n" + + "\x10LIST_CRYPTO_KEYS\x10\xdf\x02\x1a\x14\xf2\x8b\xe4\x10\x0flist:cryptokeys\x12/\n" + + "\x12CREATE_CRYPTO_KEYS\x10\xe0\x02\x1a\x16\xf2\x8b\xe4\x10\x11create:cryptokeys\x12/\n" + + "\x12DELETE_CRYPTO_KEYS\x10\xe1\x02\x1a\x16\xf2\x8b\xe4\x10\x11delete:cryptokeys\x121\n" + + "\x13CREATE_RESOLVE_INFO\x10\xe8\x02\x1a\x17\xf2\x8b\xe4\x10\x12create:resolveinfo\x123\n" + + "\x14CREATE_FLAG_ASSIGNED\x10\xf2\x02\x1a\x18\xf2\x8b\xe4\x10\x13create:flagassigned\x125\n" + + "\x15STATS_TEST_HYPOTHESIS\x10\xfc\x02\x1a\x19\xf2\x8b\xe4\x10\x14stats:testhypothesis\x12/\n" + + "\x12STATS_RUN_ANALYSIS\x10\xfd\x02\x1a\x16\xf2\x8b\xe4\x10\x11stats:runanalysis\x12F\n" + + "\x1eSTATS_RUN_EXPLORATORY_ANALYSIS\x10\xfe\x02\x1a!\xf2\x8b\xe4\x10\x1cstats:runexploratoryanalysis\x12:\n" + + "\x18STATS_RUN_POWER_ANALYSIS\x10\xff\x02\x1a\x1b\xf2\x8b\xe4\x10\x16stats:runpoweranalysis\x127\n" + + "\x16READ_SUBGROUP_ANALYSES\x10\x86\x03\x1a\x1a\xf2\x8b\xe4\x10\x15read:subgroupanalyses\x127\n" + + "\x16LIST_SUBGROUP_ANALYSES\x10\x87\x03\x1a\x1a\xf2\x8b\xe4\x10\x15list:subgroupanalyses\x12;\n" + + "\x18CREATE_SUBGROUP_ANALYSES\x10\x88\x03\x1a\x1c\xf2\x8b\xe4\x10\x17create:subgroupanalyses\x12;\n" + + "\x18DELETE_SUBGROUP_ANALYSES\x10\x89\x03\x1a\x1c\xf2\x8b\xe4\x10\x17delete:subgroupanalyses\x12?\n" + + "\x1aREAD_MATERIALIZED_SEGMENTS\x10\x90\x03\x1a\x1e\xf2\x8b\xe4\x10\x19read:materializedsegments\x12?\n" + + "\x1aLIST_MATERIALIZED_SEGMENTS\x10\x91\x03\x1a\x1e\xf2\x8b\xe4\x10\x19list:materializedsegments\x12C\n" + + "\x1cCREATE_MATERIALIZED_SEGMENTS\x10\x92\x03\x1a \xf2\x8b\xe4\x10\x1bcreate:materializedsegments\x12C\n" + + "\x1cDELETE_MATERIALIZED_SEGMENTS\x10\x93\x03\x1a \xf2\x8b\xe4\x10\x1bdelete:materializedsegments\x12C\n" + + "\x1cUPDATE_MATERIALIZED_SEGMENTS\x10\x94\x03\x1a \xf2\x8b\xe4\x10\x1bupdate:materializedsegments\x12\"\n" + + "\vREAD_GROUPS\x10\x9a\x03\x1a\x10\xf2\x8b\xe4\x10\vread:groups\x12\"\n" + + "\vLIST_GROUPS\x10\x9b\x03\x1a\x10\xf2\x8b\xe4\x10\vlist:groups\x12&\n" + + "\rCREATE_GROUPS\x10\x9c\x03\x1a\x12\xf2\x8b\xe4\x10\rcreate:groups\x12&\n" + + "\rUPDATE_GROUPS\x10\x9d\x03\x1a\x12\xf2\x8b\xe4\x10\rupdate:groups\x12&\n" + + "\rDELETE_GROUPS\x10\x9e\x03\x1a\x12\xf2\x8b\xe4\x10\rdelete:groups\x12\"\n" + + "\vREAD_IMAGES\x10\xa4\x03\x1a\x10\xf2\x8b\xe4\x10\vread:images\x12\"\n" + + "\vLIST_IMAGES\x10\xa5\x03\x1a\x10\xf2\x8b\xe4\x10\vlist:images\x12&\n" + + "\rCREATE_IMAGES\x10\xa6\x03\x1a\x12\xf2\x8b\xe4\x10\rcreate:images\x12&\n" + + "\rUPDATE_IMAGES\x10\xa7\x03\x1a\x12\xf2\x8b\xe4\x10\rupdate:images\x12&\n" + + "\rDELETE_IMAGES\x10\xa8\x03\x1a\x12\xf2\x8b\xe4\x10\rdelete:images\x12&\n" + + "\rREAD_SURFACES\x10\xae\x03\x1a\x12\xf2\x8b\xe4\x10\rread:surfaces\x12&\n" + + "\rLIST_SURFACES\x10\xaf\x03\x1a\x12\xf2\x8b\xe4\x10\rlist:surfaces\x12*\n" + + "\x0fCREATE_SURFACES\x10\xb0\x03\x1a\x14\xf2\x8b\xe4\x10\x0fcreate:surfaces\x12*\n" + + "\x0fUPDATE_SURFACES\x10\xb1\x03\x1a\x14\xf2\x8b\xe4\x10\x0fupdate:surfaces\x12*\n" + + "\x0fDELETE_SURFACES\x10\xb2\x03\x1a\x14\xf2\x8b\xe4\x10\x0fdelete:surfaces:X\n" + + "\x04auth\x12\x1e.google.protobuf.MethodOptions\x18\xf9\xc0\x8c\x02 \x01(\v2!.confidence.auth.v1.AuthorizationR\x04auth::\n" + + "\x05scope\x12!.google.protobuf.EnumValueOptions\x18\xbe\xc1\x8c\x02 \x01(\tR\x05scopeB0\n" + + "!com.spotify.confidence.commons.v1B\tAuthProtoP\x01b\x06proto3" + +var ( + file_confidence_auth_v1_auth_proto_rawDescOnce sync.Once + file_confidence_auth_v1_auth_proto_rawDescData []byte +) + +func file_confidence_auth_v1_auth_proto_rawDescGZIP() []byte { + file_confidence_auth_v1_auth_proto_rawDescOnce.Do(func() { + file_confidence_auth_v1_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_auth_v1_auth_proto_rawDesc), len(file_confidence_auth_v1_auth_proto_rawDesc))) + }) + return file_confidence_auth_v1_auth_proto_rawDescData +} + +var file_confidence_auth_v1_auth_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_confidence_auth_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_confidence_auth_v1_auth_proto_goTypes = []any{ + (Permission)(0), // 0: confidence.auth.v1.Permission + (*Authorization)(nil), // 1: confidence.auth.v1.Authorization + (*descriptorpb.MethodOptions)(nil), // 2: google.protobuf.MethodOptions + (*descriptorpb.EnumValueOptions)(nil), // 3: google.protobuf.EnumValueOptions +} +var file_confidence_auth_v1_auth_proto_depIdxs = []int32{ + 0, // 0: confidence.auth.v1.Authorization.required_permission:type_name -> confidence.auth.v1.Permission + 2, // 1: confidence.auth.v1.auth:extendee -> google.protobuf.MethodOptions + 3, // 2: confidence.auth.v1.scope:extendee -> google.protobuf.EnumValueOptions + 1, // 3: confidence.auth.v1.auth:type_name -> confidence.auth.v1.Authorization + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 3, // [3:4] is the sub-list for extension type_name + 1, // [1:3] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_confidence_auth_v1_auth_proto_init() } +func file_confidence_auth_v1_auth_proto_init() { + if File_confidence_auth_v1_auth_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_auth_v1_auth_proto_rawDesc), len(file_confidence_auth_v1_auth_proto_rawDesc)), + NumEnums: 1, + NumMessages: 1, + NumExtensions: 2, + NumServices: 0, + }, + GoTypes: file_confidence_auth_v1_auth_proto_goTypes, + DependencyIndexes: file_confidence_auth_v1_auth_proto_depIdxs, + EnumInfos: file_confidence_auth_v1_auth_proto_enumTypes, + MessageInfos: file_confidence_auth_v1_auth_proto_msgTypes, + ExtensionInfos: file_confidence_auth_v1_auth_proto_extTypes, + }.Build() + File_confidence_auth_v1_auth_proto = out.File + file_confidence_auth_v1_auth_proto_goTypes = nil + file_confidence_auth_v1_auth_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/events/v1/annotations.pb.go b/openfeature-provider/go/proto/confidence/events/v1/annotations.pb.go new file mode 100644 index 0000000..0edbd8e --- /dev/null +++ b/openfeature-provider/go/proto/confidence/events/v1/annotations.pb.go @@ -0,0 +1,155 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/events/v1/annotations.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type EventSpec struct { + state protoimpl.MessageState `protogen:"open.v1"` + Persist bool `protobuf:"varint,1,opt,name=persist,proto3" json:"persist,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EventSpec) Reset() { + *x = EventSpec{} + mi := &file_confidence_events_v1_annotations_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EventSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventSpec) ProtoMessage() {} + +func (x *EventSpec) ProtoReflect() protoreflect.Message { + mi := &file_confidence_events_v1_annotations_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventSpec.ProtoReflect.Descriptor instead. +func (*EventSpec) Descriptor() ([]byte, []int) { + return file_confidence_events_v1_annotations_proto_rawDescGZIP(), []int{0} +} + +func (x *EventSpec) GetPersist() bool { + if x != nil { + return x.Persist + } + return false +} + +func (x *EventSpec) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +var file_confidence_events_v1_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*EventSpec)(nil), + Field: 4324222, + Name: "confidence.events.v1.event", + Tag: "bytes,4324222,opt,name=event", + Filename: "confidence/events/v1/annotations.proto", + }, +} + +// Extension fields to descriptorpb.MessageOptions. +var ( + // optional confidence.events.v1.EventSpec event = 4324222; + E_Event = &file_confidence_events_v1_annotations_proto_extTypes[0] +) + +var File_confidence_events_v1_annotations_proto protoreflect.FileDescriptor + +const file_confidence_events_v1_annotations_proto_rawDesc = "" + + "\n" + + "&confidence/events/v1/annotations.proto\x12\x14confidence.events.v1\x1a google/protobuf/descriptor.proto\"G\n" + + "\tEventSpec\x12\x18\n" + + "\apersist\x18\x01 \x01(\bR\apersist\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription:Y\n" + + "\x05event\x12\x1f.google.protobuf.MessageOptions\x18\xfe\xf6\x87\x02 \x01(\v2\x1f.confidence.events.v1.EventSpecR\x05eventB7\n" + + "!com.spotify.confidence.commons.v1B\x10AnnotationsProtoP\x01b\x06proto3" + +var ( + file_confidence_events_v1_annotations_proto_rawDescOnce sync.Once + file_confidence_events_v1_annotations_proto_rawDescData []byte +) + +func file_confidence_events_v1_annotations_proto_rawDescGZIP() []byte { + file_confidence_events_v1_annotations_proto_rawDescOnce.Do(func() { + file_confidence_events_v1_annotations_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_events_v1_annotations_proto_rawDesc), len(file_confidence_events_v1_annotations_proto_rawDesc))) + }) + return file_confidence_events_v1_annotations_proto_rawDescData +} + +var file_confidence_events_v1_annotations_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_confidence_events_v1_annotations_proto_goTypes = []any{ + (*EventSpec)(nil), // 0: confidence.events.v1.EventSpec + (*descriptorpb.MessageOptions)(nil), // 1: google.protobuf.MessageOptions +} +var file_confidence_events_v1_annotations_proto_depIdxs = []int32{ + 1, // 0: confidence.events.v1.event:extendee -> google.protobuf.MessageOptions + 0, // 1: confidence.events.v1.event:type_name -> confidence.events.v1.EventSpec + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 1, // [1:2] is the sub-list for extension type_name + 0, // [0:1] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_confidence_events_v1_annotations_proto_init() } +func file_confidence_events_v1_annotations_proto_init() { + if File_confidence_events_v1_annotations_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_events_v1_annotations_proto_rawDesc), len(file_confidence_events_v1_annotations_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 1, + NumServices: 0, + }, + GoTypes: file_confidence_events_v1_annotations_proto_goTypes, + DependencyIndexes: file_confidence_events_v1_annotations_proto_depIdxs, + MessageInfos: file_confidence_events_v1_annotations_proto_msgTypes, + ExtensionInfos: file_confidence_events_v1_annotations_proto_extTypes, + }.Build() + File_confidence_events_v1_annotations_proto = out.File + file_confidence_events_v1_annotations_proto_goTypes = nil + file_confidence_events_v1_annotations_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/flags/admin/v1/events/events.pb.go b/openfeature-provider/go/proto/confidence/flags/admin/v1/events/events.pb.go new file mode 100644 index 0000000..578e6e8 --- /dev/null +++ b/openfeature-provider/go/proto/confidence/flags/admin/v1/events/events.pb.go @@ -0,0 +1,681 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/flags/admin/v1/events/events.proto + +package events + +import ( + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1" + v1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Occurs when a new flag is created +type FlagCreated struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The flag that was created + Flag *v1.Flag `protobuf:"bytes,1,opt,name=flag,proto3" json:"flag,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagCreated) Reset() { + *x = FlagCreated{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagCreated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagCreated) ProtoMessage() {} + +func (x *FlagCreated) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagCreated.ProtoReflect.Descriptor instead. +func (*FlagCreated) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{0} +} + +func (x *FlagCreated) GetFlag() *v1.Flag { + if x != nil { + return x.Flag + } + return nil +} + +// Occurs when a flag has been updated +type FlagUpdated struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The flag that was updated + Flag *v1.Flag `protobuf:"bytes,1,opt,name=flag,proto3" json:"flag,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagUpdated) Reset() { + *x = FlagUpdated{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagUpdated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagUpdated) ProtoMessage() {} + +func (x *FlagUpdated) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagUpdated.ProtoReflect.Descriptor instead. +func (*FlagUpdated) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{1} +} + +func (x *FlagUpdated) GetFlag() *v1.Flag { + if x != nil { + return x.Flag + } + return nil +} + +// Occurs when a flag is archived +type FlagArchived struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The flag that was archived + Flag *v1.Flag `protobuf:"bytes,1,opt,name=flag,proto3" json:"flag,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagArchived) Reset() { + *x = FlagArchived{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagArchived) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagArchived) ProtoMessage() {} + +func (x *FlagArchived) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagArchived.ProtoReflect.Descriptor instead. +func (*FlagArchived) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{2} +} + +func (x *FlagArchived) GetFlag() *v1.Flag { + if x != nil { + return x.Flag + } + return nil +} + +// Occurs when a segment is created +type SegmentCreated struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The segment that was created + Segment *v1.Segment `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SegmentCreated) Reset() { + *x = SegmentCreated{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SegmentCreated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SegmentCreated) ProtoMessage() {} + +func (x *SegmentCreated) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SegmentCreated.ProtoReflect.Descriptor instead. +func (*SegmentCreated) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{3} +} + +func (x *SegmentCreated) GetSegment() *v1.Segment { + if x != nil { + return x.Segment + } + return nil +} + +// Occurs when a segment is updated +type SegmentUpdated struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The segment that was updated + Segment *v1.Segment `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SegmentUpdated) Reset() { + *x = SegmentUpdated{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SegmentUpdated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SegmentUpdated) ProtoMessage() {} + +func (x *SegmentUpdated) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SegmentUpdated.ProtoReflect.Descriptor instead. +func (*SegmentUpdated) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{4} +} + +func (x *SegmentUpdated) GetSegment() *v1.Segment { + if x != nil { + return x.Segment + } + return nil +} + +// Occurs when a segment is allocated +type SegmentAllocated struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The segment that was allocated + Segment *v1.Segment `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SegmentAllocated) Reset() { + *x = SegmentAllocated{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SegmentAllocated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SegmentAllocated) ProtoMessage() {} + +func (x *SegmentAllocated) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SegmentAllocated.ProtoReflect.Descriptor instead. +func (*SegmentAllocated) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{5} +} + +func (x *SegmentAllocated) GetSegment() *v1.Segment { + if x != nil { + return x.Segment + } + return nil +} + +// Occurs when a segment is archived +type SegmentArchived struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The segment that was archived + Segment *v1.Segment `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SegmentArchived) Reset() { + *x = SegmentArchived{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SegmentArchived) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SegmentArchived) ProtoMessage() {} + +func (x *SegmentArchived) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SegmentArchived.ProtoReflect.Descriptor instead. +func (*SegmentArchived) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{6} +} + +func (x *SegmentArchived) GetSegment() *v1.Segment { + if x != nil { + return x.Segment + } + return nil +} + +// Occurs when a Rule is enabled +type RuleEnabled struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The Rule that was enabled + Rule *v1.Flag_Rule `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RuleEnabled) Reset() { + *x = RuleEnabled{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RuleEnabled) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RuleEnabled) ProtoMessage() {} + +func (x *RuleEnabled) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RuleEnabled.ProtoReflect.Descriptor instead. +func (*RuleEnabled) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{7} +} + +func (x *RuleEnabled) GetRule() *v1.Flag_Rule { + if x != nil { + return x.Rule + } + return nil +} + +// Occurs when a Rule is disabled +type RuleDisabled struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The Rule that was disabled + Rule *v1.Flag_Rule `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RuleDisabled) Reset() { + *x = RuleDisabled{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RuleDisabled) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RuleDisabled) ProtoMessage() {} + +func (x *RuleDisabled) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RuleDisabled.ProtoReflect.Descriptor instead. +func (*RuleDisabled) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{8} +} + +func (x *RuleDisabled) GetRule() *v1.Flag_Rule { + if x != nil { + return x.Rule + } + return nil +} + +// A materialized segment was created. +type MaterializedSegmentCreated struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The created materialized segment. + MaterializedSegment *v1.MaterializedSegment `protobuf:"bytes,1,opt,name=materialized_segment,json=materializedSegment,proto3" json:"materialized_segment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MaterializedSegmentCreated) Reset() { + *x = MaterializedSegmentCreated{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MaterializedSegmentCreated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaterializedSegmentCreated) ProtoMessage() {} + +func (x *MaterializedSegmentCreated) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MaterializedSegmentCreated.ProtoReflect.Descriptor instead. +func (*MaterializedSegmentCreated) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{9} +} + +func (x *MaterializedSegmentCreated) GetMaterializedSegment() *v1.MaterializedSegment { + if x != nil { + return x.MaterializedSegment + } + return nil +} + +// A materialized segment was updated. +type MaterializedSegmentUpdated struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The updated materialized segment. + MaterializedSegment *v1.MaterializedSegment `protobuf:"bytes,1,opt,name=materialized_segment,json=materializedSegment,proto3" json:"materialized_segment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MaterializedSegmentUpdated) Reset() { + *x = MaterializedSegmentUpdated{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MaterializedSegmentUpdated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaterializedSegmentUpdated) ProtoMessage() {} + +func (x *MaterializedSegmentUpdated) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MaterializedSegmentUpdated.ProtoReflect.Descriptor instead. +func (*MaterializedSegmentUpdated) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{10} +} + +func (x *MaterializedSegmentUpdated) GetMaterializedSegment() *v1.MaterializedSegment { + if x != nil { + return x.MaterializedSegment + } + return nil +} + +// A materialized segment was deleted. +type MaterializedSegmentDeleted struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The deleted materialized segment. + MaterializedSegment string `protobuf:"bytes,1,opt,name=materialized_segment,json=materializedSegment,proto3" json:"materialized_segment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MaterializedSegmentDeleted) Reset() { + *x = MaterializedSegmentDeleted{} + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MaterializedSegmentDeleted) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaterializedSegmentDeleted) ProtoMessage() {} + +func (x *MaterializedSegmentDeleted) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_events_events_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MaterializedSegmentDeleted.ProtoReflect.Descriptor instead. +func (*MaterializedSegmentDeleted) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP(), []int{11} +} + +func (x *MaterializedSegmentDeleted) GetMaterializedSegment() string { + if x != nil { + return x.MaterializedSegment + } + return "" +} + +var File_confidence_flags_admin_v1_events_events_proto protoreflect.FileDescriptor + +const file_confidence_flags_admin_v1_events_events_proto_rawDesc = "" + + "\n" + + "-confidence/flags/admin/v1/events/events.proto\x12 confidence.flags.admin.v1.events\x1a&confidence/events/v1/annotations.proto\x1a%confidence/flags/admin/v1/types.proto\"n\n" + + "\vFlagCreated\x123\n" + + "\x04flag\x18\x01 \x01(\v2\x1f.confidence.flags.admin.v1.FlagR\x04flag:*\xf2\xb7\xbf\x10%\b\x01\x12!Occurs when a new flag is created\"p\n" + + "\vFlagUpdated\x123\n" + + "\x04flag\x18\x01 \x01(\v2\x1f.confidence.flags.admin.v1.FlagR\x04flag:,\xf2\xb7\xbf\x10'\b\x01\x12#Occurs when a flag has been updated\"l\n" + + "\fFlagArchived\x123\n" + + "\x04flag\x18\x01 \x01(\v2\x1f.confidence.flags.admin.v1.FlagR\x04flag:'\xf2\xb7\xbf\x10\"\b\x01\x12\x1eOccurs when a flag is archived\"y\n" + + "\x0eSegmentCreated\x12<\n" + + "\asegment\x18\x01 \x01(\v2\".confidence.flags.admin.v1.SegmentR\asegment:)\xf2\xb7\xbf\x10$\b\x01\x12 Occurs when a segment is created\"y\n" + + "\x0eSegmentUpdated\x12<\n" + + "\asegment\x18\x01 \x01(\v2\".confidence.flags.admin.v1.SegmentR\asegment:)\xf2\xb7\xbf\x10$\b\x01\x12 Occurs when a segment is updated\"}\n" + + "\x10SegmentAllocated\x12<\n" + + "\asegment\x18\x01 \x01(\v2\".confidence.flags.admin.v1.SegmentR\asegment:+\xf2\xb7\xbf\x10&\b\x01\x12\"Occurs when a segment is allocated\"{\n" + + "\x0fSegmentArchived\x12<\n" + + "\asegment\x18\x01 \x01(\v2\".confidence.flags.admin.v1.SegmentR\asegment:*\xf2\xb7\xbf\x10%\b\x01\x12!Occurs when a segment is archived\"o\n" + + "\vRuleEnabled\x128\n" + + "\x04rule\x18\x01 \x01(\v2$.confidence.flags.admin.v1.Flag.RuleR\x04rule:&\xf2\xb7\xbf\x10!\b\x01\x12\x1dOccurs when a Rule is enabled\"q\n" + + "\fRuleDisabled\x128\n" + + "\x04rule\x18\x01 \x01(\v2$.confidence.flags.admin.v1.Flag.RuleR\x04rule:'\xf2\xb7\xbf\x10\"\b\x01\x12\x1eOccurs when a Rule is disabled\"\xb7\x01\n" + + "\x1aMaterializedSegmentCreated\x12a\n" + + "\x14materialized_segment\x18\x01 \x01(\v2..confidence.flags.admin.v1.MaterializedSegmentR\x13materializedSegment:6\xf2\xb7\xbf\x101\b\x01\x12-Occurs when a materialized segment is created\"\xb7\x01\n" + + "\x1aMaterializedSegmentUpdated\x12a\n" + + "\x14materialized_segment\x18\x01 \x01(\v2..confidence.flags.admin.v1.MaterializedSegmentR\x13materializedSegment:6\xf2\xb7\xbf\x101\b\x01\x12-Occurs when a materialized segment is updated\"\x87\x01\n" + + "\x1aMaterializedSegmentDeleted\x121\n" + + "\x14materialized_segment\x18\x01 \x01(\tR\x13materializedSegment:6\xf2\xb7\xbf\x101\b\x01\x12-Occurs when a materialized segment is deletedB=\n" + + ",com.spotify.confidence.flags.admin.v1.eventsB\vEventsProtoP\x01b\x06proto3" + +var ( + file_confidence_flags_admin_v1_events_events_proto_rawDescOnce sync.Once + file_confidence_flags_admin_v1_events_events_proto_rawDescData []byte +) + +func file_confidence_flags_admin_v1_events_events_proto_rawDescGZIP() []byte { + file_confidence_flags_admin_v1_events_events_proto_rawDescOnce.Do(func() { + file_confidence_flags_admin_v1_events_events_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_flags_admin_v1_events_events_proto_rawDesc), len(file_confidence_flags_admin_v1_events_events_proto_rawDesc))) + }) + return file_confidence_flags_admin_v1_events_events_proto_rawDescData +} + +var file_confidence_flags_admin_v1_events_events_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_confidence_flags_admin_v1_events_events_proto_goTypes = []any{ + (*FlagCreated)(nil), // 0: confidence.flags.admin.v1.events.FlagCreated + (*FlagUpdated)(nil), // 1: confidence.flags.admin.v1.events.FlagUpdated + (*FlagArchived)(nil), // 2: confidence.flags.admin.v1.events.FlagArchived + (*SegmentCreated)(nil), // 3: confidence.flags.admin.v1.events.SegmentCreated + (*SegmentUpdated)(nil), // 4: confidence.flags.admin.v1.events.SegmentUpdated + (*SegmentAllocated)(nil), // 5: confidence.flags.admin.v1.events.SegmentAllocated + (*SegmentArchived)(nil), // 6: confidence.flags.admin.v1.events.SegmentArchived + (*RuleEnabled)(nil), // 7: confidence.flags.admin.v1.events.RuleEnabled + (*RuleDisabled)(nil), // 8: confidence.flags.admin.v1.events.RuleDisabled + (*MaterializedSegmentCreated)(nil), // 9: confidence.flags.admin.v1.events.MaterializedSegmentCreated + (*MaterializedSegmentUpdated)(nil), // 10: confidence.flags.admin.v1.events.MaterializedSegmentUpdated + (*MaterializedSegmentDeleted)(nil), // 11: confidence.flags.admin.v1.events.MaterializedSegmentDeleted + (*v1.Flag)(nil), // 12: confidence.flags.admin.v1.Flag + (*v1.Segment)(nil), // 13: confidence.flags.admin.v1.Segment + (*v1.Flag_Rule)(nil), // 14: confidence.flags.admin.v1.Flag.Rule + (*v1.MaterializedSegment)(nil), // 15: confidence.flags.admin.v1.MaterializedSegment +} +var file_confidence_flags_admin_v1_events_events_proto_depIdxs = []int32{ + 12, // 0: confidence.flags.admin.v1.events.FlagCreated.flag:type_name -> confidence.flags.admin.v1.Flag + 12, // 1: confidence.flags.admin.v1.events.FlagUpdated.flag:type_name -> confidence.flags.admin.v1.Flag + 12, // 2: confidence.flags.admin.v1.events.FlagArchived.flag:type_name -> confidence.flags.admin.v1.Flag + 13, // 3: confidence.flags.admin.v1.events.SegmentCreated.segment:type_name -> confidence.flags.admin.v1.Segment + 13, // 4: confidence.flags.admin.v1.events.SegmentUpdated.segment:type_name -> confidence.flags.admin.v1.Segment + 13, // 5: confidence.flags.admin.v1.events.SegmentAllocated.segment:type_name -> confidence.flags.admin.v1.Segment + 13, // 6: confidence.flags.admin.v1.events.SegmentArchived.segment:type_name -> confidence.flags.admin.v1.Segment + 14, // 7: confidence.flags.admin.v1.events.RuleEnabled.rule:type_name -> confidence.flags.admin.v1.Flag.Rule + 14, // 8: confidence.flags.admin.v1.events.RuleDisabled.rule:type_name -> confidence.flags.admin.v1.Flag.Rule + 15, // 9: confidence.flags.admin.v1.events.MaterializedSegmentCreated.materialized_segment:type_name -> confidence.flags.admin.v1.MaterializedSegment + 15, // 10: confidence.flags.admin.v1.events.MaterializedSegmentUpdated.materialized_segment:type_name -> confidence.flags.admin.v1.MaterializedSegment + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_confidence_flags_admin_v1_events_events_proto_init() } +func file_confidence_flags_admin_v1_events_events_proto_init() { + if File_confidence_flags_admin_v1_events_events_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_flags_admin_v1_events_events_proto_rawDesc), len(file_confidence_flags_admin_v1_events_events_proto_rawDesc)), + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_confidence_flags_admin_v1_events_events_proto_goTypes, + DependencyIndexes: file_confidence_flags_admin_v1_events_events_proto_depIdxs, + MessageInfos: file_confidence_flags_admin_v1_events_events_proto_msgTypes, + }.Build() + File_confidence_flags_admin_v1_events_events_proto = out.File + file_confidence_flags_admin_v1_events_events_proto_goTypes = nil + file_confidence_flags_admin_v1_events_events_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/flags/admin/v1/resolver.pb.go b/openfeature-provider/go/proto/confidence/flags/admin/v1/resolver.pb.go new file mode 100644 index 0000000..3ff8fee --- /dev/null +++ b/openfeature-provider/go/proto/confidence/flags/admin/v1/resolver.pb.go @@ -0,0 +1,517 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/flags/admin/v1/resolver.proto + +package v1 + +import ( + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api" + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1" + v1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/iam/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// An account region +type ResolverState_Region int32 + +const ( + // Region is not set + ResolverState_REGION_UNSPECIFIED ResolverState_Region = 0 + // EU region + ResolverState_REGION_EU ResolverState_Region = 1 + // US region + ResolverState_REGION_US ResolverState_Region = 2 +) + +// Enum value maps for ResolverState_Region. +var ( + ResolverState_Region_name = map[int32]string{ + 0: "REGION_UNSPECIFIED", + 1: "REGION_EU", + 2: "REGION_US", + } + ResolverState_Region_value = map[string]int32{ + "REGION_UNSPECIFIED": 0, + "REGION_EU": 1, + "REGION_US": 2, + } +) + +func (x ResolverState_Region) Enum() *ResolverState_Region { + p := new(ResolverState_Region) + *p = x + return p +} + +func (x ResolverState_Region) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ResolverState_Region) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_flags_admin_v1_resolver_proto_enumTypes[0].Descriptor() +} + +func (ResolverState_Region) Type() protoreflect.EnumType { + return &file_confidence_flags_admin_v1_resolver_proto_enumTypes[0] +} + +func (x ResolverState_Region) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ResolverState_Region.Descriptor instead. +func (ResolverState_Region) EnumDescriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_resolver_proto_rawDescGZIP(), []int{3, 0} +} + +// Request to fetch resolver state uri +type ResolverStateUriRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolverStateUriRequest) Reset() { + *x = ResolverStateUriRequest{} + mi := &file_confidence_flags_admin_v1_resolver_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolverStateUriRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolverStateUriRequest) ProtoMessage() {} + +func (x *ResolverStateUriRequest) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_resolver_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolverStateUriRequest.ProtoReflect.Descriptor instead. +func (*ResolverStateUriRequest) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_resolver_proto_rawDescGZIP(), []int{0} +} + +// Response of fetching resolver state uri +type ResolverStateUriResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The signed uri that can be used to fetch state + SignedUri string `protobuf:"bytes,1,opt,name=signed_uri,json=signedUri,proto3" json:"signed_uri,omitempty"` + // At what time the state uri expires + ExpireTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` + // The account the referenced state belongs to + Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolverStateUriResponse) Reset() { + *x = ResolverStateUriResponse{} + mi := &file_confidence_flags_admin_v1_resolver_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolverStateUriResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolverStateUriResponse) ProtoMessage() {} + +func (x *ResolverStateUriResponse) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_resolver_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolverStateUriResponse.ProtoReflect.Descriptor instead. +func (*ResolverStateUriResponse) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_resolver_proto_rawDescGZIP(), []int{1} +} + +func (x *ResolverStateUriResponse) GetSignedUri() string { + if x != nil { + return x.SignedUri + } + return "" +} + +func (x *ResolverStateUriResponse) GetExpireTime() *timestamppb.Timestamp { + if x != nil { + return x.ExpireTime + } + return nil +} + +func (x *ResolverStateUriResponse) GetAccount() string { + if x != nil { + return x.Account + } + return "" +} + +// Request to get the resolver state for the whole account +type ResolverStateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolverStateRequest) Reset() { + *x = ResolverStateRequest{} + mi := &file_confidence_flags_admin_v1_resolver_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolverStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolverStateRequest) ProtoMessage() {} + +func (x *ResolverStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_resolver_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolverStateRequest.ProtoReflect.Descriptor instead. +func (*ResolverStateRequest) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_resolver_proto_rawDescGZIP(), []int{2} +} + +// The full state for operating a flags resolver +type ResolverState struct { + state protoimpl.MessageState `protogen:"open.v1"` + // All active flags + Flags []*Flag `protobuf:"bytes,1,rep,name=flags,proto3" json:"flags,omitempty"` + // All allocated segments, but without the `bitset_allocation` field set. The actual bitsets will be packed and sent + // separately. + SegmentsNoBitsets []*Segment `protobuf:"bytes,2,rep,name=segments_no_bitsets,json=segmentsNoBitsets,proto3" json:"segments_no_bitsets,omitempty"` + // Packed bitsets for the segments + Bitsets []*ResolverState_PackedBitset `protobuf:"bytes,5,rep,name=bitsets,proto3" json:"bitsets,omitempty"` + // All clients + Clients []*v1.Client `protobuf:"bytes,6,rep,name=clients,proto3" json:"clients,omitempty"` + // All client credentials + ClientCredentials []*v1.ClientCredential `protobuf:"bytes,7,rep,name=client_credentials,json=clientCredentials,proto3" json:"client_credentials,omitempty"` + // The region of the account + Region ResolverState_Region `protobuf:"varint,8,opt,name=region,proto3,enum=confidence.flags.admin.v1.ResolverState_Region" json:"region,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolverState) Reset() { + *x = ResolverState{} + mi := &file_confidence_flags_admin_v1_resolver_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolverState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolverState) ProtoMessage() {} + +func (x *ResolverState) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_resolver_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolverState.ProtoReflect.Descriptor instead. +func (*ResolverState) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_resolver_proto_rawDescGZIP(), []int{3} +} + +func (x *ResolverState) GetFlags() []*Flag { + if x != nil { + return x.Flags + } + return nil +} + +func (x *ResolverState) GetSegmentsNoBitsets() []*Segment { + if x != nil { + return x.SegmentsNoBitsets + } + return nil +} + +func (x *ResolverState) GetBitsets() []*ResolverState_PackedBitset { + if x != nil { + return x.Bitsets + } + return nil +} + +func (x *ResolverState) GetClients() []*v1.Client { + if x != nil { + return x.Clients + } + return nil +} + +func (x *ResolverState) GetClientCredentials() []*v1.ClientCredential { + if x != nil { + return x.ClientCredentials + } + return nil +} + +func (x *ResolverState) GetRegion() ResolverState_Region { + if x != nil { + return x.Region + } + return ResolverState_REGION_UNSPECIFIED +} + +// A compressed bitset for a specific segment. The bitset will be gzipped, unless it's all ones, in which case the +// `full_bitset` field will be set instead. +type ResolverState_PackedBitset struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The segment which this bitset belongs to + Segment string `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` + // Types that are valid to be assigned to Bitset: + // + // *ResolverState_PackedBitset_GzippedBitset + // *ResolverState_PackedBitset_FullBitset + Bitset isResolverState_PackedBitset_Bitset `protobuf_oneof:"bitset"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolverState_PackedBitset) Reset() { + *x = ResolverState_PackedBitset{} + mi := &file_confidence_flags_admin_v1_resolver_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolverState_PackedBitset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolverState_PackedBitset) ProtoMessage() {} + +func (x *ResolverState_PackedBitset) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_resolver_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolverState_PackedBitset.ProtoReflect.Descriptor instead. +func (*ResolverState_PackedBitset) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_resolver_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *ResolverState_PackedBitset) GetSegment() string { + if x != nil { + return x.Segment + } + return "" +} + +func (x *ResolverState_PackedBitset) GetBitset() isResolverState_PackedBitset_Bitset { + if x != nil { + return x.Bitset + } + return nil +} + +func (x *ResolverState_PackedBitset) GetGzippedBitset() []byte { + if x != nil { + if x, ok := x.Bitset.(*ResolverState_PackedBitset_GzippedBitset); ok { + return x.GzippedBitset + } + } + return nil +} + +func (x *ResolverState_PackedBitset) GetFullBitset() bool { + if x != nil { + if x, ok := x.Bitset.(*ResolverState_PackedBitset_FullBitset); ok { + return x.FullBitset + } + } + return false +} + +type isResolverState_PackedBitset_Bitset interface { + isResolverState_PackedBitset_Bitset() +} + +type ResolverState_PackedBitset_GzippedBitset struct { + // A gzip compressed bitset + GzippedBitset []byte `protobuf:"bytes,2,opt,name=gzipped_bitset,json=gzippedBitset,proto3,oneof"` +} + +type ResolverState_PackedBitset_FullBitset struct { + // Set to true if all bits in the bitset are set + FullBitset bool `protobuf:"varint,3,opt,name=full_bitset,json=fullBitset,proto3,oneof"` +} + +func (*ResolverState_PackedBitset_GzippedBitset) isResolverState_PackedBitset_Bitset() {} + +func (*ResolverState_PackedBitset_FullBitset) isResolverState_PackedBitset_Bitset() {} + +var File_confidence_flags_admin_v1_resolver_proto protoreflect.FileDescriptor + +const file_confidence_flags_admin_v1_resolver_proto_rawDesc = "" + + "\n" + + "(confidence/flags/admin/v1/resolver.proto\x12\x19confidence.flags.admin.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a%confidence/flags/admin/v1/types.proto\x1a\x1bconfidence/iam/v1/iam.proto\x1a confidence/api/annotations.proto\x1a\x1dconfidence/auth/v1/auth.proto\"\x19\n" + + "\x17ResolverStateUriRequest\"\x90\x01\n" + + "\x18ResolverStateUriResponse\x12\x1d\n" + + "\n" + + "signed_uri\x18\x01 \x01(\tR\tsignedUri\x12;\n" + + "\vexpire_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "expireTime\x12\x18\n" + + "\aaccount\x18\x03 \x01(\tR\aaccount\"\x16\n" + + "\x14ResolverStateRequest\"\xa1\x05\n" + + "\rResolverState\x125\n" + + "\x05flags\x18\x01 \x03(\v2\x1f.confidence.flags.admin.v1.FlagR\x05flags\x12R\n" + + "\x13segments_no_bitsets\x18\x02 \x03(\v2\".confidence.flags.admin.v1.SegmentR\x11segmentsNoBitsets\x12O\n" + + "\abitsets\x18\x05 \x03(\v25.confidence.flags.admin.v1.ResolverState.PackedBitsetR\abitsets\x123\n" + + "\aclients\x18\x06 \x03(\v2\x19.confidence.iam.v1.ClientR\aclients\x12R\n" + + "\x12client_credentials\x18\a \x03(\v2#.confidence.iam.v1.ClientCredentialR\x11clientCredentials\x12G\n" + + "\x06region\x18\b \x01(\x0e2/.confidence.flags.admin.v1.ResolverState.RegionR\x06region\x1a\xa1\x01\n" + + "\fPackedBitset\x12;\n" + + "\asegment\x18\x01 \x01(\tB!\xfaA\x1e\n" + + "\x1cflags.confidence.dev/SegmentR\asegment\x12'\n" + + "\x0egzipped_bitset\x18\x02 \x01(\fH\x00R\rgzippedBitset\x12!\n" + + "\vfull_bitset\x18\x03 \x01(\bH\x00R\n" + + "fullBitsetB\b\n" + + "\x06bitset\">\n" + + "\x06Region\x12\x16\n" + + "\x12REGION_UNSPECIFIED\x10\x00\x12\r\n" + + "\tREGION_EU\x10\x01\x12\r\n" + + "\tREGION_US\x10\x022\xd1\x03\n" + + "\x14ResolverStateService\x12\xad\x01\n" + + "\x11FullResolverState\x12/.confidence.flags.admin.v1.ResolverStateRequest\x1a(.confidence.flags.admin.v1.ResolverState\";ʇ\xe4\x10\x18\"\aaccount*\rcan_view_flag\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/resolverState:full0\x01\x12\xc4\x01\n" + + "\x10ResolverStateUri\x122.confidence.flags.admin.v1.ResolverStateUriRequest\x1a3.confidence.flags.admin.v1.ResolverStateUriResponse\"Gʇ\xe4\x10\x18\"\aaccount*\rcan_view_flag\x82\xd3\xe4\x93\x02$\x12\"/v1/resolverState:resolverStateUri\x1aB\xe2\x87\xe4\x10\x17flags.eu.confidence.dev\xe2\x87\xe4\x10\x17flags.us.confidence.dev\xea\x87\xe4\x10\x05FlagsB8\n" + + "%com.spotify.confidence.flags.admin.v1B\rResolverProtoP\x01b\x06proto3" + +var ( + file_confidence_flags_admin_v1_resolver_proto_rawDescOnce sync.Once + file_confidence_flags_admin_v1_resolver_proto_rawDescData []byte +) + +func file_confidence_flags_admin_v1_resolver_proto_rawDescGZIP() []byte { + file_confidence_flags_admin_v1_resolver_proto_rawDescOnce.Do(func() { + file_confidence_flags_admin_v1_resolver_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_flags_admin_v1_resolver_proto_rawDesc), len(file_confidence_flags_admin_v1_resolver_proto_rawDesc))) + }) + return file_confidence_flags_admin_v1_resolver_proto_rawDescData +} + +var file_confidence_flags_admin_v1_resolver_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_confidence_flags_admin_v1_resolver_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_confidence_flags_admin_v1_resolver_proto_goTypes = []any{ + (ResolverState_Region)(0), // 0: confidence.flags.admin.v1.ResolverState.Region + (*ResolverStateUriRequest)(nil), // 1: confidence.flags.admin.v1.ResolverStateUriRequest + (*ResolverStateUriResponse)(nil), // 2: confidence.flags.admin.v1.ResolverStateUriResponse + (*ResolverStateRequest)(nil), // 3: confidence.flags.admin.v1.ResolverStateRequest + (*ResolverState)(nil), // 4: confidence.flags.admin.v1.ResolverState + (*ResolverState_PackedBitset)(nil), // 5: confidence.flags.admin.v1.ResolverState.PackedBitset + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*Flag)(nil), // 7: confidence.flags.admin.v1.Flag + (*Segment)(nil), // 8: confidence.flags.admin.v1.Segment + (*v1.Client)(nil), // 9: confidence.iam.v1.Client + (*v1.ClientCredential)(nil), // 10: confidence.iam.v1.ClientCredential +} +var file_confidence_flags_admin_v1_resolver_proto_depIdxs = []int32{ + 6, // 0: confidence.flags.admin.v1.ResolverStateUriResponse.expire_time:type_name -> google.protobuf.Timestamp + 7, // 1: confidence.flags.admin.v1.ResolverState.flags:type_name -> confidence.flags.admin.v1.Flag + 8, // 2: confidence.flags.admin.v1.ResolverState.segments_no_bitsets:type_name -> confidence.flags.admin.v1.Segment + 5, // 3: confidence.flags.admin.v1.ResolverState.bitsets:type_name -> confidence.flags.admin.v1.ResolverState.PackedBitset + 9, // 4: confidence.flags.admin.v1.ResolverState.clients:type_name -> confidence.iam.v1.Client + 10, // 5: confidence.flags.admin.v1.ResolverState.client_credentials:type_name -> confidence.iam.v1.ClientCredential + 0, // 6: confidence.flags.admin.v1.ResolverState.region:type_name -> confidence.flags.admin.v1.ResolverState.Region + 3, // 7: confidence.flags.admin.v1.ResolverStateService.FullResolverState:input_type -> confidence.flags.admin.v1.ResolverStateRequest + 1, // 8: confidence.flags.admin.v1.ResolverStateService.ResolverStateUri:input_type -> confidence.flags.admin.v1.ResolverStateUriRequest + 4, // 9: confidence.flags.admin.v1.ResolverStateService.FullResolverState:output_type -> confidence.flags.admin.v1.ResolverState + 2, // 10: confidence.flags.admin.v1.ResolverStateService.ResolverStateUri:output_type -> confidence.flags.admin.v1.ResolverStateUriResponse + 9, // [9:11] is the sub-list for method output_type + 7, // [7:9] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_confidence_flags_admin_v1_resolver_proto_init() } +func file_confidence_flags_admin_v1_resolver_proto_init() { + if File_confidence_flags_admin_v1_resolver_proto != nil { + return + } + file_confidence_flags_admin_v1_types_proto_init() + file_confidence_flags_admin_v1_resolver_proto_msgTypes[4].OneofWrappers = []any{ + (*ResolverState_PackedBitset_GzippedBitset)(nil), + (*ResolverState_PackedBitset_FullBitset)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_flags_admin_v1_resolver_proto_rawDesc), len(file_confidence_flags_admin_v1_resolver_proto_rawDesc)), + NumEnums: 1, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_confidence_flags_admin_v1_resolver_proto_goTypes, + DependencyIndexes: file_confidence_flags_admin_v1_resolver_proto_depIdxs, + EnumInfos: file_confidence_flags_admin_v1_resolver_proto_enumTypes, + MessageInfos: file_confidence_flags_admin_v1_resolver_proto_msgTypes, + }.Build() + File_confidence_flags_admin_v1_resolver_proto = out.File + file_confidence_flags_admin_v1_resolver_proto_goTypes = nil + file_confidence_flags_admin_v1_resolver_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/flags/admin/v1/resolver_grpc.pb.go b/openfeature-provider/go/proto/confidence/flags/admin/v1/resolver_grpc.pb.go new file mode 100644 index 0000000..f9a97e2 --- /dev/null +++ b/openfeature-provider/go/proto/confidence/flags/admin/v1/resolver_grpc.pb.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 +// source: confidence/flags/admin/v1/resolver.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + ResolverStateService_FullResolverState_FullMethodName = "/confidence.flags.admin.v1.ResolverStateService/FullResolverState" + ResolverStateService_ResolverStateUri_FullMethodName = "/confidence.flags.admin.v1.ResolverStateService/ResolverStateUri" +) + +// ResolverStateServiceClient is the client API for ResolverStateService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Service for fetching the state for resolving flags +type ResolverStateServiceClient interface { + // Gets the full state for running a resolver + FullResolverState(ctx context.Context, in *ResolverStateRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ResolverState], error) + // Gets a signed uri that can be used to download the current resolver state + ResolverStateUri(ctx context.Context, in *ResolverStateUriRequest, opts ...grpc.CallOption) (*ResolverStateUriResponse, error) +} + +type resolverStateServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewResolverStateServiceClient(cc grpc.ClientConnInterface) ResolverStateServiceClient { + return &resolverStateServiceClient{cc} +} + +func (c *resolverStateServiceClient) FullResolverState(ctx context.Context, in *ResolverStateRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ResolverState], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ResolverStateService_ServiceDesc.Streams[0], ResolverStateService_FullResolverState_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[ResolverStateRequest, ResolverState]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ResolverStateService_FullResolverStateClient = grpc.ServerStreamingClient[ResolverState] + +func (c *resolverStateServiceClient) ResolverStateUri(ctx context.Context, in *ResolverStateUriRequest, opts ...grpc.CallOption) (*ResolverStateUriResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ResolverStateUriResponse) + err := c.cc.Invoke(ctx, ResolverStateService_ResolverStateUri_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ResolverStateServiceServer is the server API for ResolverStateService service. +// All implementations must embed UnimplementedResolverStateServiceServer +// for forward compatibility. +// +// Service for fetching the state for resolving flags +type ResolverStateServiceServer interface { + // Gets the full state for running a resolver + FullResolverState(*ResolverStateRequest, grpc.ServerStreamingServer[ResolverState]) error + // Gets a signed uri that can be used to download the current resolver state + ResolverStateUri(context.Context, *ResolverStateUriRequest) (*ResolverStateUriResponse, error) + mustEmbedUnimplementedResolverStateServiceServer() +} + +// UnimplementedResolverStateServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedResolverStateServiceServer struct{} + +func (UnimplementedResolverStateServiceServer) FullResolverState(*ResolverStateRequest, grpc.ServerStreamingServer[ResolverState]) error { + return status.Errorf(codes.Unimplemented, "method FullResolverState not implemented") +} +func (UnimplementedResolverStateServiceServer) ResolverStateUri(context.Context, *ResolverStateUriRequest) (*ResolverStateUriResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResolverStateUri not implemented") +} +func (UnimplementedResolverStateServiceServer) mustEmbedUnimplementedResolverStateServiceServer() {} +func (UnimplementedResolverStateServiceServer) testEmbeddedByValue() {} + +// UnsafeResolverStateServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ResolverStateServiceServer will +// result in compilation errors. +type UnsafeResolverStateServiceServer interface { + mustEmbedUnimplementedResolverStateServiceServer() +} + +func RegisterResolverStateServiceServer(s grpc.ServiceRegistrar, srv ResolverStateServiceServer) { + // If the following call pancis, it indicates UnimplementedResolverStateServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&ResolverStateService_ServiceDesc, srv) +} + +func _ResolverStateService_FullResolverState_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ResolverStateRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ResolverStateServiceServer).FullResolverState(m, &grpc.GenericServerStream[ResolverStateRequest, ResolverState]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ResolverStateService_FullResolverStateServer = grpc.ServerStreamingServer[ResolverState] + +func _ResolverStateService_ResolverStateUri_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResolverStateUriRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ResolverStateServiceServer).ResolverStateUri(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ResolverStateService_ResolverStateUri_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ResolverStateServiceServer).ResolverStateUri(ctx, req.(*ResolverStateUriRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ResolverStateService_ServiceDesc is the grpc.ServiceDesc for ResolverStateService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ResolverStateService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "confidence.flags.admin.v1.ResolverStateService", + HandlerType: (*ResolverStateServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ResolverStateUri", + Handler: _ResolverStateService_ResolverStateUri_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "FullResolverState", + Handler: _ResolverStateService_FullResolverState_Handler, + ServerStreams: true, + }, + }, + Metadata: "confidence/flags/admin/v1/resolver.proto", +} diff --git a/openfeature-provider/go/proto/confidence/flags/admin/v1/types.pb.go b/openfeature-provider/go/proto/confidence/flags/admin/v1/types.pb.go new file mode 100644 index 0000000..fe80e92 --- /dev/null +++ b/openfeature-provider/go/proto/confidence/flags/admin/v1/types.pb.go @@ -0,0 +1,3497 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/flags/admin/v1/types.proto + +package v1 + +import ( + v1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + decimal "google.golang.org/genproto/googleapis/type/decimal" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Enum specifying how much of a segments information should be returned. +type SegmentView int32 + +const ( + // The default / unset value. + // The API will default to the BASIC view. + SegmentView_SEGMENT_VIEW_UNSPECIFIED SegmentView = 0 + // Include basic information about the segment, excluding the bitset allocation. + // This is the default value (for both ListSegments and GetSegment). + SegmentView_BASIC SegmentView = 1 + // Include everything. + SegmentView_FULL SegmentView = 2 +) + +// Enum value maps for SegmentView. +var ( + SegmentView_name = map[int32]string{ + 0: "SEGMENT_VIEW_UNSPECIFIED", + 1: "BASIC", + 2: "FULL", + } + SegmentView_value = map[string]int32{ + "SEGMENT_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2, + } +) + +func (x SegmentView) Enum() *SegmentView { + p := new(SegmentView) + *p = x + return p +} + +func (x SegmentView) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SegmentView) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_flags_admin_v1_types_proto_enumTypes[0].Descriptor() +} + +func (SegmentView) Type() protoreflect.EnumType { + return &file_confidence_flags_admin_v1_types_proto_enumTypes[0] +} + +func (x SegmentView) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SegmentView.Descriptor instead. +func (SegmentView) EnumDescriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{0} +} + +// The state of a segment. +type Segment_State int32 + +const ( + // Unspecified state. + Segment_STATE_UNSPECIFIED Segment_State = 0 + // Segment is ready for use (no allocation is needed). + Segment_OK Segment_State = 4 + // Segment has is configured for exclusivity, but has not been allocated. + Segment_UNALLOCATED Segment_State = 1 + // Segment has been allocated with an exclusive allocation. + Segment_ALLOCATED Segment_State = 2 + // Segment is no longer used. + Segment_ARCHIVED Segment_State = 3 +) + +// Enum value maps for Segment_State. +var ( + Segment_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 4: "OK", + 1: "UNALLOCATED", + 2: "ALLOCATED", + 3: "ARCHIVED", + } + Segment_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "OK": 4, + "UNALLOCATED": 1, + "ALLOCATED": 2, + "ARCHIVED": 3, + } +) + +func (x Segment_State) Enum() *Segment_State { + p := new(Segment_State) + *p = x + return p +} + +func (x Segment_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Segment_State) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_flags_admin_v1_types_proto_enumTypes[1].Descriptor() +} + +func (Segment_State) Type() protoreflect.EnumType { + return &file_confidence_flags_admin_v1_types_proto_enumTypes[1] +} + +func (x Segment_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Segment_State.Descriptor instead. +func (Segment_State) EnumDescriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{0, 0} +} + +// State of the flag. +type Flag_State int32 + +const ( + // Unspecified state. + Flag_STATE_UNSPECIFIED Flag_State = 0 + // The flag is active and can be resolved. + Flag_ACTIVE Flag_State = 1 + // The flag is no longer active. + Flag_ARCHIVED Flag_State = 2 +) + +// Enum value maps for Flag_State. +var ( + Flag_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "ACTIVE", + 2: "ARCHIVED", + } + Flag_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "ARCHIVED": 2, + } +) + +func (x Flag_State) Enum() *Flag_State { + p := new(Flag_State) + *p = x + return p +} + +func (x Flag_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Flag_State) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_flags_admin_v1_types_proto_enumTypes[2].Descriptor() +} + +func (Flag_State) Type() protoreflect.EnumType { + return &file_confidence_flags_admin_v1_types_proto_enumTypes[2] +} + +func (x Flag_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Flag_State.Descriptor instead. +func (Flag_State) EnumDescriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 0} +} + +// The type of a field in the schema. +type EvaluationContextSchemaField_Kind int32 + +const ( + // Unspecified kind. + EvaluationContextSchemaField_KIND_UNSPECIFIED EvaluationContextSchemaField_Kind = 0 + // Null value observed. + EvaluationContextSchemaField_NULL_KIND EvaluationContextSchemaField_Kind = 1 + // A number, integer or double, observed. + EvaluationContextSchemaField_NUMBER_KIND EvaluationContextSchemaField_Kind = 2 + // A string observed. + EvaluationContextSchemaField_STRING_KIND EvaluationContextSchemaField_Kind = 3 + // A boolean observed. + EvaluationContextSchemaField_BOOL_KIND EvaluationContextSchemaField_Kind = 4 +) + +// Enum value maps for EvaluationContextSchemaField_Kind. +var ( + EvaluationContextSchemaField_Kind_name = map[int32]string{ + 0: "KIND_UNSPECIFIED", + 1: "NULL_KIND", + 2: "NUMBER_KIND", + 3: "STRING_KIND", + 4: "BOOL_KIND", + } + EvaluationContextSchemaField_Kind_value = map[string]int32{ + "KIND_UNSPECIFIED": 0, + "NULL_KIND": 1, + "NUMBER_KIND": 2, + "STRING_KIND": 3, + "BOOL_KIND": 4, + } +) + +func (x EvaluationContextSchemaField_Kind) Enum() *EvaluationContextSchemaField_Kind { + p := new(EvaluationContextSchemaField_Kind) + *p = x + return p +} + +func (x EvaluationContextSchemaField_Kind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EvaluationContextSchemaField_Kind) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_flags_admin_v1_types_proto_enumTypes[3].Descriptor() +} + +func (EvaluationContextSchemaField_Kind) Type() protoreflect.EnumType { + return &file_confidence_flags_admin_v1_types_proto_enumTypes[3] +} + +func (x EvaluationContextSchemaField_Kind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EvaluationContextSchemaField_Kind.Descriptor instead. +func (EvaluationContextSchemaField_Kind) EnumDescriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{7, 0} +} + +// Enum of different formats that country should be in. +type ContextFieldSemanticType_CountrySemanticType_CountryFormat int32 + +const ( + // No semantic type for the field. + ContextFieldSemanticType_CountrySemanticType_COUNTRY_FORMAT_UNSPECIFIED ContextFieldSemanticType_CountrySemanticType_CountryFormat = 0 + // The field is a country specified by a 2 letter code. + ContextFieldSemanticType_CountrySemanticType_TWO_LETTER_ISO_CODE ContextFieldSemanticType_CountrySemanticType_CountryFormat = 1 +) + +// Enum value maps for ContextFieldSemanticType_CountrySemanticType_CountryFormat. +var ( + ContextFieldSemanticType_CountrySemanticType_CountryFormat_name = map[int32]string{ + 0: "COUNTRY_FORMAT_UNSPECIFIED", + 1: "TWO_LETTER_ISO_CODE", + } + ContextFieldSemanticType_CountrySemanticType_CountryFormat_value = map[string]int32{ + "COUNTRY_FORMAT_UNSPECIFIED": 0, + "TWO_LETTER_ISO_CODE": 1, + } +) + +func (x ContextFieldSemanticType_CountrySemanticType_CountryFormat) Enum() *ContextFieldSemanticType_CountrySemanticType_CountryFormat { + p := new(ContextFieldSemanticType_CountrySemanticType_CountryFormat) + *p = x + return p +} + +func (x ContextFieldSemanticType_CountrySemanticType_CountryFormat) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ContextFieldSemanticType_CountrySemanticType_CountryFormat) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_flags_admin_v1_types_proto_enumTypes[4].Descriptor() +} + +func (ContextFieldSemanticType_CountrySemanticType_CountryFormat) Type() protoreflect.EnumType { + return &file_confidence_flags_admin_v1_types_proto_enumTypes[4] +} + +func (x ContextFieldSemanticType_CountrySemanticType_CountryFormat) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ContextFieldSemanticType_CountrySemanticType_CountryFormat.Descriptor instead. +func (ContextFieldSemanticType_CountrySemanticType_CountryFormat) EnumDescriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{8, 3, 0} +} + +// A reusable slice of an entity population. +type Segment struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The resource name of the segment. + // For example: + // `segments/0smva5nxuhv4yts6paxt` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // A human-friendly name for the segment. + DisplayName string `protobuf:"bytes,12,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // The targeting that this segment adheres to. + Targeting *v1.Targeting `protobuf:"bytes,2,opt,name=targeting,proto3" json:"targeting,omitempty"` + // How much of the total population that is allocated to this segment, + // and the coordination with other segments. + Allocation *Segment_Allocation `protobuf:"bytes,3,opt,name=allocation,proto3" json:"allocation,omitempty"` + // Current state of the segment. + State Segment_State `protobuf:"varint,5,opt,name=state,proto3,enum=confidence.flags.admin.v1.Segment_State" json:"state,omitempty"` + // A bitset representing the buckets that are allocated for this segment. + BitsetAllocation *Segment_BitsetAllocation `protobuf:"bytes,6,opt,name=bitset_allocation,json=bitsetAllocation,proto3" json:"bitset_allocation,omitempty"` + // General labels for this resource. + Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // The workflow instance that created this segment. If set, permissions + // will be inherited from the workflow instance, in addition to the segment permissions. + WorkflowInstance string `protobuf:"bytes,16,opt,name=workflow_instance,json=workflowInstance,proto3" json:"workflow_instance,omitempty"` + // The flag owning the rule this segment is connected to. If set, permissions + // will be inherited from the flag, in addition to the segment permissions. + Flag string `protobuf:"bytes,17,opt,name=flag,proto3" json:"flag,omitempty"` + // Time when the segment was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the segment was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this segment. + Creator string `protobuf:"bytes,13,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this segment. + Updater string `protobuf:"bytes,14,opt,name=updater,proto3" json:"updater,omitempty"` + // The owner of the resource. If not set will default to the creator. + Owner string `protobuf:"bytes,15,opt,name=owner,proto3" json:"owner,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Segment) Reset() { + *x = Segment{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Segment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Segment) ProtoMessage() {} + +func (x *Segment) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Segment.ProtoReflect.Descriptor instead. +func (*Segment) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Segment) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Segment) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *Segment) GetTargeting() *v1.Targeting { + if x != nil { + return x.Targeting + } + return nil +} + +func (x *Segment) GetAllocation() *Segment_Allocation { + if x != nil { + return x.Allocation + } + return nil +} + +func (x *Segment) GetState() Segment_State { + if x != nil { + return x.State + } + return Segment_STATE_UNSPECIFIED +} + +func (x *Segment) GetBitsetAllocation() *Segment_BitsetAllocation { + if x != nil { + return x.BitsetAllocation + } + return nil +} + +func (x *Segment) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Segment) GetWorkflowInstance() string { + if x != nil { + return x.WorkflowInstance + } + return "" +} + +func (x *Segment) GetFlag() string { + if x != nil { + return x.Flag + } + return "" +} + +func (x *Segment) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Segment) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *Segment) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *Segment) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +func (x *Segment) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +// A slice of the entity population that has is materialized as individual entity identifiers stored in a database. +// Useful for segmenting a large list of entities that cannot otherwise be easily targeted through evaluation context. +type MaterializedSegment struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The resource name of the materialized segment. + // For example: + // `materializedSegment/0smva5nxuhv4yts6paxt` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // A human-friendly name for the segment. + DisplayName string `protobuf:"bytes,12,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // General labels for this resource. + Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Time when the segment was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the segment was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this segment. + Creator string `protobuf:"bytes,13,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this segment. + Updater string `protobuf:"bytes,14,opt,name=updater,proto3" json:"updater,omitempty"` + // The owner of the resource. If not set will default to the creator. + Owner string `protobuf:"bytes,15,opt,name=owner,proto3" json:"owner,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MaterializedSegment) Reset() { + *x = MaterializedSegment{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MaterializedSegment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaterializedSegment) ProtoMessage() {} + +func (x *MaterializedSegment) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MaterializedSegment.ProtoReflect.Descriptor instead. +func (*MaterializedSegment) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{1} +} + +func (x *MaterializedSegment) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MaterializedSegment) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *MaterializedSegment) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *MaterializedSegment) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *MaterializedSegment) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *MaterializedSegment) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *MaterializedSegment) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +func (x *MaterializedSegment) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +// A flag controlling how entities are assigned variants. +type Flag struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The resource name of the flag. + // For example: + // `flags/my-flag` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // A description for the flag. + Description string `protobuf:"bytes,13,opt,name=description,proto3" json:"description,omitempty"` + // Schema for the value of each variant. + Schema *v1.FlagSchema_StructFlagSchema `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` + // List of variants for this flag. When a client resolves this flag, it will + // be assigned exactly one of the variants in this list along with its value. + // (-- api-linter: core::0122::embedded-resource=disabled + // + // aip.dev/not-precedent: these are embedded for historical reasons. --) + Variants []*Flag_Variant `protobuf:"bytes,3,rep,name=variants,proto3" json:"variants,omitempty"` + // The current state of the flag. + State Flag_State `protobuf:"varint,4,opt,name=state,proto3,enum=confidence.flags.admin.v1.Flag_State" json:"state,omitempty"` + // List of ordered rules that determines how entities are assigned to + // variants. When a client resolves this flag, each rule will be tried in + // order, the first rule that match, will provide a variant assignment. If + // not rule matches, no variant will be assigned. + // (-- api-linter: core::0122::embedded-resource=disabled + // + // aip.dev/not-precedent: these are embedded for historical reasons. --) + Rules []*Flag_Rule `protobuf:"bytes,5,rep,name=rules,proto3" json:"rules,omitempty"` + // List of clients that this flag is enabled for. + Clients []string `protobuf:"bytes,12,rep,name=clients,proto3" json:"clients,omitempty"` + // Time when the flag was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the flag was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this flag. + Creator string `protobuf:"bytes,14,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this flag. + Updater string `protobuf:"bytes,15,opt,name=updater,proto3" json:"updater,omitempty"` + // General labels for this flag. + Labels map[string]string `protobuf:"bytes,10,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Semi-realtime usage statistics for the flag. + UsageMetadata *Flag_UsageMetadata `protobuf:"bytes,11,opt,name=usage_metadata,json=usageMetadata,proto3" json:"usage_metadata,omitempty"` + // The owner of the resource. If not set will default to the creator. + Owner string `protobuf:"bytes,16,opt,name=owner,proto3" json:"owner,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag) Reset() { + *x = Flag{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag) ProtoMessage() {} + +func (x *Flag) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag.ProtoReflect.Descriptor instead. +func (*Flag) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2} +} + +func (x *Flag) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Flag) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Flag) GetSchema() *v1.FlagSchema_StructFlagSchema { + if x != nil { + return x.Schema + } + return nil +} + +func (x *Flag) GetVariants() []*Flag_Variant { + if x != nil { + return x.Variants + } + return nil +} + +func (x *Flag) GetState() Flag_State { + if x != nil { + return x.State + } + return Flag_STATE_UNSPECIFIED +} + +func (x *Flag) GetRules() []*Flag_Rule { + if x != nil { + return x.Rules + } + return nil +} + +func (x *Flag) GetClients() []string { + if x != nil { + return x.Clients + } + return nil +} + +func (x *Flag) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Flag) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *Flag) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *Flag) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +func (x *Flag) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Flag) GetUsageMetadata() *Flag_UsageMetadata { + if x != nil { + return x.UsageMetadata + } + return nil +} + +func (x *Flag) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +// Configuration for setting up edge resolvers on Fastly for this account. +type FastlyConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The resource name of the Fastly config. + // For example: + // `fastlyConfig/0smva5nxuhv4yts6paxt` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // A human-friendly name for the Fastly config. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // The Fastly Service ID that should be deployed to. + ServiceId string `protobuf:"bytes,3,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + // Determines if the Fastly config is enabled or not. + Enabled bool `protobuf:"varint,9,opt,name=enabled,proto3" json:"enabled,omitempty"` + // Time of last deployment to Fastly. + LastDeployTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=last_deploy_time,json=lastDeployTime,proto3" json:"last_deploy_time,omitempty"` + // General labels for this resource. + Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Time when the Fastly config was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the Fastly config was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this Fastly config. + Creator string `protobuf:"bytes,7,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this Fastly config. + Updater string `protobuf:"bytes,8,opt,name=updater,proto3" json:"updater,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FastlyConfig) Reset() { + *x = FastlyConfig{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FastlyConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FastlyConfig) ProtoMessage() {} + +func (x *FastlyConfig) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FastlyConfig.ProtoReflect.Descriptor instead. +func (*FastlyConfig) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{3} +} + +func (x *FastlyConfig) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FastlyConfig) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *FastlyConfig) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +func (x *FastlyConfig) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *FastlyConfig) GetLastDeployTime() *timestamppb.Timestamp { + if x != nil { + return x.LastDeployTime + } + return nil +} + +func (x *FastlyConfig) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *FastlyConfig) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *FastlyConfig) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *FastlyConfig) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *FastlyConfig) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +// Represents an evaluation context field that has been manually added +type EvaluationContextFieldOverride struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The resource name of the field. + // For example: + // `evaluationContextField/country` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The path to the field. i.e: `country` or `foo.bar` + Field string `protobuf:"bytes,8,opt,name=field,proto3" json:"field,omitempty"` + // The clients this field should be available for. Empty list means all. + Clients []string `protobuf:"bytes,9,rep,name=clients,proto3" json:"clients,omitempty"` + // The value type of this field + Kind EvaluationContextSchemaField_Kind `protobuf:"varint,10,opt,name=kind,proto3,enum=confidence.flags.admin.v1.EvaluationContextSchemaField_Kind" json:"kind,omitempty"` + // Semantic type of a field. Makes it possible to narrow the number of possible values for a field etc. + SemanticType *ContextFieldSemanticType `protobuf:"bytes,11,opt,name=semantic_type,json=semanticType,proto3" json:"semantic_type,omitempty"` + // Human friendly name of the field + DisplayName string `protobuf:"bytes,12,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // If this field should be hidden. + Hidden bool `protobuf:"varint,13,opt,name=hidden,proto3" json:"hidden,omitempty"` + // General labels for this resource. + Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Time when the field was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the field was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this field. + Creator string `protobuf:"bytes,5,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this field. + Updater string `protobuf:"bytes,6,opt,name=updater,proto3" json:"updater,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EvaluationContextFieldOverride) Reset() { + *x = EvaluationContextFieldOverride{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EvaluationContextFieldOverride) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationContextFieldOverride) ProtoMessage() {} + +func (x *EvaluationContextFieldOverride) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationContextFieldOverride.ProtoReflect.Descriptor instead. +func (*EvaluationContextFieldOverride) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{4} +} + +func (x *EvaluationContextFieldOverride) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EvaluationContextFieldOverride) GetField() string { + if x != nil { + return x.Field + } + return "" +} + +func (x *EvaluationContextFieldOverride) GetClients() []string { + if x != nil { + return x.Clients + } + return nil +} + +func (x *EvaluationContextFieldOverride) GetKind() EvaluationContextSchemaField_Kind { + if x != nil { + return x.Kind + } + return EvaluationContextSchemaField_KIND_UNSPECIFIED +} + +func (x *EvaluationContextFieldOverride) GetSemanticType() *ContextFieldSemanticType { + if x != nil { + return x.SemanticType + } + return nil +} + +func (x *EvaluationContextFieldOverride) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *EvaluationContextFieldOverride) GetHidden() bool { + if x != nil { + return x.Hidden + } + return false +} + +func (x *EvaluationContextFieldOverride) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *EvaluationContextFieldOverride) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *EvaluationContextFieldOverride) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *EvaluationContextFieldOverride) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *EvaluationContextFieldOverride) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +// Information about how a client resolved +type ClientResolveInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Resource reference to a client. + Client string `protobuf:"bytes,1,opt,name=client,proto3" json:"client,omitempty"` + // Resource reference to a credential. + ClientCredential string `protobuf:"bytes,2,opt,name=client_credential,json=clientCredential,proto3" json:"client_credential,omitempty"` + // The different evaluation context schema of the client that have been seen recently. + Schema []*ClientResolveInfo_EvaluationContextSchemaInstance `protobuf:"bytes,3,rep,name=schema,proto3" json:"schema,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientResolveInfo) Reset() { + *x = ClientResolveInfo{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientResolveInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientResolveInfo) ProtoMessage() {} + +func (x *ClientResolveInfo) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientResolveInfo.ProtoReflect.Descriptor instead. +func (*ClientResolveInfo) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{5} +} + +func (x *ClientResolveInfo) GetClient() string { + if x != nil { + return x.Client + } + return "" +} + +func (x *ClientResolveInfo) GetClientCredential() string { + if x != nil { + return x.ClientCredential + } + return "" +} + +func (x *ClientResolveInfo) GetSchema() []*ClientResolveInfo_EvaluationContextSchemaInstance { + if x != nil { + return x.Schema + } + return nil +} + +type FlagResolveInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The flag the info is about + Flag string `protobuf:"bytes,1,opt,name=flag,proto3" json:"flag,omitempty"` + // Information about how variants were resolved. + VariantResolveInfo []*FlagResolveInfo_VariantResolveInfo `protobuf:"bytes,2,rep,name=variant_resolve_info,json=variantResolveInfo,proto3" json:"variant_resolve_info,omitempty"` + // Information about how rules were resolved. + RuleResolveInfo []*FlagResolveInfo_RuleResolveInfo `protobuf:"bytes,3,rep,name=rule_resolve_info,json=ruleResolveInfo,proto3" json:"rule_resolve_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagResolveInfo) Reset() { + *x = FlagResolveInfo{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagResolveInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagResolveInfo) ProtoMessage() {} + +func (x *FlagResolveInfo) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagResolveInfo.ProtoReflect.Descriptor instead. +func (*FlagResolveInfo) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{6} +} + +func (x *FlagResolveInfo) GetFlag() string { + if x != nil { + return x.Flag + } + return "" +} + +func (x *FlagResolveInfo) GetVariantResolveInfo() []*FlagResolveInfo_VariantResolveInfo { + if x != nil { + return x.VariantResolveInfo + } + return nil +} + +func (x *FlagResolveInfo) GetRuleResolveInfo() []*FlagResolveInfo_RuleResolveInfo { + if x != nil { + return x.RuleResolveInfo + } + return nil +} + +// The type of fields observed in an evaluation context. +type EvaluationContextSchemaField struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The observed types. + Types []EvaluationContextSchemaField_Kind `protobuf:"varint,1,rep,packed,name=types,proto3,enum=confidence.flags.admin.v1.EvaluationContextSchemaField_Kind" json:"types,omitempty"` + // Human friendly name of the field + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // If the field should be visible or not + Hidden bool `protobuf:"varint,3,opt,name=hidden,proto3" json:"hidden,omitempty"` + // Semantic type of a field. Makes it possible to narrow the number of possible values for a field etc. + SemanticType *ContextFieldSemanticType `protobuf:"bytes,4,opt,name=semantic_type,json=semanticType,proto3" json:"semantic_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EvaluationContextSchemaField) Reset() { + *x = EvaluationContextSchemaField{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EvaluationContextSchemaField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationContextSchemaField) ProtoMessage() {} + +func (x *EvaluationContextSchemaField) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationContextSchemaField.ProtoReflect.Descriptor instead. +func (*EvaluationContextSchemaField) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{7} +} + +func (x *EvaluationContextSchemaField) GetTypes() []EvaluationContextSchemaField_Kind { + if x != nil { + return x.Types + } + return nil +} + +func (x *EvaluationContextSchemaField) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *EvaluationContextSchemaField) GetHidden() bool { + if x != nil { + return x.Hidden + } + return false +} + +func (x *EvaluationContextSchemaField) GetSemanticType() *ContextFieldSemanticType { + if x != nil { + return x.SemanticType + } + return nil +} + +// Semantic type of a field. Makes it possible to narrow the number of possible values for a field etc. +type ContextFieldSemanticType struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Type: + // + // *ContextFieldSemanticType_Country + // *ContextFieldSemanticType_EnumType + // *ContextFieldSemanticType_EntityReference + // *ContextFieldSemanticType_Version + // *ContextFieldSemanticType_Date + // *ContextFieldSemanticType_Timestamp + Type isContextFieldSemanticType_Type `protobuf_oneof:"type"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContextFieldSemanticType) Reset() { + *x = ContextFieldSemanticType{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContextFieldSemanticType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContextFieldSemanticType) ProtoMessage() {} + +func (x *ContextFieldSemanticType) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContextFieldSemanticType.ProtoReflect.Descriptor instead. +func (*ContextFieldSemanticType) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{8} +} + +func (x *ContextFieldSemanticType) GetType() isContextFieldSemanticType_Type { + if x != nil { + return x.Type + } + return nil +} + +func (x *ContextFieldSemanticType) GetCountry() *ContextFieldSemanticType_CountrySemanticType { + if x != nil { + if x, ok := x.Type.(*ContextFieldSemanticType_Country); ok { + return x.Country + } + } + return nil +} + +func (x *ContextFieldSemanticType) GetEnumType() *ContextFieldSemanticType_EnumSemanticType { + if x != nil { + if x, ok := x.Type.(*ContextFieldSemanticType_EnumType); ok { + return x.EnumType + } + } + return nil +} + +func (x *ContextFieldSemanticType) GetEntityReference() *ContextFieldSemanticType_EntitySemanticType { + if x != nil { + if x, ok := x.Type.(*ContextFieldSemanticType_EntityReference); ok { + return x.EntityReference + } + } + return nil +} + +func (x *ContextFieldSemanticType) GetVersion() *ContextFieldSemanticType_VersionSemanticType { + if x != nil { + if x, ok := x.Type.(*ContextFieldSemanticType_Version); ok { + return x.Version + } + } + return nil +} + +func (x *ContextFieldSemanticType) GetDate() *ContextFieldSemanticType_DateSemanticType { + if x != nil { + if x, ok := x.Type.(*ContextFieldSemanticType_Date); ok { + return x.Date + } + } + return nil +} + +func (x *ContextFieldSemanticType) GetTimestamp() *ContextFieldSemanticType_TimestampSemanticType { + if x != nil { + if x, ok := x.Type.(*ContextFieldSemanticType_Timestamp); ok { + return x.Timestamp + } + } + return nil +} + +type isContextFieldSemanticType_Type interface { + isContextFieldSemanticType_Type() +} + +type ContextFieldSemanticType_Country struct { + // (-- api-linter: core::0143::standardized-codes=disabled + // + // aip.dev/not-precedent: We use country. --) + // + // If this is a country type, this specifies in what format. + Country *ContextFieldSemanticType_CountrySemanticType `protobuf:"bytes,1,opt,name=country,proto3,oneof"` +} + +type ContextFieldSemanticType_EnumType struct { + // If this is an enum this specifies what value it has etc. + EnumType *ContextFieldSemanticType_EnumSemanticType `protobuf:"bytes,2,opt,name=enum_type,json=enumType,proto3,oneof"` +} + +type ContextFieldSemanticType_EntityReference struct { + // If this field is a reference to an entity. + EntityReference *ContextFieldSemanticType_EntitySemanticType `protobuf:"bytes,3,opt,name=entity_reference,json=entityReference,proto3,oneof"` +} + +type ContextFieldSemanticType_Version struct { + // If this field is a semantic type. + Version *ContextFieldSemanticType_VersionSemanticType `protobuf:"bytes,4,opt,name=version,proto3,oneof"` +} + +type ContextFieldSemanticType_Date struct { + // (-- api-linter: core::0142::time-field-type=disabled + // + // aip.dev/not-precedent: This isn't a date but a spec of a date. --) + // + // If this field is a date. + Date *ContextFieldSemanticType_DateSemanticType `protobuf:"bytes,5,opt,name=date,proto3,oneof"` +} + +type ContextFieldSemanticType_Timestamp struct { + // (-- api-linter: core::0142::time-field-type=disabled + // + // aip.dev/not-precedent: This isn't a timestamp but a spec of a timestamp. --) + // + // If this field is a timestamp. + Timestamp *ContextFieldSemanticType_TimestampSemanticType `protobuf:"bytes,6,opt,name=timestamp,proto3,oneof"` +} + +func (*ContextFieldSemanticType_Country) isContextFieldSemanticType_Type() {} + +func (*ContextFieldSemanticType_EnumType) isContextFieldSemanticType_Type() {} + +func (*ContextFieldSemanticType_EntityReference) isContextFieldSemanticType_Type() {} + +func (*ContextFieldSemanticType_Version) isContextFieldSemanticType_Type() {} + +func (*ContextFieldSemanticType_Date) isContextFieldSemanticType_Type() {} + +func (*ContextFieldSemanticType_Timestamp) isContextFieldSemanticType_Type() {} + +// Allocation and coordination of the segment. +type Segment_Allocation struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Fraction of entity population that is eligible for this segment. + Proportion *decimal.Decimal `protobuf:"bytes,1,opt,name=proportion,proto3" json:"proportion,omitempty"` + // Set of tags that can be used to coordinate this segment with others. + ExclusivityTags []string `protobuf:"bytes,3,rep,name=exclusivity_tags,json=exclusivityTags,proto3" json:"exclusivity_tags,omitempty"` + // (-- api-linter: core::0140::prepositions=disabled + // + // aip.dev/not-precedent: It means that we're exclusive to other tags, makes sense. --) + // + // List of tags that this segment is exclusive to, meaning that an entity + // cannot be in this segment and also in any segment that has a tag in the + // list. + ExclusiveTo []string `protobuf:"bytes,4,rep,name=exclusive_to,json=exclusiveTo,proto3" json:"exclusive_to,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Segment_Allocation) Reset() { + *x = Segment_Allocation{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Segment_Allocation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Segment_Allocation) ProtoMessage() {} + +func (x *Segment_Allocation) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Segment_Allocation.ProtoReflect.Descriptor instead. +func (*Segment_Allocation) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Segment_Allocation) GetProportion() *decimal.Decimal { + if x != nil { + return x.Proportion + } + return nil +} + +func (x *Segment_Allocation) GetExclusivityTags() []string { + if x != nil { + return x.ExclusivityTags + } + return nil +} + +func (x *Segment_Allocation) GetExclusiveTo() []string { + if x != nil { + return x.ExclusiveTo + } + return nil +} + +// A bit set where each bit represents a fixed fraction of the entity +// population. +type Segment_BitsetAllocation struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Byte encoded bitset. + Bitset []byte `protobuf:"bytes,1,opt,name=bitset,proto3" json:"bitset,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Segment_BitsetAllocation) Reset() { + *x = Segment_BitsetAllocation{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Segment_BitsetAllocation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Segment_BitsetAllocation) ProtoMessage() {} + +func (x *Segment_BitsetAllocation) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Segment_BitsetAllocation.ProtoReflect.Descriptor instead. +func (*Segment_BitsetAllocation) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *Segment_BitsetAllocation) GetBitset() []byte { + if x != nil { + return x.Bitset + } + return nil +} + +// Usage statistics for the flag. +type Flag_UsageMetadata struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The total number of resolves of this flag. + ResolveCount int64 `protobuf:"varint,1,opt,name=resolve_count,json=resolveCount,proto3" json:"resolve_count,omitempty"` + // The last time this flag was resolved. + LastResolveTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_resolve_time,json=lastResolveTime,proto3" json:"last_resolve_time,omitempty"` + // The last time this flag was applied. + LastApplyTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=last_apply_time,json=lastApplyTime,proto3" json:"last_apply_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_UsageMetadata) Reset() { + *x = Flag_UsageMetadata{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_UsageMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_UsageMetadata) ProtoMessage() {} + +func (x *Flag_UsageMetadata) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_UsageMetadata.ProtoReflect.Descriptor instead. +func (*Flag_UsageMetadata) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 1} +} + +func (x *Flag_UsageMetadata) GetResolveCount() int64 { + if x != nil { + return x.ResolveCount + } + return 0 +} + +func (x *Flag_UsageMetadata) GetLastResolveTime() *timestamppb.Timestamp { + if x != nil { + return x.LastResolveTime + } + return nil +} + +func (x *Flag_UsageMetadata) GetLastApplyTime() *timestamppb.Timestamp { + if x != nil { + return x.LastApplyTime + } + return nil +} + +// A possible named value the flag can assign. +type Flag_Variant struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The resource name of the variant. + // For example: + // `flags/my-flag/variants/control` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The value that this variant represents. A possibly nested json object. + Value *structpb.Struct `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + // General set of labels for this resource. + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // A human-friendly description of the variant. + Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` + // Time when the flag was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the flag was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this variant. + Creator string `protobuf:"bytes,9,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this variant. + Updater string `protobuf:"bytes,10,opt,name=updater,proto3" json:"updater,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Variant) Reset() { + *x = Flag_Variant{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Variant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Variant) ProtoMessage() {} + +func (x *Flag_Variant) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Variant.ProtoReflect.Descriptor instead. +func (*Flag_Variant) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 2} +} + +func (x *Flag_Variant) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Flag_Variant) GetValue() *structpb.Struct { + if x != nil { + return x.Value + } + return nil +} + +func (x *Flag_Variant) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Flag_Variant) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Flag_Variant) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Flag_Variant) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *Flag_Variant) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *Flag_Variant) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +// A rule that decides how a subset of the flags variants are assigned. +type Flag_Rule struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The resource name of the rule. + // For example: + // `flags/my-flag/rules/1bhq4c2zqigdzqg6ufni` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // A reference to the segment that this rule uses to specify entities + // that are eligible. + Segment string `protobuf:"bytes,2,opt,name=segment,proto3" json:"segment,omitempty"` + // Specification of how an entity should be randomly assigned to values. + AssignmentSpec *Flag_Rule_AssignmentSpec `protobuf:"bytes,12,opt,name=assignment_spec,json=assignmentSpec,proto3" json:"assignment_spec,omitempty"` + // Metadata about how the flag has been resolved. + UsageMetadata *Flag_Rule_UsageMetadata `protobuf:"bytes,4,opt,name=usage_metadata,json=usageMetadata,proto3" json:"usage_metadata,omitempty"` + // Selector of what key to randomize on from the evaluation context. + // "targeting_key" is the default if not specified + TargetingKeySelector string `protobuf:"bytes,5,opt,name=targeting_key_selector,json=targetingKeySelector,proto3" json:"targeting_key_selector,omitempty"` + // Decides if the rule should be enabled for resolve or not. + Enabled bool `protobuf:"varint,11,opt,name=enabled,proto3" json:"enabled,omitempty"` + // Time when the rule was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the flag was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this rule. + Creator string `protobuf:"bytes,14,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this rule. + Updater string `protobuf:"bytes,15,opt,name=updater,proto3" json:"updater,omitempty"` + // General set of labels for this resource. + Labels map[string]string `protobuf:"bytes,10,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Specifies if materializations are written to/read from + MaterializationSpec *Flag_Rule_MaterializationSpec `protobuf:"bytes,13,opt,name=materialization_spec,json=materializationSpec,proto3" json:"materialization_spec,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule) Reset() { + *x = Flag_Rule{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule) ProtoMessage() {} + +func (x *Flag_Rule) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule.ProtoReflect.Descriptor instead. +func (*Flag_Rule) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3} +} + +func (x *Flag_Rule) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Flag_Rule) GetSegment() string { + if x != nil { + return x.Segment + } + return "" +} + +func (x *Flag_Rule) GetAssignmentSpec() *Flag_Rule_AssignmentSpec { + if x != nil { + return x.AssignmentSpec + } + return nil +} + +func (x *Flag_Rule) GetUsageMetadata() *Flag_Rule_UsageMetadata { + if x != nil { + return x.UsageMetadata + } + return nil +} + +func (x *Flag_Rule) GetTargetingKeySelector() string { + if x != nil { + return x.TargetingKeySelector + } + return "" +} + +func (x *Flag_Rule) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *Flag_Rule) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Flag_Rule) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *Flag_Rule) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *Flag_Rule) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +func (x *Flag_Rule) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Flag_Rule) GetMaterializationSpec() *Flag_Rule_MaterializationSpec { + if x != nil { + return x.MaterializationSpec + } + return nil +} + +// Specifies if materializations are written to/read from +type Flag_Rule_MaterializationSpec struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Feeds assignments into materialization + WriteMaterialization string `protobuf:"bytes,1,opt,name=write_materialization,json=writeMaterialization,proto3" json:"write_materialization,omitempty"` + // Reads assignments from materialization + ReadMaterialization string `protobuf:"bytes,2,opt,name=read_materialization,json=readMaterialization,proto3" json:"read_materialization,omitempty"` + // How materialization reads should be treated + Mode *Flag_Rule_MaterializationSpec_MaterializationReadMode `protobuf:"bytes,3,opt,name=mode,proto3" json:"mode,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule_MaterializationSpec) Reset() { + *x = Flag_Rule_MaterializationSpec{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule_MaterializationSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule_MaterializationSpec) ProtoMessage() {} + +func (x *Flag_Rule_MaterializationSpec) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule_MaterializationSpec.ProtoReflect.Descriptor instead. +func (*Flag_Rule_MaterializationSpec) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3, 1} +} + +func (x *Flag_Rule_MaterializationSpec) GetWriteMaterialization() string { + if x != nil { + return x.WriteMaterialization + } + return "" +} + +func (x *Flag_Rule_MaterializationSpec) GetReadMaterialization() string { + if x != nil { + return x.ReadMaterialization + } + return "" +} + +func (x *Flag_Rule_MaterializationSpec) GetMode() *Flag_Rule_MaterializationSpec_MaterializationReadMode { + if x != nil { + return x.Mode + } + return nil +} + +// Describes how an entity is randomly assigned to a variant. +type Flag_Rule_AssignmentSpec struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The total number of buckets to consider when randomizing. + BucketCount int32 `protobuf:"varint,1,opt,name=bucket_count,json=bucketCount,proto3" json:"bucket_count,omitempty"` + // A list that divides the total buckets into assignments + Assignments []*Flag_Rule_Assignment `protobuf:"bytes,2,rep,name=assignments,proto3" json:"assignments,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule_AssignmentSpec) Reset() { + *x = Flag_Rule_AssignmentSpec{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule_AssignmentSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule_AssignmentSpec) ProtoMessage() {} + +func (x *Flag_Rule_AssignmentSpec) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule_AssignmentSpec.ProtoReflect.Descriptor instead. +func (*Flag_Rule_AssignmentSpec) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3, 2} +} + +func (x *Flag_Rule_AssignmentSpec) GetBucketCount() int32 { + if x != nil { + return x.BucketCount + } + return 0 +} + +func (x *Flag_Rule_AssignmentSpec) GetAssignments() []*Flag_Rule_Assignment { + if x != nil { + return x.Assignments + } + return nil +} + +// Maps a range of buckets to a value assignment. +type Flag_Rule_Assignment struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Opaque identifier of this assignment. + AssignmentId string `protobuf:"bytes,1,opt,name=assignment_id,json=assignmentId,proto3" json:"assignment_id,omitempty"` + // Determines how the client should be assigned values. + // + // Types that are valid to be assigned to Assignment: + // + // *Flag_Rule_Assignment_Variant + // *Flag_Rule_Assignment_Fallthrough + // *Flag_Rule_Assignment_ClientDefault + Assignment isFlag_Rule_Assignment_Assignment `protobuf_oneof:"assignment"` + // The range of buckets that the variant occupies. + BucketRanges []*Flag_Rule_BucketRange `protobuf:"bytes,5,rep,name=bucket_ranges,json=bucketRanges,proto3" json:"bucket_ranges,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule_Assignment) Reset() { + *x = Flag_Rule_Assignment{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule_Assignment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule_Assignment) ProtoMessage() {} + +func (x *Flag_Rule_Assignment) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule_Assignment.ProtoReflect.Descriptor instead. +func (*Flag_Rule_Assignment) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3, 3} +} + +func (x *Flag_Rule_Assignment) GetAssignmentId() string { + if x != nil { + return x.AssignmentId + } + return "" +} + +func (x *Flag_Rule_Assignment) GetAssignment() isFlag_Rule_Assignment_Assignment { + if x != nil { + return x.Assignment + } + return nil +} + +func (x *Flag_Rule_Assignment) GetVariant() *Flag_Rule_Assignment_VariantAssignment { + if x != nil { + if x, ok := x.Assignment.(*Flag_Rule_Assignment_Variant); ok { + return x.Variant + } + } + return nil +} + +func (x *Flag_Rule_Assignment) GetFallthrough() *Flag_Rule_Assignment_FallthroughAssignment { + if x != nil { + if x, ok := x.Assignment.(*Flag_Rule_Assignment_Fallthrough); ok { + return x.Fallthrough + } + } + return nil +} + +func (x *Flag_Rule_Assignment) GetClientDefault() *Flag_Rule_Assignment_ClientDefaultAssignment { + if x != nil { + if x, ok := x.Assignment.(*Flag_Rule_Assignment_ClientDefault); ok { + return x.ClientDefault + } + } + return nil +} + +func (x *Flag_Rule_Assignment) GetBucketRanges() []*Flag_Rule_BucketRange { + if x != nil { + return x.BucketRanges + } + return nil +} + +type isFlag_Rule_Assignment_Assignment interface { + isFlag_Rule_Assignment_Assignment() +} + +type Flag_Rule_Assignment_Variant struct { + // Assign a value from a variant. + Variant *Flag_Rule_Assignment_VariantAssignment `protobuf:"bytes,2,opt,name=variant,proto3,oneof"` +} + +type Flag_Rule_Assignment_Fallthrough struct { + // Assign a value from the first rule after this one that matches. + Fallthrough *Flag_Rule_Assignment_FallthroughAssignment `protobuf:"bytes,3,opt,name=fallthrough,proto3,oneof"` +} + +type Flag_Rule_Assignment_ClientDefault struct { + // Assign the default values in the client. + ClientDefault *Flag_Rule_Assignment_ClientDefaultAssignment `protobuf:"bytes,4,opt,name=client_default,json=clientDefault,proto3,oneof"` +} + +func (*Flag_Rule_Assignment_Variant) isFlag_Rule_Assignment_Assignment() {} + +func (*Flag_Rule_Assignment_Fallthrough) isFlag_Rule_Assignment_Assignment() {} + +func (*Flag_Rule_Assignment_ClientDefault) isFlag_Rule_Assignment_Assignment() {} + +// The range of buckets that a variant occupies. +type Flag_Rule_BucketRange struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The start bucket (inclusive). + Lower int32 `protobuf:"varint,1,opt,name=lower,proto3" json:"lower,omitempty"` + // The end bucket (exclusive). + Upper int32 `protobuf:"varint,2,opt,name=upper,proto3" json:"upper,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule_BucketRange) Reset() { + *x = Flag_Rule_BucketRange{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule_BucketRange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule_BucketRange) ProtoMessage() {} + +func (x *Flag_Rule_BucketRange) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule_BucketRange.ProtoReflect.Descriptor instead. +func (*Flag_Rule_BucketRange) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3, 4} +} + +func (x *Flag_Rule_BucketRange) GetLower() int32 { + if x != nil { + return x.Lower + } + return 0 +} + +func (x *Flag_Rule_BucketRange) GetUpper() int32 { + if x != nil { + return x.Upper + } + return 0 +} + +// Usage statistics for the rule. +type Flag_Rule_UsageMetadata struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The total number of resolves of this rule. + ResolveCount int64 `protobuf:"varint,1,opt,name=resolve_count,json=resolveCount,proto3" json:"resolve_count,omitempty"` + // Total number of applies to this rule. + ApplyCount int64 `protobuf:"varint,4,opt,name=apply_count,json=applyCount,proto3" json:"apply_count,omitempty"` + // The last time this rule was resolved. + LastResolveTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_resolve_time,json=lastResolveTime,proto3" json:"last_resolve_time,omitempty"` + // The last time this rule was applied. + LastApplyTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=last_apply_time,json=lastApplyTime,proto3" json:"last_apply_time,omitempty"` + // Usage statistics for each assignment. + AssignmentUsageMetadata []*Flag_Rule_AssignmentUsageMetadata `protobuf:"bytes,5,rep,name=assignment_usage_metadata,json=assignmentUsageMetadata,proto3" json:"assignment_usage_metadata,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule_UsageMetadata) Reset() { + *x = Flag_Rule_UsageMetadata{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule_UsageMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule_UsageMetadata) ProtoMessage() {} + +func (x *Flag_Rule_UsageMetadata) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule_UsageMetadata.ProtoReflect.Descriptor instead. +func (*Flag_Rule_UsageMetadata) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3, 5} +} + +func (x *Flag_Rule_UsageMetadata) GetResolveCount() int64 { + if x != nil { + return x.ResolveCount + } + return 0 +} + +func (x *Flag_Rule_UsageMetadata) GetApplyCount() int64 { + if x != nil { + return x.ApplyCount + } + return 0 +} + +func (x *Flag_Rule_UsageMetadata) GetLastResolveTime() *timestamppb.Timestamp { + if x != nil { + return x.LastResolveTime + } + return nil +} + +func (x *Flag_Rule_UsageMetadata) GetLastApplyTime() *timestamppb.Timestamp { + if x != nil { + return x.LastApplyTime + } + return nil +} + +func (x *Flag_Rule_UsageMetadata) GetAssignmentUsageMetadata() []*Flag_Rule_AssignmentUsageMetadata { + if x != nil { + return x.AssignmentUsageMetadata + } + return nil +} + +// Usage statistics for a particular assignment. +type Flag_Rule_AssignmentUsageMetadata struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The assignment id, empty means no assignment id was passed. + AssignmentId string `protobuf:"bytes,1,opt,name=assignment_id,json=assignmentId,proto3" json:"assignment_id,omitempty"` + // Total number of resolves. + ResolveCount int64 `protobuf:"varint,2,opt,name=resolve_count,json=resolveCount,proto3" json:"resolve_count,omitempty"` + // Total number of applies. + ApplyCount int64 `protobuf:"varint,3,opt,name=apply_count,json=applyCount,proto3" json:"apply_count,omitempty"` + // The last time this rule was applied. + LastApplyTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_apply_time,json=lastApplyTime,proto3" json:"last_apply_time,omitempty"` + // Total number of applies with empty targeting key. + EmptyTargetingKeyCount int64 `protobuf:"varint,5,opt,name=empty_targeting_key_count,json=emptyTargetingKeyCount,proto3" json:"empty_targeting_key_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule_AssignmentUsageMetadata) Reset() { + *x = Flag_Rule_AssignmentUsageMetadata{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule_AssignmentUsageMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule_AssignmentUsageMetadata) ProtoMessage() {} + +func (x *Flag_Rule_AssignmentUsageMetadata) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule_AssignmentUsageMetadata.ProtoReflect.Descriptor instead. +func (*Flag_Rule_AssignmentUsageMetadata) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3, 6} +} + +func (x *Flag_Rule_AssignmentUsageMetadata) GetAssignmentId() string { + if x != nil { + return x.AssignmentId + } + return "" +} + +func (x *Flag_Rule_AssignmentUsageMetadata) GetResolveCount() int64 { + if x != nil { + return x.ResolveCount + } + return 0 +} + +func (x *Flag_Rule_AssignmentUsageMetadata) GetApplyCount() int64 { + if x != nil { + return x.ApplyCount + } + return 0 +} + +func (x *Flag_Rule_AssignmentUsageMetadata) GetLastApplyTime() *timestamppb.Timestamp { + if x != nil { + return x.LastApplyTime + } + return nil +} + +func (x *Flag_Rule_AssignmentUsageMetadata) GetEmptyTargetingKeyCount() int64 { + if x != nil { + return x.EmptyTargetingKeyCount + } + return 0 +} + +// How materialization reads should be treated +type Flag_Rule_MaterializationSpec_MaterializationReadMode struct { + state protoimpl.MessageState `protogen:"open.v1"` + // If the materialization must match, only units in the materialization will be in the rule, all other units + // will skip this rule (also known as paused intake). If this is set to false units will match if they are in + // the materialization or if they match the segment. + MaterializationMustMatch bool `protobuf:"varint,1,opt,name=materialization_must_match,json=materializationMustMatch,proto3" json:"materialization_must_match,omitempty"` + // By default materialization will only be seen as a match of the targeting of the segment that the rule + // references also matches. Depending on the type of targeting, this may or may not be the wanted behaviour. + // Setting this to true will mean that any unit in the materialization will match the rule no matter if + // they match the targeting. Irrespective if this is set to false or true the segment allocation + // proportion/bucketing is ignored for any unit in the materialization. + SegmentTargetingCanBeIgnored bool `protobuf:"varint,2,opt,name=segment_targeting_can_be_ignored,json=segmentTargetingCanBeIgnored,proto3" json:"segment_targeting_can_be_ignored,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule_MaterializationSpec_MaterializationReadMode) Reset() { + *x = Flag_Rule_MaterializationSpec_MaterializationReadMode{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule_MaterializationSpec_MaterializationReadMode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule_MaterializationSpec_MaterializationReadMode) ProtoMessage() {} + +func (x *Flag_Rule_MaterializationSpec_MaterializationReadMode) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule_MaterializationSpec_MaterializationReadMode.ProtoReflect.Descriptor instead. +func (*Flag_Rule_MaterializationSpec_MaterializationReadMode) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3, 1, 0} +} + +func (x *Flag_Rule_MaterializationSpec_MaterializationReadMode) GetMaterializationMustMatch() bool { + if x != nil { + return x.MaterializationMustMatch + } + return false +} + +func (x *Flag_Rule_MaterializationSpec_MaterializationReadMode) GetSegmentTargetingCanBeIgnored() bool { + if x != nil { + return x.SegmentTargetingCanBeIgnored + } + return false +} + +// Assignment of a variant +type Flag_Rule_Assignment_VariantAssignment struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Reference to a variant in the flag. Note: the variant must be located + // in the same flag. + Variant string `protobuf:"bytes,1,opt,name=variant,proto3" json:"variant,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule_Assignment_VariantAssignment) Reset() { + *x = Flag_Rule_Assignment_VariantAssignment{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule_Assignment_VariantAssignment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule_Assignment_VariantAssignment) ProtoMessage() {} + +func (x *Flag_Rule_Assignment_VariantAssignment) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule_Assignment_VariantAssignment.ProtoReflect.Descriptor instead. +func (*Flag_Rule_Assignment_VariantAssignment) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3, 3, 0} +} + +func (x *Flag_Rule_Assignment_VariantAssignment) GetVariant() string { + if x != nil { + return x.Variant + } + return "" +} + +// No value will be assigned and passed on to the next rule, an +// event with a fallthrough assignment will be generated. +type Flag_Rule_Assignment_FallthroughAssignment struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule_Assignment_FallthroughAssignment) Reset() { + *x = Flag_Rule_Assignment_FallthroughAssignment{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule_Assignment_FallthroughAssignment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule_Assignment_FallthroughAssignment) ProtoMessage() {} + +func (x *Flag_Rule_Assignment_FallthroughAssignment) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule_Assignment_FallthroughAssignment.ProtoReflect.Descriptor instead. +func (*Flag_Rule_Assignment_FallthroughAssignment) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3, 3, 1} +} + +// No variant will be assigned and the client should return the +// configured default values. +type Flag_Rule_Assignment_ClientDefaultAssignment struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Flag_Rule_Assignment_ClientDefaultAssignment) Reset() { + *x = Flag_Rule_Assignment_ClientDefaultAssignment{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Flag_Rule_Assignment_ClientDefaultAssignment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag_Rule_Assignment_ClientDefaultAssignment) ProtoMessage() {} + +func (x *Flag_Rule_Assignment_ClientDefaultAssignment) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag_Rule_Assignment_ClientDefaultAssignment.ProtoReflect.Descriptor instead. +func (*Flag_Rule_Assignment_ClientDefaultAssignment) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{2, 3, 3, 2} +} + +// An instance of a schema that was seen +type ClientResolveInfo_EvaluationContextSchemaInstance struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Schema of each field in the evaluation context. + Schema map[string]EvaluationContextSchemaField_Kind `protobuf:"bytes,1,rep,name=schema,proto3" json:"schema,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=confidence.flags.admin.v1.EvaluationContextSchemaField_Kind"` + // Optional semantic type per field. + SemanticTypes map[string]*ContextFieldSemanticType `protobuf:"bytes,2,rep,name=semantic_types,json=semanticTypes,proto3" json:"semantic_types,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientResolveInfo_EvaluationContextSchemaInstance) Reset() { + *x = ClientResolveInfo_EvaluationContextSchemaInstance{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientResolveInfo_EvaluationContextSchemaInstance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientResolveInfo_EvaluationContextSchemaInstance) ProtoMessage() {} + +func (x *ClientResolveInfo_EvaluationContextSchemaInstance) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientResolveInfo_EvaluationContextSchemaInstance.ProtoReflect.Descriptor instead. +func (*ClientResolveInfo_EvaluationContextSchemaInstance) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *ClientResolveInfo_EvaluationContextSchemaInstance) GetSchema() map[string]EvaluationContextSchemaField_Kind { + if x != nil { + return x.Schema + } + return nil +} + +func (x *ClientResolveInfo_EvaluationContextSchemaInstance) GetSemanticTypes() map[string]*ContextFieldSemanticType { + if x != nil { + return x.SemanticTypes + } + return nil +} + +// Information about how a variant was resolved. +type FlagResolveInfo_VariantResolveInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + // If there was a variant assigned, otherwise not set + Variant string `protobuf:"bytes,1,opt,name=variant,proto3" json:"variant,omitempty"` + // Number of times the variant was resolved in this period + Count int64 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagResolveInfo_VariantResolveInfo) Reset() { + *x = FlagResolveInfo_VariantResolveInfo{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagResolveInfo_VariantResolveInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagResolveInfo_VariantResolveInfo) ProtoMessage() {} + +func (x *FlagResolveInfo_VariantResolveInfo) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagResolveInfo_VariantResolveInfo.ProtoReflect.Descriptor instead. +func (*FlagResolveInfo_VariantResolveInfo) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *FlagResolveInfo_VariantResolveInfo) GetVariant() string { + if x != nil { + return x.Variant + } + return "" +} + +func (x *FlagResolveInfo_VariantResolveInfo) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// Information about how a rule was resolved. +type FlagResolveInfo_RuleResolveInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The rule that was resolved + Rule string `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"` + // Number of times the rule was resolved in this period + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + // Resolve counts on each assignment + AssignmentResolveInfo []*FlagResolveInfo_AssignmentResolveInfo `protobuf:"bytes,3,rep,name=assignment_resolve_info,json=assignmentResolveInfo,proto3" json:"assignment_resolve_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagResolveInfo_RuleResolveInfo) Reset() { + *x = FlagResolveInfo_RuleResolveInfo{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagResolveInfo_RuleResolveInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagResolveInfo_RuleResolveInfo) ProtoMessage() {} + +func (x *FlagResolveInfo_RuleResolveInfo) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagResolveInfo_RuleResolveInfo.ProtoReflect.Descriptor instead. +func (*FlagResolveInfo_RuleResolveInfo) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{6, 1} +} + +func (x *FlagResolveInfo_RuleResolveInfo) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *FlagResolveInfo_RuleResolveInfo) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *FlagResolveInfo_RuleResolveInfo) GetAssignmentResolveInfo() []*FlagResolveInfo_AssignmentResolveInfo { + if x != nil { + return x.AssignmentResolveInfo + } + return nil +} + +// Information about the assignment that was resolved. +type FlagResolveInfo_AssignmentResolveInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The assignment id of the resolved value, otherwise not set. + AssignmentId string `protobuf:"bytes,1,opt,name=assignment_id,json=assignmentId,proto3" json:"assignment_id,omitempty"` + // Number of times the assignment id was resolved in this period. + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagResolveInfo_AssignmentResolveInfo) Reset() { + *x = FlagResolveInfo_AssignmentResolveInfo{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagResolveInfo_AssignmentResolveInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagResolveInfo_AssignmentResolveInfo) ProtoMessage() {} + +func (x *FlagResolveInfo_AssignmentResolveInfo) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagResolveInfo_AssignmentResolveInfo.ProtoReflect.Descriptor instead. +func (*FlagResolveInfo_AssignmentResolveInfo) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{6, 2} +} + +func (x *FlagResolveInfo_AssignmentResolveInfo) GetAssignmentId() string { + if x != nil { + return x.AssignmentId + } + return "" +} + +func (x *FlagResolveInfo_AssignmentResolveInfo) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// Specifies a semver semantic type +type ContextFieldSemanticType_VersionSemanticType struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContextFieldSemanticType_VersionSemanticType) Reset() { + *x = ContextFieldSemanticType_VersionSemanticType{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContextFieldSemanticType_VersionSemanticType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContextFieldSemanticType_VersionSemanticType) ProtoMessage() {} + +func (x *ContextFieldSemanticType_VersionSemanticType) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContextFieldSemanticType_VersionSemanticType.ProtoReflect.Descriptor instead. +func (*ContextFieldSemanticType_VersionSemanticType) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{8, 0} +} + +// Specifies a date semantic type +type ContextFieldSemanticType_DateSemanticType struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContextFieldSemanticType_DateSemanticType) Reset() { + *x = ContextFieldSemanticType_DateSemanticType{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContextFieldSemanticType_DateSemanticType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContextFieldSemanticType_DateSemanticType) ProtoMessage() {} + +func (x *ContextFieldSemanticType_DateSemanticType) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContextFieldSemanticType_DateSemanticType.ProtoReflect.Descriptor instead. +func (*ContextFieldSemanticType_DateSemanticType) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{8, 1} +} + +// Specifies a timestamp semantic type +type ContextFieldSemanticType_TimestampSemanticType struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContextFieldSemanticType_TimestampSemanticType) Reset() { + *x = ContextFieldSemanticType_TimestampSemanticType{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContextFieldSemanticType_TimestampSemanticType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContextFieldSemanticType_TimestampSemanticType) ProtoMessage() {} + +func (x *ContextFieldSemanticType_TimestampSemanticType) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContextFieldSemanticType_TimestampSemanticType.ProtoReflect.Descriptor instead. +func (*ContextFieldSemanticType_TimestampSemanticType) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{8, 2} +} + +// Specifies a country semantic type. +type ContextFieldSemanticType_CountrySemanticType struct { + state protoimpl.MessageState `protogen:"open.v1"` + // What format the country is specified in. + Format ContextFieldSemanticType_CountrySemanticType_CountryFormat `protobuf:"varint,1,opt,name=format,proto3,enum=confidence.flags.admin.v1.ContextFieldSemanticType_CountrySemanticType_CountryFormat" json:"format,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContextFieldSemanticType_CountrySemanticType) Reset() { + *x = ContextFieldSemanticType_CountrySemanticType{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContextFieldSemanticType_CountrySemanticType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContextFieldSemanticType_CountrySemanticType) ProtoMessage() {} + +func (x *ContextFieldSemanticType_CountrySemanticType) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContextFieldSemanticType_CountrySemanticType.ProtoReflect.Descriptor instead. +func (*ContextFieldSemanticType_CountrySemanticType) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{8, 3} +} + +func (x *ContextFieldSemanticType_CountrySemanticType) GetFormat() ContextFieldSemanticType_CountrySemanticType_CountryFormat { + if x != nil { + return x.Format + } + return ContextFieldSemanticType_CountrySemanticType_COUNTRY_FORMAT_UNSPECIFIED +} + +// Specifies an enum semantic type. +type ContextFieldSemanticType_EnumSemanticType struct { + state protoimpl.MessageState `protogen:"open.v1"` + // What allowed values exist for this enum. + Values []*ContextFieldSemanticType_EnumSemanticType_EnumValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContextFieldSemanticType_EnumSemanticType) Reset() { + *x = ContextFieldSemanticType_EnumSemanticType{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContextFieldSemanticType_EnumSemanticType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContextFieldSemanticType_EnumSemanticType) ProtoMessage() {} + +func (x *ContextFieldSemanticType_EnumSemanticType) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContextFieldSemanticType_EnumSemanticType.ProtoReflect.Descriptor instead. +func (*ContextFieldSemanticType_EnumSemanticType) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{8, 4} +} + +func (x *ContextFieldSemanticType_EnumSemanticType) GetValues() []*ContextFieldSemanticType_EnumSemanticType_EnumValue { + if x != nil { + return x.Values + } + return nil +} + +// Specifies a field that has a semantic type of entity. +type ContextFieldSemanticType_EntitySemanticType struct { + state protoimpl.MessageState `protogen:"open.v1"` + // A reference to the entity that exists in this field.- + Entity string `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContextFieldSemanticType_EntitySemanticType) Reset() { + *x = ContextFieldSemanticType_EntitySemanticType{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContextFieldSemanticType_EntitySemanticType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContextFieldSemanticType_EntitySemanticType) ProtoMessage() {} + +func (x *ContextFieldSemanticType_EntitySemanticType) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContextFieldSemanticType_EntitySemanticType.ProtoReflect.Descriptor instead. +func (*ContextFieldSemanticType_EntitySemanticType) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{8, 5} +} + +func (x *ContextFieldSemanticType_EntitySemanticType) GetEntity() string { + if x != nil { + return x.Entity + } + return "" +} + +// An allowed value for the enum +type ContextFieldSemanticType_EnumSemanticType_EnumValue struct { + state protoimpl.MessageState `protogen:"open.v1"` + // A possible value the enum can take. + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContextFieldSemanticType_EnumSemanticType_EnumValue) Reset() { + *x = ContextFieldSemanticType_EnumSemanticType_EnumValue{} + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContextFieldSemanticType_EnumSemanticType_EnumValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContextFieldSemanticType_EnumSemanticType_EnumValue) ProtoMessage() {} + +func (x *ContextFieldSemanticType_EnumSemanticType_EnumValue) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_admin_v1_types_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContextFieldSemanticType_EnumSemanticType_EnumValue.ProtoReflect.Descriptor instead. +func (*ContextFieldSemanticType_EnumSemanticType_EnumValue) Descriptor() ([]byte, []int) { + return file_confidence_flags_admin_v1_types_proto_rawDescGZIP(), []int{8, 4, 0} +} + +func (x *ContextFieldSemanticType_EnumSemanticType_EnumValue) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_confidence_flags_admin_v1_types_proto protoreflect.FileDescriptor + +const file_confidence_flags_admin_v1_types_proto_rawDesc = "" + + "\n" + + "%confidence/flags/admin/v1/types.proto\x12\x19confidence.flags.admin.v1\x1a\x19google/api/resource.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19google/type/decimal.proto\x1a&confidence/flags/types/v1/target.proto\x1a%confidence/flags/types/v1/types.proto\"\xcd\n" + + "\n" + + "\aSegment\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12'\n" + + "\fdisplay_name\x18\f \x01(\tB\x04\xe2A\x01\x01R\vdisplayName\x12B\n" + + "\ttargeting\x18\x02 \x01(\v2$.confidence.flags.types.v1.TargetingR\ttargeting\x12M\n" + + "\n" + + "allocation\x18\x03 \x01(\v2-.confidence.flags.admin.v1.Segment.AllocationR\n" + + "allocation\x12D\n" + + "\x05state\x18\x05 \x01(\x0e2(.confidence.flags.admin.v1.Segment.StateB\x04\xe2A\x01\x03R\x05state\x12f\n" + + "\x11bitset_allocation\x18\x06 \x01(\v23.confidence.flags.admin.v1.Segment.BitsetAllocationB\x04\xe2A\x01\x03R\x10bitsetAllocation\x12F\n" + + "\x06labels\x18\a \x03(\v2..confidence.flags.admin.v1.Segment.LabelsEntryR\x06labels\x12^\n" + + "\x11workflow_instance\x18\x10 \x01(\tB1\xe2A\x01\x01\xfaA*\n" + + "(workflow.confidence.dev/WorkflowInstanceR\x10workflowInstance\x126\n" + + "\x04flag\x18\x11 \x01(\tB\"\xe2A\x01\x01\xfaA\x1b\n" + + "\x19flags.confidence.dev/FlagR\x04flag\x12B\n" + + "\vcreate_time\x18\b \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\t \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\r \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\x0e \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x12:\n" + + "\x05owner\x18\x0f \x01(\tB$\xe2A\x01\x01\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\x05owner\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a\x90\x01\n" + + "\n" + + "Allocation\x124\n" + + "\n" + + "proportion\x18\x01 \x01(\v2\x14.google.type.DecimalR\n" + + "proportion\x12)\n" + + "\x10exclusivity_tags\x18\x03 \x03(\tR\x0fexclusivityTags\x12!\n" + + "\fexclusive_to\x18\x04 \x03(\tR\vexclusiveTo\x1a*\n" + + "\x10BitsetAllocation\x12\x16\n" + + "\x06bitset\x18\x01 \x01(\fR\x06bitset\"T\n" + + "\x05State\x12\x15\n" + + "\x11STATE_UNSPECIFIED\x10\x00\x12\x06\n" + + "\x02OK\x10\x04\x12\x0f\n" + + "\vUNALLOCATED\x10\x01\x12\r\n" + + "\tALLOCATED\x10\x02\x12\f\n" + + "\bARCHIVED\x10\x03:H\xeaAE\n" + + "\x1cflags.confidence.dev/Segment\x12\x12segments/{segment}*\bsegments2\asegment\"\xb6\x05\n" + + "\x13MaterializedSegment\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12'\n" + + "\fdisplay_name\x18\f \x01(\tB\x04\xe2A\x01\x02R\vdisplayName\x12R\n" + + "\x06labels\x18\a \x03(\v2:.confidence.flags.admin.v1.MaterializedSegment.LabelsEntryR\x06labels\x12B\n" + + "\vcreate_time\x18\b \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\t \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\r \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\x0e \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x12:\n" + + "\x05owner\x18\x0f \x01(\tB$\xe2A\x01\x01\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\x05owner\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:\x86\x01\xeaA\x82\x01\n" + + "(flags.confidence.dev/MaterializedSegment\x12+materializedSegments/{materialized_segment}*\x14materializedSegments2\x13materializedSegment\"\xa4%\n" + + "\x04Flag\x12\x19\n" + + "\x04name\x18\x01 \x01(\tB\x05\xe2A\x02\x05\bR\x04name\x12&\n" + + "\vdescription\x18\r \x01(\tB\x04\xe2A\x01\x01R\vdescription\x12T\n" + + "\x06schema\x18\x02 \x01(\v26.confidence.flags.types.v1.FlagSchema.StructFlagSchemaB\x04\xe2A\x01\x01R\x06schema\x12C\n" + + "\bvariants\x18\x03 \x03(\v2'.confidence.flags.admin.v1.Flag.VariantR\bvariants\x12B\n" + + "\x05state\x18\x04 \x01(\x0e2%.confidence.flags.admin.v1.Flag.StateB\x05\xe2A\x02\x03\x02R\x05state\x12:\n" + + "\x05rules\x18\x05 \x03(\v2$.confidence.flags.admin.v1.Flag.RuleR\x05rules\x128\n" + + "\aclients\x18\f \x03(\tB\x1e\xfaA\x1b\n" + + "\x19iam.confidence.dev/ClientR\aclients\x12B\n" + + "\vcreate_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\x0e \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\x0f \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x12C\n" + + "\x06labels\x18\n" + + " \x03(\v2+.confidence.flags.admin.v1.Flag.LabelsEntryR\x06labels\x12T\n" + + "\x0eusage_metadata\x18\v \x01(\v2-.confidence.flags.admin.v1.Flag.UsageMetadataR\rusageMetadata\x12:\n" + + "\x05owner\x18\x10 \x01(\tB$\xe2A\x01\x01\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\x05owner\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a\xc0\x01\n" + + "\rUsageMetadata\x12#\n" + + "\rresolve_count\x18\x01 \x01(\x03R\fresolveCount\x12F\n" + + "\x11last_resolve_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x0flastResolveTime\x12B\n" + + "\x0flast_apply_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\rlastApplyTime\x1a\xe4\x04\n" + + "\aVariant\x12\x19\n" + + "\x04name\x18\x01 \x01(\tB\x05\xe2A\x02\x02\bR\x04name\x123\n" + + "\x05value\x18\x02 \x01(\v2\x17.google.protobuf.StructB\x04\xe2A\x01\x02R\x05value\x12K\n" + + "\x06labels\x18\x03 \x03(\v23.confidence.flags.admin.v1.Flag.Variant.LabelsEntryR\x06labels\x12 \n" + + "\vdescription\x18\b \x01(\tR\vdescription\x12B\n" + + "\vcreate_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\t \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\n" + + " \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:U\xeaAR\n" + + "\x1cflags.confidence.dev/Variant\x12\x1fflags/{flag}/variants/{variant}*\bvariants2\avariant\x1a\xc8\x16\n" + + "\x04Rule\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12?\n" + + "\asegment\x18\x02 \x01(\tB%\xe2A\x01\x02\xfaA\x1e\n" + + "\x1cflags.confidence.dev/SegmentR\asegment\x12b\n" + + "\x0fassignment_spec\x18\f \x01(\v23.confidence.flags.admin.v1.Flag.Rule.AssignmentSpecB\x04\xe2A\x01\x02R\x0eassignmentSpec\x12`\n" + + "\x0eusage_metadata\x18\x04 \x01(\v22.confidence.flags.admin.v1.Flag.Rule.UsageMetadataB\x05\xe2A\x02\x03\x02R\rusageMetadata\x124\n" + + "\x16targeting_key_selector\x18\x05 \x01(\tR\x14targetingKeySelector\x12\x1e\n" + + "\aenabled\x18\v \x01(\bB\x04\xe2A\x01\x02R\aenabled\x12B\n" + + "\vcreate_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\x0e \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\x0f \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x12H\n" + + "\x06labels\x18\n" + + " \x03(\v20.confidence.flags.admin.v1.Flag.Rule.LabelsEntryR\x06labels\x12k\n" + + "\x14materialization_spec\x18\r \x01(\v28.confidence.flags.admin.v1.Flag.Rule.MaterializationSpecR\x13materializationSpec\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a\xf1\x03\n" + + "\x13MaterializationSpec\x12f\n" + + "\x15write_materialization\x18\x01 \x01(\tB1\xe2A\x01\x01\xfaA*\n" + + "(flags.confidence.dev/MaterializedSegmentR\x14writeMaterialization\x12d\n" + + "\x14read_materialization\x18\x02 \x01(\tB1\xe2A\x01\x01\xfaA*\n" + + "(flags.confidence.dev/MaterializedSegmentR\x13readMaterialization\x12j\n" + + "\x04mode\x18\x03 \x01(\v2P.confidence.flags.admin.v1.Flag.Rule.MaterializationSpec.MaterializationReadModeB\x04\xe2A\x01\x01R\x04mode\x1a\x9f\x01\n" + + "\x17MaterializationReadMode\x12<\n" + + "\x1amaterialization_must_match\x18\x01 \x01(\bR\x18materializationMustMatch\x12F\n" + + " segment_targeting_can_be_ignored\x18\x02 \x01(\bR\x1csegmentTargetingCanBeIgnored\x1a\x86\x01\n" + + "\x0eAssignmentSpec\x12!\n" + + "\fbucket_count\x18\x01 \x01(\x05R\vbucketCount\x12Q\n" + + "\vassignments\x18\x02 \x03(\v2/.confidence.flags.admin.v1.Flag.Rule.AssignmentR\vassignments\x1a\xdc\x04\n" + + "\n" + + "Assignment\x12#\n" + + "\rassignment_id\x18\x01 \x01(\tR\fassignmentId\x12]\n" + + "\avariant\x18\x02 \x01(\v2A.confidence.flags.admin.v1.Flag.Rule.Assignment.VariantAssignmentH\x00R\avariant\x12i\n" + + "\vfallthrough\x18\x03 \x01(\v2E.confidence.flags.admin.v1.Flag.Rule.Assignment.FallthroughAssignmentH\x00R\vfallthrough\x12p\n" + + "\x0eclient_default\x18\x04 \x01(\v2G.confidence.flags.admin.v1.Flag.Rule.Assignment.ClientDefaultAssignmentH\x00R\rclientDefault\x12U\n" + + "\rbucket_ranges\x18\x05 \x03(\v20.confidence.flags.admin.v1.Flag.Rule.BucketRangeR\fbucketRanges\x1aT\n" + + "\x11VariantAssignment\x12?\n" + + "\avariant\x18\x01 \x01(\tB%\xe2A\x01\x02\xfaA\x1e\n" + + "\x1cflags.confidence.dev/VariantR\avariant\x1a\x17\n" + + "\x15FallthroughAssignment\x1a\x19\n" + + "\x17ClientDefaultAssignmentB\f\n" + + "\n" + + "assignment\x1aE\n" + + "\vBucketRange\x12\x1a\n" + + "\x05lower\x18\x01 \x01(\x05B\x04\xe2A\x01\x02R\x05lower\x12\x1a\n" + + "\x05upper\x18\x02 \x01(\x05B\x04\xe2A\x01\x02R\x05upper\x1a\xdb\x02\n" + + "\rUsageMetadata\x12#\n" + + "\rresolve_count\x18\x01 \x01(\x03R\fresolveCount\x12\x1f\n" + + "\vapply_count\x18\x04 \x01(\x03R\n" + + "applyCount\x12F\n" + + "\x11last_resolve_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x0flastResolveTime\x12B\n" + + "\x0flast_apply_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\rlastApplyTime\x12x\n" + + "\x19assignment_usage_metadata\x18\x05 \x03(\v2<.confidence.flags.admin.v1.Flag.Rule.AssignmentUsageMetadataR\x17assignmentUsageMetadata\x1a\x83\x02\n" + + "\x17AssignmentUsageMetadata\x12#\n" + + "\rassignment_id\x18\x01 \x01(\tR\fassignmentId\x12#\n" + + "\rresolve_count\x18\x02 \x01(\x03R\fresolveCount\x12\x1f\n" + + "\vapply_count\x18\x03 \x01(\x03R\n" + + "applyCount\x12B\n" + + "\x0flast_apply_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\rlastApplyTime\x129\n" + + "\x19empty_targeting_key_count\x18\x05 \x01(\x03R\x16emptyTargetingKeyCount:F\xeaAC\n" + + "\x19flags.confidence.dev/Rule\x12\x19flags/{flag}/rules/{rule}*\x05rules2\x04rule\"8\n" + + "\x05State\x12\x15\n" + + "\x11STATE_UNSPECIFIED\x10\x00\x12\n" + + "\n" + + "\x06ACTIVE\x10\x01\x12\f\n" + + "\bARCHIVED\x10\x02:9\xeaA6\n" + + "\x19flags.confidence.dev/Flag\x12\fflags/{flag}*\x05flags2\x04flag\"\xcd\x05\n" + + "\fFastlyConfig\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12'\n" + + "\fdisplay_name\x18\x02 \x01(\tB\x04\xe2A\x01\x01R\vdisplayName\x12\x1d\n" + + "\n" + + "service_id\x18\x03 \x01(\tR\tserviceId\x12\x18\n" + + "\aenabled\x18\t \x01(\bR\aenabled\x12K\n" + + "\x10last_deploy_time\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\x0elastDeployTime\x12K\n" + + "\x06labels\x18\x04 \x03(\v23.confidence.flags.admin.v1.FastlyConfig.LabelsEntryR\x06labels\x12B\n" + + "\vcreate_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\a \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\b \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:b\xeaA_\n" + + "!flags.confidence.dev/FastlyConfig\x12\x1dfastlyConfigs/{fastly_config}*\rfastlyConfigs2\ffastlyConfig\"\xd8\a\n" + + "\x1eEvaluationContextFieldOverride\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12\x1a\n" + + "\x05field\x18\b \x01(\tB\x04\xe2A\x01\x02R\x05field\x12\x1e\n" + + "\aclients\x18\t \x03(\tB\x04\xe2A\x01\x01R\aclients\x12V\n" + + "\x04kind\x18\n" + + " \x01(\x0e2<.confidence.flags.admin.v1.EvaluationContextSchemaField.KindB\x04\xe2A\x01\x02R\x04kind\x12^\n" + + "\rsemantic_type\x18\v \x01(\v23.confidence.flags.admin.v1.ContextFieldSemanticTypeB\x04\xe2A\x01\x01R\fsemanticType\x12'\n" + + "\fdisplay_name\x18\f \x01(\tB\x04\xe2A\x01\x01R\vdisplayName\x12\x1c\n" + + "\x06hidden\x18\r \x01(\bB\x04\xe2A\x01\x01R\x06hidden\x12c\n" + + "\x06labels\x18\x02 \x03(\v2E.confidence.flags.admin.v1.EvaluationContextFieldOverride.LabelsEntryB\x04\xe2A\x01\x01R\x06labels\x12B\n" + + "\vcreate_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\x05 \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\x06 \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:\xb6\x01\xeaA\xb2\x01\n" + + "3flags.confidence.dev/EvaluationContextFieldOverride\x12:evaluationContextFieldOverrides/{evaluation_context_field}*\x1fevaluationContextFieldOverrides2\x1eevaluationContextFieldOverride\"\x9f\x06\n" + + "\x11ClientResolveInfo\x12:\n" + + "\x06client\x18\x01 \x01(\tB\"\xe2A\x01\x02\xfaA\x1b\n" + + "\x19iam.confidence.dev/ClientR\x06client\x12Y\n" + + "\x11client_credential\x18\x02 \x01(\tB,\xe2A\x01\x02\xfaA%\n" + + "#iam.confidence.dev/ClientCredentialR\x10clientCredential\x12d\n" + + "\x06schema\x18\x03 \x03(\v2L.confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstanceR\x06schema\x1a\x8c\x04\n" + + "\x1fEvaluationContextSchemaInstance\x12p\n" + + "\x06schema\x18\x01 \x03(\v2X.confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance.SchemaEntryR\x06schema\x12\x86\x01\n" + + "\x0esemantic_types\x18\x02 \x03(\v2_.confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance.SemanticTypesEntryR\rsemanticTypes\x1aw\n" + + "\vSchemaEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12R\n" + + "\x05value\x18\x02 \x01(\x0e2<.confidence.flags.admin.v1.EvaluationContextSchemaField.KindR\x05value:\x028\x01\x1au\n" + + "\x12SemanticTypesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12I\n" + + "\x05value\x18\x02 \x01(\v23.confidence.flags.admin.v1.ContextFieldSemanticTypeR\x05value:\x028\x01\"\xdd\x05\n" + + "\x0fFlagResolveInfo\x126\n" + + "\x04flag\x18\x01 \x01(\tB\"\xe2A\x01\x02\xfaA\x1b\n" + + "\x19flags.confidence.dev/FlagR\x04flag\x12o\n" + + "\x14variant_resolve_info\x18\x02 \x03(\v2=.confidence.flags.admin.v1.FlagResolveInfo.VariantResolveInfoR\x12variantResolveInfo\x12f\n" + + "\x11rule_resolve_info\x18\x03 \x03(\v2:.confidence.flags.admin.v1.FlagResolveInfo.RuleResolveInfoR\x0fruleResolveInfo\x1aq\n" + + "\x12VariantResolveInfo\x12?\n" + + "\avariant\x18\x01 \x01(\tB%\xe2A\x01\x01\xfaA\x1e\n" + + "\x1cflags.confidence.dev/VariantR\avariant\x12\x1a\n" + + "\x05count\x18\x03 \x01(\x03B\x04\xe2A\x01\x02R\x05count\x1a\xe5\x01\n" + + "\x0fRuleResolveInfo\x126\n" + + "\x04rule\x18\x01 \x01(\tB\"\xe2A\x01\x02\xfaA\x1b\n" + + "\x19flags.confidence.dev/RuleR\x04rule\x12\x1a\n" + + "\x05count\x18\x02 \x01(\x03B\x04\xe2A\x01\x02R\x05count\x12~\n" + + "\x17assignment_resolve_info\x18\x03 \x03(\v2@.confidence.flags.admin.v1.FlagResolveInfo.AssignmentResolveInfoB\x04\xe2A\x01\x01R\x15assignmentResolveInfo\x1a^\n" + + "\x15AssignmentResolveInfo\x12)\n" + + "\rassignment_id\x18\x01 \x01(\tB\x04\xe2A\x01\x01R\fassignmentId\x12\x1a\n" + + "\x05count\x18\x02 \x01(\x03B\x04\xe2A\x01\x02R\x05count\"\xe5\x02\n" + + "\x1cEvaluationContextSchemaField\x12R\n" + + "\x05types\x18\x01 \x03(\x0e2<.confidence.flags.admin.v1.EvaluationContextSchemaField.KindR\x05types\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x16\n" + + "\x06hidden\x18\x03 \x01(\bR\x06hidden\x12X\n" + + "\rsemantic_type\x18\x04 \x01(\v23.confidence.flags.admin.v1.ContextFieldSemanticTypeR\fsemanticType\"\\\n" + + "\x04Kind\x12\x14\n" + + "\x10KIND_UNSPECIFIED\x10\x00\x12\r\n" + + "\tNULL_KIND\x10\x01\x12\x0f\n" + + "\vNUMBER_KIND\x10\x02\x12\x0f\n" + + "\vSTRING_KIND\x10\x03\x12\r\n" + + "\tBOOL_KIND\x10\x04\"\xa4\t\n" + + "\x18ContextFieldSemanticType\x12c\n" + + "\acountry\x18\x01 \x01(\v2G.confidence.flags.admin.v1.ContextFieldSemanticType.CountrySemanticTypeH\x00R\acountry\x12c\n" + + "\tenum_type\x18\x02 \x01(\v2D.confidence.flags.admin.v1.ContextFieldSemanticType.EnumSemanticTypeH\x00R\benumType\x12s\n" + + "\x10entity_reference\x18\x03 \x01(\v2F.confidence.flags.admin.v1.ContextFieldSemanticType.EntitySemanticTypeH\x00R\x0fentityReference\x12c\n" + + "\aversion\x18\x04 \x01(\v2G.confidence.flags.admin.v1.ContextFieldSemanticType.VersionSemanticTypeH\x00R\aversion\x12Z\n" + + "\x04date\x18\x05 \x01(\v2D.confidence.flags.admin.v1.ContextFieldSemanticType.DateSemanticTypeH\x00R\x04date\x12i\n" + + "\ttimestamp\x18\x06 \x01(\v2I.confidence.flags.admin.v1.ContextFieldSemanticType.TimestampSemanticTypeH\x00R\ttimestamp\x1a\x15\n" + + "\x13VersionSemanticType\x1a\x12\n" + + "\x10DateSemanticType\x1a\x17\n" + + "\x15TimestampSemanticType\x1a\xd4\x01\n" + + "\x13CountrySemanticType\x12s\n" + + "\x06format\x18\x01 \x01(\x0e2U.confidence.flags.admin.v1.ContextFieldSemanticType.CountrySemanticType.CountryFormatB\x04\xe2A\x01\x02R\x06format\"H\n" + + "\rCountryFormat\x12\x1e\n" + + "\x1aCOUNTRY_FORMAT_UNSPECIFIED\x10\x00\x12\x17\n" + + "\x13TWO_LETTER_ISO_CODE\x10\x01\x1a\xa3\x01\n" + + "\x10EnumSemanticType\x12l\n" + + "\x06values\x18\x01 \x03(\v2N.confidence.flags.admin.v1.ContextFieldSemanticType.EnumSemanticType.EnumValueB\x04\xe2A\x01\x02R\x06values\x1a!\n" + + "\tEnumValue\x12\x14\n" + + "\x05value\x18\x01 \x01(\tR\x05value\x1aT\n" + + "\x12EntitySemanticType\x12>\n" + + "\x06entity\x18\x01 \x01(\tB&\xe2A\x01\x02\xfaA\x1f\n" + + "\x1dmetrics.confidence.dev/EntityR\x06entityB\x06\n" + + "\x04type*@\n" + + "\vSegmentView\x12\x1c\n" + + "\x18SEGMENT_VIEW_UNSPECIFIED\x10\x00\x12\t\n" + + "\x05BASIC\x10\x01\x12\b\n" + + "\x04FULL\x10\x02B5\n" + + "%com.spotify.confidence.flags.admin.v1B\n" + + "TypesProtoP\x01b\x06proto3" + +var ( + file_confidence_flags_admin_v1_types_proto_rawDescOnce sync.Once + file_confidence_flags_admin_v1_types_proto_rawDescData []byte +) + +func file_confidence_flags_admin_v1_types_proto_rawDescGZIP() []byte { + file_confidence_flags_admin_v1_types_proto_rawDescOnce.Do(func() { + file_confidence_flags_admin_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_flags_admin_v1_types_proto_rawDesc), len(file_confidence_flags_admin_v1_types_proto_rawDesc))) + }) + return file_confidence_flags_admin_v1_types_proto_rawDescData +} + +var file_confidence_flags_admin_v1_types_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_confidence_flags_admin_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 44) +var file_confidence_flags_admin_v1_types_proto_goTypes = []any{ + (SegmentView)(0), // 0: confidence.flags.admin.v1.SegmentView + (Segment_State)(0), // 1: confidence.flags.admin.v1.Segment.State + (Flag_State)(0), // 2: confidence.flags.admin.v1.Flag.State + (EvaluationContextSchemaField_Kind)(0), // 3: confidence.flags.admin.v1.EvaluationContextSchemaField.Kind + (ContextFieldSemanticType_CountrySemanticType_CountryFormat)(0), // 4: confidence.flags.admin.v1.ContextFieldSemanticType.CountrySemanticType.CountryFormat + (*Segment)(nil), // 5: confidence.flags.admin.v1.Segment + (*MaterializedSegment)(nil), // 6: confidence.flags.admin.v1.MaterializedSegment + (*Flag)(nil), // 7: confidence.flags.admin.v1.Flag + (*FastlyConfig)(nil), // 8: confidence.flags.admin.v1.FastlyConfig + (*EvaluationContextFieldOverride)(nil), // 9: confidence.flags.admin.v1.EvaluationContextFieldOverride + (*ClientResolveInfo)(nil), // 10: confidence.flags.admin.v1.ClientResolveInfo + (*FlagResolveInfo)(nil), // 11: confidence.flags.admin.v1.FlagResolveInfo + (*EvaluationContextSchemaField)(nil), // 12: confidence.flags.admin.v1.EvaluationContextSchemaField + (*ContextFieldSemanticType)(nil), // 13: confidence.flags.admin.v1.ContextFieldSemanticType + nil, // 14: confidence.flags.admin.v1.Segment.LabelsEntry + (*Segment_Allocation)(nil), // 15: confidence.flags.admin.v1.Segment.Allocation + (*Segment_BitsetAllocation)(nil), // 16: confidence.flags.admin.v1.Segment.BitsetAllocation + nil, // 17: confidence.flags.admin.v1.MaterializedSegment.LabelsEntry + nil, // 18: confidence.flags.admin.v1.Flag.LabelsEntry + (*Flag_UsageMetadata)(nil), // 19: confidence.flags.admin.v1.Flag.UsageMetadata + (*Flag_Variant)(nil), // 20: confidence.flags.admin.v1.Flag.Variant + (*Flag_Rule)(nil), // 21: confidence.flags.admin.v1.Flag.Rule + nil, // 22: confidence.flags.admin.v1.Flag.Variant.LabelsEntry + nil, // 23: confidence.flags.admin.v1.Flag.Rule.LabelsEntry + (*Flag_Rule_MaterializationSpec)(nil), // 24: confidence.flags.admin.v1.Flag.Rule.MaterializationSpec + (*Flag_Rule_AssignmentSpec)(nil), // 25: confidence.flags.admin.v1.Flag.Rule.AssignmentSpec + (*Flag_Rule_Assignment)(nil), // 26: confidence.flags.admin.v1.Flag.Rule.Assignment + (*Flag_Rule_BucketRange)(nil), // 27: confidence.flags.admin.v1.Flag.Rule.BucketRange + (*Flag_Rule_UsageMetadata)(nil), // 28: confidence.flags.admin.v1.Flag.Rule.UsageMetadata + (*Flag_Rule_AssignmentUsageMetadata)(nil), // 29: confidence.flags.admin.v1.Flag.Rule.AssignmentUsageMetadata + (*Flag_Rule_MaterializationSpec_MaterializationReadMode)(nil), // 30: confidence.flags.admin.v1.Flag.Rule.MaterializationSpec.MaterializationReadMode + (*Flag_Rule_Assignment_VariantAssignment)(nil), // 31: confidence.flags.admin.v1.Flag.Rule.Assignment.VariantAssignment + (*Flag_Rule_Assignment_FallthroughAssignment)(nil), // 32: confidence.flags.admin.v1.Flag.Rule.Assignment.FallthroughAssignment + (*Flag_Rule_Assignment_ClientDefaultAssignment)(nil), // 33: confidence.flags.admin.v1.Flag.Rule.Assignment.ClientDefaultAssignment + nil, // 34: confidence.flags.admin.v1.FastlyConfig.LabelsEntry + nil, // 35: confidence.flags.admin.v1.EvaluationContextFieldOverride.LabelsEntry + (*ClientResolveInfo_EvaluationContextSchemaInstance)(nil), // 36: confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance + nil, // 37: confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance.SchemaEntry + nil, // 38: confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance.SemanticTypesEntry + (*FlagResolveInfo_VariantResolveInfo)(nil), // 39: confidence.flags.admin.v1.FlagResolveInfo.VariantResolveInfo + (*FlagResolveInfo_RuleResolveInfo)(nil), // 40: confidence.flags.admin.v1.FlagResolveInfo.RuleResolveInfo + (*FlagResolveInfo_AssignmentResolveInfo)(nil), // 41: confidence.flags.admin.v1.FlagResolveInfo.AssignmentResolveInfo + (*ContextFieldSemanticType_VersionSemanticType)(nil), // 42: confidence.flags.admin.v1.ContextFieldSemanticType.VersionSemanticType + (*ContextFieldSemanticType_DateSemanticType)(nil), // 43: confidence.flags.admin.v1.ContextFieldSemanticType.DateSemanticType + (*ContextFieldSemanticType_TimestampSemanticType)(nil), // 44: confidence.flags.admin.v1.ContextFieldSemanticType.TimestampSemanticType + (*ContextFieldSemanticType_CountrySemanticType)(nil), // 45: confidence.flags.admin.v1.ContextFieldSemanticType.CountrySemanticType + (*ContextFieldSemanticType_EnumSemanticType)(nil), // 46: confidence.flags.admin.v1.ContextFieldSemanticType.EnumSemanticType + (*ContextFieldSemanticType_EntitySemanticType)(nil), // 47: confidence.flags.admin.v1.ContextFieldSemanticType.EntitySemanticType + (*ContextFieldSemanticType_EnumSemanticType_EnumValue)(nil), // 48: confidence.flags.admin.v1.ContextFieldSemanticType.EnumSemanticType.EnumValue + (*v1.Targeting)(nil), // 49: confidence.flags.types.v1.Targeting + (*timestamppb.Timestamp)(nil), // 50: google.protobuf.Timestamp + (*v1.FlagSchema_StructFlagSchema)(nil), // 51: confidence.flags.types.v1.FlagSchema.StructFlagSchema + (*decimal.Decimal)(nil), // 52: google.type.Decimal + (*structpb.Struct)(nil), // 53: google.protobuf.Struct +} +var file_confidence_flags_admin_v1_types_proto_depIdxs = []int32{ + 49, // 0: confidence.flags.admin.v1.Segment.targeting:type_name -> confidence.flags.types.v1.Targeting + 15, // 1: confidence.flags.admin.v1.Segment.allocation:type_name -> confidence.flags.admin.v1.Segment.Allocation + 1, // 2: confidence.flags.admin.v1.Segment.state:type_name -> confidence.flags.admin.v1.Segment.State + 16, // 3: confidence.flags.admin.v1.Segment.bitset_allocation:type_name -> confidence.flags.admin.v1.Segment.BitsetAllocation + 14, // 4: confidence.flags.admin.v1.Segment.labels:type_name -> confidence.flags.admin.v1.Segment.LabelsEntry + 50, // 5: confidence.flags.admin.v1.Segment.create_time:type_name -> google.protobuf.Timestamp + 50, // 6: confidence.flags.admin.v1.Segment.update_time:type_name -> google.protobuf.Timestamp + 17, // 7: confidence.flags.admin.v1.MaterializedSegment.labels:type_name -> confidence.flags.admin.v1.MaterializedSegment.LabelsEntry + 50, // 8: confidence.flags.admin.v1.MaterializedSegment.create_time:type_name -> google.protobuf.Timestamp + 50, // 9: confidence.flags.admin.v1.MaterializedSegment.update_time:type_name -> google.protobuf.Timestamp + 51, // 10: confidence.flags.admin.v1.Flag.schema:type_name -> confidence.flags.types.v1.FlagSchema.StructFlagSchema + 20, // 11: confidence.flags.admin.v1.Flag.variants:type_name -> confidence.flags.admin.v1.Flag.Variant + 2, // 12: confidence.flags.admin.v1.Flag.state:type_name -> confidence.flags.admin.v1.Flag.State + 21, // 13: confidence.flags.admin.v1.Flag.rules:type_name -> confidence.flags.admin.v1.Flag.Rule + 50, // 14: confidence.flags.admin.v1.Flag.create_time:type_name -> google.protobuf.Timestamp + 50, // 15: confidence.flags.admin.v1.Flag.update_time:type_name -> google.protobuf.Timestamp + 18, // 16: confidence.flags.admin.v1.Flag.labels:type_name -> confidence.flags.admin.v1.Flag.LabelsEntry + 19, // 17: confidence.flags.admin.v1.Flag.usage_metadata:type_name -> confidence.flags.admin.v1.Flag.UsageMetadata + 50, // 18: confidence.flags.admin.v1.FastlyConfig.last_deploy_time:type_name -> google.protobuf.Timestamp + 34, // 19: confidence.flags.admin.v1.FastlyConfig.labels:type_name -> confidence.flags.admin.v1.FastlyConfig.LabelsEntry + 50, // 20: confidence.flags.admin.v1.FastlyConfig.create_time:type_name -> google.protobuf.Timestamp + 50, // 21: confidence.flags.admin.v1.FastlyConfig.update_time:type_name -> google.protobuf.Timestamp + 3, // 22: confidence.flags.admin.v1.EvaluationContextFieldOverride.kind:type_name -> confidence.flags.admin.v1.EvaluationContextSchemaField.Kind + 13, // 23: confidence.flags.admin.v1.EvaluationContextFieldOverride.semantic_type:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType + 35, // 24: confidence.flags.admin.v1.EvaluationContextFieldOverride.labels:type_name -> confidence.flags.admin.v1.EvaluationContextFieldOverride.LabelsEntry + 50, // 25: confidence.flags.admin.v1.EvaluationContextFieldOverride.create_time:type_name -> google.protobuf.Timestamp + 50, // 26: confidence.flags.admin.v1.EvaluationContextFieldOverride.update_time:type_name -> google.protobuf.Timestamp + 36, // 27: confidence.flags.admin.v1.ClientResolveInfo.schema:type_name -> confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance + 39, // 28: confidence.flags.admin.v1.FlagResolveInfo.variant_resolve_info:type_name -> confidence.flags.admin.v1.FlagResolveInfo.VariantResolveInfo + 40, // 29: confidence.flags.admin.v1.FlagResolveInfo.rule_resolve_info:type_name -> confidence.flags.admin.v1.FlagResolveInfo.RuleResolveInfo + 3, // 30: confidence.flags.admin.v1.EvaluationContextSchemaField.types:type_name -> confidence.flags.admin.v1.EvaluationContextSchemaField.Kind + 13, // 31: confidence.flags.admin.v1.EvaluationContextSchemaField.semantic_type:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType + 45, // 32: confidence.flags.admin.v1.ContextFieldSemanticType.country:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType.CountrySemanticType + 46, // 33: confidence.flags.admin.v1.ContextFieldSemanticType.enum_type:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType.EnumSemanticType + 47, // 34: confidence.flags.admin.v1.ContextFieldSemanticType.entity_reference:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType.EntitySemanticType + 42, // 35: confidence.flags.admin.v1.ContextFieldSemanticType.version:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType.VersionSemanticType + 43, // 36: confidence.flags.admin.v1.ContextFieldSemanticType.date:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType.DateSemanticType + 44, // 37: confidence.flags.admin.v1.ContextFieldSemanticType.timestamp:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType.TimestampSemanticType + 52, // 38: confidence.flags.admin.v1.Segment.Allocation.proportion:type_name -> google.type.Decimal + 50, // 39: confidence.flags.admin.v1.Flag.UsageMetadata.last_resolve_time:type_name -> google.protobuf.Timestamp + 50, // 40: confidence.flags.admin.v1.Flag.UsageMetadata.last_apply_time:type_name -> google.protobuf.Timestamp + 53, // 41: confidence.flags.admin.v1.Flag.Variant.value:type_name -> google.protobuf.Struct + 22, // 42: confidence.flags.admin.v1.Flag.Variant.labels:type_name -> confidence.flags.admin.v1.Flag.Variant.LabelsEntry + 50, // 43: confidence.flags.admin.v1.Flag.Variant.create_time:type_name -> google.protobuf.Timestamp + 50, // 44: confidence.flags.admin.v1.Flag.Variant.update_time:type_name -> google.protobuf.Timestamp + 25, // 45: confidence.flags.admin.v1.Flag.Rule.assignment_spec:type_name -> confidence.flags.admin.v1.Flag.Rule.AssignmentSpec + 28, // 46: confidence.flags.admin.v1.Flag.Rule.usage_metadata:type_name -> confidence.flags.admin.v1.Flag.Rule.UsageMetadata + 50, // 47: confidence.flags.admin.v1.Flag.Rule.create_time:type_name -> google.protobuf.Timestamp + 50, // 48: confidence.flags.admin.v1.Flag.Rule.update_time:type_name -> google.protobuf.Timestamp + 23, // 49: confidence.flags.admin.v1.Flag.Rule.labels:type_name -> confidence.flags.admin.v1.Flag.Rule.LabelsEntry + 24, // 50: confidence.flags.admin.v1.Flag.Rule.materialization_spec:type_name -> confidence.flags.admin.v1.Flag.Rule.MaterializationSpec + 30, // 51: confidence.flags.admin.v1.Flag.Rule.MaterializationSpec.mode:type_name -> confidence.flags.admin.v1.Flag.Rule.MaterializationSpec.MaterializationReadMode + 26, // 52: confidence.flags.admin.v1.Flag.Rule.AssignmentSpec.assignments:type_name -> confidence.flags.admin.v1.Flag.Rule.Assignment + 31, // 53: confidence.flags.admin.v1.Flag.Rule.Assignment.variant:type_name -> confidence.flags.admin.v1.Flag.Rule.Assignment.VariantAssignment + 32, // 54: confidence.flags.admin.v1.Flag.Rule.Assignment.fallthrough:type_name -> confidence.flags.admin.v1.Flag.Rule.Assignment.FallthroughAssignment + 33, // 55: confidence.flags.admin.v1.Flag.Rule.Assignment.client_default:type_name -> confidence.flags.admin.v1.Flag.Rule.Assignment.ClientDefaultAssignment + 27, // 56: confidence.flags.admin.v1.Flag.Rule.Assignment.bucket_ranges:type_name -> confidence.flags.admin.v1.Flag.Rule.BucketRange + 50, // 57: confidence.flags.admin.v1.Flag.Rule.UsageMetadata.last_resolve_time:type_name -> google.protobuf.Timestamp + 50, // 58: confidence.flags.admin.v1.Flag.Rule.UsageMetadata.last_apply_time:type_name -> google.protobuf.Timestamp + 29, // 59: confidence.flags.admin.v1.Flag.Rule.UsageMetadata.assignment_usage_metadata:type_name -> confidence.flags.admin.v1.Flag.Rule.AssignmentUsageMetadata + 50, // 60: confidence.flags.admin.v1.Flag.Rule.AssignmentUsageMetadata.last_apply_time:type_name -> google.protobuf.Timestamp + 37, // 61: confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance.schema:type_name -> confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance.SchemaEntry + 38, // 62: confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance.semantic_types:type_name -> confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance.SemanticTypesEntry + 3, // 63: confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance.SchemaEntry.value:type_name -> confidence.flags.admin.v1.EvaluationContextSchemaField.Kind + 13, // 64: confidence.flags.admin.v1.ClientResolveInfo.EvaluationContextSchemaInstance.SemanticTypesEntry.value:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType + 41, // 65: confidence.flags.admin.v1.FlagResolveInfo.RuleResolveInfo.assignment_resolve_info:type_name -> confidence.flags.admin.v1.FlagResolveInfo.AssignmentResolveInfo + 4, // 66: confidence.flags.admin.v1.ContextFieldSemanticType.CountrySemanticType.format:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType.CountrySemanticType.CountryFormat + 48, // 67: confidence.flags.admin.v1.ContextFieldSemanticType.EnumSemanticType.values:type_name -> confidence.flags.admin.v1.ContextFieldSemanticType.EnumSemanticType.EnumValue + 68, // [68:68] is the sub-list for method output_type + 68, // [68:68] is the sub-list for method input_type + 68, // [68:68] is the sub-list for extension type_name + 68, // [68:68] is the sub-list for extension extendee + 0, // [0:68] is the sub-list for field type_name +} + +func init() { file_confidence_flags_admin_v1_types_proto_init() } +func file_confidence_flags_admin_v1_types_proto_init() { + if File_confidence_flags_admin_v1_types_proto != nil { + return + } + file_confidence_flags_admin_v1_types_proto_msgTypes[8].OneofWrappers = []any{ + (*ContextFieldSemanticType_Country)(nil), + (*ContextFieldSemanticType_EnumType)(nil), + (*ContextFieldSemanticType_EntityReference)(nil), + (*ContextFieldSemanticType_Version)(nil), + (*ContextFieldSemanticType_Date)(nil), + (*ContextFieldSemanticType_Timestamp)(nil), + } + file_confidence_flags_admin_v1_types_proto_msgTypes[21].OneofWrappers = []any{ + (*Flag_Rule_Assignment_Variant)(nil), + (*Flag_Rule_Assignment_Fallthrough)(nil), + (*Flag_Rule_Assignment_ClientDefault)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_flags_admin_v1_types_proto_rawDesc), len(file_confidence_flags_admin_v1_types_proto_rawDesc)), + NumEnums: 5, + NumMessages: 44, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_confidence_flags_admin_v1_types_proto_goTypes, + DependencyIndexes: file_confidence_flags_admin_v1_types_proto_depIdxs, + EnumInfos: file_confidence_flags_admin_v1_types_proto_enumTypes, + MessageInfos: file_confidence_flags_admin_v1_types_proto_msgTypes, + }.Build() + File_confidence_flags_admin_v1_types_proto = out.File + file_confidence_flags_admin_v1_types_proto_goTypes = nil + file_confidence_flags_admin_v1_types_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/flags/resolverevents/events.pb.go b/openfeature-provider/go/proto/confidence/flags/resolverevents/events.pb.go new file mode 100644 index 0000000..d56d915 --- /dev/null +++ b/openfeature-provider/go/proto/confidence/flags/resolverevents/events.pb.go @@ -0,0 +1,628 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/flags/resolver/v1/events/events.proto + +package resolverevents + +import ( + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1" + resolvertypes "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolvertypes" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type FlagAssigned_DefaultAssignment_DefaultAssignmentReason int32 + +const ( + FlagAssigned_DefaultAssignment_DEFAULT_ASSIGNMENT_REASON_UNSPECIFIED FlagAssigned_DefaultAssignment_DefaultAssignmentReason = 0 + FlagAssigned_DefaultAssignment_NO_SEGMENT_MATCH FlagAssigned_DefaultAssignment_DefaultAssignmentReason = 1 + // Deprecated: Marked as deprecated in confidence/flags/resolver/v1/events/events.proto. + FlagAssigned_DefaultAssignment_NO_TREATMENT_MATCH FlagAssigned_DefaultAssignment_DefaultAssignmentReason = 2 + FlagAssigned_DefaultAssignment_FLAG_ARCHIVED FlagAssigned_DefaultAssignment_DefaultAssignmentReason = 3 +) + +// Enum value maps for FlagAssigned_DefaultAssignment_DefaultAssignmentReason. +var ( + FlagAssigned_DefaultAssignment_DefaultAssignmentReason_name = map[int32]string{ + 0: "DEFAULT_ASSIGNMENT_REASON_UNSPECIFIED", + 1: "NO_SEGMENT_MATCH", + 2: "NO_TREATMENT_MATCH", + 3: "FLAG_ARCHIVED", + } + FlagAssigned_DefaultAssignment_DefaultAssignmentReason_value = map[string]int32{ + "DEFAULT_ASSIGNMENT_REASON_UNSPECIFIED": 0, + "NO_SEGMENT_MATCH": 1, + "NO_TREATMENT_MATCH": 2, + "FLAG_ARCHIVED": 3, + } +) + +func (x FlagAssigned_DefaultAssignment_DefaultAssignmentReason) Enum() *FlagAssigned_DefaultAssignment_DefaultAssignmentReason { + p := new(FlagAssigned_DefaultAssignment_DefaultAssignmentReason) + *p = x + return p +} + +func (x FlagAssigned_DefaultAssignment_DefaultAssignmentReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FlagAssigned_DefaultAssignment_DefaultAssignmentReason) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_flags_resolver_v1_events_events_proto_enumTypes[0].Descriptor() +} + +func (FlagAssigned_DefaultAssignment_DefaultAssignmentReason) Type() protoreflect.EnumType { + return &file_confidence_flags_resolver_v1_events_events_proto_enumTypes[0] +} + +func (x FlagAssigned_DefaultAssignment_DefaultAssignmentReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FlagAssigned_DefaultAssignment_DefaultAssignmentReason.Descriptor instead. +func (FlagAssigned_DefaultAssignment_DefaultAssignmentReason) EnumDescriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_events_events_proto_rawDescGZIP(), []int{1, 2, 0} +} + +type ClientInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Client string `protobuf:"bytes,1,opt,name=client,proto3" json:"client,omitempty"` + ClientCredential string `protobuf:"bytes,2,opt,name=client_credential,json=clientCredential,proto3" json:"client_credential,omitempty"` //TODO: client version + // Information about the SDK used to interact with the API. + Sdk *resolvertypes.Sdk `protobuf:"bytes,3,opt,name=sdk,proto3" json:"sdk,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientInfo) Reset() { + *x = ClientInfo{} + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientInfo) ProtoMessage() {} + +func (x *ClientInfo) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientInfo.ProtoReflect.Descriptor instead. +func (*ClientInfo) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_events_events_proto_rawDescGZIP(), []int{0} +} + +func (x *ClientInfo) GetClient() string { + if x != nil { + return x.Client + } + return "" +} + +func (x *ClientInfo) GetClientCredential() string { + if x != nil { + return x.ClientCredential + } + return "" +} + +func (x *ClientInfo) GetSdk() *resolvertypes.Sdk { + if x != nil { + return x.Sdk + } + return nil +} + +type FlagAssigned struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResolveId string `protobuf:"bytes,10,opt,name=resolve_id,json=resolveId,proto3" json:"resolve_id,omitempty"` + ClientInfo *ClientInfo `protobuf:"bytes,3,opt,name=client_info,json=clientInfo,proto3" json:"client_info,omitempty"` + Flags []*FlagAssigned_AppliedFlag `protobuf:"bytes,15,rep,name=flags,proto3" json:"flags,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagAssigned) Reset() { + *x = FlagAssigned{} + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagAssigned) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagAssigned) ProtoMessage() {} + +func (x *FlagAssigned) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagAssigned.ProtoReflect.Descriptor instead. +func (*FlagAssigned) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_events_events_proto_rawDescGZIP(), []int{1} +} + +func (x *FlagAssigned) GetResolveId() string { + if x != nil { + return x.ResolveId + } + return "" +} + +func (x *FlagAssigned) GetClientInfo() *ClientInfo { + if x != nil { + return x.ClientInfo + } + return nil +} + +func (x *FlagAssigned) GetFlags() []*FlagAssigned_AppliedFlag { + if x != nil { + return x.Flags + } + return nil +} + +type FallthroughAssignment struct { + state protoimpl.MessageState `protogen:"open.v1"` + Rule string `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"` + AssignmentId string `protobuf:"bytes,2,opt,name=assignment_id,json=assignmentId,proto3" json:"assignment_id,omitempty"` + TargetingKey string `protobuf:"bytes,3,opt,name=targeting_key,json=targetingKey,proto3" json:"targeting_key,omitempty"` + TargetingKeySelector string `protobuf:"bytes,4,opt,name=targeting_key_selector,json=targetingKeySelector,proto3" json:"targeting_key_selector,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FallthroughAssignment) Reset() { + *x = FallthroughAssignment{} + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FallthroughAssignment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FallthroughAssignment) ProtoMessage() {} + +func (x *FallthroughAssignment) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FallthroughAssignment.ProtoReflect.Descriptor instead. +func (*FallthroughAssignment) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_events_events_proto_rawDescGZIP(), []int{2} +} + +func (x *FallthroughAssignment) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *FallthroughAssignment) GetAssignmentId() string { + if x != nil { + return x.AssignmentId + } + return "" +} + +func (x *FallthroughAssignment) GetTargetingKey() string { + if x != nil { + return x.TargetingKey + } + return "" +} + +func (x *FallthroughAssignment) GetTargetingKeySelector() string { + if x != nil { + return x.TargetingKeySelector + } + return "" +} + +type FlagAssigned_AppliedFlag struct { + state protoimpl.MessageState `protogen:"open.v1"` + Flag string `protobuf:"bytes,1,opt,name=flag,proto3" json:"flag,omitempty"` + TargetingKey string `protobuf:"bytes,2,opt,name=targeting_key,json=targetingKey,proto3" json:"targeting_key,omitempty"` + TargetingKeySelector string `protobuf:"bytes,3,opt,name=targeting_key_selector,json=targetingKeySelector,proto3" json:"targeting_key_selector,omitempty"` + // Types that are valid to be assigned to Assignment: + // + // *FlagAssigned_AppliedFlag_AssignmentInfo + // *FlagAssigned_AppliedFlag_DefaultAssignment + Assignment isFlagAssigned_AppliedFlag_Assignment `protobuf_oneof:"assignment"` + AssignmentId string `protobuf:"bytes,6,opt,name=assignment_id,json=assignmentId,proto3" json:"assignment_id,omitempty"` + Rule string `protobuf:"bytes,7,opt,name=rule,proto3" json:"rule,omitempty"` + FallthroughAssignments []*FallthroughAssignment `protobuf:"bytes,8,rep,name=fallthrough_assignments,json=fallthroughAssignments,proto3" json:"fallthrough_assignments,omitempty"` + ApplyTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=apply_time,json=applyTime,proto3" json:"apply_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagAssigned_AppliedFlag) Reset() { + *x = FlagAssigned_AppliedFlag{} + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagAssigned_AppliedFlag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagAssigned_AppliedFlag) ProtoMessage() {} + +func (x *FlagAssigned_AppliedFlag) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagAssigned_AppliedFlag.ProtoReflect.Descriptor instead. +func (*FlagAssigned_AppliedFlag) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_events_events_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *FlagAssigned_AppliedFlag) GetFlag() string { + if x != nil { + return x.Flag + } + return "" +} + +func (x *FlagAssigned_AppliedFlag) GetTargetingKey() string { + if x != nil { + return x.TargetingKey + } + return "" +} + +func (x *FlagAssigned_AppliedFlag) GetTargetingKeySelector() string { + if x != nil { + return x.TargetingKeySelector + } + return "" +} + +func (x *FlagAssigned_AppliedFlag) GetAssignment() isFlagAssigned_AppliedFlag_Assignment { + if x != nil { + return x.Assignment + } + return nil +} + +func (x *FlagAssigned_AppliedFlag) GetAssignmentInfo() *FlagAssigned_AssignmentInfo { + if x != nil { + if x, ok := x.Assignment.(*FlagAssigned_AppliedFlag_AssignmentInfo); ok { + return x.AssignmentInfo + } + } + return nil +} + +func (x *FlagAssigned_AppliedFlag) GetDefaultAssignment() *FlagAssigned_DefaultAssignment { + if x != nil { + if x, ok := x.Assignment.(*FlagAssigned_AppliedFlag_DefaultAssignment); ok { + return x.DefaultAssignment + } + } + return nil +} + +func (x *FlagAssigned_AppliedFlag) GetAssignmentId() string { + if x != nil { + return x.AssignmentId + } + return "" +} + +func (x *FlagAssigned_AppliedFlag) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *FlagAssigned_AppliedFlag) GetFallthroughAssignments() []*FallthroughAssignment { + if x != nil { + return x.FallthroughAssignments + } + return nil +} + +func (x *FlagAssigned_AppliedFlag) GetApplyTime() *timestamppb.Timestamp { + if x != nil { + return x.ApplyTime + } + return nil +} + +type isFlagAssigned_AppliedFlag_Assignment interface { + isFlagAssigned_AppliedFlag_Assignment() +} + +type FlagAssigned_AppliedFlag_AssignmentInfo struct { + AssignmentInfo *FlagAssigned_AssignmentInfo `protobuf:"bytes,4,opt,name=assignment_info,json=assignmentInfo,proto3,oneof"` +} + +type FlagAssigned_AppliedFlag_DefaultAssignment struct { + DefaultAssignment *FlagAssigned_DefaultAssignment `protobuf:"bytes,5,opt,name=default_assignment,json=defaultAssignment,proto3,oneof"` +} + +func (*FlagAssigned_AppliedFlag_AssignmentInfo) isFlagAssigned_AppliedFlag_Assignment() {} + +func (*FlagAssigned_AppliedFlag_DefaultAssignment) isFlagAssigned_AppliedFlag_Assignment() {} + +type FlagAssigned_AssignmentInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Segment string `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` + Variant string `protobuf:"bytes,2,opt,name=variant,proto3" json:"variant,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagAssigned_AssignmentInfo) Reset() { + *x = FlagAssigned_AssignmentInfo{} + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagAssigned_AssignmentInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagAssigned_AssignmentInfo) ProtoMessage() {} + +func (x *FlagAssigned_AssignmentInfo) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagAssigned_AssignmentInfo.ProtoReflect.Descriptor instead. +func (*FlagAssigned_AssignmentInfo) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_events_events_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *FlagAssigned_AssignmentInfo) GetSegment() string { + if x != nil { + return x.Segment + } + return "" +} + +func (x *FlagAssigned_AssignmentInfo) GetVariant() string { + if x != nil { + return x.Variant + } + return "" +} + +type FlagAssigned_DefaultAssignment struct { + state protoimpl.MessageState `protogen:"open.v1"` + Reason FlagAssigned_DefaultAssignment_DefaultAssignmentReason `protobuf:"varint,1,opt,name=reason,proto3,enum=confidence.flags.resolver.v1.events.FlagAssigned_DefaultAssignment_DefaultAssignmentReason" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagAssigned_DefaultAssignment) Reset() { + *x = FlagAssigned_DefaultAssignment{} + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagAssigned_DefaultAssignment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagAssigned_DefaultAssignment) ProtoMessage() {} + +func (x *FlagAssigned_DefaultAssignment) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_events_events_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagAssigned_DefaultAssignment.ProtoReflect.Descriptor instead. +func (*FlagAssigned_DefaultAssignment) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_events_events_proto_rawDescGZIP(), []int{1, 2} +} + +func (x *FlagAssigned_DefaultAssignment) GetReason() FlagAssigned_DefaultAssignment_DefaultAssignmentReason { + if x != nil { + return x.Reason + } + return FlagAssigned_DefaultAssignment_DEFAULT_ASSIGNMENT_REASON_UNSPECIFIED +} + +var File_confidence_flags_resolver_v1_events_events_proto protoreflect.FileDescriptor + +const file_confidence_flags_resolver_v1_events_events_proto_rawDesc = "" + + "\n" + + "0confidence/flags/resolver/v1/events/events.proto\x12#confidence.flags.resolver.v1.events\x1a&confidence/events/v1/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19google/api/resource.proto\x1a(confidence/flags/resolver/v1/types.proto\"\xd0\x01\n" + + "\n" + + "ClientInfo\x126\n" + + "\x06client\x18\x01 \x01(\tB\x1e\xfaA\x1b\n" + + "\x19iam.confidence.dev/ClientR\x06client\x12U\n" + + "\x11client_credential\x18\x02 \x01(\tB(\xfaA%\n" + + "#iam.confidence.dev/ClientCredentialR\x10clientCredential\x123\n" + + "\x03sdk\x18\x03 \x01(\v2!.confidence.flags.resolver.v1.SdkR\x03sdk\"\xb5\n" + + "\n" + + "\fFlagAssigned\x12\x1d\n" + + "\n" + + "resolve_id\x18\n" + + " \x01(\tR\tresolveId\x12P\n" + + "\vclient_info\x18\x03 \x01(\v2/.confidence.flags.resolver.v1.events.ClientInfoR\n" + + "clientInfo\x12S\n" + + "\x05flags\x18\x0f \x03(\v2=.confidence.flags.resolver.v1.events.FlagAssigned.AppliedFlagR\x05flags\x1a\x96\x05\n" + + "\vAppliedFlag\x122\n" + + "\x04flag\x18\x01 \x01(\tB\x1e\xfaA\x1b\n" + + "\x19flags.confidence.dev/FlagR\x04flag\x12#\n" + + "\rtargeting_key\x18\x02 \x01(\tR\ftargetingKey\x124\n" + + "\x16targeting_key_selector\x18\x03 \x01(\tR\x14targetingKeySelector\x12k\n" + + "\x0fassignment_info\x18\x04 \x01(\v2@.confidence.flags.resolver.v1.events.FlagAssigned.AssignmentInfoH\x00R\x0eassignmentInfo\x12t\n" + + "\x12default_assignment\x18\x05 \x01(\v2C.confidence.flags.resolver.v1.events.FlagAssigned.DefaultAssignmentH\x00R\x11defaultAssignment\x12#\n" + + "\rassignment_id\x18\x06 \x01(\tR\fassignmentId\x122\n" + + "\x04rule\x18\a \x01(\tB\x1e\xfaA\x1b\n" + + "\x19flags.confidence.dev/RuleR\x04rule\x12s\n" + + "\x17fallthrough_assignments\x18\b \x03(\v2:.confidence.flags.resolver.v1.events.FallthroughAssignmentR\x16fallthroughAssignments\x129\n" + + "\n" + + "apply_time\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tapplyTimeB\f\n" + + "\n" + + "assignment\x1a\x8e\x01\n" + + "\x0eAssignmentInfo\x12;\n" + + "\asegment\x18\x01 \x01(\tB!\xfaA\x1e\n" + + "\x1cflags.confidence.dev/SegmentR\asegment\x12?\n" + + "\avariant\x18\x02 \x01(\tB%\xfaA\"\n" + + " flags.confidence.dev/FlagVariantR\avariant\x1a\x94\x02\n" + + "\x11DefaultAssignment\x12s\n" + + "\x06reason\x18\x01 \x01(\x0e2[.confidence.flags.resolver.v1.events.FlagAssigned.DefaultAssignment.DefaultAssignmentReasonR\x06reason\"\x89\x01\n" + + "\x17DefaultAssignmentReason\x12)\n" + + "%DEFAULT_ASSIGNMENT_REASON_UNSPECIFIED\x10\x00\x12\x14\n" + + "\x10NO_SEGMENT_MATCH\x10\x01\x12\x1a\n" + + "\x12NO_TREATMENT_MATCH\x10\x02\x1a\x02\b\x01\x12\x11\n" + + "\rFLAG_ARCHIVED\x10\x03:\x1e\xf2\xb7\xbf\x10\x19\x12\x17A flag has been applied\"\xcb\x01\n" + + "\x15FallthroughAssignment\x122\n" + + "\x04rule\x18\x01 \x01(\tB\x1e\xfaA\x1b\n" + + "\x19flags.confidence.dev/RuleR\x04rule\x12#\n" + + "\rassignment_id\x18\x02 \x01(\tR\fassignmentId\x12#\n" + + "\rtargeting_key\x18\x03 \x01(\tR\ftargetingKey\x124\n" + + "\x16targeting_key_selector\x18\x04 \x01(\tR\x14targetingKeySelectorB@\n" + + "/com.spotify.confidence.flags.resolver.v1.eventsB\vEventsProtoP\x01b\x06proto3" + +var ( + file_confidence_flags_resolver_v1_events_events_proto_rawDescOnce sync.Once + file_confidence_flags_resolver_v1_events_events_proto_rawDescData []byte +) + +func file_confidence_flags_resolver_v1_events_events_proto_rawDescGZIP() []byte { + file_confidence_flags_resolver_v1_events_events_proto_rawDescOnce.Do(func() { + file_confidence_flags_resolver_v1_events_events_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_flags_resolver_v1_events_events_proto_rawDesc), len(file_confidence_flags_resolver_v1_events_events_proto_rawDesc))) + }) + return file_confidence_flags_resolver_v1_events_events_proto_rawDescData +} + +var file_confidence_flags_resolver_v1_events_events_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_confidence_flags_resolver_v1_events_events_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_confidence_flags_resolver_v1_events_events_proto_goTypes = []any{ + (FlagAssigned_DefaultAssignment_DefaultAssignmentReason)(0), // 0: confidence.flags.resolver.v1.events.FlagAssigned.DefaultAssignment.DefaultAssignmentReason + (*ClientInfo)(nil), // 1: confidence.flags.resolver.v1.events.ClientInfo + (*FlagAssigned)(nil), // 2: confidence.flags.resolver.v1.events.FlagAssigned + (*FallthroughAssignment)(nil), // 3: confidence.flags.resolver.v1.events.FallthroughAssignment + (*FlagAssigned_AppliedFlag)(nil), // 4: confidence.flags.resolver.v1.events.FlagAssigned.AppliedFlag + (*FlagAssigned_AssignmentInfo)(nil), // 5: confidence.flags.resolver.v1.events.FlagAssigned.AssignmentInfo + (*FlagAssigned_DefaultAssignment)(nil), // 6: confidence.flags.resolver.v1.events.FlagAssigned.DefaultAssignment + (*resolvertypes.Sdk)(nil), // 7: confidence.flags.resolver.v1.Sdk + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp +} +var file_confidence_flags_resolver_v1_events_events_proto_depIdxs = []int32{ + 7, // 0: confidence.flags.resolver.v1.events.ClientInfo.sdk:type_name -> confidence.flags.resolver.v1.Sdk + 1, // 1: confidence.flags.resolver.v1.events.FlagAssigned.client_info:type_name -> confidence.flags.resolver.v1.events.ClientInfo + 4, // 2: confidence.flags.resolver.v1.events.FlagAssigned.flags:type_name -> confidence.flags.resolver.v1.events.FlagAssigned.AppliedFlag + 5, // 3: confidence.flags.resolver.v1.events.FlagAssigned.AppliedFlag.assignment_info:type_name -> confidence.flags.resolver.v1.events.FlagAssigned.AssignmentInfo + 6, // 4: confidence.flags.resolver.v1.events.FlagAssigned.AppliedFlag.default_assignment:type_name -> confidence.flags.resolver.v1.events.FlagAssigned.DefaultAssignment + 3, // 5: confidence.flags.resolver.v1.events.FlagAssigned.AppliedFlag.fallthrough_assignments:type_name -> confidence.flags.resolver.v1.events.FallthroughAssignment + 8, // 6: confidence.flags.resolver.v1.events.FlagAssigned.AppliedFlag.apply_time:type_name -> google.protobuf.Timestamp + 0, // 7: confidence.flags.resolver.v1.events.FlagAssigned.DefaultAssignment.reason:type_name -> confidence.flags.resolver.v1.events.FlagAssigned.DefaultAssignment.DefaultAssignmentReason + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_confidence_flags_resolver_v1_events_events_proto_init() } +func file_confidence_flags_resolver_v1_events_events_proto_init() { + if File_confidence_flags_resolver_v1_events_events_proto != nil { + return + } + file_confidence_flags_resolver_v1_events_events_proto_msgTypes[3].OneofWrappers = []any{ + (*FlagAssigned_AppliedFlag_AssignmentInfo)(nil), + (*FlagAssigned_AppliedFlag_DefaultAssignment)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_flags_resolver_v1_events_events_proto_rawDesc), len(file_confidence_flags_resolver_v1_events_events_proto_rawDesc)), + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_confidence_flags_resolver_v1_events_events_proto_goTypes, + DependencyIndexes: file_confidence_flags_resolver_v1_events_events_proto_depIdxs, + EnumInfos: file_confidence_flags_resolver_v1_events_events_proto_enumTypes, + MessageInfos: file_confidence_flags_resolver_v1_events_events_proto_msgTypes, + }.Build() + File_confidence_flags_resolver_v1_events_events_proto = out.File + file_confidence_flags_resolver_v1_events_events_proto_goTypes = nil + file_confidence_flags_resolver_v1_events_events_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/flags/resolverinternal/internal_api.pb.go b/openfeature-provider/go/proto/confidence/flags/resolverinternal/internal_api.pb.go new file mode 100644 index 0000000..05d3c80 --- /dev/null +++ b/openfeature-provider/go/proto/confidence/flags/resolverinternal/internal_api.pb.go @@ -0,0 +1,664 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/flags/resolver/v1/internal_api.proto + +package resolverinternal + +import ( + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api" + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1" + v1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1" + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1/events" + resolverevents "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolverevents" + resolvertypes "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolvertypes" + _ "google.golang.org/genproto/googleapis/api/annotations" + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The service that allows to report flag assigned and other client-side flag +// operations, useful when the resolve engine runs on the customer's premises +// (e.g. side-car) +type WriteFlagLogsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + FlagAssigned []*resolverevents.FlagAssigned `protobuf:"bytes,1,rep,name=flag_assigned,json=flagAssigned,proto3" json:"flag_assigned,omitempty"` + TelemetryData *TelemetryData `protobuf:"bytes,2,opt,name=telemetry_data,json=telemetryData,proto3" json:"telemetry_data,omitempty"` + ClientResolveInfo []*v1.ClientResolveInfo `protobuf:"bytes,3,rep,name=client_resolve_info,json=clientResolveInfo,proto3" json:"client_resolve_info,omitempty"` + FlagResolveInfo []*v1.FlagResolveInfo `protobuf:"bytes,4,rep,name=flag_resolve_info,json=flagResolveInfo,proto3" json:"flag_resolve_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteFlagLogsRequest) Reset() { + *x = WriteFlagLogsRequest{} + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteFlagLogsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteFlagLogsRequest) ProtoMessage() {} + +func (x *WriteFlagLogsRequest) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteFlagLogsRequest.ProtoReflect.Descriptor instead. +func (*WriteFlagLogsRequest) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_internal_api_proto_rawDescGZIP(), []int{0} +} + +func (x *WriteFlagLogsRequest) GetFlagAssigned() []*resolverevents.FlagAssigned { + if x != nil { + return x.FlagAssigned + } + return nil +} + +func (x *WriteFlagLogsRequest) GetTelemetryData() *TelemetryData { + if x != nil { + return x.TelemetryData + } + return nil +} + +func (x *WriteFlagLogsRequest) GetClientResolveInfo() []*v1.ClientResolveInfo { + if x != nil { + return x.ClientResolveInfo + } + return nil +} + +func (x *WriteFlagLogsRequest) GetFlagResolveInfo() []*v1.FlagResolveInfo { + if x != nil { + return x.FlagResolveInfo + } + return nil +} + +type WriteFlagLogsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteFlagLogsResponse) Reset() { + *x = WriteFlagLogsResponse{} + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteFlagLogsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteFlagLogsResponse) ProtoMessage() {} + +func (x *WriteFlagLogsResponse) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteFlagLogsResponse.ProtoReflect.Descriptor instead. +func (*WriteFlagLogsResponse) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_internal_api_proto_rawDescGZIP(), []int{1} +} + +// A request to write flag assignments +type WriteFlagAssignedRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // List of flag assigned events to write + FlagAssigned []*resolverevents.FlagAssigned `protobuf:"bytes,1,rep,name=flag_assigned,json=flagAssigned,proto3" json:"flag_assigned,omitempty"` + TelemetryData *TelemetryData `protobuf:"bytes,2,opt,name=telemetry_data,json=telemetryData,proto3" json:"telemetry_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteFlagAssignedRequest) Reset() { + *x = WriteFlagAssignedRequest{} + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteFlagAssignedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteFlagAssignedRequest) ProtoMessage() {} + +func (x *WriteFlagAssignedRequest) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteFlagAssignedRequest.ProtoReflect.Descriptor instead. +func (*WriteFlagAssignedRequest) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_internal_api_proto_rawDescGZIP(), []int{2} +} + +func (x *WriteFlagAssignedRequest) GetFlagAssigned() []*resolverevents.FlagAssigned { + if x != nil { + return x.FlagAssigned + } + return nil +} + +func (x *WriteFlagAssignedRequest) GetTelemetryData() *TelemetryData { + if x != nil { + return x.TelemetryData + } + return nil +} + +// Response to writing flag assignments +type WriteFlagAssignedResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The total number of assigned flags, should equal the sum of the flag counts in each flag + // assigned event. + AssignedFlags int64 `protobuf:"varint,1,opt,name=assigned_flags,json=assignedFlags,proto3" json:"assigned_flags,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteFlagAssignedResponse) Reset() { + *x = WriteFlagAssignedResponse{} + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteFlagAssignedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteFlagAssignedResponse) ProtoMessage() {} + +func (x *WriteFlagAssignedResponse) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteFlagAssignedResponse.ProtoReflect.Descriptor instead. +func (*WriteFlagAssignedResponse) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_internal_api_proto_rawDescGZIP(), []int{3} +} + +func (x *WriteFlagAssignedResponse) GetAssignedFlags() int64 { + if x != nil { + return x.AssignedFlags + } + return 0 +} + +// Collection of telemetry metrics, usually included in request messages to +// monitor sender-side issues or performance +type TelemetryData struct { + state protoimpl.MessageState `protogen:"open.v1"` + // "events" dropped from the sender to due to issues or inefficiencies. + // This is implemented as a delta counter between TelemetryData messages + DroppedEvents int64 `protobuf:"varint,1,opt,name=dropped_events,json=droppedEvents,proto3" json:"dropped_events,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TelemetryData) Reset() { + *x = TelemetryData{} + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TelemetryData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TelemetryData) ProtoMessage() {} + +func (x *TelemetryData) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TelemetryData.ProtoReflect.Descriptor instead. +func (*TelemetryData) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_internal_api_proto_rawDescGZIP(), []int{4} +} + +func (x *TelemetryData) GetDroppedEvents() int64 { + if x != nil { + return x.DroppedEvents + } + return 0 +} + +type ResolveToken struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to ResolveToken: + // + // *ResolveToken_TokenV1 + ResolveToken isResolveToken_ResolveToken `protobuf_oneof:"resolve_token"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveToken) Reset() { + *x = ResolveToken{} + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveToken) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveToken) ProtoMessage() {} + +func (x *ResolveToken) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveToken.ProtoReflect.Descriptor instead. +func (*ResolveToken) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_internal_api_proto_rawDescGZIP(), []int{5} +} + +func (x *ResolveToken) GetResolveToken() isResolveToken_ResolveToken { + if x != nil { + return x.ResolveToken + } + return nil +} + +func (x *ResolveToken) GetTokenV1() *ResolveTokenV1 { + if x != nil { + if x, ok := x.ResolveToken.(*ResolveToken_TokenV1); ok { + return x.TokenV1 + } + } + return nil +} + +type isResolveToken_ResolveToken interface { + isResolveToken_ResolveToken() +} + +type ResolveToken_TokenV1 struct { + TokenV1 *ResolveTokenV1 `protobuf:"bytes,1,opt,name=token_v1,json=tokenV1,proto3,oneof"` +} + +func (*ResolveToken_TokenV1) isResolveToken_ResolveToken() {} + +type ResolveTokenV1 struct { + state protoimpl.MessageState `protogen:"open.v1"` + EvaluationContext *structpb.Struct `protobuf:"bytes,1,opt,name=evaluation_context,json=evaluationContext,proto3" json:"evaluation_context,omitempty"` + Assignments map[string]*ResolveTokenV1_AssignedFlag `protobuf:"bytes,2,rep,name=assignments,proto3" json:"assignments,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + ResolveId string `protobuf:"bytes,3,opt,name=resolve_id,json=resolveId,proto3" json:"resolve_id,omitempty"` + // The account that the resolve was made for + Account string `protobuf:"bytes,4,opt,name=account,proto3" json:"account,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveTokenV1) Reset() { + *x = ResolveTokenV1{} + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveTokenV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveTokenV1) ProtoMessage() {} + +func (x *ResolveTokenV1) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveTokenV1.ProtoReflect.Descriptor instead. +func (*ResolveTokenV1) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_internal_api_proto_rawDescGZIP(), []int{6} +} + +func (x *ResolveTokenV1) GetEvaluationContext() *structpb.Struct { + if x != nil { + return x.EvaluationContext + } + return nil +} + +func (x *ResolveTokenV1) GetAssignments() map[string]*ResolveTokenV1_AssignedFlag { + if x != nil { + return x.Assignments + } + return nil +} + +func (x *ResolveTokenV1) GetResolveId() string { + if x != nil { + return x.ResolveId + } + return "" +} + +func (x *ResolveTokenV1) GetAccount() string { + if x != nil { + return x.Account + } + return "" +} + +type ResolveTokenV1_AssignedFlag struct { + state protoimpl.MessageState `protogen:"open.v1"` + Flag string `protobuf:"bytes,1,opt,name=flag,proto3" json:"flag,omitempty"` + TargetingKey string `protobuf:"bytes,2,opt,name=targeting_key,json=targetingKey,proto3" json:"targeting_key,omitempty"` + TargetingKeySelector string `protobuf:"bytes,10,opt,name=targeting_key_selector,json=targetingKeySelector,proto3" json:"targeting_key_selector,omitempty"` + Segment string `protobuf:"bytes,3,opt,name=segment,proto3" json:"segment,omitempty"` + Variant string `protobuf:"bytes,4,opt,name=variant,proto3" json:"variant,omitempty"` + Rule string `protobuf:"bytes,5,opt,name=rule,proto3" json:"rule,omitempty"` + Reason resolvertypes.ResolveReason `protobuf:"varint,6,opt,name=reason,proto3,enum=confidence.flags.resolver.v1.ResolveReason" json:"reason,omitempty"` + FallthroughAssignments []*resolverevents.FallthroughAssignment `protobuf:"bytes,9,rep,name=fallthrough_assignments,json=fallthroughAssignments,proto3" json:"fallthrough_assignments,omitempty"` + AssignmentId string `protobuf:"bytes,8,opt,name=assignment_id,json=assignmentId,proto3" json:"assignment_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveTokenV1_AssignedFlag) Reset() { + *x = ResolveTokenV1_AssignedFlag{} + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveTokenV1_AssignedFlag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveTokenV1_AssignedFlag) ProtoMessage() {} + +func (x *ResolveTokenV1_AssignedFlag) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveTokenV1_AssignedFlag.ProtoReflect.Descriptor instead. +func (*ResolveTokenV1_AssignedFlag) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_internal_api_proto_rawDescGZIP(), []int{6, 1} +} + +func (x *ResolveTokenV1_AssignedFlag) GetFlag() string { + if x != nil { + return x.Flag + } + return "" +} + +func (x *ResolveTokenV1_AssignedFlag) GetTargetingKey() string { + if x != nil { + return x.TargetingKey + } + return "" +} + +func (x *ResolveTokenV1_AssignedFlag) GetTargetingKeySelector() string { + if x != nil { + return x.TargetingKeySelector + } + return "" +} + +func (x *ResolveTokenV1_AssignedFlag) GetSegment() string { + if x != nil { + return x.Segment + } + return "" +} + +func (x *ResolveTokenV1_AssignedFlag) GetVariant() string { + if x != nil { + return x.Variant + } + return "" +} + +func (x *ResolveTokenV1_AssignedFlag) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *ResolveTokenV1_AssignedFlag) GetReason() resolvertypes.ResolveReason { + if x != nil { + return x.Reason + } + return resolvertypes.ResolveReason(0) +} + +func (x *ResolveTokenV1_AssignedFlag) GetFallthroughAssignments() []*resolverevents.FallthroughAssignment { + if x != nil { + return x.FallthroughAssignments + } + return nil +} + +func (x *ResolveTokenV1_AssignedFlag) GetAssignmentId() string { + if x != nil { + return x.AssignmentId + } + return "" +} + +var File_confidence_flags_resolver_v1_internal_api_proto protoreflect.FileDescriptor + +const file_confidence_flags_resolver_v1_internal_api_proto_rawDesc = "" + + "\n" + + "/confidence/flags/resolver/v1/internal_api.proto\x12\x1cconfidence.flags.resolver.v1\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/visibility.proto\x1a%confidence/flags/admin/v1/types.proto\x1a(confidence/flags/resolver/v1/types.proto\x1a0confidence/flags/resolver/v1/events/events.proto\x1a\x1dconfidence/auth/v1/auth.proto\x1a confidence/api/annotations.proto\x1a-confidence/flags/admin/v1/events/events.proto\"\x90\x03\n" + + "\x14WriteFlagLogsRequest\x12\\\n" + + "\rflag_assigned\x18\x01 \x03(\v21.confidence.flags.resolver.v1.events.FlagAssignedB\x04\xe2A\x01\x01R\fflagAssigned\x12X\n" + + "\x0etelemetry_data\x18\x02 \x01(\v2+.confidence.flags.resolver.v1.TelemetryDataB\x04\xe2A\x01\x01R\rtelemetryData\x12b\n" + + "\x13client_resolve_info\x18\x03 \x03(\v2,.confidence.flags.admin.v1.ClientResolveInfoB\x04\xe2A\x01\x01R\x11clientResolveInfo\x12\\\n" + + "\x11flag_resolve_info\x18\x04 \x03(\v2*.confidence.flags.admin.v1.FlagResolveInfoB\x04\xe2A\x01\x01R\x0fflagResolveInfo\"\x17\n" + + "\x15WriteFlagLogsResponse\"\xd2\x01\n" + + "\x18WriteFlagAssignedRequest\x12\\\n" + + "\rflag_assigned\x18\x01 \x03(\v21.confidence.flags.resolver.v1.events.FlagAssignedB\x04\xe2A\x01\x02R\fflagAssigned\x12X\n" + + "\x0etelemetry_data\x18\x02 \x01(\v2+.confidence.flags.resolver.v1.TelemetryDataB\x04\xe2A\x01\x01R\rtelemetryData\"B\n" + + "\x19WriteFlagAssignedResponse\x12%\n" + + "\x0eassigned_flags\x18\x01 \x01(\x03R\rassignedFlags\"<\n" + + "\rTelemetryData\x12+\n" + + "\x0edropped_events\x18\x01 \x01(\x03B\x04\xe2A\x01\x02R\rdroppedEvents\"j\n" + + "\fResolveToken\x12I\n" + + "\btoken_v1\x18\x01 \x01(\v2,.confidence.flags.resolver.v1.ResolveTokenV1H\x00R\atokenV1B\x0f\n" + + "\rresolve_token\"\x9a\a\n" + + "\x0eResolveTokenV1\x12F\n" + + "\x12evaluation_context\x18\x01 \x01(\v2\x17.google.protobuf.StructR\x11evaluationContext\x12_\n" + + "\vassignments\x18\x02 \x03(\v2=.confidence.flags.resolver.v1.ResolveTokenV1.AssignmentsEntryR\vassignments\x12\x1d\n" + + "\n" + + "resolve_id\x18\x03 \x01(\tR\tresolveId\x12\x18\n" + + "\aaccount\x18\x04 \x01(\tR\aaccount\x1ay\n" + + "\x10AssignmentsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12O\n" + + "\x05value\x18\x02 \x01(\v29.confidence.flags.resolver.v1.ResolveTokenV1.AssignedFlagR\x05value:\x028\x01\x1a\xaa\x04\n" + + "\fAssignedFlag\x122\n" + + "\x04flag\x18\x01 \x01(\tB\x1e\xfaA\x1b\n" + + "\x19flags.confidence.dev/FlagR\x04flag\x12#\n" + + "\rtargeting_key\x18\x02 \x01(\tR\ftargetingKey\x124\n" + + "\x16targeting_key_selector\x18\n" + + " \x01(\tR\x14targetingKeySelector\x12;\n" + + "\asegment\x18\x03 \x01(\tB!\xfaA\x1e\n" + + "\x1cflags.confidence.dev/SegmentR\asegment\x12;\n" + + "\avariant\x18\x04 \x01(\tB!\xfaA\x1e\n" + + "\x1cflags.confidence.dev/VariantR\avariant\x122\n" + + "\x04rule\x18\x05 \x01(\tB\x1e\xfaA\x1b\n" + + "\x19flags.confidence.dev/RuleR\x04rule\x12C\n" + + "\x06reason\x18\x06 \x01(\x0e2+.confidence.flags.resolver.v1.ResolveReasonR\x06reason\x12s\n" + + "\x17fallthrough_assignments\x18\t \x03(\v2:.confidence.flags.resolver.v1.events.FallthroughAssignmentR\x16fallthroughAssignments\x12#\n" + + "\rassignment_id\x18\b \x01(\tR\fassignmentId2\xce\x04\n" + + "\x19InternalFlagLoggerService\x12\x82\x02\n" + + "\x11WriteFlagAssigned\x126.confidence.flags.resolver.v1.WriteFlagAssignedRequest\x1a7.confidence.flags.resolver.v1.WriteFlagAssignedResponse\"|ʇ\xe4\x10(\n" + + "\x02\xf2\x02\"\aaccount*\x17can_write_flag_assigned0\x01\x82\xd3\xe4\x93\x02I:\x01*Z,:\rflag_assigned\"\x1b/v1/flagAssigned:writeArray\"\x16/v1/flagAssigned:write\x12\xc4\x01\n" + + "\rWriteFlagLogs\x122.confidence.flags.resolver.v1.WriteFlagLogsRequest\x1a3.confidence.flags.resolver.v1.WriteFlagLogsResponse\"Jʇ\xe4\x10(\n" + + "\x02\xf2\x02\"\aaccount*\x17can_write_flag_assigned0\x01\x82\xd3\xe4\x93\x02\x17:\x01*\"\x12/v1/flagLogs:write\x1ae\xe2\x87\xe4\x10\x1aresolver.eu.confidence.dev\xe2\x87\xe4\x10\x1aresolver.us.confidence.dev\xea\x87\xe4\x10\x12InternalFlagLogger\xfa\xd2\xe4\x93\x02\n" + + "\x12\bINTERNALB>\n" + + "(com.spotify.confidence.flags.resolver.v1B\x10InternalApiProtoP\x01b\x06proto3" + +var ( + file_confidence_flags_resolver_v1_internal_api_proto_rawDescOnce sync.Once + file_confidence_flags_resolver_v1_internal_api_proto_rawDescData []byte +) + +func file_confidence_flags_resolver_v1_internal_api_proto_rawDescGZIP() []byte { + file_confidence_flags_resolver_v1_internal_api_proto_rawDescOnce.Do(func() { + file_confidence_flags_resolver_v1_internal_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_flags_resolver_v1_internal_api_proto_rawDesc), len(file_confidence_flags_resolver_v1_internal_api_proto_rawDesc))) + }) + return file_confidence_flags_resolver_v1_internal_api_proto_rawDescData +} + +var file_confidence_flags_resolver_v1_internal_api_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_confidence_flags_resolver_v1_internal_api_proto_goTypes = []any{ + (*WriteFlagLogsRequest)(nil), // 0: confidence.flags.resolver.v1.WriteFlagLogsRequest + (*WriteFlagLogsResponse)(nil), // 1: confidence.flags.resolver.v1.WriteFlagLogsResponse + (*WriteFlagAssignedRequest)(nil), // 2: confidence.flags.resolver.v1.WriteFlagAssignedRequest + (*WriteFlagAssignedResponse)(nil), // 3: confidence.flags.resolver.v1.WriteFlagAssignedResponse + (*TelemetryData)(nil), // 4: confidence.flags.resolver.v1.TelemetryData + (*ResolveToken)(nil), // 5: confidence.flags.resolver.v1.ResolveToken + (*ResolveTokenV1)(nil), // 6: confidence.flags.resolver.v1.ResolveTokenV1 + nil, // 7: confidence.flags.resolver.v1.ResolveTokenV1.AssignmentsEntry + (*ResolveTokenV1_AssignedFlag)(nil), // 8: confidence.flags.resolver.v1.ResolveTokenV1.AssignedFlag + (*resolverevents.FlagAssigned)(nil), // 9: confidence.flags.resolver.v1.events.FlagAssigned + (*v1.ClientResolveInfo)(nil), // 10: confidence.flags.admin.v1.ClientResolveInfo + (*v1.FlagResolveInfo)(nil), // 11: confidence.flags.admin.v1.FlagResolveInfo + (*structpb.Struct)(nil), // 12: google.protobuf.Struct + (resolvertypes.ResolveReason)(0), // 13: confidence.flags.resolver.v1.ResolveReason + (*resolverevents.FallthroughAssignment)(nil), // 14: confidence.flags.resolver.v1.events.FallthroughAssignment +} +var file_confidence_flags_resolver_v1_internal_api_proto_depIdxs = []int32{ + 9, // 0: confidence.flags.resolver.v1.WriteFlagLogsRequest.flag_assigned:type_name -> confidence.flags.resolver.v1.events.FlagAssigned + 4, // 1: confidence.flags.resolver.v1.WriteFlagLogsRequest.telemetry_data:type_name -> confidence.flags.resolver.v1.TelemetryData + 10, // 2: confidence.flags.resolver.v1.WriteFlagLogsRequest.client_resolve_info:type_name -> confidence.flags.admin.v1.ClientResolveInfo + 11, // 3: confidence.flags.resolver.v1.WriteFlagLogsRequest.flag_resolve_info:type_name -> confidence.flags.admin.v1.FlagResolveInfo + 9, // 4: confidence.flags.resolver.v1.WriteFlagAssignedRequest.flag_assigned:type_name -> confidence.flags.resolver.v1.events.FlagAssigned + 4, // 5: confidence.flags.resolver.v1.WriteFlagAssignedRequest.telemetry_data:type_name -> confidence.flags.resolver.v1.TelemetryData + 6, // 6: confidence.flags.resolver.v1.ResolveToken.token_v1:type_name -> confidence.flags.resolver.v1.ResolveTokenV1 + 12, // 7: confidence.flags.resolver.v1.ResolveTokenV1.evaluation_context:type_name -> google.protobuf.Struct + 7, // 8: confidence.flags.resolver.v1.ResolveTokenV1.assignments:type_name -> confidence.flags.resolver.v1.ResolveTokenV1.AssignmentsEntry + 8, // 9: confidence.flags.resolver.v1.ResolveTokenV1.AssignmentsEntry.value:type_name -> confidence.flags.resolver.v1.ResolveTokenV1.AssignedFlag + 13, // 10: confidence.flags.resolver.v1.ResolveTokenV1.AssignedFlag.reason:type_name -> confidence.flags.resolver.v1.ResolveReason + 14, // 11: confidence.flags.resolver.v1.ResolveTokenV1.AssignedFlag.fallthrough_assignments:type_name -> confidence.flags.resolver.v1.events.FallthroughAssignment + 2, // 12: confidence.flags.resolver.v1.InternalFlagLoggerService.WriteFlagAssigned:input_type -> confidence.flags.resolver.v1.WriteFlagAssignedRequest + 0, // 13: confidence.flags.resolver.v1.InternalFlagLoggerService.WriteFlagLogs:input_type -> confidence.flags.resolver.v1.WriteFlagLogsRequest + 3, // 14: confidence.flags.resolver.v1.InternalFlagLoggerService.WriteFlagAssigned:output_type -> confidence.flags.resolver.v1.WriteFlagAssignedResponse + 1, // 15: confidence.flags.resolver.v1.InternalFlagLoggerService.WriteFlagLogs:output_type -> confidence.flags.resolver.v1.WriteFlagLogsResponse + 14, // [14:16] is the sub-list for method output_type + 12, // [12:14] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_confidence_flags_resolver_v1_internal_api_proto_init() } +func file_confidence_flags_resolver_v1_internal_api_proto_init() { + if File_confidence_flags_resolver_v1_internal_api_proto != nil { + return + } + file_confidence_flags_resolver_v1_internal_api_proto_msgTypes[5].OneofWrappers = []any{ + (*ResolveToken_TokenV1)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_flags_resolver_v1_internal_api_proto_rawDesc), len(file_confidence_flags_resolver_v1_internal_api_proto_rawDesc)), + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_confidence_flags_resolver_v1_internal_api_proto_goTypes, + DependencyIndexes: file_confidence_flags_resolver_v1_internal_api_proto_depIdxs, + MessageInfos: file_confidence_flags_resolver_v1_internal_api_proto_msgTypes, + }.Build() + File_confidence_flags_resolver_v1_internal_api_proto = out.File + file_confidence_flags_resolver_v1_internal_api_proto_goTypes = nil + file_confidence_flags_resolver_v1_internal_api_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/flags/resolverinternal/internal_api_grpc.pb.go b/openfeature-provider/go/proto/confidence/flags/resolverinternal/internal_api_grpc.pb.go new file mode 100644 index 0000000..525f001 --- /dev/null +++ b/openfeature-provider/go/proto/confidence/flags/resolverinternal/internal_api_grpc.pb.go @@ -0,0 +1,176 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 +// source: confidence/flags/resolver/v1/internal_api.proto + +package resolverinternal + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + InternalFlagLoggerService_WriteFlagAssigned_FullMethodName = "/confidence.flags.resolver.v1.InternalFlagLoggerService/WriteFlagAssigned" + InternalFlagLoggerService_WriteFlagLogs_FullMethodName = "/confidence.flags.resolver.v1.InternalFlagLoggerService/WriteFlagLogs" +) + +// InternalFlagLoggerServiceClient is the client API for InternalFlagLoggerService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type InternalFlagLoggerServiceClient interface { + // Writes flag assignment events. Mostly called from the sidecar resolver. + // (-- api-linter: core::0136::http-uri-suffix=disabled + // + // aip.dev/not-precedent: Disabled because the additional binding. --) + WriteFlagAssigned(ctx context.Context, in *WriteFlagAssignedRequest, opts ...grpc.CallOption) (*WriteFlagAssignedResponse, error) + // Writes flag assignment events and resolve logs together. + // (-- api-linter: core::0136::http-uri-suffix=disabled + // + // aip.dev/not-precedent: Disabled because the additional binding. --) + WriteFlagLogs(ctx context.Context, in *WriteFlagLogsRequest, opts ...grpc.CallOption) (*WriteFlagLogsResponse, error) +} + +type internalFlagLoggerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewInternalFlagLoggerServiceClient(cc grpc.ClientConnInterface) InternalFlagLoggerServiceClient { + return &internalFlagLoggerServiceClient{cc} +} + +func (c *internalFlagLoggerServiceClient) WriteFlagAssigned(ctx context.Context, in *WriteFlagAssignedRequest, opts ...grpc.CallOption) (*WriteFlagAssignedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(WriteFlagAssignedResponse) + err := c.cc.Invoke(ctx, InternalFlagLoggerService_WriteFlagAssigned_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *internalFlagLoggerServiceClient) WriteFlagLogs(ctx context.Context, in *WriteFlagLogsRequest, opts ...grpc.CallOption) (*WriteFlagLogsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(WriteFlagLogsResponse) + err := c.cc.Invoke(ctx, InternalFlagLoggerService_WriteFlagLogs_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InternalFlagLoggerServiceServer is the server API for InternalFlagLoggerService service. +// All implementations must embed UnimplementedInternalFlagLoggerServiceServer +// for forward compatibility. +type InternalFlagLoggerServiceServer interface { + // Writes flag assignment events. Mostly called from the sidecar resolver. + // (-- api-linter: core::0136::http-uri-suffix=disabled + // + // aip.dev/not-precedent: Disabled because the additional binding. --) + WriteFlagAssigned(context.Context, *WriteFlagAssignedRequest) (*WriteFlagAssignedResponse, error) + // Writes flag assignment events and resolve logs together. + // (-- api-linter: core::0136::http-uri-suffix=disabled + // + // aip.dev/not-precedent: Disabled because the additional binding. --) + WriteFlagLogs(context.Context, *WriteFlagLogsRequest) (*WriteFlagLogsResponse, error) + mustEmbedUnimplementedInternalFlagLoggerServiceServer() +} + +// UnimplementedInternalFlagLoggerServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedInternalFlagLoggerServiceServer struct{} + +func (UnimplementedInternalFlagLoggerServiceServer) WriteFlagAssigned(context.Context, *WriteFlagAssignedRequest) (*WriteFlagAssignedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WriteFlagAssigned not implemented") +} +func (UnimplementedInternalFlagLoggerServiceServer) WriteFlagLogs(context.Context, *WriteFlagLogsRequest) (*WriteFlagLogsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WriteFlagLogs not implemented") +} +func (UnimplementedInternalFlagLoggerServiceServer) mustEmbedUnimplementedInternalFlagLoggerServiceServer() { +} +func (UnimplementedInternalFlagLoggerServiceServer) testEmbeddedByValue() {} + +// UnsafeInternalFlagLoggerServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to InternalFlagLoggerServiceServer will +// result in compilation errors. +type UnsafeInternalFlagLoggerServiceServer interface { + mustEmbedUnimplementedInternalFlagLoggerServiceServer() +} + +func RegisterInternalFlagLoggerServiceServer(s grpc.ServiceRegistrar, srv InternalFlagLoggerServiceServer) { + // If the following call pancis, it indicates UnimplementedInternalFlagLoggerServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&InternalFlagLoggerService_ServiceDesc, srv) +} + +func _InternalFlagLoggerService_WriteFlagAssigned_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteFlagAssignedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InternalFlagLoggerServiceServer).WriteFlagAssigned(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InternalFlagLoggerService_WriteFlagAssigned_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InternalFlagLoggerServiceServer).WriteFlagAssigned(ctx, req.(*WriteFlagAssignedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InternalFlagLoggerService_WriteFlagLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteFlagLogsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InternalFlagLoggerServiceServer).WriteFlagLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: InternalFlagLoggerService_WriteFlagLogs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InternalFlagLoggerServiceServer).WriteFlagLogs(ctx, req.(*WriteFlagLogsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// InternalFlagLoggerService_ServiceDesc is the grpc.ServiceDesc for InternalFlagLoggerService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var InternalFlagLoggerService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "confidence.flags.resolver.v1.InternalFlagLoggerService", + HandlerType: (*InternalFlagLoggerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "WriteFlagAssigned", + Handler: _InternalFlagLoggerService_WriteFlagAssigned_Handler, + }, + { + MethodName: "WriteFlagLogs", + Handler: _InternalFlagLoggerService_WriteFlagLogs_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "confidence/flags/resolver/v1/internal_api.proto", +} diff --git a/openfeature-provider/go/proto/confidence/flags/resolvertypes/types.pb.go b/openfeature-provider/go/proto/confidence/flags/resolvertypes/types.pb.go new file mode 100644 index 0000000..4c237a6 --- /dev/null +++ b/openfeature-provider/go/proto/confidence/flags/resolvertypes/types.pb.go @@ -0,0 +1,392 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/flags/resolver/v1/types.proto + +package resolvertypes + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ResolveReason int32 + +const ( + // Unspecified enum. + ResolveReason_RESOLVE_REASON_UNSPECIFIED ResolveReason = 0 + // The flag was successfully resolved because one rule matched. + ResolveReason_RESOLVE_REASON_MATCH ResolveReason = 1 + // The flag could not be resolved because no rule matched. + ResolveReason_RESOLVE_REASON_NO_SEGMENT_MATCH ResolveReason = 2 + // The flag could not be resolved because the matching rule had no variant + // that could be assigned. + // + // Deprecated: Marked as deprecated in confidence/flags/resolver/v1/types.proto. + ResolveReason_RESOLVE_REASON_NO_TREATMENT_MATCH ResolveReason = 3 + // The flag could not be resolved because it was archived. + ResolveReason_RESOLVE_REASON_FLAG_ARCHIVED ResolveReason = 4 + // The flag could not be resolved because the targeting key field was invalid + ResolveReason_RESOLVE_REASON_TARGETING_KEY_ERROR ResolveReason = 5 + // Unknown error occurred during the resolve + ResolveReason_RESOLVE_REASON_ERROR ResolveReason = 6 +) + +// Enum value maps for ResolveReason. +var ( + ResolveReason_name = map[int32]string{ + 0: "RESOLVE_REASON_UNSPECIFIED", + 1: "RESOLVE_REASON_MATCH", + 2: "RESOLVE_REASON_NO_SEGMENT_MATCH", + 3: "RESOLVE_REASON_NO_TREATMENT_MATCH", + 4: "RESOLVE_REASON_FLAG_ARCHIVED", + 5: "RESOLVE_REASON_TARGETING_KEY_ERROR", + 6: "RESOLVE_REASON_ERROR", + } + ResolveReason_value = map[string]int32{ + "RESOLVE_REASON_UNSPECIFIED": 0, + "RESOLVE_REASON_MATCH": 1, + "RESOLVE_REASON_NO_SEGMENT_MATCH": 2, + "RESOLVE_REASON_NO_TREATMENT_MATCH": 3, + "RESOLVE_REASON_FLAG_ARCHIVED": 4, + "RESOLVE_REASON_TARGETING_KEY_ERROR": 5, + "RESOLVE_REASON_ERROR": 6, + } +) + +func (x ResolveReason) Enum() *ResolveReason { + p := new(ResolveReason) + *p = x + return p +} + +func (x ResolveReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ResolveReason) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_flags_resolver_v1_types_proto_enumTypes[0].Descriptor() +} + +func (ResolveReason) Type() protoreflect.EnumType { + return &file_confidence_flags_resolver_v1_types_proto_enumTypes[0] +} + +func (x ResolveReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ResolveReason.Descriptor instead. +func (ResolveReason) EnumDescriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_types_proto_rawDescGZIP(), []int{0} +} + +type SdkId int32 + +const ( + SdkId_SDK_ID_UNSPECIFIED SdkId = 0 + SdkId_SDK_ID_JAVA_PROVIDER SdkId = 1 + SdkId_SDK_ID_KOTLIN_PROVIDER SdkId = 2 + SdkId_SDK_ID_SWIFT_PROVIDER SdkId = 3 + SdkId_SDK_ID_JS_WEB_PROVIDER SdkId = 4 + SdkId_SDK_ID_JS_SERVER_PROVIDER SdkId = 5 + SdkId_SDK_ID_PYTHON_PROVIDER SdkId = 6 + SdkId_SDK_ID_GO_PROVIDER SdkId = 7 + SdkId_SDK_ID_RUBY_PROVIDER SdkId = 8 + SdkId_SDK_ID_RUST_PROVIDER SdkId = 9 + SdkId_SDK_ID_JAVA_CONFIDENCE SdkId = 10 + SdkId_SDK_ID_KOTLIN_CONFIDENCE SdkId = 11 + SdkId_SDK_ID_SWIFT_CONFIDENCE SdkId = 12 + SdkId_SDK_ID_JS_CONFIDENCE SdkId = 13 + SdkId_SDK_ID_PYTHON_CONFIDENCE SdkId = 14 + SdkId_SDK_ID_GO_CONFIDENCE SdkId = 15 + SdkId_SDK_ID_RUST_CONFIDENCE SdkId = 16 + SdkId_SDK_ID_FLUTTER_IOS_CONFIDENCE SdkId = 17 + SdkId_SDK_ID_FLUTTER_ANDROID_CONFIDENCE SdkId = 18 + SdkId_SDK_ID_DOTNET_CONFIDENCE SdkId = 19 +) + +// Enum value maps for SdkId. +var ( + SdkId_name = map[int32]string{ + 0: "SDK_ID_UNSPECIFIED", + 1: "SDK_ID_JAVA_PROVIDER", + 2: "SDK_ID_KOTLIN_PROVIDER", + 3: "SDK_ID_SWIFT_PROVIDER", + 4: "SDK_ID_JS_WEB_PROVIDER", + 5: "SDK_ID_JS_SERVER_PROVIDER", + 6: "SDK_ID_PYTHON_PROVIDER", + 7: "SDK_ID_GO_PROVIDER", + 8: "SDK_ID_RUBY_PROVIDER", + 9: "SDK_ID_RUST_PROVIDER", + 10: "SDK_ID_JAVA_CONFIDENCE", + 11: "SDK_ID_KOTLIN_CONFIDENCE", + 12: "SDK_ID_SWIFT_CONFIDENCE", + 13: "SDK_ID_JS_CONFIDENCE", + 14: "SDK_ID_PYTHON_CONFIDENCE", + 15: "SDK_ID_GO_CONFIDENCE", + 16: "SDK_ID_RUST_CONFIDENCE", + 17: "SDK_ID_FLUTTER_IOS_CONFIDENCE", + 18: "SDK_ID_FLUTTER_ANDROID_CONFIDENCE", + 19: "SDK_ID_DOTNET_CONFIDENCE", + } + SdkId_value = map[string]int32{ + "SDK_ID_UNSPECIFIED": 0, + "SDK_ID_JAVA_PROVIDER": 1, + "SDK_ID_KOTLIN_PROVIDER": 2, + "SDK_ID_SWIFT_PROVIDER": 3, + "SDK_ID_JS_WEB_PROVIDER": 4, + "SDK_ID_JS_SERVER_PROVIDER": 5, + "SDK_ID_PYTHON_PROVIDER": 6, + "SDK_ID_GO_PROVIDER": 7, + "SDK_ID_RUBY_PROVIDER": 8, + "SDK_ID_RUST_PROVIDER": 9, + "SDK_ID_JAVA_CONFIDENCE": 10, + "SDK_ID_KOTLIN_CONFIDENCE": 11, + "SDK_ID_SWIFT_CONFIDENCE": 12, + "SDK_ID_JS_CONFIDENCE": 13, + "SDK_ID_PYTHON_CONFIDENCE": 14, + "SDK_ID_GO_CONFIDENCE": 15, + "SDK_ID_RUST_CONFIDENCE": 16, + "SDK_ID_FLUTTER_IOS_CONFIDENCE": 17, + "SDK_ID_FLUTTER_ANDROID_CONFIDENCE": 18, + "SDK_ID_DOTNET_CONFIDENCE": 19, + } +) + +func (x SdkId) Enum() *SdkId { + p := new(SdkId) + *p = x + return p +} + +func (x SdkId) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SdkId) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_flags_resolver_v1_types_proto_enumTypes[1].Descriptor() +} + +func (SdkId) Type() protoreflect.EnumType { + return &file_confidence_flags_resolver_v1_types_proto_enumTypes[1] +} + +func (x SdkId) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SdkId.Descriptor instead. +func (SdkId) EnumDescriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_types_proto_rawDescGZIP(), []int{1} +} + +// (-- api-linter: core::0123::resource-annotation=disabled +// +// aip.dev/not-precedent: SDKs are not internal Confidence resources. --) +type Sdk struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Identifier of the SDK used to interact with the API. + // + // Types that are valid to be assigned to Sdk: + // + // *Sdk_Id + // *Sdk_CustomId + Sdk isSdk_Sdk `protobuf_oneof:"sdk"` + // Version of the SDK. + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Sdk) Reset() { + *x = Sdk{} + mi := &file_confidence_flags_resolver_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Sdk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Sdk) ProtoMessage() {} + +func (x *Sdk) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Sdk.ProtoReflect.Descriptor instead. +func (*Sdk) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Sdk) GetSdk() isSdk_Sdk { + if x != nil { + return x.Sdk + } + return nil +} + +func (x *Sdk) GetId() SdkId { + if x != nil { + if x, ok := x.Sdk.(*Sdk_Id); ok { + return x.Id + } + } + return SdkId_SDK_ID_UNSPECIFIED +} + +func (x *Sdk) GetCustomId() string { + if x != nil { + if x, ok := x.Sdk.(*Sdk_CustomId); ok { + return x.CustomId + } + } + return "" +} + +func (x *Sdk) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type isSdk_Sdk interface { + isSdk_Sdk() +} + +type Sdk_Id struct { + // Name of a Confidence SDKs. + Id SdkId `protobuf:"varint,1,opt,name=id,proto3,enum=confidence.flags.resolver.v1.SdkId,oneof"` +} + +type Sdk_CustomId struct { + // Custom name for non-Confidence SDKs. + CustomId string `protobuf:"bytes,2,opt,name=custom_id,json=customId,proto3,oneof"` +} + +func (*Sdk_Id) isSdk_Sdk() {} + +func (*Sdk_CustomId) isSdk_Sdk() {} + +var File_confidence_flags_resolver_v1_types_proto protoreflect.FileDescriptor + +const file_confidence_flags_resolver_v1_types_proto_rawDesc = "" + + "\n" + + "(confidence/flags/resolver/v1/types.proto\x12\x1cconfidence.flags.resolver.v1\x1a\x1fgoogle/api/field_behavior.proto\"\x82\x01\n" + + "\x03Sdk\x125\n" + + "\x02id\x18\x01 \x01(\x0e2#.confidence.flags.resolver.v1.SdkIdH\x00R\x02id\x12\x1d\n" + + "\tcustom_id\x18\x02 \x01(\tH\x00R\bcustomId\x12\x1e\n" + + "\aversion\x18\x03 \x01(\tB\x04\xe2A\x01\x01R\aversionB\x05\n" + + "\x03sdk*\xfd\x01\n" + + "\rResolveReason\x12\x1e\n" + + "\x1aRESOLVE_REASON_UNSPECIFIED\x10\x00\x12\x18\n" + + "\x14RESOLVE_REASON_MATCH\x10\x01\x12#\n" + + "\x1fRESOLVE_REASON_NO_SEGMENT_MATCH\x10\x02\x12)\n" + + "!RESOLVE_REASON_NO_TREATMENT_MATCH\x10\x03\x1a\x02\b\x01\x12 \n" + + "\x1cRESOLVE_REASON_FLAG_ARCHIVED\x10\x04\x12&\n" + + "\"RESOLVE_REASON_TARGETING_KEY_ERROR\x10\x05\x12\x18\n" + + "\x14RESOLVE_REASON_ERROR\x10\x06*\xc0\x04\n" + + "\x05SdkId\x12\x16\n" + + "\x12SDK_ID_UNSPECIFIED\x10\x00\x12\x18\n" + + "\x14SDK_ID_JAVA_PROVIDER\x10\x01\x12\x1a\n" + + "\x16SDK_ID_KOTLIN_PROVIDER\x10\x02\x12\x19\n" + + "\x15SDK_ID_SWIFT_PROVIDER\x10\x03\x12\x1a\n" + + "\x16SDK_ID_JS_WEB_PROVIDER\x10\x04\x12\x1d\n" + + "\x19SDK_ID_JS_SERVER_PROVIDER\x10\x05\x12\x1a\n" + + "\x16SDK_ID_PYTHON_PROVIDER\x10\x06\x12\x16\n" + + "\x12SDK_ID_GO_PROVIDER\x10\a\x12\x18\n" + + "\x14SDK_ID_RUBY_PROVIDER\x10\b\x12\x18\n" + + "\x14SDK_ID_RUST_PROVIDER\x10\t\x12\x1a\n" + + "\x16SDK_ID_JAVA_CONFIDENCE\x10\n" + + "\x12\x1c\n" + + "\x18SDK_ID_KOTLIN_CONFIDENCE\x10\v\x12\x1b\n" + + "\x17SDK_ID_SWIFT_CONFIDENCE\x10\f\x12\x18\n" + + "\x14SDK_ID_JS_CONFIDENCE\x10\r\x12\x1c\n" + + "\x18SDK_ID_PYTHON_CONFIDENCE\x10\x0e\x12\x18\n" + + "\x14SDK_ID_GO_CONFIDENCE\x10\x0f\x12\x1a\n" + + "\x16SDK_ID_RUST_CONFIDENCE\x10\x10\x12!\n" + + "\x1dSDK_ID_FLUTTER_IOS_CONFIDENCE\x10\x11\x12%\n" + + "!SDK_ID_FLUTTER_ANDROID_CONFIDENCE\x10\x12\x12\x1c\n" + + "\x18SDK_ID_DOTNET_CONFIDENCE\x10\x13B8\n" + + "(com.spotify.confidence.flags.resolver.v1B\n" + + "TypesProtoP\x01b\x06proto3" + +var ( + file_confidence_flags_resolver_v1_types_proto_rawDescOnce sync.Once + file_confidence_flags_resolver_v1_types_proto_rawDescData []byte +) + +func file_confidence_flags_resolver_v1_types_proto_rawDescGZIP() []byte { + file_confidence_flags_resolver_v1_types_proto_rawDescOnce.Do(func() { + file_confidence_flags_resolver_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_flags_resolver_v1_types_proto_rawDesc), len(file_confidence_flags_resolver_v1_types_proto_rawDesc))) + }) + return file_confidence_flags_resolver_v1_types_proto_rawDescData +} + +var file_confidence_flags_resolver_v1_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_confidence_flags_resolver_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_confidence_flags_resolver_v1_types_proto_goTypes = []any{ + (ResolveReason)(0), // 0: confidence.flags.resolver.v1.ResolveReason + (SdkId)(0), // 1: confidence.flags.resolver.v1.SdkId + (*Sdk)(nil), // 2: confidence.flags.resolver.v1.Sdk +} +var file_confidence_flags_resolver_v1_types_proto_depIdxs = []int32{ + 1, // 0: confidence.flags.resolver.v1.Sdk.id:type_name -> confidence.flags.resolver.v1.SdkId + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_confidence_flags_resolver_v1_types_proto_init() } +func file_confidence_flags_resolver_v1_types_proto_init() { + if File_confidence_flags_resolver_v1_types_proto != nil { + return + } + file_confidence_flags_resolver_v1_types_proto_msgTypes[0].OneofWrappers = []any{ + (*Sdk_Id)(nil), + (*Sdk_CustomId)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_flags_resolver_v1_types_proto_rawDesc), len(file_confidence_flags_resolver_v1_types_proto_rawDesc)), + NumEnums: 2, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_confidence_flags_resolver_v1_types_proto_goTypes, + DependencyIndexes: file_confidence_flags_resolver_v1_types_proto_depIdxs, + EnumInfos: file_confidence_flags_resolver_v1_types_proto_enumTypes, + MessageInfos: file_confidence_flags_resolver_v1_types_proto_msgTypes, + }.Build() + File_confidence_flags_resolver_v1_types_proto = out.File + file_confidence_flags_resolver_v1_types_proto_goTypes = nil + file_confidence_flags_resolver_v1_types_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/flags/types/v1/target.pb.go b/openfeature-provider/go/proto/confidence/flags/types/v1/target.pb.go new file mode 100644 index 0000000..60e518c --- /dev/null +++ b/openfeature-provider/go/proto/confidence/flags/types/v1/target.pb.go @@ -0,0 +1,1357 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/flags/types/v1/target.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Targeting struct { + state protoimpl.MessageState `protogen:"open.v1"` + Criteria map[string]*Targeting_Criterion `protobuf:"bytes,1,rep,name=criteria,proto3" json:"criteria,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Expression *Expression `protobuf:"bytes,2,opt,name=expression,proto3" json:"expression,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting) Reset() { + *x = Targeting{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting) ProtoMessage() {} + +func (x *Targeting) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting.ProtoReflect.Descriptor instead. +func (*Targeting) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0} +} + +func (x *Targeting) GetCriteria() map[string]*Targeting_Criterion { + if x != nil { + return x.Criteria + } + return nil +} + +func (x *Targeting) GetExpression() *Expression { + if x != nil { + return x.Expression + } + return nil +} + +// A boolean expression with leaf nodes that reference criteria elements +type Expression struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Expression: + // + // *Expression_Ref + // *Expression_Not + // *Expression_And + // *Expression_Or + Expression isExpression_Expression `protobuf_oneof:"expression"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Expression) Reset() { + *x = Expression{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Expression) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Expression) ProtoMessage() {} + +func (x *Expression) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Expression.ProtoReflect.Descriptor instead. +func (*Expression) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{1} +} + +func (x *Expression) GetExpression() isExpression_Expression { + if x != nil { + return x.Expression + } + return nil +} + +func (x *Expression) GetRef() string { + if x != nil { + if x, ok := x.Expression.(*Expression_Ref); ok { + return x.Ref + } + } + return "" +} + +func (x *Expression) GetNot() *Expression { + if x != nil { + if x, ok := x.Expression.(*Expression_Not); ok { + return x.Not + } + } + return nil +} + +func (x *Expression) GetAnd() *Expression_Operands { + if x != nil { + if x, ok := x.Expression.(*Expression_And); ok { + return x.And + } + } + return nil +} + +func (x *Expression) GetOr() *Expression_Operands { + if x != nil { + if x, ok := x.Expression.(*Expression_Or); ok { + return x.Or + } + } + return nil +} + +type isExpression_Expression interface { + isExpression_Expression() +} + +type Expression_Ref struct { + Ref string `protobuf:"bytes,1,opt,name=ref,proto3,oneof"` +} + +type Expression_Not struct { + Not *Expression `protobuf:"bytes,2,opt,name=not,proto3,oneof"` +} + +type Expression_And struct { + And *Expression_Operands `protobuf:"bytes,3,opt,name=and,proto3,oneof"` +} + +type Expression_Or struct { + Or *Expression_Operands `protobuf:"bytes,4,opt,name=or,proto3,oneof"` +} + +func (*Expression_Ref) isExpression_Expression() {} + +func (*Expression_Not) isExpression_Expression() {} + +func (*Expression_And) isExpression_Expression() {} + +func (*Expression_Or) isExpression_Expression() {} + +type Targeting_Criterion struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Criterion: + // + // *Targeting_Criterion_Attribute + // *Targeting_Criterion_Segment + Criterion isTargeting_Criterion_Criterion `protobuf_oneof:"criterion"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_Criterion) Reset() { + *x = Targeting_Criterion{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_Criterion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_Criterion) ProtoMessage() {} + +func (x *Targeting_Criterion) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_Criterion.ProtoReflect.Descriptor instead. +func (*Targeting_Criterion) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Targeting_Criterion) GetCriterion() isTargeting_Criterion_Criterion { + if x != nil { + return x.Criterion + } + return nil +} + +func (x *Targeting_Criterion) GetAttribute() *Targeting_Criterion_AttributeCriterion { + if x != nil { + if x, ok := x.Criterion.(*Targeting_Criterion_Attribute); ok { + return x.Attribute + } + } + return nil +} + +func (x *Targeting_Criterion) GetSegment() *Targeting_Criterion_SegmentCriterion { + if x != nil { + if x, ok := x.Criterion.(*Targeting_Criterion_Segment); ok { + return x.Segment + } + } + return nil +} + +type isTargeting_Criterion_Criterion interface { + isTargeting_Criterion_Criterion() +} + +type Targeting_Criterion_Attribute struct { + Attribute *Targeting_Criterion_AttributeCriterion `protobuf:"bytes,1,opt,name=attribute,proto3,oneof"` +} + +type Targeting_Criterion_Segment struct { + Segment *Targeting_Criterion_SegmentCriterion `protobuf:"bytes,2,opt,name=segment,proto3,oneof"` +} + +func (*Targeting_Criterion_Attribute) isTargeting_Criterion_Criterion() {} + +func (*Targeting_Criterion_Segment) isTargeting_Criterion_Criterion() {} + +// is match if at least one input item matches the inner rule +// is not match if the input list is empty/missing +type Targeting_AnyRule struct { + state protoimpl.MessageState `protogen:"open.v1"` + Rule *Targeting_InnerRule `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_AnyRule) Reset() { + *x = Targeting_AnyRule{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_AnyRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_AnyRule) ProtoMessage() {} + +func (x *Targeting_AnyRule) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_AnyRule.ProtoReflect.Descriptor instead. +func (*Targeting_AnyRule) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *Targeting_AnyRule) GetRule() *Targeting_InnerRule { + if x != nil { + return x.Rule + } + return nil +} + +// is match if each and every input item matches the inner rule +// is also match if the input field is empty/missing +type Targeting_AllRule struct { + state protoimpl.MessageState `protogen:"open.v1"` + Rule *Targeting_InnerRule `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_AllRule) Reset() { + *x = Targeting_AllRule{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_AllRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_AllRule) ProtoMessage() {} + +func (x *Targeting_AllRule) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_AllRule.ProtoReflect.Descriptor instead. +func (*Targeting_AllRule) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 3} +} + +func (x *Targeting_AllRule) GetRule() *Targeting_InnerRule { + if x != nil { + return x.Rule + } + return nil +} + +type Targeting_InnerRule struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Rule: + // + // *Targeting_InnerRule_EqRule + // *Targeting_InnerRule_SetRule + // *Targeting_InnerRule_RangeRule + Rule isTargeting_InnerRule_Rule `protobuf_oneof:"rule"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_InnerRule) Reset() { + *x = Targeting_InnerRule{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_InnerRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_InnerRule) ProtoMessage() {} + +func (x *Targeting_InnerRule) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_InnerRule.ProtoReflect.Descriptor instead. +func (*Targeting_InnerRule) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 4} +} + +func (x *Targeting_InnerRule) GetRule() isTargeting_InnerRule_Rule { + if x != nil { + return x.Rule + } + return nil +} + +func (x *Targeting_InnerRule) GetEqRule() *Targeting_EqRule { + if x != nil { + if x, ok := x.Rule.(*Targeting_InnerRule_EqRule); ok { + return x.EqRule + } + } + return nil +} + +func (x *Targeting_InnerRule) GetSetRule() *Targeting_SetRule { + if x != nil { + if x, ok := x.Rule.(*Targeting_InnerRule_SetRule); ok { + return x.SetRule + } + } + return nil +} + +func (x *Targeting_InnerRule) GetRangeRule() *Targeting_RangeRule { + if x != nil { + if x, ok := x.Rule.(*Targeting_InnerRule_RangeRule); ok { + return x.RangeRule + } + } + return nil +} + +type isTargeting_InnerRule_Rule interface { + isTargeting_InnerRule_Rule() +} + +type Targeting_InnerRule_EqRule struct { + EqRule *Targeting_EqRule `protobuf:"bytes,1,opt,name=eq_rule,json=eqRule,proto3,oneof"` +} + +type Targeting_InnerRule_SetRule struct { + SetRule *Targeting_SetRule `protobuf:"bytes,2,opt,name=set_rule,json=setRule,proto3,oneof"` +} + +type Targeting_InnerRule_RangeRule struct { + RangeRule *Targeting_RangeRule `protobuf:"bytes,3,opt,name=range_rule,json=rangeRule,proto3,oneof"` +} + +func (*Targeting_InnerRule_EqRule) isTargeting_InnerRule_Rule() {} + +func (*Targeting_InnerRule_SetRule) isTargeting_InnerRule_Rule() {} + +func (*Targeting_InnerRule_RangeRule) isTargeting_InnerRule_Rule() {} + +// same as SetRule with a single value +type Targeting_EqRule struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value *Targeting_Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_EqRule) Reset() { + *x = Targeting_EqRule{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_EqRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_EqRule) ProtoMessage() {} + +func (x *Targeting_EqRule) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_EqRule.ProtoReflect.Descriptor instead. +func (*Targeting_EqRule) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 5} +} + +func (x *Targeting_EqRule) GetValue() *Targeting_Value { + if x != nil { + return x.Value + } + return nil +} + +// represents a set of allowed values +// in {a, b, c} -> x == a || x == b || x == c || ... +// not in {a, b} -> x != a && x != b && ... +type Targeting_SetRule struct { + state protoimpl.MessageState `protogen:"open.v1"` + Values []*Targeting_Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_SetRule) Reset() { + *x = Targeting_SetRule{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_SetRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_SetRule) ProtoMessage() {} + +func (x *Targeting_SetRule) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_SetRule.ProtoReflect.Descriptor instead. +func (*Targeting_SetRule) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 6} +} + +func (x *Targeting_SetRule) GetValues() []*Targeting_Value { + if x != nil { + return x.Values + } + return nil +} + +// represents a criteria on a value using inequalities +// closed range start, end -> start <[=] x && x <[=] end +// open end start, ... -> start <[=] x +// open start ..., end -> x <[=] end +type Targeting_RangeRule struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Start: + // + // *Targeting_RangeRule_StartInclusive + // *Targeting_RangeRule_StartExclusive + Start isTargeting_RangeRule_Start `protobuf_oneof:"start"` + // Types that are valid to be assigned to End: + // + // *Targeting_RangeRule_EndInclusive + // *Targeting_RangeRule_EndExclusive + End isTargeting_RangeRule_End `protobuf_oneof:"end"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_RangeRule) Reset() { + *x = Targeting_RangeRule{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_RangeRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_RangeRule) ProtoMessage() {} + +func (x *Targeting_RangeRule) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_RangeRule.ProtoReflect.Descriptor instead. +func (*Targeting_RangeRule) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 7} +} + +func (x *Targeting_RangeRule) GetStart() isTargeting_RangeRule_Start { + if x != nil { + return x.Start + } + return nil +} + +func (x *Targeting_RangeRule) GetStartInclusive() *Targeting_Value { + if x != nil { + if x, ok := x.Start.(*Targeting_RangeRule_StartInclusive); ok { + return x.StartInclusive + } + } + return nil +} + +func (x *Targeting_RangeRule) GetStartExclusive() *Targeting_Value { + if x != nil { + if x, ok := x.Start.(*Targeting_RangeRule_StartExclusive); ok { + return x.StartExclusive + } + } + return nil +} + +func (x *Targeting_RangeRule) GetEnd() isTargeting_RangeRule_End { + if x != nil { + return x.End + } + return nil +} + +func (x *Targeting_RangeRule) GetEndInclusive() *Targeting_Value { + if x != nil { + if x, ok := x.End.(*Targeting_RangeRule_EndInclusive); ok { + return x.EndInclusive + } + } + return nil +} + +func (x *Targeting_RangeRule) GetEndExclusive() *Targeting_Value { + if x != nil { + if x, ok := x.End.(*Targeting_RangeRule_EndExclusive); ok { + return x.EndExclusive + } + } + return nil +} + +type isTargeting_RangeRule_Start interface { + isTargeting_RangeRule_Start() +} + +type Targeting_RangeRule_StartInclusive struct { + StartInclusive *Targeting_Value `protobuf:"bytes,1,opt,name=start_inclusive,json=startInclusive,proto3,oneof"` +} + +type Targeting_RangeRule_StartExclusive struct { + StartExclusive *Targeting_Value `protobuf:"bytes,2,opt,name=start_exclusive,json=startExclusive,proto3,oneof"` +} + +func (*Targeting_RangeRule_StartInclusive) isTargeting_RangeRule_Start() {} + +func (*Targeting_RangeRule_StartExclusive) isTargeting_RangeRule_Start() {} + +type isTargeting_RangeRule_End interface { + isTargeting_RangeRule_End() +} + +type Targeting_RangeRule_EndInclusive struct { + EndInclusive *Targeting_Value `protobuf:"bytes,3,opt,name=end_inclusive,json=endInclusive,proto3,oneof"` +} + +type Targeting_RangeRule_EndExclusive struct { + EndExclusive *Targeting_Value `protobuf:"bytes,4,opt,name=end_exclusive,json=endExclusive,proto3,oneof"` +} + +func (*Targeting_RangeRule_EndInclusive) isTargeting_RangeRule_End() {} + +func (*Targeting_RangeRule_EndExclusive) isTargeting_RangeRule_End() {} + +// equality (==, !=, ∈) defined for all types +// comparison (<, <=, >, >=) defined for number, timestamp, version +type Targeting_Value struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Value: + // + // *Targeting_Value_BoolValue + // *Targeting_Value_NumberValue + // *Targeting_Value_StringValue + // *Targeting_Value_TimestampValue + // *Targeting_Value_VersionValue + // *Targeting_Value_ListValue + Value isTargeting_Value_Value `protobuf_oneof:"value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_Value) Reset() { + *x = Targeting_Value{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_Value) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_Value) ProtoMessage() {} + +func (x *Targeting_Value) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_Value.ProtoReflect.Descriptor instead. +func (*Targeting_Value) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 8} +} + +func (x *Targeting_Value) GetValue() isTargeting_Value_Value { + if x != nil { + return x.Value + } + return nil +} + +func (x *Targeting_Value) GetBoolValue() bool { + if x != nil { + if x, ok := x.Value.(*Targeting_Value_BoolValue); ok { + return x.BoolValue + } + } + return false +} + +func (x *Targeting_Value) GetNumberValue() float64 { + if x != nil { + if x, ok := x.Value.(*Targeting_Value_NumberValue); ok { + return x.NumberValue + } + } + return 0 +} + +func (x *Targeting_Value) GetStringValue() string { + if x != nil { + if x, ok := x.Value.(*Targeting_Value_StringValue); ok { + return x.StringValue + } + } + return "" +} + +func (x *Targeting_Value) GetTimestampValue() *timestamppb.Timestamp { + if x != nil { + if x, ok := x.Value.(*Targeting_Value_TimestampValue); ok { + return x.TimestampValue + } + } + return nil +} + +func (x *Targeting_Value) GetVersionValue() *Targeting_SemanticVersion { + if x != nil { + if x, ok := x.Value.(*Targeting_Value_VersionValue); ok { + return x.VersionValue + } + } + return nil +} + +func (x *Targeting_Value) GetListValue() *Targeting_ListValue { + if x != nil { + if x, ok := x.Value.(*Targeting_Value_ListValue); ok { + return x.ListValue + } + } + return nil +} + +type isTargeting_Value_Value interface { + isTargeting_Value_Value() +} + +type Targeting_Value_BoolValue struct { + BoolValue bool `protobuf:"varint,1,opt,name=bool_value,json=boolValue,proto3,oneof"` +} + +type Targeting_Value_NumberValue struct { + NumberValue float64 `protobuf:"fixed64,7,opt,name=number_value,json=numberValue,proto3,oneof"` +} + +type Targeting_Value_StringValue struct { + StringValue string `protobuf:"bytes,4,opt,name=string_value,json=stringValue,proto3,oneof"` +} + +type Targeting_Value_TimestampValue struct { + TimestampValue *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp_value,json=timestampValue,proto3,oneof"` +} + +type Targeting_Value_VersionValue struct { + VersionValue *Targeting_SemanticVersion `protobuf:"bytes,6,opt,name=version_value,json=versionValue,proto3,oneof"` +} + +type Targeting_Value_ListValue struct { + ListValue *Targeting_ListValue `protobuf:"bytes,8,opt,name=list_value,json=listValue,proto3,oneof"` +} + +func (*Targeting_Value_BoolValue) isTargeting_Value_Value() {} + +func (*Targeting_Value_NumberValue) isTargeting_Value_Value() {} + +func (*Targeting_Value_StringValue) isTargeting_Value_Value() {} + +func (*Targeting_Value_TimestampValue) isTargeting_Value_Value() {} + +func (*Targeting_Value_VersionValue) isTargeting_Value_Value() {} + +func (*Targeting_Value_ListValue) isTargeting_Value_Value() {} + +type Targeting_ListValue struct { + state protoimpl.MessageState `protogen:"open.v1"` + Values []*Targeting_Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_ListValue) Reset() { + *x = Targeting_ListValue{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_ListValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_ListValue) ProtoMessage() {} + +func (x *Targeting_ListValue) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_ListValue.ProtoReflect.Descriptor instead. +func (*Targeting_ListValue) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 9} +} + +func (x *Targeting_ListValue) GetValues() []*Targeting_Value { + if x != nil { + return x.Values + } + return nil +} + +type Targeting_SemanticVersion struct { + state protoimpl.MessageState `protogen:"open.v1"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_SemanticVersion) Reset() { + *x = Targeting_SemanticVersion{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_SemanticVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_SemanticVersion) ProtoMessage() {} + +func (x *Targeting_SemanticVersion) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_SemanticVersion.ProtoReflect.Descriptor instead. +func (*Targeting_SemanticVersion) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 10} +} + +func (x *Targeting_SemanticVersion) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type Targeting_Criterion_AttributeCriterion struct { + state protoimpl.MessageState `protogen:"open.v1"` + AttributeName string `protobuf:"bytes,1,opt,name=attribute_name,json=attributeName,proto3" json:"attribute_name,omitempty"` + // Types that are valid to be assigned to Rule: + // + // *Targeting_Criterion_AttributeCriterion_EqRule + // *Targeting_Criterion_AttributeCriterion_SetRule + // *Targeting_Criterion_AttributeCriterion_RangeRule + // *Targeting_Criterion_AttributeCriterion_AnyRule + // *Targeting_Criterion_AttributeCriterion_AllRule + Rule isTargeting_Criterion_AttributeCriterion_Rule `protobuf_oneof:"rule"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_Criterion_AttributeCriterion) Reset() { + *x = Targeting_Criterion_AttributeCriterion{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_Criterion_AttributeCriterion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_Criterion_AttributeCriterion) ProtoMessage() {} + +func (x *Targeting_Criterion_AttributeCriterion) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_Criterion_AttributeCriterion.ProtoReflect.Descriptor instead. +func (*Targeting_Criterion_AttributeCriterion) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 1, 0} +} + +func (x *Targeting_Criterion_AttributeCriterion) GetAttributeName() string { + if x != nil { + return x.AttributeName + } + return "" +} + +func (x *Targeting_Criterion_AttributeCriterion) GetRule() isTargeting_Criterion_AttributeCriterion_Rule { + if x != nil { + return x.Rule + } + return nil +} + +func (x *Targeting_Criterion_AttributeCriterion) GetEqRule() *Targeting_EqRule { + if x != nil { + if x, ok := x.Rule.(*Targeting_Criterion_AttributeCriterion_EqRule); ok { + return x.EqRule + } + } + return nil +} + +func (x *Targeting_Criterion_AttributeCriterion) GetSetRule() *Targeting_SetRule { + if x != nil { + if x, ok := x.Rule.(*Targeting_Criterion_AttributeCriterion_SetRule); ok { + return x.SetRule + } + } + return nil +} + +func (x *Targeting_Criterion_AttributeCriterion) GetRangeRule() *Targeting_RangeRule { + if x != nil { + if x, ok := x.Rule.(*Targeting_Criterion_AttributeCriterion_RangeRule); ok { + return x.RangeRule + } + } + return nil +} + +func (x *Targeting_Criterion_AttributeCriterion) GetAnyRule() *Targeting_AnyRule { + if x != nil { + if x, ok := x.Rule.(*Targeting_Criterion_AttributeCriterion_AnyRule); ok { + return x.AnyRule + } + } + return nil +} + +func (x *Targeting_Criterion_AttributeCriterion) GetAllRule() *Targeting_AllRule { + if x != nil { + if x, ok := x.Rule.(*Targeting_Criterion_AttributeCriterion_AllRule); ok { + return x.AllRule + } + } + return nil +} + +type isTargeting_Criterion_AttributeCriterion_Rule interface { + isTargeting_Criterion_AttributeCriterion_Rule() +} + +type Targeting_Criterion_AttributeCriterion_EqRule struct { + EqRule *Targeting_EqRule `protobuf:"bytes,2,opt,name=eq_rule,json=eqRule,proto3,oneof"` +} + +type Targeting_Criterion_AttributeCriterion_SetRule struct { + SetRule *Targeting_SetRule `protobuf:"bytes,3,opt,name=set_rule,json=setRule,proto3,oneof"` +} + +type Targeting_Criterion_AttributeCriterion_RangeRule struct { + RangeRule *Targeting_RangeRule `protobuf:"bytes,4,opt,name=range_rule,json=rangeRule,proto3,oneof"` +} + +type Targeting_Criterion_AttributeCriterion_AnyRule struct { + AnyRule *Targeting_AnyRule `protobuf:"bytes,5,opt,name=any_rule,json=anyRule,proto3,oneof"` +} + +type Targeting_Criterion_AttributeCriterion_AllRule struct { + AllRule *Targeting_AllRule `protobuf:"bytes,6,opt,name=all_rule,json=allRule,proto3,oneof"` +} + +func (*Targeting_Criterion_AttributeCriterion_EqRule) isTargeting_Criterion_AttributeCriterion_Rule() { +} + +func (*Targeting_Criterion_AttributeCriterion_SetRule) isTargeting_Criterion_AttributeCriterion_Rule() { +} + +func (*Targeting_Criterion_AttributeCriterion_RangeRule) isTargeting_Criterion_AttributeCriterion_Rule() { +} + +func (*Targeting_Criterion_AttributeCriterion_AnyRule) isTargeting_Criterion_AttributeCriterion_Rule() { +} + +func (*Targeting_Criterion_AttributeCriterion_AllRule) isTargeting_Criterion_AttributeCriterion_Rule() { +} + +type Targeting_Criterion_SegmentCriterion struct { + state protoimpl.MessageState `protogen:"open.v1"` + Segment string `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Targeting_Criterion_SegmentCriterion) Reset() { + *x = Targeting_Criterion_SegmentCriterion{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Targeting_Criterion_SegmentCriterion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Targeting_Criterion_SegmentCriterion) ProtoMessage() {} + +func (x *Targeting_Criterion_SegmentCriterion) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Targeting_Criterion_SegmentCriterion.ProtoReflect.Descriptor instead. +func (*Targeting_Criterion_SegmentCriterion) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{0, 1, 1} +} + +func (x *Targeting_Criterion_SegmentCriterion) GetSegment() string { + if x != nil { + return x.Segment + } + return "" +} + +type Expression_Operands struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operands []*Expression `protobuf:"bytes,1,rep,name=operands,proto3" json:"operands,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Expression_Operands) Reset() { + *x = Expression_Operands{} + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Expression_Operands) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Expression_Operands) ProtoMessage() {} + +func (x *Expression_Operands) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_target_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Expression_Operands.ProtoReflect.Descriptor instead. +func (*Expression_Operands) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_target_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *Expression_Operands) GetOperands() []*Expression { + if x != nil { + return x.Operands + } + return nil +} + +var File_confidence_flags_types_v1_target_proto protoreflect.FileDescriptor + +const file_confidence_flags_types_v1_target_proto_rawDesc = "" + + "\n" + + "&confidence/flags/types/v1/target.proto\x12\x19confidence.flags.types.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xee\x12\n" + + "\tTargeting\x12N\n" + + "\bcriteria\x18\x01 \x03(\v22.confidence.flags.types.v1.Targeting.CriteriaEntryR\bcriteria\x12E\n" + + "\n" + + "expression\x18\x02 \x01(\v2%.confidence.flags.types.v1.ExpressionR\n" + + "expression\x1ak\n" + + "\rCriteriaEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12D\n" + + "\x05value\x18\x02 \x01(\v2..confidence.flags.types.v1.Targeting.CriterionR\x05value:\x028\x01\x1a\xc6\x05\n" + + "\tCriterion\x12a\n" + + "\tattribute\x18\x01 \x01(\v2A.confidence.flags.types.v1.Targeting.Criterion.AttributeCriterionH\x00R\tattribute\x12[\n" + + "\asegment\x18\x02 \x01(\v2?.confidence.flags.types.v1.Targeting.Criterion.SegmentCriterionH\x00R\asegment\x1a\xbd\x03\n" + + "\x12AttributeCriterion\x12%\n" + + "\x0eattribute_name\x18\x01 \x01(\tR\rattributeName\x12F\n" + + "\aeq_rule\x18\x02 \x01(\v2+.confidence.flags.types.v1.Targeting.EqRuleH\x00R\x06eqRule\x12I\n" + + "\bset_rule\x18\x03 \x01(\v2,.confidence.flags.types.v1.Targeting.SetRuleH\x00R\asetRule\x12O\n" + + "\n" + + "range_rule\x18\x04 \x01(\v2..confidence.flags.types.v1.Targeting.RangeRuleH\x00R\trangeRule\x12I\n" + + "\bany_rule\x18\x05 \x01(\v2,.confidence.flags.types.v1.Targeting.AnyRuleH\x00R\aanyRule\x12I\n" + + "\ball_rule\x18\x06 \x01(\v2,.confidence.flags.types.v1.Targeting.AllRuleH\x00R\aallRuleB\x06\n" + + "\x04rule\x1a,\n" + + "\x10SegmentCriterion\x12\x18\n" + + "\asegment\x18\x01 \x01(\tR\asegmentB\v\n" + + "\tcriterion\x1aM\n" + + "\aAnyRule\x12B\n" + + "\x04rule\x18\x01 \x01(\v2..confidence.flags.types.v1.Targeting.InnerRuleR\x04rule\x1aM\n" + + "\aAllRule\x12B\n" + + "\x04rule\x18\x01 \x01(\v2..confidence.flags.types.v1.Targeting.InnerRuleR\x04rule\x1a\xf7\x01\n" + + "\tInnerRule\x12F\n" + + "\aeq_rule\x18\x01 \x01(\v2+.confidence.flags.types.v1.Targeting.EqRuleH\x00R\x06eqRule\x12I\n" + + "\bset_rule\x18\x02 \x01(\v2,.confidence.flags.types.v1.Targeting.SetRuleH\x00R\asetRule\x12O\n" + + "\n" + + "range_rule\x18\x03 \x01(\v2..confidence.flags.types.v1.Targeting.RangeRuleH\x00R\trangeRuleB\x06\n" + + "\x04rule\x1aJ\n" + + "\x06EqRule\x12@\n" + + "\x05value\x18\x01 \x01(\v2*.confidence.flags.types.v1.Targeting.ValueR\x05value\x1aM\n" + + "\aSetRule\x12B\n" + + "\x06values\x18\x01 \x03(\v2*.confidence.flags.types.v1.Targeting.ValueR\x06values\x1a\xef\x02\n" + + "\tRangeRule\x12U\n" + + "\x0fstart_inclusive\x18\x01 \x01(\v2*.confidence.flags.types.v1.Targeting.ValueH\x00R\x0estartInclusive\x12U\n" + + "\x0fstart_exclusive\x18\x02 \x01(\v2*.confidence.flags.types.v1.Targeting.ValueH\x00R\x0estartExclusive\x12Q\n" + + "\rend_inclusive\x18\x03 \x01(\v2*.confidence.flags.types.v1.Targeting.ValueH\x01R\fendInclusive\x12Q\n" + + "\rend_exclusive\x18\x04 \x01(\v2*.confidence.flags.types.v1.Targeting.ValueH\x01R\fendExclusiveB\a\n" + + "\x05startB\x05\n" + + "\x03end\x1a\xf0\x02\n" + + "\x05Value\x12\x1f\n" + + "\n" + + "bool_value\x18\x01 \x01(\bH\x00R\tboolValue\x12#\n" + + "\fnumber_value\x18\a \x01(\x01H\x00R\vnumberValue\x12#\n" + + "\fstring_value\x18\x04 \x01(\tH\x00R\vstringValue\x12E\n" + + "\x0ftimestamp_value\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampH\x00R\x0etimestampValue\x12[\n" + + "\rversion_value\x18\x06 \x01(\v24.confidence.flags.types.v1.Targeting.SemanticVersionH\x00R\fversionValue\x12O\n" + + "\n" + + "list_value\x18\b \x01(\v2..confidence.flags.types.v1.Targeting.ListValueH\x00R\tlistValueB\a\n" + + "\x05value\x1aO\n" + + "\tListValue\x12B\n" + + "\x06values\x18\x01 \x03(\v2*.confidence.flags.types.v1.Targeting.ValueR\x06values\x1a+\n" + + "\x0fSemanticVersion\x12\x18\n" + + "\aversion\x18\x01 \x01(\tR\aversion\"\xbe\x02\n" + + "\n" + + "Expression\x12\x12\n" + + "\x03ref\x18\x01 \x01(\tH\x00R\x03ref\x129\n" + + "\x03not\x18\x02 \x01(\v2%.confidence.flags.types.v1.ExpressionH\x00R\x03not\x12B\n" + + "\x03and\x18\x03 \x01(\v2..confidence.flags.types.v1.Expression.OperandsH\x00R\x03and\x12@\n" + + "\x02or\x18\x04 \x01(\v2..confidence.flags.types.v1.Expression.OperandsH\x00R\x02or\x1aM\n" + + "\bOperands\x12A\n" + + "\boperands\x18\x01 \x03(\v2%.confidence.flags.types.v1.ExpressionR\boperandsB\f\n" + + "\n" + + "expressionB9\n" + + "%com.spotify.confidence.flags.types.v1B\x0eTargetingProtoP\x01b\x06proto3" + +var ( + file_confidence_flags_types_v1_target_proto_rawDescOnce sync.Once + file_confidence_flags_types_v1_target_proto_rawDescData []byte +) + +func file_confidence_flags_types_v1_target_proto_rawDescGZIP() []byte { + file_confidence_flags_types_v1_target_proto_rawDescOnce.Do(func() { + file_confidence_flags_types_v1_target_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_flags_types_v1_target_proto_rawDesc), len(file_confidence_flags_types_v1_target_proto_rawDesc))) + }) + return file_confidence_flags_types_v1_target_proto_rawDescData +} + +var file_confidence_flags_types_v1_target_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_confidence_flags_types_v1_target_proto_goTypes = []any{ + (*Targeting)(nil), // 0: confidence.flags.types.v1.Targeting + (*Expression)(nil), // 1: confidence.flags.types.v1.Expression + nil, // 2: confidence.flags.types.v1.Targeting.CriteriaEntry + (*Targeting_Criterion)(nil), // 3: confidence.flags.types.v1.Targeting.Criterion + (*Targeting_AnyRule)(nil), // 4: confidence.flags.types.v1.Targeting.AnyRule + (*Targeting_AllRule)(nil), // 5: confidence.flags.types.v1.Targeting.AllRule + (*Targeting_InnerRule)(nil), // 6: confidence.flags.types.v1.Targeting.InnerRule + (*Targeting_EqRule)(nil), // 7: confidence.flags.types.v1.Targeting.EqRule + (*Targeting_SetRule)(nil), // 8: confidence.flags.types.v1.Targeting.SetRule + (*Targeting_RangeRule)(nil), // 9: confidence.flags.types.v1.Targeting.RangeRule + (*Targeting_Value)(nil), // 10: confidence.flags.types.v1.Targeting.Value + (*Targeting_ListValue)(nil), // 11: confidence.flags.types.v1.Targeting.ListValue + (*Targeting_SemanticVersion)(nil), // 12: confidence.flags.types.v1.Targeting.SemanticVersion + (*Targeting_Criterion_AttributeCriterion)(nil), // 13: confidence.flags.types.v1.Targeting.Criterion.AttributeCriterion + (*Targeting_Criterion_SegmentCriterion)(nil), // 14: confidence.flags.types.v1.Targeting.Criterion.SegmentCriterion + (*Expression_Operands)(nil), // 15: confidence.flags.types.v1.Expression.Operands + (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp +} +var file_confidence_flags_types_v1_target_proto_depIdxs = []int32{ + 2, // 0: confidence.flags.types.v1.Targeting.criteria:type_name -> confidence.flags.types.v1.Targeting.CriteriaEntry + 1, // 1: confidence.flags.types.v1.Targeting.expression:type_name -> confidence.flags.types.v1.Expression + 1, // 2: confidence.flags.types.v1.Expression.not:type_name -> confidence.flags.types.v1.Expression + 15, // 3: confidence.flags.types.v1.Expression.and:type_name -> confidence.flags.types.v1.Expression.Operands + 15, // 4: confidence.flags.types.v1.Expression.or:type_name -> confidence.flags.types.v1.Expression.Operands + 3, // 5: confidence.flags.types.v1.Targeting.CriteriaEntry.value:type_name -> confidence.flags.types.v1.Targeting.Criterion + 13, // 6: confidence.flags.types.v1.Targeting.Criterion.attribute:type_name -> confidence.flags.types.v1.Targeting.Criterion.AttributeCriterion + 14, // 7: confidence.flags.types.v1.Targeting.Criterion.segment:type_name -> confidence.flags.types.v1.Targeting.Criterion.SegmentCriterion + 6, // 8: confidence.flags.types.v1.Targeting.AnyRule.rule:type_name -> confidence.flags.types.v1.Targeting.InnerRule + 6, // 9: confidence.flags.types.v1.Targeting.AllRule.rule:type_name -> confidence.flags.types.v1.Targeting.InnerRule + 7, // 10: confidence.flags.types.v1.Targeting.InnerRule.eq_rule:type_name -> confidence.flags.types.v1.Targeting.EqRule + 8, // 11: confidence.flags.types.v1.Targeting.InnerRule.set_rule:type_name -> confidence.flags.types.v1.Targeting.SetRule + 9, // 12: confidence.flags.types.v1.Targeting.InnerRule.range_rule:type_name -> confidence.flags.types.v1.Targeting.RangeRule + 10, // 13: confidence.flags.types.v1.Targeting.EqRule.value:type_name -> confidence.flags.types.v1.Targeting.Value + 10, // 14: confidence.flags.types.v1.Targeting.SetRule.values:type_name -> confidence.flags.types.v1.Targeting.Value + 10, // 15: confidence.flags.types.v1.Targeting.RangeRule.start_inclusive:type_name -> confidence.flags.types.v1.Targeting.Value + 10, // 16: confidence.flags.types.v1.Targeting.RangeRule.start_exclusive:type_name -> confidence.flags.types.v1.Targeting.Value + 10, // 17: confidence.flags.types.v1.Targeting.RangeRule.end_inclusive:type_name -> confidence.flags.types.v1.Targeting.Value + 10, // 18: confidence.flags.types.v1.Targeting.RangeRule.end_exclusive:type_name -> confidence.flags.types.v1.Targeting.Value + 16, // 19: confidence.flags.types.v1.Targeting.Value.timestamp_value:type_name -> google.protobuf.Timestamp + 12, // 20: confidence.flags.types.v1.Targeting.Value.version_value:type_name -> confidence.flags.types.v1.Targeting.SemanticVersion + 11, // 21: confidence.flags.types.v1.Targeting.Value.list_value:type_name -> confidence.flags.types.v1.Targeting.ListValue + 10, // 22: confidence.flags.types.v1.Targeting.ListValue.values:type_name -> confidence.flags.types.v1.Targeting.Value + 7, // 23: confidence.flags.types.v1.Targeting.Criterion.AttributeCriterion.eq_rule:type_name -> confidence.flags.types.v1.Targeting.EqRule + 8, // 24: confidence.flags.types.v1.Targeting.Criterion.AttributeCriterion.set_rule:type_name -> confidence.flags.types.v1.Targeting.SetRule + 9, // 25: confidence.flags.types.v1.Targeting.Criterion.AttributeCriterion.range_rule:type_name -> confidence.flags.types.v1.Targeting.RangeRule + 4, // 26: confidence.flags.types.v1.Targeting.Criterion.AttributeCriterion.any_rule:type_name -> confidence.flags.types.v1.Targeting.AnyRule + 5, // 27: confidence.flags.types.v1.Targeting.Criterion.AttributeCriterion.all_rule:type_name -> confidence.flags.types.v1.Targeting.AllRule + 1, // 28: confidence.flags.types.v1.Expression.Operands.operands:type_name -> confidence.flags.types.v1.Expression + 29, // [29:29] is the sub-list for method output_type + 29, // [29:29] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name +} + +func init() { file_confidence_flags_types_v1_target_proto_init() } +func file_confidence_flags_types_v1_target_proto_init() { + if File_confidence_flags_types_v1_target_proto != nil { + return + } + file_confidence_flags_types_v1_target_proto_msgTypes[1].OneofWrappers = []any{ + (*Expression_Ref)(nil), + (*Expression_Not)(nil), + (*Expression_And)(nil), + (*Expression_Or)(nil), + } + file_confidence_flags_types_v1_target_proto_msgTypes[3].OneofWrappers = []any{ + (*Targeting_Criterion_Attribute)(nil), + (*Targeting_Criterion_Segment)(nil), + } + file_confidence_flags_types_v1_target_proto_msgTypes[6].OneofWrappers = []any{ + (*Targeting_InnerRule_EqRule)(nil), + (*Targeting_InnerRule_SetRule)(nil), + (*Targeting_InnerRule_RangeRule)(nil), + } + file_confidence_flags_types_v1_target_proto_msgTypes[9].OneofWrappers = []any{ + (*Targeting_RangeRule_StartInclusive)(nil), + (*Targeting_RangeRule_StartExclusive)(nil), + (*Targeting_RangeRule_EndInclusive)(nil), + (*Targeting_RangeRule_EndExclusive)(nil), + } + file_confidence_flags_types_v1_target_proto_msgTypes[10].OneofWrappers = []any{ + (*Targeting_Value_BoolValue)(nil), + (*Targeting_Value_NumberValue)(nil), + (*Targeting_Value_StringValue)(nil), + (*Targeting_Value_TimestampValue)(nil), + (*Targeting_Value_VersionValue)(nil), + (*Targeting_Value_ListValue)(nil), + } + file_confidence_flags_types_v1_target_proto_msgTypes[13].OneofWrappers = []any{ + (*Targeting_Criterion_AttributeCriterion_EqRule)(nil), + (*Targeting_Criterion_AttributeCriterion_SetRule)(nil), + (*Targeting_Criterion_AttributeCriterion_RangeRule)(nil), + (*Targeting_Criterion_AttributeCriterion_AnyRule)(nil), + (*Targeting_Criterion_AttributeCriterion_AllRule)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_flags_types_v1_target_proto_rawDesc), len(file_confidence_flags_types_v1_target_proto_rawDesc)), + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_confidence_flags_types_v1_target_proto_goTypes, + DependencyIndexes: file_confidence_flags_types_v1_target_proto_depIdxs, + MessageInfos: file_confidence_flags_types_v1_target_proto_msgTypes, + }.Build() + File_confidence_flags_types_v1_target_proto = out.File + file_confidence_flags_types_v1_target_proto_goTypes = nil + file_confidence_flags_types_v1_target_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/flags/types/v1/types.pb.go b/openfeature-provider/go/proto/confidence/flags/types/v1/types.pb.go new file mode 100644 index 0000000..8b180b1 --- /dev/null +++ b/openfeature-provider/go/proto/confidence/flags/types/v1/types.pb.go @@ -0,0 +1,540 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/flags/types/v1/types.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Schema for the value of a flag. +// +// The value of a flag is always a struct with one or more nested fields. +// Example of a struct schema with two fields, `color` (a string) and `len` (an int): +// +// ``` +// +// { +// "schema": { +// "color": { +// "stringSchema": {} +// }, +// "len": { +// "intSchema": {} +// } +// } +// } +// +// ``` +type FlagSchema struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to SchemaType: + // + // *FlagSchema_StructSchema + // *FlagSchema_ListSchema + // *FlagSchema_IntSchema + // *FlagSchema_DoubleSchema + // *FlagSchema_StringSchema + // *FlagSchema_BoolSchema + SchemaType isFlagSchema_SchemaType `protobuf_oneof:"schema_type"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagSchema) Reset() { + *x = FlagSchema{} + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagSchema) ProtoMessage() {} + +func (x *FlagSchema) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagSchema.ProtoReflect.Descriptor instead. +func (*FlagSchema) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_types_proto_rawDescGZIP(), []int{0} +} + +func (x *FlagSchema) GetSchemaType() isFlagSchema_SchemaType { + if x != nil { + return x.SchemaType + } + return nil +} + +func (x *FlagSchema) GetStructSchema() *FlagSchema_StructFlagSchema { + if x != nil { + if x, ok := x.SchemaType.(*FlagSchema_StructSchema); ok { + return x.StructSchema + } + } + return nil +} + +func (x *FlagSchema) GetListSchema() *FlagSchema_ListFlagSchema { + if x != nil { + if x, ok := x.SchemaType.(*FlagSchema_ListSchema); ok { + return x.ListSchema + } + } + return nil +} + +func (x *FlagSchema) GetIntSchema() *FlagSchema_IntFlagSchema { + if x != nil { + if x, ok := x.SchemaType.(*FlagSchema_IntSchema); ok { + return x.IntSchema + } + } + return nil +} + +func (x *FlagSchema) GetDoubleSchema() *FlagSchema_DoubleFlagSchema { + if x != nil { + if x, ok := x.SchemaType.(*FlagSchema_DoubleSchema); ok { + return x.DoubleSchema + } + } + return nil +} + +func (x *FlagSchema) GetStringSchema() *FlagSchema_StringFlagSchema { + if x != nil { + if x, ok := x.SchemaType.(*FlagSchema_StringSchema); ok { + return x.StringSchema + } + } + return nil +} + +func (x *FlagSchema) GetBoolSchema() *FlagSchema_BoolFlagSchema { + if x != nil { + if x, ok := x.SchemaType.(*FlagSchema_BoolSchema); ok { + return x.BoolSchema + } + } + return nil +} + +type isFlagSchema_SchemaType interface { + isFlagSchema_SchemaType() +} + +type FlagSchema_StructSchema struct { + // Schema if this is a struct + StructSchema *FlagSchema_StructFlagSchema `protobuf:"bytes,1,opt,name=struct_schema,json=structSchema,proto3,oneof"` +} + +type FlagSchema_ListSchema struct { + // Schema if this is a list + ListSchema *FlagSchema_ListFlagSchema `protobuf:"bytes,2,opt,name=list_schema,json=listSchema,proto3,oneof"` +} + +type FlagSchema_IntSchema struct { + // Schema if this is an int + IntSchema *FlagSchema_IntFlagSchema `protobuf:"bytes,3,opt,name=int_schema,json=intSchema,proto3,oneof"` +} + +type FlagSchema_DoubleSchema struct { + // Schema if this is a double + DoubleSchema *FlagSchema_DoubleFlagSchema `protobuf:"bytes,4,opt,name=double_schema,json=doubleSchema,proto3,oneof"` +} + +type FlagSchema_StringSchema struct { + // Schema if this is a string + StringSchema *FlagSchema_StringFlagSchema `protobuf:"bytes,5,opt,name=string_schema,json=stringSchema,proto3,oneof"` +} + +type FlagSchema_BoolSchema struct { + // Schema if this is a bool + BoolSchema *FlagSchema_BoolFlagSchema `protobuf:"bytes,6,opt,name=bool_schema,json=boolSchema,proto3,oneof"` +} + +func (*FlagSchema_StructSchema) isFlagSchema_SchemaType() {} + +func (*FlagSchema_ListSchema) isFlagSchema_SchemaType() {} + +func (*FlagSchema_IntSchema) isFlagSchema_SchemaType() {} + +func (*FlagSchema_DoubleSchema) isFlagSchema_SchemaType() {} + +func (*FlagSchema_StringSchema) isFlagSchema_SchemaType() {} + +func (*FlagSchema_BoolSchema) isFlagSchema_SchemaType() {} + +// A schema of nested fields. The length of the field name is limited to +// 32 characters and can only contain alphanumeric characters, hyphens and +// underscores. The number of fields in a struct is limited to 64. +// Structs can not be nested more than four (4) levels. +type FlagSchema_StructFlagSchema struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Map of field name to the schema for the field + Schema map[string]*FlagSchema `protobuf:"bytes,1,rep,name=schema,proto3" json:"schema,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagSchema_StructFlagSchema) Reset() { + *x = FlagSchema_StructFlagSchema{} + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagSchema_StructFlagSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagSchema_StructFlagSchema) ProtoMessage() {} + +func (x *FlagSchema_StructFlagSchema) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagSchema_StructFlagSchema.ProtoReflect.Descriptor instead. +func (*FlagSchema_StructFlagSchema) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_types_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *FlagSchema_StructFlagSchema) GetSchema() map[string]*FlagSchema { + if x != nil { + return x.Schema + } + return nil +} + +// A number that has a decimal place. +type FlagSchema_DoubleFlagSchema struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagSchema_DoubleFlagSchema) Reset() { + *x = FlagSchema_DoubleFlagSchema{} + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagSchema_DoubleFlagSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagSchema_DoubleFlagSchema) ProtoMessage() {} + +func (x *FlagSchema_DoubleFlagSchema) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagSchema_DoubleFlagSchema.ProtoReflect.Descriptor instead. +func (*FlagSchema_DoubleFlagSchema) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_types_proto_rawDescGZIP(), []int{0, 1} +} + +// A whole number without a decimal point. +type FlagSchema_IntFlagSchema struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagSchema_IntFlagSchema) Reset() { + *x = FlagSchema_IntFlagSchema{} + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagSchema_IntFlagSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagSchema_IntFlagSchema) ProtoMessage() {} + +func (x *FlagSchema_IntFlagSchema) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagSchema_IntFlagSchema.ProtoReflect.Descriptor instead. +func (*FlagSchema_IntFlagSchema) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_types_proto_rawDescGZIP(), []int{0, 2} +} + +// A string. The length is limited to 250 characters. +type FlagSchema_StringFlagSchema struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagSchema_StringFlagSchema) Reset() { + *x = FlagSchema_StringFlagSchema{} + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagSchema_StringFlagSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagSchema_StringFlagSchema) ProtoMessage() {} + +func (x *FlagSchema_StringFlagSchema) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagSchema_StringFlagSchema.ProtoReflect.Descriptor instead. +func (*FlagSchema_StringFlagSchema) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_types_proto_rawDescGZIP(), []int{0, 3} +} + +// A boolean: true or false. +type FlagSchema_BoolFlagSchema struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagSchema_BoolFlagSchema) Reset() { + *x = FlagSchema_BoolFlagSchema{} + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagSchema_BoolFlagSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagSchema_BoolFlagSchema) ProtoMessage() {} + +func (x *FlagSchema_BoolFlagSchema) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagSchema_BoolFlagSchema.ProtoReflect.Descriptor instead. +func (*FlagSchema_BoolFlagSchema) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_types_proto_rawDescGZIP(), []int{0, 4} +} + +// A list of values. The values have the same data types which +// is defined by `element_schema`. +type FlagSchema_ListFlagSchema struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The schema for the elements in the list + ElementSchema *FlagSchema `protobuf:"bytes,1,opt,name=element_schema,json=elementSchema,proto3" json:"element_schema,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagSchema_ListFlagSchema) Reset() { + *x = FlagSchema_ListFlagSchema{} + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagSchema_ListFlagSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagSchema_ListFlagSchema) ProtoMessage() {} + +func (x *FlagSchema_ListFlagSchema) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_types_v1_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagSchema_ListFlagSchema.ProtoReflect.Descriptor instead. +func (*FlagSchema_ListFlagSchema) Descriptor() ([]byte, []int) { + return file_confidence_flags_types_v1_types_proto_rawDescGZIP(), []int{0, 5} +} + +func (x *FlagSchema_ListFlagSchema) GetElementSchema() *FlagSchema { + if x != nil { + return x.ElementSchema + } + return nil +} + +var File_confidence_flags_types_v1_types_proto protoreflect.FileDescriptor + +const file_confidence_flags_types_v1_types_proto_rawDesc = "" + + "\n" + + "%confidence/flags/types/v1/types.proto\x12\x19confidence.flags.types.v1\"\xbe\a\n" + + "\n" + + "FlagSchema\x12]\n" + + "\rstruct_schema\x18\x01 \x01(\v26.confidence.flags.types.v1.FlagSchema.StructFlagSchemaH\x00R\fstructSchema\x12W\n" + + "\vlist_schema\x18\x02 \x01(\v24.confidence.flags.types.v1.FlagSchema.ListFlagSchemaH\x00R\n" + + "listSchema\x12T\n" + + "\n" + + "int_schema\x18\x03 \x01(\v23.confidence.flags.types.v1.FlagSchema.IntFlagSchemaH\x00R\tintSchema\x12]\n" + + "\rdouble_schema\x18\x04 \x01(\v26.confidence.flags.types.v1.FlagSchema.DoubleFlagSchemaH\x00R\fdoubleSchema\x12]\n" + + "\rstring_schema\x18\x05 \x01(\v26.confidence.flags.types.v1.FlagSchema.StringFlagSchemaH\x00R\fstringSchema\x12W\n" + + "\vbool_schema\x18\x06 \x01(\v24.confidence.flags.types.v1.FlagSchema.BoolFlagSchemaH\x00R\n" + + "boolSchema\x1a\xd0\x01\n" + + "\x10StructFlagSchema\x12Z\n" + + "\x06schema\x18\x01 \x03(\v2B.confidence.flags.types.v1.FlagSchema.StructFlagSchema.SchemaEntryR\x06schema\x1a`\n" + + "\vSchemaEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12;\n" + + "\x05value\x18\x02 \x01(\v2%.confidence.flags.types.v1.FlagSchemaR\x05value:\x028\x01\x1a\x12\n" + + "\x10DoubleFlagSchema\x1a\x0f\n" + + "\rIntFlagSchema\x1a\x12\n" + + "\x10StringFlagSchema\x1a\x10\n" + + "\x0eBoolFlagSchema\x1a^\n" + + "\x0eListFlagSchema\x12L\n" + + "\x0eelement_schema\x18\x01 \x01(\v2%.confidence.flags.types.v1.FlagSchemaR\relementSchemaB\r\n" + + "\vschema_typeB5\n" + + "%com.spotify.confidence.flags.types.v1B\n" + + "TypesProtoP\x01b\x06proto3" + +var ( + file_confidence_flags_types_v1_types_proto_rawDescOnce sync.Once + file_confidence_flags_types_v1_types_proto_rawDescData []byte +) + +func file_confidence_flags_types_v1_types_proto_rawDescGZIP() []byte { + file_confidence_flags_types_v1_types_proto_rawDescOnce.Do(func() { + file_confidence_flags_types_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_flags_types_v1_types_proto_rawDesc), len(file_confidence_flags_types_v1_types_proto_rawDesc))) + }) + return file_confidence_flags_types_v1_types_proto_rawDescData +} + +var file_confidence_flags_types_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_confidence_flags_types_v1_types_proto_goTypes = []any{ + (*FlagSchema)(nil), // 0: confidence.flags.types.v1.FlagSchema + (*FlagSchema_StructFlagSchema)(nil), // 1: confidence.flags.types.v1.FlagSchema.StructFlagSchema + (*FlagSchema_DoubleFlagSchema)(nil), // 2: confidence.flags.types.v1.FlagSchema.DoubleFlagSchema + (*FlagSchema_IntFlagSchema)(nil), // 3: confidence.flags.types.v1.FlagSchema.IntFlagSchema + (*FlagSchema_StringFlagSchema)(nil), // 4: confidence.flags.types.v1.FlagSchema.StringFlagSchema + (*FlagSchema_BoolFlagSchema)(nil), // 5: confidence.flags.types.v1.FlagSchema.BoolFlagSchema + (*FlagSchema_ListFlagSchema)(nil), // 6: confidence.flags.types.v1.FlagSchema.ListFlagSchema + nil, // 7: confidence.flags.types.v1.FlagSchema.StructFlagSchema.SchemaEntry +} +var file_confidence_flags_types_v1_types_proto_depIdxs = []int32{ + 1, // 0: confidence.flags.types.v1.FlagSchema.struct_schema:type_name -> confidence.flags.types.v1.FlagSchema.StructFlagSchema + 6, // 1: confidence.flags.types.v1.FlagSchema.list_schema:type_name -> confidence.flags.types.v1.FlagSchema.ListFlagSchema + 3, // 2: confidence.flags.types.v1.FlagSchema.int_schema:type_name -> confidence.flags.types.v1.FlagSchema.IntFlagSchema + 2, // 3: confidence.flags.types.v1.FlagSchema.double_schema:type_name -> confidence.flags.types.v1.FlagSchema.DoubleFlagSchema + 4, // 4: confidence.flags.types.v1.FlagSchema.string_schema:type_name -> confidence.flags.types.v1.FlagSchema.StringFlagSchema + 5, // 5: confidence.flags.types.v1.FlagSchema.bool_schema:type_name -> confidence.flags.types.v1.FlagSchema.BoolFlagSchema + 7, // 6: confidence.flags.types.v1.FlagSchema.StructFlagSchema.schema:type_name -> confidence.flags.types.v1.FlagSchema.StructFlagSchema.SchemaEntry + 0, // 7: confidence.flags.types.v1.FlagSchema.ListFlagSchema.element_schema:type_name -> confidence.flags.types.v1.FlagSchema + 0, // 8: confidence.flags.types.v1.FlagSchema.StructFlagSchema.SchemaEntry.value:type_name -> confidence.flags.types.v1.FlagSchema + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_confidence_flags_types_v1_types_proto_init() } +func file_confidence_flags_types_v1_types_proto_init() { + if File_confidence_flags_types_v1_types_proto != nil { + return + } + file_confidence_flags_types_v1_types_proto_msgTypes[0].OneofWrappers = []any{ + (*FlagSchema_StructSchema)(nil), + (*FlagSchema_ListSchema)(nil), + (*FlagSchema_IntSchema)(nil), + (*FlagSchema_DoubleSchema)(nil), + (*FlagSchema_StringSchema)(nil), + (*FlagSchema_BoolSchema)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_flags_types_v1_types_proto_rawDesc), len(file_confidence_flags_types_v1_types_proto_rawDesc)), + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_confidence_flags_types_v1_types_proto_goTypes, + DependencyIndexes: file_confidence_flags_types_v1_types_proto_depIdxs, + MessageInfos: file_confidence_flags_types_v1_types_proto_msgTypes, + }.Build() + File_confidence_flags_types_v1_types_proto = out.File + file_confidence_flags_types_v1_types_proto_goTypes = nil + file_confidence_flags_types_v1_types_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/iam/v1/auth_api.pb.go b/openfeature-provider/go/proto/confidence/iam/v1/auth_api.pb.go new file mode 100644 index 0000000..ee3ad0b --- /dev/null +++ b/openfeature-provider/go/proto/confidence/iam/v1/auth_api.pb.go @@ -0,0 +1,211 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/iam/v1/auth_api.proto + +package v1 + +import ( + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api" + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RequestAccessTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The grant type. Currently only "client_credentials" is supported + GrantType string `protobuf:"bytes,1,opt,name=grant_type,json=grantType,proto3" json:"grant_type,omitempty"` + // The client id of the client to ge the token for + ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // The secret of the client to get the token for + ClientSecret string `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RequestAccessTokenRequest) Reset() { + *x = RequestAccessTokenRequest{} + mi := &file_confidence_iam_v1_auth_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RequestAccessTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestAccessTokenRequest) ProtoMessage() {} + +func (x *RequestAccessTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_auth_api_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestAccessTokenRequest.ProtoReflect.Descriptor instead. +func (*RequestAccessTokenRequest) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_auth_api_proto_rawDescGZIP(), []int{0} +} + +func (x *RequestAccessTokenRequest) GetGrantType() string { + if x != nil { + return x.GrantType + } + return "" +} + +func (x *RequestAccessTokenRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *RequestAccessTokenRequest) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +type AccessToken struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The access token that kan be used to call the api + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + // The ttl of the Access Token token from the time it was issued (in seconds). + ExpiresIn int64 `protobuf:"varint,2,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AccessToken) Reset() { + *x = AccessToken{} + mi := &file_confidence_iam_v1_auth_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AccessToken) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccessToken) ProtoMessage() {} + +func (x *AccessToken) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_auth_api_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccessToken.ProtoReflect.Descriptor instead. +func (*AccessToken) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_auth_api_proto_rawDescGZIP(), []int{1} +} + +func (x *AccessToken) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *AccessToken) GetExpiresIn() int64 { + if x != nil { + return x.ExpiresIn + } + return 0 +} + +var File_confidence_iam_v1_auth_api_proto protoreflect.FileDescriptor + +const file_confidence_iam_v1_auth_api_proto_rawDesc = "" + + "\n" + + " confidence/iam/v1/auth_api.proto\x12\x11confidence.iam.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1dconfidence/auth/v1/auth.proto\x1a confidence/api/annotations.proto\"\x8e\x01\n" + + "\x19RequestAccessTokenRequest\x12#\n" + + "\n" + + "grant_type\x18\x01 \x01(\tB\x04\xe2A\x01\x02R\tgrantType\x12!\n" + + "\tclient_id\x18\x02 \x01(\tB\x04\xe2A\x01\x02R\bclientId\x12)\n" + + "\rclient_secret\x18\x03 \x01(\tB\x04\xe2A\x01\x02R\fclientSecret\"[\n" + + "\vAccessToken\x12'\n" + + "\faccess_token\x18\x01 \x01(\tB\x04\xe2A\x01\x02R\vaccessToken\x12#\n" + + "\n" + + "expires_in\x18\x02 \x01(\x03B\x04\xe2A\x01\x02R\texpiresIn2\xd1\x01\n" + + "\vAuthService\x12\x82\x01\n" + + "\x12RequestAccessToken\x12,.confidence.iam.v1.RequestAccessTokenRequest\x1a\x1e.confidence.iam.v1.AccessToken\"\x1eʇ\xe4\x10\x02\x10\x01\x82\xd3\xe4\x93\x02\x11\"\x0f/v1/oauth/token\x1a=\xe2\x87\xe4\x10\x15iam.eu.confidence.dev\xe2\x87\xe4\x10\x15iam.us.confidence.dev\xea\x87\xe4\x10\x04AuthB/\n" + + "\x1dcom.spotify.confidence.iam.v1B\fAuthApiProtoP\x01b\x06proto3" + +var ( + file_confidence_iam_v1_auth_api_proto_rawDescOnce sync.Once + file_confidence_iam_v1_auth_api_proto_rawDescData []byte +) + +func file_confidence_iam_v1_auth_api_proto_rawDescGZIP() []byte { + file_confidence_iam_v1_auth_api_proto_rawDescOnce.Do(func() { + file_confidence_iam_v1_auth_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_iam_v1_auth_api_proto_rawDesc), len(file_confidence_iam_v1_auth_api_proto_rawDesc))) + }) + return file_confidence_iam_v1_auth_api_proto_rawDescData +} + +var file_confidence_iam_v1_auth_api_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_confidence_iam_v1_auth_api_proto_goTypes = []any{ + (*RequestAccessTokenRequest)(nil), // 0: confidence.iam.v1.RequestAccessTokenRequest + (*AccessToken)(nil), // 1: confidence.iam.v1.AccessToken +} +var file_confidence_iam_v1_auth_api_proto_depIdxs = []int32{ + 0, // 0: confidence.iam.v1.AuthService.RequestAccessToken:input_type -> confidence.iam.v1.RequestAccessTokenRequest + 1, // 1: confidence.iam.v1.AuthService.RequestAccessToken:output_type -> confidence.iam.v1.AccessToken + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_confidence_iam_v1_auth_api_proto_init() } +func file_confidence_iam_v1_auth_api_proto_init() { + if File_confidence_iam_v1_auth_api_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_iam_v1_auth_api_proto_rawDesc), len(file_confidence_iam_v1_auth_api_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_confidence_iam_v1_auth_api_proto_goTypes, + DependencyIndexes: file_confidence_iam_v1_auth_api_proto_depIdxs, + MessageInfos: file_confidence_iam_v1_auth_api_proto_msgTypes, + }.Build() + File_confidence_iam_v1_auth_api_proto = out.File + file_confidence_iam_v1_auth_api_proto_goTypes = nil + file_confidence_iam_v1_auth_api_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/confidence/iam/v1/auth_api_grpc.pb.go b/openfeature-provider/go/proto/confidence/iam/v1/auth_api_grpc.pb.go new file mode 100644 index 0000000..652d21a --- /dev/null +++ b/openfeature-provider/go/proto/confidence/iam/v1/auth_api_grpc.pb.go @@ -0,0 +1,121 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 +// source: confidence/iam/v1/auth_api.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + AuthService_RequestAccessToken_FullMethodName = "/confidence.iam.v1.AuthService/RequestAccessToken" +) + +// AuthServiceClient is the client API for AuthService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AuthServiceClient interface { + RequestAccessToken(ctx context.Context, in *RequestAccessTokenRequest, opts ...grpc.CallOption) (*AccessToken, error) +} + +type authServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient { + return &authServiceClient{cc} +} + +func (c *authServiceClient) RequestAccessToken(ctx context.Context, in *RequestAccessTokenRequest, opts ...grpc.CallOption) (*AccessToken, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AccessToken) + err := c.cc.Invoke(ctx, AuthService_RequestAccessToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthServiceServer is the server API for AuthService service. +// All implementations must embed UnimplementedAuthServiceServer +// for forward compatibility. +type AuthServiceServer interface { + RequestAccessToken(context.Context, *RequestAccessTokenRequest) (*AccessToken, error) + mustEmbedUnimplementedAuthServiceServer() +} + +// UnimplementedAuthServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedAuthServiceServer struct{} + +func (UnimplementedAuthServiceServer) RequestAccessToken(context.Context, *RequestAccessTokenRequest) (*AccessToken, error) { + return nil, status.Errorf(codes.Unimplemented, "method RequestAccessToken not implemented") +} +func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {} +func (UnimplementedAuthServiceServer) testEmbeddedByValue() {} + +// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AuthServiceServer will +// result in compilation errors. +type UnsafeAuthServiceServer interface { + mustEmbedUnimplementedAuthServiceServer() +} + +func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) { + // If the following call pancis, it indicates UnimplementedAuthServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&AuthService_ServiceDesc, srv) +} + +func _AuthService_RequestAccessToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestAccessTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).RequestAccessToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_RequestAccessToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).RequestAccessToken(ctx, req.(*RequestAccessTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AuthService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "confidence.iam.v1.AuthService", + HandlerType: (*AuthServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RequestAccessToken", + Handler: _AuthService_RequestAccessToken_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "confidence/iam/v1/auth_api.proto", +} diff --git a/openfeature-provider/go/proto/confidence/iam/v1/iam.pb.go b/openfeature-provider/go/proto/confidence/iam/v1/iam.pb.go new file mode 100644 index 0000000..128df52 --- /dev/null +++ b/openfeature-provider/go/proto/confidence/iam/v1/iam.pb.go @@ -0,0 +1,1837 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/iam/v1/iam.proto + +package v1 + +import ( + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api" + v1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/emptypb" + _ "google.golang.org/protobuf/types/known/fieldmaskpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The different states that the key can be in. +type CryptoKey_State int32 + +const ( + // State has not been set. + CryptoKey_STATE_UNSPECIFIED CryptoKey_State = 0 + // Key is currently being created. + CryptoKey_CREATING CryptoKey_State = 1 + // Key has been created. + CryptoKey_CREATED CryptoKey_State = 2 + // Key has been deleted. + CryptoKey_DELETED CryptoKey_State = 3 +) + +// Enum value maps for CryptoKey_State. +var ( + CryptoKey_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "CREATING", + 2: "CREATED", + 3: "DELETED", + } + CryptoKey_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "CREATED": 2, + "DELETED": 3, + } +) + +func (x CryptoKey_State) Enum() *CryptoKey_State { + p := new(CryptoKey_State) + *p = x + return p +} + +func (x CryptoKey_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CryptoKey_State) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_iam_v1_iam_proto_enumTypes[0].Descriptor() +} + +func (CryptoKey_State) Type() protoreflect.EnumType { + return &file_confidence_iam_v1_iam_proto_enumTypes[0] +} + +func (x CryptoKey_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CryptoKey_State.Descriptor instead. +func (CryptoKey_State) EnumDescriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{0, 0} +} + +// The kind of key. This controls the crypto used and number of bits of the key. +type CryptoKey_Kind int32 + +const ( + // Kind has not been specified. + CryptoKey_KIND_UNSPECIFIED CryptoKey_Kind = 0 + // This crypto key can be used by Snowflake. + CryptoKey_SNOWFLAKE CryptoKey_Kind = 1 +) + +// Enum value maps for CryptoKey_Kind. +var ( + CryptoKey_Kind_name = map[int32]string{ + 0: "KIND_UNSPECIFIED", + 1: "SNOWFLAKE", + } + CryptoKey_Kind_value = map[string]int32{ + "KIND_UNSPECIFIED": 0, + "SNOWFLAKE": 1, + } +) + +func (x CryptoKey_Kind) Enum() *CryptoKey_Kind { + p := new(CryptoKey_Kind) + *p = x + return p +} + +func (x CryptoKey_Kind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CryptoKey_Kind) Descriptor() protoreflect.EnumDescriptor { + return file_confidence_iam_v1_iam_proto_enumTypes[1].Descriptor() +} + +func (CryptoKey_Kind) Type() protoreflect.EnumType { + return &file_confidence_iam_v1_iam_proto_enumTypes[1] +} + +func (x CryptoKey_Kind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CryptoKey_Kind.Descriptor instead. +func (CryptoKey_Kind) EnumDescriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{0, 1} +} + +// A cryptographic key that can be used by other services. +type CryptoKey struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The name of the crypto key. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Pem encoded public key of this cryptographical key + PublicKey string `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // The kind of key. This controls the crypto used and number of bits of the key. + Kind CryptoKey_Kind `protobuf:"varint,3,opt,name=kind,proto3,enum=confidence.iam.v1.CryptoKey_Kind" json:"kind,omitempty"` + // The current state of the key. + State CryptoKey_State `protobuf:"varint,4,opt,name=state,proto3,enum=confidence.iam.v1.CryptoKey_State" json:"state,omitempty"` + // General labels for this resource. + Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Time when the crypto key was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the crypto key was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this crypto key. + Creator string `protobuf:"bytes,10,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this crypto key. + Updater string `protobuf:"bytes,12,opt,name=updater,proto3" json:"updater,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CryptoKey) Reset() { + *x = CryptoKey{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CryptoKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CryptoKey) ProtoMessage() {} + +func (x *CryptoKey) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CryptoKey.ProtoReflect.Descriptor instead. +func (*CryptoKey) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{0} +} + +func (x *CryptoKey) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CryptoKey) GetPublicKey() string { + if x != nil { + return x.PublicKey + } + return "" +} + +func (x *CryptoKey) GetKind() CryptoKey_Kind { + if x != nil { + return x.Kind + } + return CryptoKey_KIND_UNSPECIFIED +} + +func (x *CryptoKey) GetState() CryptoKey_State { + if x != nil { + return x.State + } + return CryptoKey_STATE_UNSPECIFIED +} + +func (x *CryptoKey) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *CryptoKey) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *CryptoKey) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *CryptoKey) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *CryptoKey) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +// Represents the currently logged in user. +type CurrentUser struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The permissions the user currently has. + Permissions []*PermissionWithScope `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"` + // The current user + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` + // List of accounts that the user is member of. + AccountMemberships []*CurrentUser_AccountMembership `protobuf:"bytes,3,rep,name=account_memberships,json=accountMemberships,proto3" json:"account_memberships,omitempty"` + // The currently logged in account. + Account string `protobuf:"bytes,4,opt,name=account,proto3" json:"account,omitempty"` + // The OAuth2 client id for the service account used by this account. + ServiceAccountOauth2ClientId string `protobuf:"bytes,5,opt,name=service_account_oauth2_client_id,json=serviceAccountOauth2ClientId,proto3" json:"service_account_oauth2_client_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CurrentUser) Reset() { + *x = CurrentUser{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CurrentUser) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CurrentUser) ProtoMessage() {} + +func (x *CurrentUser) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CurrentUser.ProtoReflect.Descriptor instead. +func (*CurrentUser) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{1} +} + +func (x *CurrentUser) GetPermissions() []*PermissionWithScope { + if x != nil { + return x.Permissions + } + return nil +} + +func (x *CurrentUser) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *CurrentUser) GetAccountMemberships() []*CurrentUser_AccountMembership { + if x != nil { + return x.AccountMemberships + } + return nil +} + +func (x *CurrentUser) GetAccount() string { + if x != nil { + return x.Account + } + return "" +} + +func (x *CurrentUser) GetServiceAccountOauth2ClientId() string { + if x != nil { + return x.ServiceAccountOauth2ClientId + } + return "" +} + +// The permission and its scope. +type PermissionWithScope struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Scope of the permission on the form :. + Scope string `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + // Permission. + Permission v1.Permission `protobuf:"varint,2,opt,name=permission,proto3,enum=confidence.auth.v1.Permission" json:"permission,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PermissionWithScope) Reset() { + *x = PermissionWithScope{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PermissionWithScope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PermissionWithScope) ProtoMessage() {} + +func (x *PermissionWithScope) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PermissionWithScope.ProtoReflect.Descriptor instead. +func (*PermissionWithScope) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{2} +} + +func (x *PermissionWithScope) GetScope() string { + if x != nil { + return x.Scope + } + return "" +} + +func (x *PermissionWithScope) GetPermission() v1.Permission { + if x != nil { + return x.Permission + } + return v1.Permission(0) +} + +// An API client that can be used to programmatically access the Confidence +// APIs. +type ApiClient struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name of the API client on the form `apiClients/`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Human friendly name of the API client. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // A description of the API client, e.g. what it is for. + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Id of the API client. + ClientId string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // The client secret for the client. + ClientSecret string `protobuf:"bytes,5,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + // Permissions that the API client has. + Permissions []v1.Permission `protobuf:"varint,6,rep,packed,name=permissions,proto3,enum=confidence.auth.v1.Permission" json:"permissions,omitempty"` + // Roles that the API client has. + Roles []string `protobuf:"bytes,12,rep,name=roles,proto3" json:"roles,omitempty"` + // Time when the API client was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the API client was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this API client. + Creator string `protobuf:"bytes,13,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this API client. + Updater string `protobuf:"bytes,14,opt,name=updater,proto3" json:"updater,omitempty"` + // General labels for this resource. + Labels map[string]string `protobuf:"bytes,11,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApiClient) Reset() { + *x = ApiClient{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiClient) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiClient) ProtoMessage() {} + +func (x *ApiClient) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApiClient.ProtoReflect.Descriptor instead. +func (*ApiClient) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{3} +} + +func (x *ApiClient) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ApiClient) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *ApiClient) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *ApiClient) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *ApiClient) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *ApiClient) GetPermissions() []v1.Permission { + if x != nil { + return x.Permissions + } + return nil +} + +func (x *ApiClient) GetRoles() []string { + if x != nil { + return x.Roles + } + return nil +} + +func (x *ApiClient) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *ApiClient) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *ApiClient) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *ApiClient) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +func (x *ApiClient) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +// Represents an identity that can perform operations in the system. +// Either a user, api client or an internal service. +type Identity struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name of the identity on the form `identities/`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // User friendly name of the identity + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // What kind of identity is underlying + // + // Types that are valid to be assigned to IdentityKind: + // + // *Identity_User + // *Identity_ApiClient + // *Identity_Service + IdentityKind isIdentity_IdentityKind `protobuf_oneof:"identity_kind"` + // Time when the user was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the user was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // General labels for this resource. + Labels map[string]string `protobuf:"bytes,8,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Identity) Reset() { + *x = Identity{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Identity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Identity) ProtoMessage() {} + +func (x *Identity) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Identity.ProtoReflect.Descriptor instead. +func (*Identity) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{4} +} + +func (x *Identity) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Identity) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *Identity) GetIdentityKind() isIdentity_IdentityKind { + if x != nil { + return x.IdentityKind + } + return nil +} + +func (x *Identity) GetUser() string { + if x != nil { + if x, ok := x.IdentityKind.(*Identity_User); ok { + return x.User + } + } + return "" +} + +func (x *Identity) GetApiClient() string { + if x != nil { + if x, ok := x.IdentityKind.(*Identity_ApiClient); ok { + return x.ApiClient + } + } + return "" +} + +func (x *Identity) GetService() string { + if x != nil { + if x, ok := x.IdentityKind.(*Identity_Service); ok { + return x.Service + } + } + return "" +} + +func (x *Identity) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Identity) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *Identity) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +type isIdentity_IdentityKind interface { + isIdentity_IdentityKind() +} + +type Identity_User struct { + // The actual user if any + User string `protobuf:"bytes,3,opt,name=user,proto3,oneof"` +} + +type Identity_ApiClient struct { + // If this identity is an API client + ApiClient string `protobuf:"bytes,4,opt,name=api_client,json=apiClient,proto3,oneof"` +} + +type Identity_Service struct { + // If the identity is a service + Service string `protobuf:"bytes,5,opt,name=service,proto3,oneof"` +} + +func (*Identity_User) isIdentity_IdentityKind() {} + +func (*Identity_ApiClient) isIdentity_IdentityKind() {} + +func (*Identity_Service) isIdentity_IdentityKind() {} + +// (-- api-linter: core::0122::name-suffix=disabled +// +// aip.dev/not-precedent: A name is a name is a name. --) +// +// A Confidence user. +type User struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name of the user on the form `users/`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Full name of the user like John Doe. + FullName string `protobuf:"bytes,2,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` + // E-mail of the user. + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + // Profile picture URI if exists, otherwise empty. + PictureUri string `protobuf:"bytes,4,opt,name=picture_uri,json=pictureUri,proto3" json:"picture_uri,omitempty"` + // Time of last login. + LastLoginTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_login_time,json=lastLoginTime,proto3" json:"last_login_time,omitempty"` + // Indicator of whether the user is blocked from logging in. + Blocked bool `protobuf:"varint,6,opt,name=blocked,proto3" json:"blocked,omitempty"` + // Time when the user was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the user was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // General labels for this resource. + Labels map[string]string `protobuf:"bytes,9,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *User) Reset() { + *x = User{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{5} +} + +func (x *User) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *User) GetFullName() string { + if x != nil { + return x.FullName + } + return "" +} + +func (x *User) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *User) GetPictureUri() string { + if x != nil { + return x.PictureUri + } + return "" +} + +func (x *User) GetLastLoginTime() *timestamppb.Timestamp { + if x != nil { + return x.LastLoginTime + } + return nil +} + +func (x *User) GetBlocked() bool { + if x != nil { + return x.Blocked + } + return false +} + +func (x *User) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *User) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *User) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +// An invitation for an email to join a Confidence account. +type UserInvitation struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name of the invitation on the form `userInvitations/`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The email to the send the invitation to + InvitedEmail string `protobuf:"bytes,2,opt,name=invited_email,json=invitedEmail,proto3" json:"invited_email,omitempty"` + // The person that initiated the invite. The email sent to `invited_email` will contain this name. If not sent and + // the token is an end user token the name of the currently logged in user will be used. + // Required if the token is an API client token. + Inviter string `protobuf:"bytes,3,opt,name=inviter,proto3" json:"inviter,omitempty"` + // The roles that the user should get when accepting the invite. Must be at least 1 role. + Roles []string `protobuf:"bytes,4,rep,name=roles,proto3" json:"roles,omitempty"` + // The duration from create that the invite expires and is no longer valid. Defaults to 7 days if not specified. + Ttl *durationpb.Duration `protobuf:"bytes,5,opt,name=ttl,proto3" json:"ttl,omitempty"` + // The absolute time that the invite expires and is no longer valid. + ExpirationTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=expiration_time,json=expirationTime,proto3" json:"expiration_time,omitempty"` + // URI for accepting the invite. + InvitationUri string `protobuf:"bytes,12,opt,name=invitation_uri,json=invitationUri,proto3" json:"invitation_uri,omitempty"` + // Token required to accept the invite (part of the URI). + InvitationToken string `protobuf:"bytes,13,opt,name=invitation_token,json=invitationToken,proto3" json:"invitation_token,omitempty"` + // If true, no email will be sent with the invitation link. + DisableInvitationEmail bool `protobuf:"varint,14,opt,name=disable_invitation_email,json=disableInvitationEmail,proto3" json:"disable_invitation_email,omitempty"` + // Time when the user invitation was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the user invitation was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this user invitation. + Creator string `protobuf:"bytes,15,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this user invitation. + Updater string `protobuf:"bytes,16,opt,name=updater,proto3" json:"updater,omitempty"` + // General labels for this resource. + Labels map[string]string `protobuf:"bytes,11,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserInvitation) Reset() { + *x = UserInvitation{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserInvitation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserInvitation) ProtoMessage() {} + +func (x *UserInvitation) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserInvitation.ProtoReflect.Descriptor instead. +func (*UserInvitation) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{6} +} + +func (x *UserInvitation) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UserInvitation) GetInvitedEmail() string { + if x != nil { + return x.InvitedEmail + } + return "" +} + +func (x *UserInvitation) GetInviter() string { + if x != nil { + return x.Inviter + } + return "" +} + +func (x *UserInvitation) GetRoles() []string { + if x != nil { + return x.Roles + } + return nil +} + +func (x *UserInvitation) GetTtl() *durationpb.Duration { + if x != nil { + return x.Ttl + } + return nil +} + +func (x *UserInvitation) GetExpirationTime() *timestamppb.Timestamp { + if x != nil { + return x.ExpirationTime + } + return nil +} + +func (x *UserInvitation) GetInvitationUri() string { + if x != nil { + return x.InvitationUri + } + return "" +} + +func (x *UserInvitation) GetInvitationToken() string { + if x != nil { + return x.InvitationToken + } + return "" +} + +func (x *UserInvitation) GetDisableInvitationEmail() bool { + if x != nil { + return x.DisableInvitationEmail + } + return false +} + +func (x *UserInvitation) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *UserInvitation) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *UserInvitation) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *UserInvitation) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +func (x *UserInvitation) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +// (-- api-linter: core::0123::resource-singular=disabled +// +// aip.dev/not-precedent: We use oauth_app. --) +// +// Allows users of a third party app to authenticate towards Confidence and +// get an auth token. +type OAuthApp struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name of the OAuthApp on the form `oauthApps/`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The name to show for the app. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // The client ID to use when authenticating. + ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // The client secret to use when authenticating. + ClientSecret string `protobuf:"bytes,4,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + // Description of this oauth app. + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + // URI to a logo to show for the user while authenticating. + LogoUri string `protobuf:"bytes,6,opt,name=logo_uri,json=logoUri,proto3" json:"logo_uri,omitempty"` + // A list of URLs that the client is allowed to specify for the callback after authenticating. + AllowedCallbackUrls []string `protobuf:"bytes,7,rep,name=allowed_callback_urls,json=allowedCallbackUrls,proto3" json:"allowed_callback_urls,omitempty"` + // A list of logout URLs that the client is allowed to specify. + AllowedLogoutUrls []string `protobuf:"bytes,8,rep,name=allowed_logout_urls,json=allowedLogoutUrls,proto3" json:"allowed_logout_urls,omitempty"` + // A list of allowed origins for CORS. + AllowedWebOrigins []string `protobuf:"bytes,9,rep,name=allowed_web_origins,json=allowedWebOrigins,proto3" json:"allowed_web_origins,omitempty"` + // Time when the OAuthApp was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the OAuthApp was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this OAuthApp. + Creator string `protobuf:"bytes,15,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this OAuthApp. + Updater string `protobuf:"bytes,16,opt,name=updater,proto3" json:"updater,omitempty"` + // General labels for this resource. + Labels map[string]string `protobuf:"bytes,14,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OAuthApp) Reset() { + *x = OAuthApp{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OAuthApp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OAuthApp) ProtoMessage() {} + +func (x *OAuthApp) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OAuthApp.ProtoReflect.Descriptor instead. +func (*OAuthApp) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{7} +} + +func (x *OAuthApp) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *OAuthApp) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *OAuthApp) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *OAuthApp) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *OAuthApp) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *OAuthApp) GetLogoUri() string { + if x != nil { + return x.LogoUri + } + return "" +} + +func (x *OAuthApp) GetAllowedCallbackUrls() []string { + if x != nil { + return x.AllowedCallbackUrls + } + return nil +} + +func (x *OAuthApp) GetAllowedLogoutUrls() []string { + if x != nil { + return x.AllowedLogoutUrls + } + return nil +} + +func (x *OAuthApp) GetAllowedWebOrigins() []string { + if x != nil { + return x.AllowedWebOrigins + } + return nil +} + +func (x *OAuthApp) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *OAuthApp) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *OAuthApp) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *OAuthApp) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +func (x *OAuthApp) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +// A Client allows an app to access certain Confidence services like +// resolving flags and sending events. +type Client struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The resource name of the client. + // For example: + // `clients/1bhq4c2zqigdzqg6ufni` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Human friendly name of the client. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // The last time this client was used to resolve a flag. + LastSeenTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=last_seen_time,json=lastSeenTime,proto3" json:"last_seen_time,omitempty"` + // General set of labels for this resource. + Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Time when the client was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the client was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this client. + Creator string `protobuf:"bytes,9,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this client. + Updater string `protobuf:"bytes,10,opt,name=updater,proto3" json:"updater,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Client) Reset() { + *x = Client{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Client) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Client) ProtoMessage() {} + +func (x *Client) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Client.ProtoReflect.Descriptor instead. +func (*Client) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{8} +} + +func (x *Client) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Client) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *Client) GetLastSeenTime() *timestamppb.Timestamp { + if x != nil { + return x.LastSeenTime + } + return nil +} + +func (x *Client) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Client) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Client) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *Client) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *Client) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +// The credentials required for a client to access Confidence. +type ClientCredential struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The resource name of the client. + // For example: + // `clients/1bhq4c2zqigdzqg6ufni/credentials/3pxcfkkmi5sppg0lfa8d` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Human friendly name of the credential. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // The credential method used by this client. + // + // Types that are valid to be assigned to Credential: + // + // *ClientCredential_ClientSecret_ + Credential isClientCredential_Credential `protobuf_oneof:"credential"` + // The last time this credential was used to resolve a flag. + LastSeenTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_seen_time,json=lastSeenTime,proto3" json:"last_seen_time,omitempty"` + // General set of labels for this resource. + Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Time when the client was first created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Time when the client was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Reference to the identity that created this credential. + Creator string `protobuf:"bytes,10,opt,name=creator,proto3" json:"creator,omitempty"` + // Reference to the identity that last updated this credential. + Updater string `protobuf:"bytes,11,opt,name=updater,proto3" json:"updater,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientCredential) Reset() { + *x = ClientCredential{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientCredential) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientCredential) ProtoMessage() {} + +func (x *ClientCredential) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientCredential.ProtoReflect.Descriptor instead. +func (*ClientCredential) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{9} +} + +func (x *ClientCredential) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClientCredential) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *ClientCredential) GetCredential() isClientCredential_Credential { + if x != nil { + return x.Credential + } + return nil +} + +func (x *ClientCredential) GetClientSecret() *ClientCredential_ClientSecret { + if x != nil { + if x, ok := x.Credential.(*ClientCredential_ClientSecret_); ok { + return x.ClientSecret + } + } + return nil +} + +func (x *ClientCredential) GetLastSeenTime() *timestamppb.Timestamp { + if x != nil { + return x.LastSeenTime + } + return nil +} + +func (x *ClientCredential) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *ClientCredential) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *ClientCredential) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *ClientCredential) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *ClientCredential) GetUpdater() string { + if x != nil { + return x.Updater + } + return "" +} + +type isClientCredential_Credential interface { + isClientCredential_Credential() +} + +type ClientCredential_ClientSecret_ struct { + // A simple plaintext secret. + ClientSecret *ClientCredential_ClientSecret `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3,oneof"` +} + +func (*ClientCredential_ClientSecret_) isClientCredential_Credential() {} + +// Represents that a user is a member of an account. +type CurrentUser_AccountMembership struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The name of the account. + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + // The external id of the accounts. + ExternalId string `protobuf:"bytes,2,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + // The human friendly name of the account. + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // The string to pass when logging in. + LoginId string `protobuf:"bytes,4,opt,name=login_id,json=loginId,proto3" json:"login_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CurrentUser_AccountMembership) Reset() { + *x = CurrentUser_AccountMembership{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CurrentUser_AccountMembership) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CurrentUser_AccountMembership) ProtoMessage() {} + +func (x *CurrentUser_AccountMembership) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CurrentUser_AccountMembership.ProtoReflect.Descriptor instead. +func (*CurrentUser_AccountMembership) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *CurrentUser_AccountMembership) GetAccount() string { + if x != nil { + return x.Account + } + return "" +} + +func (x *CurrentUser_AccountMembership) GetExternalId() string { + if x != nil { + return x.ExternalId + } + return "" +} + +func (x *CurrentUser_AccountMembership) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *CurrentUser_AccountMembership) GetLoginId() string { + if x != nil { + return x.LoginId + } + return "" +} + +// A simple plaintext secret. +type ClientCredential_ClientSecret struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The secret used to authenticate a client. + Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientCredential_ClientSecret) Reset() { + *x = ClientCredential_ClientSecret{} + mi := &file_confidence_iam_v1_iam_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientCredential_ClientSecret) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientCredential_ClientSecret) ProtoMessage() {} + +func (x *ClientCredential_ClientSecret) ProtoReflect() protoreflect.Message { + mi := &file_confidence_iam_v1_iam_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientCredential_ClientSecret.ProtoReflect.Descriptor instead. +func (*ClientCredential_ClientSecret) Descriptor() ([]byte, []int) { + return file_confidence_iam_v1_iam_proto_rawDescGZIP(), []int{9, 1} +} + +func (x *ClientCredential_ClientSecret) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +var File_confidence_iam_v1_iam_proto protoreflect.FileDescriptor + +const file_confidence_iam_v1_iam_proto_rawDesc = "" + + "\n" + + "\x1bconfidence/iam/v1/iam.proto\x12\x11confidence.iam.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1dconfidence/auth/v1/auth.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/api/client.proto\x1a confidence/api/annotations.proto\"\x9d\x06\n" + + "\tCryptoKey\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12#\n" + + "\n" + + "public_key\x18\x02 \x01(\tB\x04\xe2A\x01\x03R\tpublicKey\x12;\n" + + "\x04kind\x18\x03 \x01(\x0e2!.confidence.iam.v1.CryptoKey.KindB\x04\xe2A\x01\x02R\x04kind\x12?\n" + + "\x05state\x18\x04 \x01(\x0e2\".confidence.iam.v1.CryptoKey.StateB\x05\xe2A\x02\x02\x03R\x05state\x12F\n" + + "\x06labels\x18\x05 \x03(\v2(.confidence.iam.v1.CryptoKey.LabelsEntryB\x04\xe2A\x01\x01R\x06labels\x12B\n" + + "\vcreate_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\n" + + " \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\f \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"F\n" + + "\x05State\x12\x15\n" + + "\x11STATE_UNSPECIFIED\x10\x00\x12\f\n" + + "\bCREATING\x10\x01\x12\v\n" + + "\aCREATED\x10\x02\x12\v\n" + + "\aDELETED\x10\x03\"+\n" + + "\x04Kind\x12\x14\n" + + "\x10KIND_UNSPECIFIED\x10\x00\x12\r\n" + + "\tSNOWFLAKE\x10\x01:Q\xeaAN\n" + + "\x1ciam.confidence.dev/CryptoKey\x12\x17cryptoKeys/{crypto_key}*\n" + + "cryptoKeys2\tcryptoKey\"\x8e\x04\n" + + "\vCurrentUser\x12N\n" + + "\vpermissions\x18\x01 \x03(\v2&.confidence.iam.v1.PermissionWithScopeB\x04\xe2A\x01\x01R\vpermissions\x121\n" + + "\x04user\x18\x02 \x01(\v2\x17.confidence.iam.v1.UserB\x04\xe2A\x01\x01R\x04user\x12g\n" + + "\x13account_memberships\x18\x03 \x03(\v20.confidence.iam.v1.CurrentUser.AccountMembershipB\x04\xe2A\x01\x01R\x12accountMemberships\x12\x1e\n" + + "\aaccount\x18\x04 \x01(\tB\x04\xe2A\x01\x02R\aaccount\x12L\n" + + " service_account_oauth2_client_id\x18\x05 \x01(\tB\x04\xe2A\x01\x02R\x1cserviceAccountOauth2ClientId\x1a\xa4\x01\n" + + "\x11AccountMembership\x12\x1e\n" + + "\aaccount\x18\x01 \x01(\tB\x04\xe2A\x01\x02R\aaccount\x12%\n" + + "\vexternal_id\x18\x02 \x01(\tB\x04\xe2A\x01\x02R\n" + + "externalId\x12'\n" + + "\fdisplay_name\x18\x03 \x01(\tB\x04\xe2A\x01\x02R\vdisplayName\x12\x1f\n" + + "\blogin_id\x18\x04 \x01(\tB\x04\xe2A\x01\x02R\aloginId\"w\n" + + "\x13PermissionWithScope\x12\x1a\n" + + "\x05scope\x18\x01 \x01(\tB\x04\xe2A\x01\x02R\x05scope\x12D\n" + + "\n" + + "permission\x18\x02 \x01(\x0e2\x1e.confidence.auth.v1.PermissionB\x04\xe2A\x01\x02R\n" + + "permission\"\xa5\x06\n" + + "\tApiClient\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12'\n" + + "\fdisplay_name\x18\x02 \x01(\tB\x04\xe2A\x01\x02R\vdisplayName\x12&\n" + + "\vdescription\x18\x03 \x01(\tB\x04\xe2A\x01\x01R\vdescription\x12\"\n" + + "\tclient_id\x18\x04 \x01(\tB\x05\xe2A\x02\x02\x03R\bclientId\x12)\n" + + "\rclient_secret\x18\x05 \x01(\tB\x04\xe2A\x01\x03R\fclientSecret\x12F\n" + + "\vpermissions\x18\x06 \x03(\x0e2\x1e.confidence.auth.v1.PermissionB\x04\xe2A\x01\x01R\vpermissions\x126\n" + + "\x05roles\x18\f \x03(\tB \xe2A\x01\x01\xfaA\x19\n" + + "\x17iam.confidence.dev/RoleR\x05roles\x12B\n" + + "\vcreate_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\b \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\r \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\x0e \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x12F\n" + + "\x06labels\x18\v \x03(\v2(.confidence.iam.v1.ApiClient.LabelsEntryB\x04\xe2A\x01\x01R\x06labels\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:Q\xeaAN\n" + + "\x1ciam.confidence.dev/ApiClient\x12\x17apiClients/{api_client}*\n" + + "apiClients2\tapiClient\"\xcb\x04\n" + + "\bIdentity\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12'\n" + + "\fdisplay_name\x18\x02 \x01(\tB\x04\xe2A\x01\x02R\vdisplayName\x122\n" + + "\x04user\x18\x03 \x01(\tB\x1c\xfaA\x19\n" + + "\x17iam.confidence.dev/UserH\x00R\x04user\x12B\n" + + "\n" + + "api_client\x18\x04 \x01(\tB!\xfaA\x1e\n" + + "\x1ciam.confidence.dev/ApiClientH\x00R\tapiClient\x12\x1a\n" + + "\aservice\x18\x05 \x01(\tH\x00R\aservice\x12B\n" + + "\vcreate_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12E\n" + + "\x06labels\x18\b \x03(\v2'.confidence.iam.v1.Identity.LabelsEntryB\x04\xe2A\x01\x01R\x06labels\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:M\xeaAJ\n" + + "\x1biam.confidence.dev/Identity\x12\x15identities/{identity}*\n" + + "identities2\bidentityB\x0f\n" + + "\ridentity_kind\"\xa9\x04\n" + + "\x04User\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12!\n" + + "\tfull_name\x18\x02 \x01(\tB\x04\xe2A\x01\x02R\bfullName\x12\x1a\n" + + "\x05email\x18\x03 \x01(\tB\x04\xe2A\x01\x02R\x05email\x12\x1f\n" + + "\vpicture_uri\x18\x04 \x01(\tR\n" + + "pictureUri\x12H\n" + + "\x0flast_login_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampB\x04\xe2A\x01\x03R\rlastLoginTime\x12\x1e\n" + + "\ablocked\x18\x06 \x01(\bB\x04\xe2A\x01\x03R\ablocked\x12B\n" + + "\vcreate_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\b \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12A\n" + + "\x06labels\x18\t \x03(\v2#.confidence.iam.v1.User.LabelsEntryB\x04\xe2A\x01\x01R\x06labels\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:7\xeaA4\n" + + "\x17iam.confidence.dev/User\x12\fusers/{user}*\x05users2\x04user\"\xca\a\n" + + "\x0eUserInvitation\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12)\n" + + "\rinvited_email\x18\x02 \x01(\tB\x04\xe2A\x01\x02R\finvitedEmail\x12\x1e\n" + + "\ainviter\x18\x03 \x01(\tB\x04\xe2A\x01\x01R\ainviter\x126\n" + + "\x05roles\x18\x04 \x03(\tB \xe2A\x01\x02\xfaA\x19\n" + + "\x17iam.confidence.dev/RoleR\x05roles\x121\n" + + "\x03ttl\x18\x05 \x01(\v2\x19.google.protobuf.DurationB\x04\xe2A\x01\x01R\x03ttl\x12J\n" + + "\x0fexpiration_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\x0eexpirationTime\x12,\n" + + "\x0einvitation_uri\x18\f \x01(\tB\x05\xe2A\x02\x02\x03R\rinvitationUri\x120\n" + + "\x10invitation_token\x18\r \x01(\tB\x05\xe2A\x02\x02\x03R\x0finvitationToken\x12>\n" + + "\x18disable_invitation_email\x18\x0e \x01(\bB\x04\xe2A\x01\x01R\x16disableInvitationEmail\x12B\n" + + "\vcreate_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\b \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\x0f \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\x10 \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x12K\n" + + "\x06labels\x18\v \x03(\v2-.confidence.iam.v1.UserInvitation.LabelsEntryB\x04\xe2A\x01\x01R\x06labels\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:j\xeaAg\n" + + "!iam.confidence.dev/UserInvitation\x12!userInvitations/{user_invitation}*\x0fuserInvitations2\x0euserInvitation\"\xe6\x06\n" + + "\bOAuthApp\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12'\n" + + "\fdisplay_name\x18\x02 \x01(\tB\x04\xe2A\x01\x02R\vdisplayName\x12\"\n" + + "\tclient_id\x18\x03 \x01(\tB\x05\xe2A\x02\x02\x03R\bclientId\x12*\n" + + "\rclient_secret\x18\x04 \x01(\tB\x05\xe2A\x02\x02\x03R\fclientSecret\x12&\n" + + "\vdescription\x18\x05 \x01(\tB\x04\xe2A\x01\x01R\vdescription\x12\x1f\n" + + "\blogo_uri\x18\x06 \x01(\tB\x04\xe2A\x01\x01R\alogoUri\x128\n" + + "\x15allowed_callback_urls\x18\a \x03(\tB\x04\xe2A\x01\x01R\x13allowedCallbackUrls\x124\n" + + "\x13allowed_logout_urls\x18\b \x03(\tB\x04\xe2A\x01\x01R\x11allowedLogoutUrls\x124\n" + + "\x13allowed_web_origins\x18\t \x03(\tB\x04\xe2A\x01\x01R\x11allowedWebOrigins\x12B\n" + + "\vcreate_time\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\v \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\x0f \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\x10 \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x12E\n" + + "\x06labels\x18\x0e \x03(\v2'.confidence.iam.v1.OAuthApp.LabelsEntryB\x04\xe2A\x01\x01R\x06labels\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:L\xeaAI\n" + + "\x1biam.confidence.dev/OAuthApp\x12\x15oauthApps/{oauth_app}*\toauthApps2\boauthApp\"\xe1\x04\n" + + "\x06Client\x12\x19\n" + + "\x04name\x18\x01 \x01(\tB\x05\xe2A\x02\x03\bR\x04name\x12'\n" + + "\fdisplay_name\x18\x02 \x01(\tB\x04\xe2A\x01\x02R\vdisplayName\x12F\n" + + "\x0elast_seen_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampB\x04\xe2A\x01\x03R\flastSeenTime\x12C\n" + + "\x06labels\x18\x04 \x03(\v2%.confidence.iam.v1.Client.LabelsEntryB\x04\xe2A\x01\x01R\x06labels\x12B\n" + + "\vcreate_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\t \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\n" + + " \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:A\xeaA>\n" + + "\x19iam.confidence.dev/Client\x12\x10clients/{client}*\aclients2\x06client\"\xc6\x06\n" + + "\x10ClientCredential\x12\x18\n" + + "\x04name\x18\x01 \x01(\tB\x04\xe2A\x01\bR\x04name\x12'\n" + + "\fdisplay_name\x18\x02 \x01(\tB\x04\xe2A\x01\x02R\vdisplayName\x12]\n" + + "\rclient_secret\x18\x03 \x01(\v20.confidence.iam.v1.ClientCredential.ClientSecretB\x04\xe2A\x01\x01H\x00R\fclientSecret\x12F\n" + + "\x0elast_seen_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampB\x04\xe2A\x01\x03R\flastSeenTime\x12M\n" + + "\x06labels\x18\x05 \x03(\v2/.confidence.iam.v1.ClientCredential.LabelsEntryB\x04\xe2A\x01\x01R\x06labels\x12B\n" + + "\vcreate_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "createTime\x12B\n" + + "\vupdate_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampB\x05\xe2A\x02\x02\x03R\n" + + "updateTime\x12?\n" + + "\acreator\x18\n" + + " \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\acreator\x12?\n" + + "\aupdater\x18\v \x01(\tB%\xe2A\x02\x03\x02\xfaA\x1d\n" + + "\x1biam.confidence.dev/IdentityR\aupdater\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a,\n" + + "\fClientSecret\x12\x1c\n" + + "\x06secret\x18\x01 \x01(\tB\x04\xe2A\x01\x03R\x06secret:x\xeaAu\n" + + "#iam.confidence.dev/ClientCredential\x12)clients/{client}/credentials/{credential}*\x11clientCredentials2\x10clientCredentialB\f\n" + + "\n" + + "credentialB+\n" + + "\x1dcom.spotify.confidence.iam.v1B\bIamProtoP\x01b\x06proto3" + +var ( + file_confidence_iam_v1_iam_proto_rawDescOnce sync.Once + file_confidence_iam_v1_iam_proto_rawDescData []byte +) + +func file_confidence_iam_v1_iam_proto_rawDescGZIP() []byte { + file_confidence_iam_v1_iam_proto_rawDescOnce.Do(func() { + file_confidence_iam_v1_iam_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_iam_v1_iam_proto_rawDesc), len(file_confidence_iam_v1_iam_proto_rawDesc))) + }) + return file_confidence_iam_v1_iam_proto_rawDescData +} + +var file_confidence_iam_v1_iam_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_confidence_iam_v1_iam_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_confidence_iam_v1_iam_proto_goTypes = []any{ + (CryptoKey_State)(0), // 0: confidence.iam.v1.CryptoKey.State + (CryptoKey_Kind)(0), // 1: confidence.iam.v1.CryptoKey.Kind + (*CryptoKey)(nil), // 2: confidence.iam.v1.CryptoKey + (*CurrentUser)(nil), // 3: confidence.iam.v1.CurrentUser + (*PermissionWithScope)(nil), // 4: confidence.iam.v1.PermissionWithScope + (*ApiClient)(nil), // 5: confidence.iam.v1.ApiClient + (*Identity)(nil), // 6: confidence.iam.v1.Identity + (*User)(nil), // 7: confidence.iam.v1.User + (*UserInvitation)(nil), // 8: confidence.iam.v1.UserInvitation + (*OAuthApp)(nil), // 9: confidence.iam.v1.OAuthApp + (*Client)(nil), // 10: confidence.iam.v1.Client + (*ClientCredential)(nil), // 11: confidence.iam.v1.ClientCredential + nil, // 12: confidence.iam.v1.CryptoKey.LabelsEntry + (*CurrentUser_AccountMembership)(nil), // 13: confidence.iam.v1.CurrentUser.AccountMembership + nil, // 14: confidence.iam.v1.ApiClient.LabelsEntry + nil, // 15: confidence.iam.v1.Identity.LabelsEntry + nil, // 16: confidence.iam.v1.User.LabelsEntry + nil, // 17: confidence.iam.v1.UserInvitation.LabelsEntry + nil, // 18: confidence.iam.v1.OAuthApp.LabelsEntry + nil, // 19: confidence.iam.v1.Client.LabelsEntry + nil, // 20: confidence.iam.v1.ClientCredential.LabelsEntry + (*ClientCredential_ClientSecret)(nil), // 21: confidence.iam.v1.ClientCredential.ClientSecret + (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp + (v1.Permission)(0), // 23: confidence.auth.v1.Permission + (*durationpb.Duration)(nil), // 24: google.protobuf.Duration +} +var file_confidence_iam_v1_iam_proto_depIdxs = []int32{ + 1, // 0: confidence.iam.v1.CryptoKey.kind:type_name -> confidence.iam.v1.CryptoKey.Kind + 0, // 1: confidence.iam.v1.CryptoKey.state:type_name -> confidence.iam.v1.CryptoKey.State + 12, // 2: confidence.iam.v1.CryptoKey.labels:type_name -> confidence.iam.v1.CryptoKey.LabelsEntry + 22, // 3: confidence.iam.v1.CryptoKey.create_time:type_name -> google.protobuf.Timestamp + 22, // 4: confidence.iam.v1.CryptoKey.update_time:type_name -> google.protobuf.Timestamp + 4, // 5: confidence.iam.v1.CurrentUser.permissions:type_name -> confidence.iam.v1.PermissionWithScope + 7, // 6: confidence.iam.v1.CurrentUser.user:type_name -> confidence.iam.v1.User + 13, // 7: confidence.iam.v1.CurrentUser.account_memberships:type_name -> confidence.iam.v1.CurrentUser.AccountMembership + 23, // 8: confidence.iam.v1.PermissionWithScope.permission:type_name -> confidence.auth.v1.Permission + 23, // 9: confidence.iam.v1.ApiClient.permissions:type_name -> confidence.auth.v1.Permission + 22, // 10: confidence.iam.v1.ApiClient.create_time:type_name -> google.protobuf.Timestamp + 22, // 11: confidence.iam.v1.ApiClient.update_time:type_name -> google.protobuf.Timestamp + 14, // 12: confidence.iam.v1.ApiClient.labels:type_name -> confidence.iam.v1.ApiClient.LabelsEntry + 22, // 13: confidence.iam.v1.Identity.create_time:type_name -> google.protobuf.Timestamp + 22, // 14: confidence.iam.v1.Identity.update_time:type_name -> google.protobuf.Timestamp + 15, // 15: confidence.iam.v1.Identity.labels:type_name -> confidence.iam.v1.Identity.LabelsEntry + 22, // 16: confidence.iam.v1.User.last_login_time:type_name -> google.protobuf.Timestamp + 22, // 17: confidence.iam.v1.User.create_time:type_name -> google.protobuf.Timestamp + 22, // 18: confidence.iam.v1.User.update_time:type_name -> google.protobuf.Timestamp + 16, // 19: confidence.iam.v1.User.labels:type_name -> confidence.iam.v1.User.LabelsEntry + 24, // 20: confidence.iam.v1.UserInvitation.ttl:type_name -> google.protobuf.Duration + 22, // 21: confidence.iam.v1.UserInvitation.expiration_time:type_name -> google.protobuf.Timestamp + 22, // 22: confidence.iam.v1.UserInvitation.create_time:type_name -> google.protobuf.Timestamp + 22, // 23: confidence.iam.v1.UserInvitation.update_time:type_name -> google.protobuf.Timestamp + 17, // 24: confidence.iam.v1.UserInvitation.labels:type_name -> confidence.iam.v1.UserInvitation.LabelsEntry + 22, // 25: confidence.iam.v1.OAuthApp.create_time:type_name -> google.protobuf.Timestamp + 22, // 26: confidence.iam.v1.OAuthApp.update_time:type_name -> google.protobuf.Timestamp + 18, // 27: confidence.iam.v1.OAuthApp.labels:type_name -> confidence.iam.v1.OAuthApp.LabelsEntry + 22, // 28: confidence.iam.v1.Client.last_seen_time:type_name -> google.protobuf.Timestamp + 19, // 29: confidence.iam.v1.Client.labels:type_name -> confidence.iam.v1.Client.LabelsEntry + 22, // 30: confidence.iam.v1.Client.create_time:type_name -> google.protobuf.Timestamp + 22, // 31: confidence.iam.v1.Client.update_time:type_name -> google.protobuf.Timestamp + 21, // 32: confidence.iam.v1.ClientCredential.client_secret:type_name -> confidence.iam.v1.ClientCredential.ClientSecret + 22, // 33: confidence.iam.v1.ClientCredential.last_seen_time:type_name -> google.protobuf.Timestamp + 20, // 34: confidence.iam.v1.ClientCredential.labels:type_name -> confidence.iam.v1.ClientCredential.LabelsEntry + 22, // 35: confidence.iam.v1.ClientCredential.create_time:type_name -> google.protobuf.Timestamp + 22, // 36: confidence.iam.v1.ClientCredential.update_time:type_name -> google.protobuf.Timestamp + 37, // [37:37] is the sub-list for method output_type + 37, // [37:37] is the sub-list for method input_type + 37, // [37:37] is the sub-list for extension type_name + 37, // [37:37] is the sub-list for extension extendee + 0, // [0:37] is the sub-list for field type_name +} + +func init() { file_confidence_iam_v1_iam_proto_init() } +func file_confidence_iam_v1_iam_proto_init() { + if File_confidence_iam_v1_iam_proto != nil { + return + } + file_confidence_iam_v1_iam_proto_msgTypes[4].OneofWrappers = []any{ + (*Identity_User)(nil), + (*Identity_ApiClient)(nil), + (*Identity_Service)(nil), + } + file_confidence_iam_v1_iam_proto_msgTypes[9].OneofWrappers = []any{ + (*ClientCredential_ClientSecret_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_iam_v1_iam_proto_rawDesc), len(file_confidence_iam_v1_iam_proto_rawDesc)), + NumEnums: 2, + NumMessages: 20, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_confidence_iam_v1_iam_proto_goTypes, + DependencyIndexes: file_confidence_iam_v1_iam_proto_depIdxs, + EnumInfos: file_confidence_iam_v1_iam_proto_enumTypes, + MessageInfos: file_confidence_iam_v1_iam_proto_msgTypes, + }.Build() + File_confidence_iam_v1_iam_proto = out.File + file_confidence_iam_v1_iam_proto_goTypes = nil + file_confidence_iam_v1_iam_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/messages.pb.go b/openfeature-provider/go/proto/messages.pb.go new file mode 100644 index 0000000..e71b4fc --- /dev/null +++ b/openfeature-provider/go/proto/messages.pb.go @@ -0,0 +1,378 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: messages.proto + +package messages + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Void struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Void) Reset() { + *x = Void{} + mi := &file_messages_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Void) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Void) ProtoMessage() {} + +func (x *Void) ProtoReflect() protoreflect.Message { + mi := &file_messages_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Void.ProtoReflect.Descriptor instead. +func (*Void) Descriptor() ([]byte, []int) { + return file_messages_proto_rawDescGZIP(), []int{0} +} + +type SetResolverStateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + State []byte `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` + AccountId string `protobuf:"bytes,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetResolverStateRequest) Reset() { + *x = SetResolverStateRequest{} + mi := &file_messages_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetResolverStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetResolverStateRequest) ProtoMessage() {} + +func (x *SetResolverStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_messages_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetResolverStateRequest.ProtoReflect.Descriptor instead. +func (*SetResolverStateRequest) Descriptor() ([]byte, []int) { + return file_messages_proto_rawDescGZIP(), []int{1} +} + +func (x *SetResolverStateRequest) GetState() []byte { + if x != nil { + return x.State + } + return nil +} + +func (x *SetResolverStateRequest) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +type ResolveSimpleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClientSecret string `protobuf:"bytes,1,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + EvaluationContext *structpb.Struct `protobuf:"bytes,2,opt,name=evaluation_context,json=evaluationContext,proto3" json:"evaluation_context,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveSimpleRequest) Reset() { + *x = ResolveSimpleRequest{} + mi := &file_messages_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveSimpleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveSimpleRequest) ProtoMessage() {} + +func (x *ResolveSimpleRequest) ProtoReflect() protoreflect.Message { + mi := &file_messages_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveSimpleRequest.ProtoReflect.Descriptor instead. +func (*ResolveSimpleRequest) Descriptor() ([]byte, []int) { + return file_messages_proto_rawDescGZIP(), []int{2} +} + +func (x *ResolveSimpleRequest) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *ResolveSimpleRequest) GetEvaluationContext() *structpb.Struct { + if x != nil { + return x.EvaluationContext + } + return nil +} + +func (x *ResolveSimpleRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type Request struct { + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Request) Reset() { + *x = Request{} + mi := &file_messages_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Request) ProtoMessage() {} + +func (x *Request) ProtoReflect() protoreflect.Message { + mi := &file_messages_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Request.ProtoReflect.Descriptor instead. +func (*Request) Descriptor() ([]byte, []int) { + return file_messages_proto_rawDescGZIP(), []int{3} +} + +func (x *Request) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type Response struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Result: + // + // *Response_Data + // *Response_Error + Result isResponse_Result `protobuf_oneof:"result"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Response) Reset() { + *x = Response{} + mi := &file_messages_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_messages_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_messages_proto_rawDescGZIP(), []int{4} +} + +func (x *Response) GetResult() isResponse_Result { + if x != nil { + return x.Result + } + return nil +} + +func (x *Response) GetData() []byte { + if x != nil { + if x, ok := x.Result.(*Response_Data); ok { + return x.Data + } + } + return nil +} + +func (x *Response) GetError() string { + if x != nil { + if x, ok := x.Result.(*Response_Error); ok { + return x.Error + } + } + return "" +} + +type isResponse_Result interface { + isResponse_Result() +} + +type Response_Data struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3,oneof"` +} + +type Response_Error struct { + Error string `protobuf:"bytes,2,opt,name=error,proto3,oneof"` +} + +func (*Response_Data) isResponse_Result() {} + +func (*Response_Error) isResponse_Result() {} + +var File_messages_proto protoreflect.FileDescriptor + +const file_messages_proto_rawDesc = "" + + "\n" + + "\x0emessages.proto\x12\n" + + "rust_guest\x1a\x1cgoogle/protobuf/struct.proto\"\x06\n" + + "\x04Void\"N\n" + + "\x17SetResolverStateRequest\x12\x14\n" + + "\x05state\x18\x01 \x01(\fR\x05state\x12\x1d\n" + + "\n" + + "account_id\x18\x02 \x01(\tR\taccountId\"\x97\x01\n" + + "\x14ResolveSimpleRequest\x12#\n" + + "\rclient_secret\x18\x01 \x01(\tR\fclientSecret\x12F\n" + + "\x12evaluation_context\x18\x02 \x01(\v2\x17.google.protobuf.StructR\x11evaluationContext\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\"\x1d\n" + + "\aRequest\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data\"B\n" + + "\bResponse\x12\x14\n" + + "\x04data\x18\x01 \x01(\fH\x00R\x04data\x12\x16\n" + + "\x05error\x18\x02 \x01(\tH\x00R\x05errorB\b\n" + + "\x06resultBp\n" + + "\x1bcom.spotify.confidence.wasmB\bMessagesP\x00ZEgithub.com/spotify/confidence/wasm-resolve-poc/go-host/proto/messagesb\x06proto3" + +var ( + file_messages_proto_rawDescOnce sync.Once + file_messages_proto_rawDescData []byte +) + +func file_messages_proto_rawDescGZIP() []byte { + file_messages_proto_rawDescOnce.Do(func() { + file_messages_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_messages_proto_rawDesc), len(file_messages_proto_rawDesc))) + }) + return file_messages_proto_rawDescData +} + +var file_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_messages_proto_goTypes = []any{ + (*Void)(nil), // 0: rust_guest.Void + (*SetResolverStateRequest)(nil), // 1: rust_guest.SetResolverStateRequest + (*ResolveSimpleRequest)(nil), // 2: rust_guest.ResolveSimpleRequest + (*Request)(nil), // 3: rust_guest.Request + (*Response)(nil), // 4: rust_guest.Response + (*structpb.Struct)(nil), // 5: google.protobuf.Struct +} +var file_messages_proto_depIdxs = []int32{ + 5, // 0: rust_guest.ResolveSimpleRequest.evaluation_context:type_name -> google.protobuf.Struct + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_messages_proto_init() } +func file_messages_proto_init() { + if File_messages_proto != nil { + return + } + file_messages_proto_msgTypes[4].OneofWrappers = []any{ + (*Response_Data)(nil), + (*Response_Error)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_messages_proto_rawDesc), len(file_messages_proto_rawDesc)), + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_messages_proto_goTypes, + DependencyIndexes: file_messages_proto_depIdxs, + MessageInfos: file_messages_proto_msgTypes, + }.Build() + File_messages_proto = out.File + file_messages_proto_goTypes = nil + file_messages_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/resolver/api.pb.go b/openfeature-provider/go/proto/resolver/api.pb.go new file mode 100644 index 0000000..24de428 --- /dev/null +++ b/openfeature-provider/go/proto/resolver/api.pb.go @@ -0,0 +1,574 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/flags/resolver/v1/api.proto + +package resolver + +import ( + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api" + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolverevents" + resolvertypes "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolvertypes" + v1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ResolveFlagsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // If non-empty, the specific flags are resolved, otherwise all flags + // available to the client will be resolved. + Flags []string `protobuf:"bytes,1,rep,name=flags,proto3" json:"flags,omitempty"` + // An object that contains data used in the flag resolve. For example, + // the targeting key e.g. the id of the randomization unit, other attributes + // like country or version that are used for targeting. + EvaluationContext *structpb.Struct `protobuf:"bytes,2,opt,name=evaluation_context,json=evaluationContext,proto3" json:"evaluation_context,omitempty"` + // Credentials for the client. It is used to identify the client and find + // the flags that are available to it. + ClientSecret string `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + // Determines whether the flags should be applied directly as part of the + // resolve, or delayed until `ApplyFlag` is called. A flag is typically + // applied when it is used, if this occurs much later than the resolve, then + // `apply` should likely be set to false. + Apply bool `protobuf:"varint,4,opt,name=apply,proto3" json:"apply,omitempty"` + // Information about the SDK used to initiate the request. + Sdk *resolvertypes.Sdk `protobuf:"bytes,5,opt,name=sdk,proto3" json:"sdk,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveFlagsRequest) Reset() { + *x = ResolveFlagsRequest{} + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveFlagsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveFlagsRequest) ProtoMessage() {} + +func (x *ResolveFlagsRequest) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveFlagsRequest.ProtoReflect.Descriptor instead. +func (*ResolveFlagsRequest) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_api_proto_rawDescGZIP(), []int{0} +} + +func (x *ResolveFlagsRequest) GetFlags() []string { + if x != nil { + return x.Flags + } + return nil +} + +func (x *ResolveFlagsRequest) GetEvaluationContext() *structpb.Struct { + if x != nil { + return x.EvaluationContext + } + return nil +} + +func (x *ResolveFlagsRequest) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *ResolveFlagsRequest) GetApply() bool { + if x != nil { + return x.Apply + } + return false +} + +func (x *ResolveFlagsRequest) GetSdk() *resolvertypes.Sdk { + if x != nil { + return x.Sdk + } + return nil +} + +type ResolveFlagsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The list of all flags that could be resolved. Note: if any flag was + // archived it will not be included in this list. + ResolvedFlags []*ResolvedFlag `protobuf:"bytes,1,rep,name=resolved_flags,json=resolvedFlags,proto3" json:"resolved_flags,omitempty"` + // An opaque token that is used when `apply` is set to false in `ResolveFlags`. + // When `apply` is set to false, the token must be passed to `ApplyFlags`. + ResolveToken []byte `protobuf:"bytes,2,opt,name=resolve_token,json=resolveToken,proto3" json:"resolve_token,omitempty"` + // Unique identifier for this particular resolve request. + ResolveId string `protobuf:"bytes,3,opt,name=resolve_id,json=resolveId,proto3" json:"resolve_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveFlagsResponse) Reset() { + *x = ResolveFlagsResponse{} + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveFlagsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveFlagsResponse) ProtoMessage() {} + +func (x *ResolveFlagsResponse) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveFlagsResponse.ProtoReflect.Descriptor instead. +func (*ResolveFlagsResponse) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_api_proto_rawDescGZIP(), []int{1} +} + +func (x *ResolveFlagsResponse) GetResolvedFlags() []*ResolvedFlag { + if x != nil { + return x.ResolvedFlags + } + return nil +} + +func (x *ResolveFlagsResponse) GetResolveToken() []byte { + if x != nil { + return x.ResolveToken + } + return nil +} + +func (x *ResolveFlagsResponse) GetResolveId() string { + if x != nil { + return x.ResolveId + } + return "" +} + +type ApplyFlagsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The flags to apply and information about when they were applied. + Flags []*AppliedFlag `protobuf:"bytes,1,rep,name=flags,proto3" json:"flags,omitempty"` + // Credentials for the client. + ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + // An opaque token that was returned from `ResolveFlags`; it must be set. + ResolveToken []byte `protobuf:"bytes,3,opt,name=resolve_token,json=resolveToken,proto3" json:"resolve_token,omitempty"` + // The client time when the this request was sent, used for correcting + // clock skew from the client. + SendTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=send_time,json=sendTime,proto3" json:"send_time,omitempty"` + // Information about the SDK used to initiate the request. + Sdk *resolvertypes.Sdk `protobuf:"bytes,5,opt,name=sdk,proto3" json:"sdk,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApplyFlagsRequest) Reset() { + *x = ApplyFlagsRequest{} + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApplyFlagsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyFlagsRequest) ProtoMessage() {} + +func (x *ApplyFlagsRequest) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyFlagsRequest.ProtoReflect.Descriptor instead. +func (*ApplyFlagsRequest) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_api_proto_rawDescGZIP(), []int{2} +} + +func (x *ApplyFlagsRequest) GetFlags() []*AppliedFlag { + if x != nil { + return x.Flags + } + return nil +} + +func (x *ApplyFlagsRequest) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *ApplyFlagsRequest) GetResolveToken() []byte { + if x != nil { + return x.ResolveToken + } + return nil +} + +func (x *ApplyFlagsRequest) GetSendTime() *timestamppb.Timestamp { + if x != nil { + return x.SendTime + } + return nil +} + +func (x *ApplyFlagsRequest) GetSdk() *resolvertypes.Sdk { + if x != nil { + return x.Sdk + } + return nil +} + +type ApplyFlagsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApplyFlagsResponse) Reset() { + *x = ApplyFlagsResponse{} + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApplyFlagsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyFlagsResponse) ProtoMessage() {} + +func (x *ApplyFlagsResponse) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyFlagsResponse.ProtoReflect.Descriptor instead. +func (*ApplyFlagsResponse) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_api_proto_rawDescGZIP(), []int{3} +} + +type AppliedFlag struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The id of the flag that should be applied, has the format `flags/*`. + Flag string `protobuf:"bytes,1,opt,name=flag,proto3" json:"flag,omitempty"` + // The client time when the flag was applied. + ApplyTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=apply_time,json=applyTime,proto3" json:"apply_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AppliedFlag) Reset() { + *x = AppliedFlag{} + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AppliedFlag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AppliedFlag) ProtoMessage() {} + +func (x *AppliedFlag) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AppliedFlag.ProtoReflect.Descriptor instead. +func (*AppliedFlag) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_api_proto_rawDescGZIP(), []int{4} +} + +func (x *AppliedFlag) GetFlag() string { + if x != nil { + return x.Flag + } + return "" +} + +func (x *AppliedFlag) GetApplyTime() *timestamppb.Timestamp { + if x != nil { + return x.ApplyTime + } + return nil +} + +type ResolvedFlag struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The id of the flag that as resolved. + Flag string `protobuf:"bytes,1,opt,name=flag,proto3" json:"flag,omitempty"` + // The id of the resolved variant has the format `flags/abc/variants/xyz`. + Variant string `protobuf:"bytes,2,opt,name=variant,proto3" json:"variant,omitempty"` + // The value corresponding to the variant. It will always be a json object, + // for example `{ "color": "red", "size": 12 }`. + Value *structpb.Struct `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + // The schema of the value that was returned. For example: + // ``` + // + // { + // "schema": { + // "color": { "stringSchema": {} }, + // "size": { "intSchema": {} } + // } + // } + // + // ``` + FlagSchema *v1.FlagSchema_StructFlagSchema `protobuf:"bytes,4,opt,name=flag_schema,json=flagSchema,proto3" json:"flag_schema,omitempty"` + // The reason to why the flag could be resolved or not. + Reason resolvertypes.ResolveReason `protobuf:"varint,5,opt,name=reason,proto3,enum=confidence.flags.resolver.v1.ResolveReason" json:"reason,omitempty"` + // Determines whether the flag should be applied in the clients + ShouldApply bool `protobuf:"varint,6,opt,name=should_apply,json=shouldApply,proto3" json:"should_apply,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolvedFlag) Reset() { + *x = ResolvedFlag{} + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolvedFlag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolvedFlag) ProtoMessage() {} + +func (x *ResolvedFlag) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_api_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolvedFlag.ProtoReflect.Descriptor instead. +func (*ResolvedFlag) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_api_proto_rawDescGZIP(), []int{5} +} + +func (x *ResolvedFlag) GetFlag() string { + if x != nil { + return x.Flag + } + return "" +} + +func (x *ResolvedFlag) GetVariant() string { + if x != nil { + return x.Variant + } + return "" +} + +func (x *ResolvedFlag) GetValue() *structpb.Struct { + if x != nil { + return x.Value + } + return nil +} + +func (x *ResolvedFlag) GetFlagSchema() *v1.FlagSchema_StructFlagSchema { + if x != nil { + return x.FlagSchema + } + return nil +} + +func (x *ResolvedFlag) GetReason() resolvertypes.ResolveReason { + if x != nil { + return x.Reason + } + return resolvertypes.ResolveReason(0) +} + +func (x *ResolvedFlag) GetShouldApply() bool { + if x != nil { + return x.ShouldApply + } + return false +} + +var File_confidence_flags_resolver_v1_api_proto protoreflect.FileDescriptor + +const file_confidence_flags_resolver_v1_api_proto_rawDesc = "" + + "\n" + + "&confidence/flags/resolver/v1/api.proto\x12\x1cconfidence.flags.resolver.v1\x1a\x19google/api/resource.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a confidence/api/annotations.proto\x1a%confidence/flags/types/v1/types.proto\x1a(confidence/flags/resolver/v1/types.proto\x1a0confidence/flags/resolver/v1/events/events.proto\"\x9f\x02\n" + + "\x13ResolveFlagsRequest\x128\n" + + "\x05flags\x18\x01 \x03(\tB\"\xe2A\x01\x01\xfaA\x1b\n" + + "\x19flags.confidence.dev/FlagR\x05flags\x12L\n" + + "\x12evaluation_context\x18\x02 \x01(\v2\x17.google.protobuf.StructB\x04\xe2A\x01\x01R\x11evaluationContext\x12)\n" + + "\rclient_secret\x18\x03 \x01(\tB\x04\xe2A\x01\x02R\fclientSecret\x12\x1a\n" + + "\x05apply\x18\x04 \x01(\bB\x04\xe2A\x01\x02R\x05apply\x129\n" + + "\x03sdk\x18\x05 \x01(\v2!.confidence.flags.resolver.v1.SdkB\x04\xe2A\x01\x01R\x03sdk\"\xad\x01\n" + + "\x14ResolveFlagsResponse\x12Q\n" + + "\x0eresolved_flags\x18\x01 \x03(\v2*.confidence.flags.resolver.v1.ResolvedFlagR\rresolvedFlags\x12#\n" + + "\rresolve_token\x18\x02 \x01(\fR\fresolveToken\x12\x1d\n" + + "\n" + + "resolve_id\x18\x03 \x01(\tR\tresolveId\"\xaa\x02\n" + + "\x11ApplyFlagsRequest\x12E\n" + + "\x05flags\x18\x01 \x03(\v2).confidence.flags.resolver.v1.AppliedFlagB\x04\xe2A\x01\x02R\x05flags\x12)\n" + + "\rclient_secret\x18\x02 \x01(\tB\x04\xe2A\x01\x02R\fclientSecret\x12)\n" + + "\rresolve_token\x18\x03 \x01(\fB\x04\xe2A\x01\x02R\fresolveToken\x12=\n" + + "\tsend_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampB\x04\xe2A\x01\x02R\bsendTime\x129\n" + + "\x03sdk\x18\x05 \x01(\v2!.confidence.flags.resolver.v1.SdkB\x04\xe2A\x01\x01R\x03sdk\"\x14\n" + + "\x12ApplyFlagsResponse\"\x86\x01\n" + + "\vAppliedFlag\x126\n" + + "\x04flag\x18\x01 \x01(\tB\"\xe2A\x01\x02\xfaA\x1b\n" + + "\x19flags.confidence.dev/FlagR\x04flag\x12?\n" + + "\n" + + "apply_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampB\x04\xe2A\x01\x02R\tapplyTime\"\xf5\x02\n" + + "\fResolvedFlag\x122\n" + + "\x04flag\x18\x01 \x01(\tB\x1e\xfaA\x1b\n" + + "\x19flags.confidence.dev/FlagR\x04flag\x12;\n" + + "\avariant\x18\x02 \x01(\tB!\xfaA\x1e\n" + + "\x1cflags.confidence.dev/VariantR\avariant\x12-\n" + + "\x05value\x18\x03 \x01(\v2\x17.google.protobuf.StructR\x05value\x12W\n" + + "\vflag_schema\x18\x04 \x01(\v26.confidence.flags.types.v1.FlagSchema.StructFlagSchemaR\n" + + "flagSchema\x12C\n" + + "\x06reason\x18\x05 \x01(\x0e2+.confidence.flags.resolver.v1.ResolveReasonR\x06reason\x12'\n" + + "\fshould_apply\x18\x06 \x01(\bB\x04\xe2A\x01\x03R\vshouldApply2\xc6\x03\n" + + "\x13FlagResolverService\x12\xb3\x01\n" + + "\fResolveFlags\x121.confidence.flags.resolver.v1.ResolveFlagsRequest\x1a2.confidence.flags.resolver.v1.ResolveFlagsResponse\"<҇\xe4\x10\x1b\n" + + "\x19flags.confidence.dev/Flag\x82\xd3\xe4\x93\x02\x16:\x01*\"\x11/v1/flags:resolve\x12\xab\x01\n" + + "\n" + + "ApplyFlags\x12/.confidence.flags.resolver.v1.ApplyFlagsRequest\x1a0.confidence.flags.resolver.v1.ApplyFlagsResponse\":҇\xe4\x10\x1b\n" + + "\x19flags.confidence.dev/Flag\x82\xd3\xe4\x93\x02\x14:\x01*\"\x0f/v1/flags:apply\x1aK\xe2\x87\xe4\x10\x1aresolver.eu.confidence.dev\xe2\x87\xe4\x10\x1aresolver.us.confidence.dev\xea\x87\xe4\x10\bResolverB6\n" + + "(com.spotify.confidence.flags.resolver.v1B\bApiProtoP\x01b\x06proto3" + +var ( + file_confidence_flags_resolver_v1_api_proto_rawDescOnce sync.Once + file_confidence_flags_resolver_v1_api_proto_rawDescData []byte +) + +func file_confidence_flags_resolver_v1_api_proto_rawDescGZIP() []byte { + file_confidence_flags_resolver_v1_api_proto_rawDescOnce.Do(func() { + file_confidence_flags_resolver_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_flags_resolver_v1_api_proto_rawDesc), len(file_confidence_flags_resolver_v1_api_proto_rawDesc))) + }) + return file_confidence_flags_resolver_v1_api_proto_rawDescData +} + +var file_confidence_flags_resolver_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_confidence_flags_resolver_v1_api_proto_goTypes = []any{ + (*ResolveFlagsRequest)(nil), // 0: confidence.flags.resolver.v1.ResolveFlagsRequest + (*ResolveFlagsResponse)(nil), // 1: confidence.flags.resolver.v1.ResolveFlagsResponse + (*ApplyFlagsRequest)(nil), // 2: confidence.flags.resolver.v1.ApplyFlagsRequest + (*ApplyFlagsResponse)(nil), // 3: confidence.flags.resolver.v1.ApplyFlagsResponse + (*AppliedFlag)(nil), // 4: confidence.flags.resolver.v1.AppliedFlag + (*ResolvedFlag)(nil), // 5: confidence.flags.resolver.v1.ResolvedFlag + (*structpb.Struct)(nil), // 6: google.protobuf.Struct + (*resolvertypes.Sdk)(nil), // 7: confidence.flags.resolver.v1.Sdk + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp + (*v1.FlagSchema_StructFlagSchema)(nil), // 9: confidence.flags.types.v1.FlagSchema.StructFlagSchema + (resolvertypes.ResolveReason)(0), // 10: confidence.flags.resolver.v1.ResolveReason +} +var file_confidence_flags_resolver_v1_api_proto_depIdxs = []int32{ + 6, // 0: confidence.flags.resolver.v1.ResolveFlagsRequest.evaluation_context:type_name -> google.protobuf.Struct + 7, // 1: confidence.flags.resolver.v1.ResolveFlagsRequest.sdk:type_name -> confidence.flags.resolver.v1.Sdk + 5, // 2: confidence.flags.resolver.v1.ResolveFlagsResponse.resolved_flags:type_name -> confidence.flags.resolver.v1.ResolvedFlag + 4, // 3: confidence.flags.resolver.v1.ApplyFlagsRequest.flags:type_name -> confidence.flags.resolver.v1.AppliedFlag + 8, // 4: confidence.flags.resolver.v1.ApplyFlagsRequest.send_time:type_name -> google.protobuf.Timestamp + 7, // 5: confidence.flags.resolver.v1.ApplyFlagsRequest.sdk:type_name -> confidence.flags.resolver.v1.Sdk + 8, // 6: confidence.flags.resolver.v1.AppliedFlag.apply_time:type_name -> google.protobuf.Timestamp + 6, // 7: confidence.flags.resolver.v1.ResolvedFlag.value:type_name -> google.protobuf.Struct + 9, // 8: confidence.flags.resolver.v1.ResolvedFlag.flag_schema:type_name -> confidence.flags.types.v1.FlagSchema.StructFlagSchema + 10, // 9: confidence.flags.resolver.v1.ResolvedFlag.reason:type_name -> confidence.flags.resolver.v1.ResolveReason + 0, // 10: confidence.flags.resolver.v1.FlagResolverService.ResolveFlags:input_type -> confidence.flags.resolver.v1.ResolveFlagsRequest + 2, // 11: confidence.flags.resolver.v1.FlagResolverService.ApplyFlags:input_type -> confidence.flags.resolver.v1.ApplyFlagsRequest + 1, // 12: confidence.flags.resolver.v1.FlagResolverService.ResolveFlags:output_type -> confidence.flags.resolver.v1.ResolveFlagsResponse + 3, // 13: confidence.flags.resolver.v1.FlagResolverService.ApplyFlags:output_type -> confidence.flags.resolver.v1.ApplyFlagsResponse + 12, // [12:14] is the sub-list for method output_type + 10, // [10:12] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_confidence_flags_resolver_v1_api_proto_init() } +func file_confidence_flags_resolver_v1_api_proto_init() { + if File_confidence_flags_resolver_v1_api_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_flags_resolver_v1_api_proto_rawDesc), len(file_confidence_flags_resolver_v1_api_proto_rawDesc)), + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_confidence_flags_resolver_v1_api_proto_goTypes, + DependencyIndexes: file_confidence_flags_resolver_v1_api_proto_depIdxs, + MessageInfos: file_confidence_flags_resolver_v1_api_proto_msgTypes, + }.Build() + File_confidence_flags_resolver_v1_api_proto = out.File + file_confidence_flags_resolver_v1_api_proto_goTypes = nil + file_confidence_flags_resolver_v1_api_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/proto/resolver/wasm_api.pb.go b/openfeature-provider/go/proto/resolver/wasm_api.pb.go new file mode 100644 index 0000000..aafeee3 --- /dev/null +++ b/openfeature-provider/go/proto/resolver/wasm_api.pb.go @@ -0,0 +1,672 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v5.29.3 +// source: confidence/flags/resolver/v1/wasm_api.proto + +package resolver + +import ( + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api" + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolvertypes" + _ "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/structpb" + _ "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ResolveWithStickyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResolveRequest *ResolveFlagsRequest `protobuf:"bytes,1,opt,name=resolve_request,json=resolveRequest,proto3" json:"resolve_request,omitempty"` + // Context about the materialization required for the resolve + MaterializationsPerUnit map[string]*MaterializationMap `protobuf:"bytes,2,rep,name=materializations_per_unit,json=materializationsPerUnit,proto3" json:"materializations_per_unit,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // if a materialization info is missing, we want tor return to the caller immediately + FailFastOnSticky bool `protobuf:"varint,3,opt,name=fail_fast_on_sticky,json=failFastOnSticky,proto3" json:"fail_fast_on_sticky,omitempty"` + // if we should support sticky or completely skip the flag if they had sticky rules + NotProcessSticky bool `protobuf:"varint,4,opt,name=not_process_sticky,json=notProcessSticky,proto3" json:"not_process_sticky,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveWithStickyRequest) Reset() { + *x = ResolveWithStickyRequest{} + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveWithStickyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveWithStickyRequest) ProtoMessage() {} + +func (x *ResolveWithStickyRequest) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveWithStickyRequest.ProtoReflect.Descriptor instead. +func (*ResolveWithStickyRequest) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_wasm_api_proto_rawDescGZIP(), []int{0} +} + +func (x *ResolveWithStickyRequest) GetResolveRequest() *ResolveFlagsRequest { + if x != nil { + return x.ResolveRequest + } + return nil +} + +func (x *ResolveWithStickyRequest) GetMaterializationsPerUnit() map[string]*MaterializationMap { + if x != nil { + return x.MaterializationsPerUnit + } + return nil +} + +func (x *ResolveWithStickyRequest) GetFailFastOnSticky() bool { + if x != nil { + return x.FailFastOnSticky + } + return false +} + +func (x *ResolveWithStickyRequest) GetNotProcessSticky() bool { + if x != nil { + return x.NotProcessSticky + } + return false +} + +type MaterializationMap struct { + state protoimpl.MessageState `protogen:"open.v1"` + // materialization name to info + InfoMap map[string]*MaterializationInfo `protobuf:"bytes,1,rep,name=info_map,json=infoMap,proto3" json:"info_map,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MaterializationMap) Reset() { + *x = MaterializationMap{} + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MaterializationMap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaterializationMap) ProtoMessage() {} + +func (x *MaterializationMap) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MaterializationMap.ProtoReflect.Descriptor instead. +func (*MaterializationMap) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_wasm_api_proto_rawDescGZIP(), []int{1} +} + +func (x *MaterializationMap) GetInfoMap() map[string]*MaterializationInfo { + if x != nil { + return x.InfoMap + } + return nil +} + +type MaterializationInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + UnitInInfo bool `protobuf:"varint,1,opt,name=unit_in_info,json=unitInInfo,proto3" json:"unit_in_info,omitempty"` + RuleToVariant map[string]string `protobuf:"bytes,2,rep,name=rule_to_variant,json=ruleToVariant,proto3" json:"rule_to_variant,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MaterializationInfo) Reset() { + *x = MaterializationInfo{} + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MaterializationInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaterializationInfo) ProtoMessage() {} + +func (x *MaterializationInfo) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MaterializationInfo.ProtoReflect.Descriptor instead. +func (*MaterializationInfo) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_wasm_api_proto_rawDescGZIP(), []int{2} +} + +func (x *MaterializationInfo) GetUnitInInfo() bool { + if x != nil { + return x.UnitInInfo + } + return false +} + +func (x *MaterializationInfo) GetRuleToVariant() map[string]string { + if x != nil { + return x.RuleToVariant + } + return nil +} + +type LogMessage struct { + state protoimpl.MessageState `protogen:"open.v1"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LogMessage) Reset() { + *x = LogMessage{} + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LogMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogMessage) ProtoMessage() {} + +func (x *LogMessage) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogMessage.ProtoReflect.Descriptor instead. +func (*LogMessage) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_wasm_api_proto_rawDescGZIP(), []int{3} +} + +func (x *LogMessage) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type ResolveWithStickyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to ResolveResult: + // + // *ResolveWithStickyResponse_Success_ + // *ResolveWithStickyResponse_MissingMaterializations_ + ResolveResult isResolveWithStickyResponse_ResolveResult `protobuf_oneof:"resolve_result"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveWithStickyResponse) Reset() { + *x = ResolveWithStickyResponse{} + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveWithStickyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveWithStickyResponse) ProtoMessage() {} + +func (x *ResolveWithStickyResponse) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveWithStickyResponse.ProtoReflect.Descriptor instead. +func (*ResolveWithStickyResponse) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_wasm_api_proto_rawDescGZIP(), []int{4} +} + +func (x *ResolveWithStickyResponse) GetResolveResult() isResolveWithStickyResponse_ResolveResult { + if x != nil { + return x.ResolveResult + } + return nil +} + +func (x *ResolveWithStickyResponse) GetSuccess() *ResolveWithStickyResponse_Success { + if x != nil { + if x, ok := x.ResolveResult.(*ResolveWithStickyResponse_Success_); ok { + return x.Success + } + } + return nil +} + +func (x *ResolveWithStickyResponse) GetMissingMaterializations() *ResolveWithStickyResponse_MissingMaterializations { + if x != nil { + if x, ok := x.ResolveResult.(*ResolveWithStickyResponse_MissingMaterializations_); ok { + return x.MissingMaterializations + } + } + return nil +} + +type isResolveWithStickyResponse_ResolveResult interface { + isResolveWithStickyResponse_ResolveResult() +} + +type ResolveWithStickyResponse_Success_ struct { + Success *ResolveWithStickyResponse_Success `protobuf:"bytes,1,opt,name=success,proto3,oneof"` +} + +type ResolveWithStickyResponse_MissingMaterializations_ struct { + MissingMaterializations *ResolveWithStickyResponse_MissingMaterializations `protobuf:"bytes,2,opt,name=missing_materializations,json=missingMaterializations,proto3,oneof"` +} + +func (*ResolveWithStickyResponse_Success_) isResolveWithStickyResponse_ResolveResult() {} + +func (*ResolveWithStickyResponse_MissingMaterializations_) isResolveWithStickyResponse_ResolveResult() { +} + +type ResolveWithStickyResponse_Success struct { + state protoimpl.MessageState `protogen:"open.v1"` + Response *ResolveFlagsResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` + Updates []*ResolveWithStickyResponse_MaterializationUpdate `protobuf:"bytes,2,rep,name=updates,proto3" json:"updates,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveWithStickyResponse_Success) Reset() { + *x = ResolveWithStickyResponse_Success{} + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveWithStickyResponse_Success) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveWithStickyResponse_Success) ProtoMessage() {} + +func (x *ResolveWithStickyResponse_Success) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveWithStickyResponse_Success.ProtoReflect.Descriptor instead. +func (*ResolveWithStickyResponse_Success) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_wasm_api_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *ResolveWithStickyResponse_Success) GetResponse() *ResolveFlagsResponse { + if x != nil { + return x.Response + } + return nil +} + +func (x *ResolveWithStickyResponse_Success) GetUpdates() []*ResolveWithStickyResponse_MaterializationUpdate { + if x != nil { + return x.Updates + } + return nil +} + +type ResolveWithStickyResponse_MissingMaterializations struct { + state protoimpl.MessageState `protogen:"open.v1"` + Items []*ResolveWithStickyResponse_MissingMaterializationItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveWithStickyResponse_MissingMaterializations) Reset() { + *x = ResolveWithStickyResponse_MissingMaterializations{} + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveWithStickyResponse_MissingMaterializations) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveWithStickyResponse_MissingMaterializations) ProtoMessage() {} + +func (x *ResolveWithStickyResponse_MissingMaterializations) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveWithStickyResponse_MissingMaterializations.ProtoReflect.Descriptor instead. +func (*ResolveWithStickyResponse_MissingMaterializations) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_wasm_api_proto_rawDescGZIP(), []int{4, 1} +} + +func (x *ResolveWithStickyResponse_MissingMaterializations) GetItems() []*ResolveWithStickyResponse_MissingMaterializationItem { + if x != nil { + return x.Items + } + return nil +} + +type ResolveWithStickyResponse_MissingMaterializationItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + Unit string `protobuf:"bytes,1,opt,name=unit,proto3" json:"unit,omitempty"` + Rule string `protobuf:"bytes,2,opt,name=rule,proto3" json:"rule,omitempty"` + ReadMaterialization string `protobuf:"bytes,3,opt,name=read_materialization,json=readMaterialization,proto3" json:"read_materialization,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveWithStickyResponse_MissingMaterializationItem) Reset() { + *x = ResolveWithStickyResponse_MissingMaterializationItem{} + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveWithStickyResponse_MissingMaterializationItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveWithStickyResponse_MissingMaterializationItem) ProtoMessage() {} + +func (x *ResolveWithStickyResponse_MissingMaterializationItem) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveWithStickyResponse_MissingMaterializationItem.ProtoReflect.Descriptor instead. +func (*ResolveWithStickyResponse_MissingMaterializationItem) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_wasm_api_proto_rawDescGZIP(), []int{4, 2} +} + +func (x *ResolveWithStickyResponse_MissingMaterializationItem) GetUnit() string { + if x != nil { + return x.Unit + } + return "" +} + +func (x *ResolveWithStickyResponse_MissingMaterializationItem) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *ResolveWithStickyResponse_MissingMaterializationItem) GetReadMaterialization() string { + if x != nil { + return x.ReadMaterialization + } + return "" +} + +type ResolveWithStickyResponse_MaterializationUpdate struct { + state protoimpl.MessageState `protogen:"open.v1"` + Unit string `protobuf:"bytes,1,opt,name=unit,proto3" json:"unit,omitempty"` + WriteMaterialization string `protobuf:"bytes,2,opt,name=write_materialization,json=writeMaterialization,proto3" json:"write_materialization,omitempty"` + Rule string `protobuf:"bytes,3,opt,name=rule,proto3" json:"rule,omitempty"` + Variant string `protobuf:"bytes,4,opt,name=variant,proto3" json:"variant,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResolveWithStickyResponse_MaterializationUpdate) Reset() { + *x = ResolveWithStickyResponse_MaterializationUpdate{} + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResolveWithStickyResponse_MaterializationUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResolveWithStickyResponse_MaterializationUpdate) ProtoMessage() {} + +func (x *ResolveWithStickyResponse_MaterializationUpdate) ProtoReflect() protoreflect.Message { + mi := &file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResolveWithStickyResponse_MaterializationUpdate.ProtoReflect.Descriptor instead. +func (*ResolveWithStickyResponse_MaterializationUpdate) Descriptor() ([]byte, []int) { + return file_confidence_flags_resolver_v1_wasm_api_proto_rawDescGZIP(), []int{4, 3} +} + +func (x *ResolveWithStickyResponse_MaterializationUpdate) GetUnit() string { + if x != nil { + return x.Unit + } + return "" +} + +func (x *ResolveWithStickyResponse_MaterializationUpdate) GetWriteMaterialization() string { + if x != nil { + return x.WriteMaterialization + } + return "" +} + +func (x *ResolveWithStickyResponse_MaterializationUpdate) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *ResolveWithStickyResponse_MaterializationUpdate) GetVariant() string { + if x != nil { + return x.Variant + } + return "" +} + +var File_confidence_flags_resolver_v1_wasm_api_proto protoreflect.FileDescriptor + +const file_confidence_flags_resolver_v1_wasm_api_proto_rawDesc = "" + + "\n" + + "+confidence/flags/resolver/v1/wasm_api.proto\x12\x1cconfidence.flags.resolver.v1\x1a\x19google/api/resource.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a confidence/api/annotations.proto\x1a%confidence/flags/types/v1/types.proto\x1a(confidence/flags/resolver/v1/types.proto\x1a&confidence/flags/resolver/v1/api.proto\"\xe3\x03\n" + + "\x18ResolveWithStickyRequest\x12Z\n" + + "\x0fresolve_request\x18\x01 \x01(\v21.confidence.flags.resolver.v1.ResolveFlagsRequestR\x0eresolveRequest\x12\x8f\x01\n" + + "\x19materializations_per_unit\x18\x02 \x03(\v2S.confidence.flags.resolver.v1.ResolveWithStickyRequest.MaterializationsPerUnitEntryR\x17materializationsPerUnit\x12-\n" + + "\x13fail_fast_on_sticky\x18\x03 \x01(\bR\x10failFastOnSticky\x12,\n" + + "\x12not_process_sticky\x18\x04 \x01(\bR\x10notProcessSticky\x1a|\n" + + "\x1cMaterializationsPerUnitEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12F\n" + + "\x05value\x18\x02 \x01(\v20.confidence.flags.resolver.v1.MaterializationMapR\x05value:\x028\x01\"\xdd\x01\n" + + "\x12MaterializationMap\x12X\n" + + "\binfo_map\x18\x01 \x03(\v2=.confidence.flags.resolver.v1.MaterializationMap.InfoMapEntryR\ainfoMap\x1am\n" + + "\fInfoMapEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12G\n" + + "\x05value\x18\x02 \x01(\v21.confidence.flags.resolver.v1.MaterializationInfoR\x05value:\x028\x01\"\xe7\x01\n" + + "\x13MaterializationInfo\x12 \n" + + "\funit_in_info\x18\x01 \x01(\bR\n" + + "unitInInfo\x12l\n" + + "\x0frule_to_variant\x18\x02 \x03(\v2D.confidence.flags.resolver.v1.MaterializationInfo.RuleToVariantEntryR\rruleToVariant\x1a@\n" + + "\x12RuleToVariantEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"&\n" + + "\n" + + "LogMessage\x12\x18\n" + + "\amessage\x18\x01 \x01(\tR\amessage\"\xee\x06\n" + + "\x19ResolveWithStickyResponse\x12[\n" + + "\asuccess\x18\x01 \x01(\v2?.confidence.flags.resolver.v1.ResolveWithStickyResponse.SuccessH\x00R\asuccess\x12\x8c\x01\n" + + "\x18missing_materializations\x18\x02 \x01(\v2O.confidence.flags.resolver.v1.ResolveWithStickyResponse.MissingMaterializationsH\x00R\x17missingMaterializations\x1a\xc2\x01\n" + + "\aSuccess\x12N\n" + + "\bresponse\x18\x01 \x01(\v22.confidence.flags.resolver.v1.ResolveFlagsResponseR\bresponse\x12g\n" + + "\aupdates\x18\x02 \x03(\v2M.confidence.flags.resolver.v1.ResolveWithStickyResponse.MaterializationUpdateR\aupdates\x1a\x83\x01\n" + + "\x17MissingMaterializations\x12h\n" + + "\x05items\x18\x01 \x03(\v2R.confidence.flags.resolver.v1.ResolveWithStickyResponse.MissingMaterializationItemR\x05items\x1aw\n" + + "\x1aMissingMaterializationItem\x12\x12\n" + + "\x04unit\x18\x01 \x01(\tR\x04unit\x12\x12\n" + + "\x04rule\x18\x02 \x01(\tR\x04rule\x121\n" + + "\x14read_materialization\x18\x03 \x01(\tR\x13readMaterialization\x1a\x8e\x01\n" + + "\x15MaterializationUpdate\x12\x12\n" + + "\x04unit\x18\x01 \x01(\tR\x04unit\x123\n" + + "\x15write_materialization\x18\x02 \x01(\tR\x14writeMaterialization\x12\x12\n" + + "\x04rule\x18\x03 \x01(\tR\x04rule\x12\x18\n" + + "\avariant\x18\x04 \x01(\tR\avariantB\x10\n" + + "\x0eresolve_resultB:\n" + + "(com.spotify.confidence.flags.resolver.v1B\fWasmApiProtoP\x01b\x06proto3" + +var ( + file_confidence_flags_resolver_v1_wasm_api_proto_rawDescOnce sync.Once + file_confidence_flags_resolver_v1_wasm_api_proto_rawDescData []byte +) + +func file_confidence_flags_resolver_v1_wasm_api_proto_rawDescGZIP() []byte { + file_confidence_flags_resolver_v1_wasm_api_proto_rawDescOnce.Do(func() { + file_confidence_flags_resolver_v1_wasm_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_confidence_flags_resolver_v1_wasm_api_proto_rawDesc), len(file_confidence_flags_resolver_v1_wasm_api_proto_rawDesc))) + }) + return file_confidence_flags_resolver_v1_wasm_api_proto_rawDescData +} + +var file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_confidence_flags_resolver_v1_wasm_api_proto_goTypes = []any{ + (*ResolveWithStickyRequest)(nil), // 0: confidence.flags.resolver.v1.ResolveWithStickyRequest + (*MaterializationMap)(nil), // 1: confidence.flags.resolver.v1.MaterializationMap + (*MaterializationInfo)(nil), // 2: confidence.flags.resolver.v1.MaterializationInfo + (*LogMessage)(nil), // 3: confidence.flags.resolver.v1.LogMessage + (*ResolveWithStickyResponse)(nil), // 4: confidence.flags.resolver.v1.ResolveWithStickyResponse + nil, // 5: confidence.flags.resolver.v1.ResolveWithStickyRequest.MaterializationsPerUnitEntry + nil, // 6: confidence.flags.resolver.v1.MaterializationMap.InfoMapEntry + nil, // 7: confidence.flags.resolver.v1.MaterializationInfo.RuleToVariantEntry + (*ResolveWithStickyResponse_Success)(nil), // 8: confidence.flags.resolver.v1.ResolveWithStickyResponse.Success + (*ResolveWithStickyResponse_MissingMaterializations)(nil), // 9: confidence.flags.resolver.v1.ResolveWithStickyResponse.MissingMaterializations + (*ResolveWithStickyResponse_MissingMaterializationItem)(nil), // 10: confidence.flags.resolver.v1.ResolveWithStickyResponse.MissingMaterializationItem + (*ResolveWithStickyResponse_MaterializationUpdate)(nil), // 11: confidence.flags.resolver.v1.ResolveWithStickyResponse.MaterializationUpdate + (*ResolveFlagsRequest)(nil), // 12: confidence.flags.resolver.v1.ResolveFlagsRequest + (*ResolveFlagsResponse)(nil), // 13: confidence.flags.resolver.v1.ResolveFlagsResponse +} +var file_confidence_flags_resolver_v1_wasm_api_proto_depIdxs = []int32{ + 12, // 0: confidence.flags.resolver.v1.ResolveWithStickyRequest.resolve_request:type_name -> confidence.flags.resolver.v1.ResolveFlagsRequest + 5, // 1: confidence.flags.resolver.v1.ResolveWithStickyRequest.materializations_per_unit:type_name -> confidence.flags.resolver.v1.ResolveWithStickyRequest.MaterializationsPerUnitEntry + 6, // 2: confidence.flags.resolver.v1.MaterializationMap.info_map:type_name -> confidence.flags.resolver.v1.MaterializationMap.InfoMapEntry + 7, // 3: confidence.flags.resolver.v1.MaterializationInfo.rule_to_variant:type_name -> confidence.flags.resolver.v1.MaterializationInfo.RuleToVariantEntry + 8, // 4: confidence.flags.resolver.v1.ResolveWithStickyResponse.success:type_name -> confidence.flags.resolver.v1.ResolveWithStickyResponse.Success + 9, // 5: confidence.flags.resolver.v1.ResolveWithStickyResponse.missing_materializations:type_name -> confidence.flags.resolver.v1.ResolveWithStickyResponse.MissingMaterializations + 1, // 6: confidence.flags.resolver.v1.ResolveWithStickyRequest.MaterializationsPerUnitEntry.value:type_name -> confidence.flags.resolver.v1.MaterializationMap + 2, // 7: confidence.flags.resolver.v1.MaterializationMap.InfoMapEntry.value:type_name -> confidence.flags.resolver.v1.MaterializationInfo + 13, // 8: confidence.flags.resolver.v1.ResolveWithStickyResponse.Success.response:type_name -> confidence.flags.resolver.v1.ResolveFlagsResponse + 11, // 9: confidence.flags.resolver.v1.ResolveWithStickyResponse.Success.updates:type_name -> confidence.flags.resolver.v1.ResolveWithStickyResponse.MaterializationUpdate + 10, // 10: confidence.flags.resolver.v1.ResolveWithStickyResponse.MissingMaterializations.items:type_name -> confidence.flags.resolver.v1.ResolveWithStickyResponse.MissingMaterializationItem + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_confidence_flags_resolver_v1_wasm_api_proto_init() } +func file_confidence_flags_resolver_v1_wasm_api_proto_init() { + if File_confidence_flags_resolver_v1_wasm_api_proto != nil { + return + } + file_confidence_flags_resolver_v1_api_proto_init() + file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes[4].OneofWrappers = []any{ + (*ResolveWithStickyResponse_Success_)(nil), + (*ResolveWithStickyResponse_MissingMaterializations_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_confidence_flags_resolver_v1_wasm_api_proto_rawDesc), len(file_confidence_flags_resolver_v1_wasm_api_proto_rawDesc)), + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_confidence_flags_resolver_v1_wasm_api_proto_goTypes, + DependencyIndexes: file_confidence_flags_resolver_v1_wasm_api_proto_depIdxs, + MessageInfos: file_confidence_flags_resolver_v1_wasm_api_proto_msgTypes, + }.Build() + File_confidence_flags_resolver_v1_wasm_api_proto = out.File + file_confidence_flags_resolver_v1_wasm_api_proto_goTypes = nil + file_confidence_flags_resolver_v1_wasm_api_proto_depIdxs = nil +} diff --git a/openfeature-provider/go/provider_builder.go b/openfeature-provider/go/provider_builder.go new file mode 100644 index 0000000..6c9c339 --- /dev/null +++ b/openfeature-provider/go/provider_builder.go @@ -0,0 +1,156 @@ +package confidence + +import ( + "context" + "fmt" + + "github.com/tetratelabs/wazero" +) + +const ( + ConfidenceDomain = "edge-grpc.spotify.com" +) + +// ProviderConfig holds configuration for the Confidence provider +type ProviderConfig struct { + // Required: API credentials + APIClientID string + APIClientSecret string + ClientSecret string + + // Optional: Custom service addresses (for advanced use cases only) + // If not provided, defaults to global region + ResolverStateServiceAddr string + FlagLoggerServiceAddr string + AuthServiceAddr string +} + +// ProviderConfigWithStateProvider holds configuration for the Confidence provider with a custom StateProvider +// WARNING: This configuration is intended for testing and advanced use cases ONLY. +// For production deployments, use NewProvider() with ProviderConfig instead, which provides: +// - Automatic state fetching from Confidence backend +// - Built-in authentication and secure connections +// - Exposure event logging for analytics +// +// Only use this when you need to provide a custom state source (e.g., local file cache for testing). +type ProviderConfigWithStateProvider struct { + // Required: Client secret for signing evaluations + ClientSecret string + + // Required: State provider for fetching resolver state + StateProvider StateProvider + + // Required: Account ID + AccountId string + + // Optional: Custom WASM bytes (for advanced use cases only) + // If not provided, loads from default location + WasmBytes []byte +} + +// NewProvider creates a new Confidence OpenFeature provider with simple configuration +func NewProvider(ctx context.Context, config ProviderConfig) (*LocalResolverProvider, error) { + // Validate required fields + if config.APIClientID == "" { + return nil, fmt.Errorf("APIClientID is required") + } + if config.APIClientSecret == "" { + return nil, fmt.Errorf("APIClientSecret is required") + } + if config.ClientSecret == "" { + return nil, fmt.Errorf("ClientSecret is required") + } + + // Set service addresses to defaults if not provided + resolverStateServiceAddr := config.ResolverStateServiceAddr + if resolverStateServiceAddr == "" { + resolverStateServiceAddr = ConfidenceDomain + } + + flagLoggerServiceAddr := config.FlagLoggerServiceAddr + if flagLoggerServiceAddr == "" { + flagLoggerServiceAddr = ConfidenceDomain + } + + authServiceAddr := config.AuthServiceAddr + if authServiceAddr == "" { + authServiceAddr = ConfidenceDomain + } + + // Use embedded WASM module + wasmBytes := defaultWasmBytes + + runtimeConfig := wazero.NewRuntimeConfig() + wasmRuntime := wazero.NewRuntimeWithConfig(ctx, runtimeConfig) + + // Create LocalResolverFactory (no custom StateProvider) + factory, err := NewLocalResolverFactory( + ctx, + wasmRuntime, + wasmBytes, + resolverStateServiceAddr, + flagLoggerServiceAddr, + authServiceAddr, + config.APIClientID, + config.APIClientSecret, + nil, // stateProvider + "", // accountId (will be extracted from token) + ) + if err != nil { + wasmRuntime.Close(ctx) + return nil, fmt.Errorf("failed to create resolver factory: %w", err) + } + + // Create provider + provider := NewLocalResolverProvider(factory, config.ClientSecret) + + return provider, nil +} + +// NewProviderWithStateProvider creates a new Confidence OpenFeature provider with a custom StateProvider +// Should only be used for testing purposes. Will not emit exposure logging. +func NewProviderWithStateProvider(ctx context.Context, config ProviderConfigWithStateProvider) (*LocalResolverProvider, error) { + // Validate required fields + if config.ClientSecret == "" { + return nil, fmt.Errorf("ClientSecret is required") + } + if config.StateProvider == nil { + return nil, fmt.Errorf("StateProvider is required") + } + if config.AccountId == "" { + return nil, fmt.Errorf("AccountId is required") + } + + // Use custom WASM bytes if provided, otherwise use embedded default + wasmBytes := config.WasmBytes + if wasmBytes == nil { + wasmBytes = defaultWasmBytes + } + + runtimeConfig := wazero.NewRuntimeConfig() + wasmRuntime := wazero.NewRuntimeWithConfig(ctx, runtimeConfig) + + // Create LocalResolverFactory with StateProvider + // When using StateProvider, we don't need gRPC service addresses or API credentials + factory, err := NewLocalResolverFactory( + ctx, + wasmRuntime, + wasmBytes, + "", // resolverStateServiceAddr - not used with StateProvider + "", // flagLoggerServiceAddr - not used with StateProvider + "", // authServiceAddr - not used with StateProvider + "", // apiClientID - not used with StateProvider + "", // apiClientSecret - not used with StateProvider + config.StateProvider, // stateProvider + config.AccountId, // accountId - required with StateProvider + ) + if err != nil { + wasmRuntime.Close(ctx) + return nil, fmt.Errorf("failed to create resolver factory with provider: %w", err) + } + + // Create provider + provider := NewLocalResolverProvider(factory, config.ClientSecret) + + return provider, nil +} diff --git a/openfeature-provider/go/resolver_api.go b/openfeature-provider/go/resolver_api.go new file mode 100644 index 0000000..c906760 --- /dev/null +++ b/openfeature-provider/go/resolver_api.go @@ -0,0 +1,423 @@ +package confidence + +import ( + "context" + "encoding/binary" + "errors" + "fmt" + "log" + "sync" + "time" + + resolverv1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolverinternal" + "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/resolver" + + "github.com/tetratelabs/wazero" + "github.com/tetratelabs/wazero/api" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" + + messages "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto" +) + +// ResolverApi handles communication with the WASM module +type ResolverApi struct { + instance api.Module + module wazero.CompiledModule + runtime wazero.Runtime + + // WASM exports + wasmMsgAlloc api.Function + wasmMsgFree api.Function + wasmMsgGuestSetResolverState api.Function + wasmMsgGuestFlushLogs api.Function + wasmMsgGuestResolve api.Function + wasmMsgGuestResolveSimple api.Function + + // Flag logger for writing logs + flagLogger WasmFlagLogger + + // Mutex to protect concurrent access to WASM instance + // All WASM operations require exclusive access + mu sync.Mutex + + // Flag to indicate instance is being closed/replaced + isClosing bool + + // Flag to track if this is the first resolve call + firstResolve bool +} + +// InitializeWasmRuntime registers host functions and compiles the WASM module +// This should be called once per runtime, not per instance +func InitializeWasmRuntime(ctx context.Context, runtime wazero.Runtime, wasmBytes []byte) (wazero.CompiledModule, error) { + // Register host functions as a separate module (only once) + _, err := runtime.NewHostModuleBuilder("wasm_msg"). + NewFunctionBuilder(). + WithFunc(func(ctx context.Context, mod api.Module, ptr uint32) uint32 { + // log_resolve: ignore payload, return Void + response := &messages.Response{Result: &messages.Response_Data{Data: mustMarshal(&messages.Void{})}} + return transferResponse(mod, response) + }). + Export("wasm_msg_host_log_resolve"). + NewFunctionBuilder(). + WithFunc(func(ctx context.Context, mod api.Module, ptr uint32) uint32 { + // log_assign: ignore payload, return Void + response := &messages.Response{Result: &messages.Response_Data{Data: mustMarshal(&messages.Void{})}} + return transferResponse(mod, response) + }). + Export("wasm_msg_host_log_assign"). + NewFunctionBuilder(). + WithFunc(func(ctx context.Context, mod api.Module, ptr uint32) uint32 { + // Return current timestamp + now := time.Now() + timestamp := timestamppb.New(now) + + // Create response wrapper + response := &messages.Response{ + Result: &messages.Response_Data{ + Data: mustMarshal(timestamp), + }, + } + + return transferResponse(mod, response) + }). + Export("wasm_msg_host_current_time"). + NewFunctionBuilder(). + WithFunc(func(ctx context.Context, mod api.Module) uint32 { + return 0 + }). + Export("wasm_msg_current_thread_id"). + Instantiate(ctx) + if err != nil { + return nil, fmt.Errorf("failed to register host functions: %w", err) + } + + // Compile the WASM module + module, err := runtime.CompileModule(ctx, wasmBytes) + if err != nil { + return nil, fmt.Errorf("failed to compile WASM module: %w", err) + } + + return module, nil +} + +// NewResolverApiFromCompiled creates a new ResolverApi instance from a pre-compiled module +func NewResolverApiFromCompiled(ctx context.Context, runtime wazero.Runtime, compiledModule wazero.CompiledModule, flagLogger WasmFlagLogger) *ResolverApi { + // Instantiate the module with a unique name to allow multiple instances + // wazero requires unique module names for multiple instantiations + config := wazero.NewModuleConfig().WithName("") + instance, err := runtime.InstantiateModule(ctx, compiledModule, config) + if err != nil { + panic(fmt.Sprintf("Failed to instantiate WASM module: %v", err)) + } + + // Get exported functions + wasmMsgAlloc := instance.ExportedFunction("wasm_msg_alloc") + wasmMsgFree := instance.ExportedFunction("wasm_msg_free") + wasmMsgGuestSetResolverState := instance.ExportedFunction("wasm_msg_guest_set_resolver_state") + wasmMsgGuestFlushLogs := instance.ExportedFunction("wasm_msg_guest_flush_logs") + wasmMsgGuestResolve := instance.ExportedFunction("wasm_msg_guest_resolve") + + if wasmMsgAlloc == nil || wasmMsgFree == nil || wasmMsgGuestSetResolverState == nil || wasmMsgGuestFlushLogs == nil || wasmMsgGuestResolve == nil { + panic("Required WASM exports not found") + } + + return &ResolverApi{ + instance: instance, + module: compiledModule, + runtime: runtime, + wasmMsgAlloc: wasmMsgAlloc, + wasmMsgFree: wasmMsgFree, + wasmMsgGuestSetResolverState: wasmMsgGuestSetResolverState, + wasmMsgGuestFlushLogs: wasmMsgGuestFlushLogs, + wasmMsgGuestResolve: wasmMsgGuestResolve, + flagLogger: flagLogger, + firstResolve: true, + } +} + +// FlushLogs flushes any pending logs from the WASM module and writes them via the flag logger +func (r *ResolverApi) FlushLogs() error { + r.mu.Lock() + // Mark instance as closing to prevent new resolves + r.isClosing = true + defer r.mu.Unlock() + + ctx := context.Background() + // Create Void request + voidRequest := &messages.Void{} + reqPtr := r.transferRequest(voidRequest) + + // Call the WASM flush_logs function + results, err := r.wasmMsgGuestFlushLogs.Call(ctx, uint64(reqPtr)) + if err != nil { + return fmt.Errorf("failed to call wasm_msg_guest_flush_logs: %w", err) + } + + // Consume the response which contains WriteFlagLogsRequest + respPtr := uint32(results[0]) + + // If the response pointer is 0, there are no logs to flush + if respPtr == 0 { + return nil + } + logRequest := &resolverv1.WriteFlagLogsRequest{} + err = r.consumeResponse(respPtr, logRequest) + if err != nil { + println(err.Error()) + // Silently ignore errors during flush - this is normal during shutdown + // when the WASM module may have already been partially cleaned up + return nil + } + + // Write logs via the flag logger + if r.flagLogger != nil && (len(logRequest.FlagAssigned) > 0 || len(logRequest.ClientResolveInfo) > 0 || len(logRequest.FlagResolveInfo) > 0) { + if err := r.flagLogger.Write(ctx, logRequest); err != nil { + log.Printf("Failed to write flushed logs: %v", err) + } + } else { + log.Printf("No flag logs were found") + } + + return nil +} + +// Close closes the WASM instance +// Note: This does NOT close the compiled module, as it may be shared across instances +func (r *ResolverApi) Close(ctx context.Context) { + log.Printf("Flushing WASM instance") + err := r.FlushLogs() + if err != nil { + log.Printf("Flushing failed: %v", err) + return + } + if r.instance != nil { + err := r.instance.Close(ctx) + if err != nil { + return + } + } +} + +// SetResolverState sets the resolver state in the WASM module +func (r *ResolverApi) SetResolverState(state []byte, accountId string) error { + // Use write lock for SetResolverState - blocks all other access + r.mu.Lock() + defer r.mu.Unlock() + + ctx := context.Background() + log.Printf("Setting resolver state for account %s", accountId) + + // Create SetResolverStateRequest + setStateRequest := &messages.SetResolverStateRequest{ + State: state, + AccountId: accountId, + } + + // Wrap in Request + request := &messages.Request{ + Data: mustMarshal(setStateRequest), + } + + // Transfer request to WASM memory + req, _ := proto.Marshal(request) + reqPtr := r.transfer(req) + + // Call the WASM function + results, err := r.wasmMsgGuestSetResolverState.Call(ctx, uint64(reqPtr)) + if err != nil { + return fmt.Errorf("failed to call wasm_msg_guest_set_resolver_state: %w", err) + } + + // Consume the response + respPtr := uint32(results[0]) + r.consume(respPtr) + + return nil +} + +// ErrInstanceClosed is returned when the WASM instance is being closed/swapped +var ErrInstanceClosed = errors.New("WASM instance is closed or being replaced") + +// Resolve resolves flags using the WASM module +func (r *ResolverApi) Resolve(request *resolver.ResolveFlagsRequest) (*resolver.ResolveFlagsResponse, error) { + // Acquire lock first, then check isClosing flag to prevent race condition + // where instance could be marked as closing between check and lock acquisition. + // If closing, return immediately with ErrInstanceClosed to prevent using stale instance. + r.mu.Lock() + if r.isClosing { + defer r.mu.Unlock() + return nil, ErrInstanceClosed + } + defer r.mu.Unlock() + + ctx := context.Background() + // Transfer request to WASM memory + reqPtr := r.transferRequest(request) + + // Call the WASM function + results, err := r.wasmMsgGuestResolve.Call(ctx, uint64(reqPtr)) + if err != nil { + return nil, fmt.Errorf("failed to call wasm_msg_guest_resolve: %w", err) + } + + // Consume the response + respPtr := uint32(results[0]) + response := &resolver.ResolveFlagsResponse{} + err = r.consumeResponse(respPtr, response) + if err != nil { + log.Printf("Resolve failed with error: %v", err) + return nil, err + } + + return response, nil +} + +// transferRequest transfers a protobuf message to WASM memory +func (r *ResolverApi) transferRequest(message proto.Message) uint32 { + data := mustMarshal(message) + request := &messages.Request{ + Data: data, + } + return r.transfer(mustMarshal(request)) +} + +// transferResponseSuccess transfers a successful response to WASM memory +func (r *ResolverApi) transferResponseSuccess(response proto.Message) uint32 { + data := mustMarshal(response) + resp := &messages.Response{ + Result: &messages.Response_Data{ + Data: data, + }, + } + return r.transfer(mustMarshal(resp)) +} + +// transferResponseError transfers an error response to WASM memory +func (r *ResolverApi) transferResponseError(error string) uint32 { + resp := &messages.Response{ + Result: &messages.Response_Error{ + Error: error, + }, + } + return r.transfer(mustMarshal(resp)) +} + +// consumeResponse consumes a response from WASM memory +func (r *ResolverApi) consumeResponse(addr uint32, target proto.Message) error { + response := &messages.Response{} + data := r.consume(addr) + + if data == nil { + return fmt.Errorf("failed to consume WASM memory at address: %d", addr) + } + + if err := proto.Unmarshal(data, response); err != nil { + return fmt.Errorf("failed to unmarshal response: %w", err) + } + + if err := response.GetError(); err != "" { + return errors.New(err) + } + return proto.Unmarshal(response.GetData(), target) +} + +// consumeRequest consumes a request from WASM memory +func (r *ResolverApi) consumeRequest(addr uint32, target proto.Message) error { + request := &messages.Request{} + data := r.consume(addr) + mustUnmarshal(data, request) + + return proto.Unmarshal(request.Data, target) +} + +// transfer allocates memory in WASM and copies data +func (r *ResolverApi) transfer(data []byte) uint32 { + ctx := context.Background() + + // Allocate memory in WASM + results, err := r.wasmMsgAlloc.Call(ctx, uint64(len(data))) + if err != nil { + // Log memory size when allocation fails + if r.instance != nil && r.instance.Memory() != nil { + memorySize := r.instance.Memory().Size() + log.Printf("Failed to allocate %d bytes. Current WASM memory size: %d bytes (%d pages). Error: %v", + len(data), memorySize, memorySize/65536, err) + } + panic(fmt.Sprintf("Failed to allocate memory: %v", err)) + } + + addr := uint32(results[0]) + + // Write data to WASM memory + memory := r.instance.Memory() + memory.Write(addr, data) + + return addr +} + +// consume reads data from WASM memory and frees it +func (r *ResolverApi) consume(addr uint32) []byte { + memory := r.instance.Memory() + + // Read length (assuming 4-byte length prefix) + lenBytes, ok := memory.Read(addr-4, 4) + if !ok { + return nil + } + length := binary.LittleEndian.Uint32(lenBytes) - 4 + + // Read data + data, ok := memory.Read(addr, length) + if !ok { + return nil + } + + // Make a copy of the data before freeing the WASM memory + // This prevents race conditions where the caller uses the data after we free it + dataCopy := make([]byte, length) + copy(dataCopy, data) + + // Free memory + ctx := context.Background() + _, err := r.wasmMsgFree.Call(ctx, uint64(addr)) + if err != nil { + return nil + } + + return dataCopy +} + +// transferResponse is a helper function for host functions to transfer responses +func transferResponse(m api.Module, response proto.Message) uint32 { + data := mustMarshal(response) + + // Allocate memory + ctx := context.Background() + results, err := m.ExportedFunction("wasm_msg_alloc").Call(ctx, uint64(len(data))) + if err != nil { + panic(fmt.Sprintf("Failed to allocate memory in host function: %v", err)) + } + + addr := uint32(results[0]) + memory := m.Memory() + memory.Write(addr, data) + + return addr +} + +// mustMarshal is a helper function that panics on marshal errors +func mustMarshal(message proto.Message) []byte { + data, err := proto.Marshal(message) + if err != nil { + panic(fmt.Sprintf("Failed to marshal protobuf: %v", err)) + } + return data +} + +func mustUnmarshal(data []byte, target proto.Message) { + if err := proto.Unmarshal(data, target); err != nil { + panic(fmt.Sprintf("Failed to unmarshal protobuf: %v", err)) + } +} diff --git a/openfeature-provider/go/scripts/generate_proto.sh b/openfeature-provider/go/scripts/generate_proto.sh new file mode 100755 index 0000000..7e7ac2e --- /dev/null +++ b/openfeature-provider/go/scripts/generate_proto.sh @@ -0,0 +1,204 @@ +#!/bin/bash + +set -e + +# Add Go bin to PATH +export PATH=$PATH:$(go env GOPATH)/bin + +# Check for required tools +if ! command -v protoc &> /dev/null; then + echo "Error: protoc is not installed. Please install Protocol Buffers compiler." >&2 + exit 1 +fi + +if ! command -v protoc-gen-go &> /dev/null; then + echo "Error: protoc-gen-go is not installed." >&2 + echo "Install with: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest" >&2 + exit 1 +fi + +if ! command -v protoc-gen-go-grpc &> /dev/null; then + echo "Error: protoc-gen-go-grpc is not installed." >&2 + echo "Install with: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest" >&2 + exit 1 +fi + +# Generate protobuf Go files +echo "Generating protobuf Go files..." + +mkdir -p proto + +# Generate wasm messages proto (WASM-specific types) +protoc --proto_path=../../wasm/proto \ + --go_out=proto \ + --go_opt=paths=source_relative \ + --go_opt=Mmessages.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto \ + messages.proto + +# Generate base types and annotations first (these have no confidence dependencies) +mkdir -p proto/confidence/auth/v1 +mkdir -p proto/confidence/api +mkdir -p proto/confidence/events/v1 +protoc --proto_path=../../confidence-resolver/protos \ + --proto_path=../java/target/protoc-dependencies/fb94b2d0c5936e4cf7aa794a2caf00da \ + --proto_path=../java/target/protoc-dependencies/45da6e25a3df602921e82a52a83b342b \ + --go_out=proto \ + --go_opt=paths=source_relative \ + --go_opt=Mconfidence/auth/v1/auth.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1 \ + --go_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + confidence/auth/v1/auth.proto \ + confidence/api/annotations.proto \ + confidence/events/v1/annotations.proto + +# Generate flag types (no confidence dependencies except annotations) +mkdir -p proto/confidence/flags/types/v1 +protoc --proto_path=../../confidence-resolver/protos \ + --proto_path=../java/target/protoc-dependencies/fb94b2d0c5936e4cf7aa794a2caf00da \ + --proto_path=../java/target/protoc-dependencies/45da6e25a3df602921e82a52a83b342b \ + --go_out=proto \ + --go_opt=paths=source_relative \ + --go_opt=Mconfidence/flags/types/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go_opt=Mconfidence/flags/types/v1/target.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + confidence/flags/types/v1/types.proto \ + confidence/flags/types/v1/target.proto + +# Generate IAM proto (depends on auth) +mkdir -p proto/confidence/iam/v1 +protoc --proto_path=../../confidence-resolver/protos \ + --proto_path=../java/target/protoc-dependencies/fb94b2d0c5936e4cf7aa794a2caf00da \ + --proto_path=../java/target/protoc-dependencies/45da6e25a3df602921e82a52a83b342b \ + --go_out=proto \ + --go_opt=paths=source_relative \ + --go_opt=Mconfidence/iam/v1/iam.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/iam/v1 \ + --go_opt=Mconfidence/auth/v1/auth.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1 \ + --go_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + confidence/iam/v1/iam.proto + +# Generate admin events and types (depend on flags/types) +mkdir -p proto/confidence/flags/admin/v1/events +protoc --proto_path=../../confidence-resolver/protos \ + --proto_path=../java/target/protoc-dependencies/fb94b2d0c5936e4cf7aa794a2caf00da \ + --proto_path=../java/target/protoc-dependencies/45da6e25a3df602921e82a52a83b342b \ + --go_out=proto \ + --go_opt=paths=source_relative \ + --go_opt=Mconfidence/flags/admin/v1/events/events.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1/events \ + --go_opt=Mconfidence/flags/admin/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1 \ + --go_opt=Mconfidence/flags/types/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go_opt=Mconfidence/flags/types/v1/target.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + confidence/flags/admin/v1/events/events.proto \ + confidence/flags/admin/v1/types.proto + +# Generate admin resolver state service (depends on admin types, flags types, iam, auth) +mkdir -p proto/confidence/flags/admin/v1 +protoc --proto_path=../../confidence-resolver/protos \ + --proto_path=../java/target/protoc-dependencies/fb94b2d0c5936e4cf7aa794a2caf00da \ + --proto_path=../java/target/protoc-dependencies/45da6e25a3df602921e82a52a83b342b \ + --go_out=proto \ + --go_opt=paths=source_relative \ + --go_opt=Mconfidence/flags/admin/v1/resolver.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1 \ + --go_opt=Mconfidence/flags/admin/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1 \ + --go_opt=Mconfidence/flags/types/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go_opt=Mconfidence/flags/types/v1/target.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go_opt=Mconfidence/iam/v1/iam.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/iam/v1 \ + --go_opt=Mconfidence/auth/v1/auth.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1 \ + --go_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + --go_opt=Mconfidence/flags/admin/v1/events/events.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1/events \ + --go-grpc_out=proto \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_opt=Mconfidence/flags/admin/v1/resolver.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1 \ + --go-grpc_opt=Mconfidence/flags/admin/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1 \ + --go-grpc_opt=Mconfidence/flags/types/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go-grpc_opt=Mconfidence/flags/types/v1/target.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go-grpc_opt=Mconfidence/iam/v1/iam.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/iam/v1 \ + --go-grpc_opt=Mconfidence/auth/v1/auth.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1 \ + --go-grpc_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go-grpc_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + --go-grpc_opt=Mconfidence/flags/admin/v1/events/events.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1/events \ + confidence/flags/admin/v1/resolver.proto + +# Generate internal flag logger service +mkdir -p proto/confidence/flags/resolverinternal +mkdir -p proto/confidence/flags/resolvertypes +mkdir -p proto/confidence/flags/resolverevents +protoc --proto_path=../../confidence-resolver/protos \ + --proto_path=../java/target/protoc-dependencies/fb94b2d0c5936e4cf7aa794a2caf00da \ + --proto_path=../java/target/protoc-dependencies/45da6e25a3df602921e82a52a83b342b \ + --go_out=proto \ + --go_opt=module=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto \ + --go_opt=Mconfidence/flags/resolver/v1/internal_api.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolverinternal \ + --go_opt=Mconfidence/flags/resolver/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolvertypes \ + --go_opt=Mconfidence/flags/resolver/v1/events/events.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolverevents \ + --go_opt=Mconfidence/flags/types/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go_opt=Mconfidence/flags/types/v1/target.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + --go_opt=Mconfidence/flags/admin/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1 \ + --go_opt=Mconfidence/flags/admin/v1/events/events.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1/events \ + --go_opt=Mconfidence/auth/v1/auth.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1 \ + --go-grpc_out=proto \ + --go-grpc_opt=module=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto \ + --go-grpc_opt=Mconfidence/flags/resolver/v1/internal_api.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolverinternal \ + --go-grpc_opt=Mconfidence/flags/resolver/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolvertypes \ + --go-grpc_opt=Mconfidence/flags/resolver/v1/events/events.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolverevents \ + --go-grpc_opt=Mconfidence/flags/types/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go-grpc_opt=Mconfidence/flags/types/v1/target.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go-grpc_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go-grpc_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + --go-grpc_opt=Mconfidence/flags/admin/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1 \ + --go-grpc_opt=Mconfidence/flags/admin/v1/events/events.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1/events \ + --go-grpc_opt=Mconfidence/auth/v1/auth.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1 \ + confidence/flags/resolver/v1/internal_api.proto \ + confidence/flags/resolver/v1/types.proto \ + confidence/flags/resolver/v1/events/events.proto + +# Generate auth service with gRPC stubs +mkdir -p proto/confidence/iam/v1 +protoc --proto_path=../../confidence-resolver/protos \ + --proto_path=../java/target/protoc-dependencies/fb94b2d0c5936e4cf7aa794a2caf00da \ + --proto_path=../java/target/protoc-dependencies/45da6e25a3df602921e82a52a83b342b \ + --go_out=proto \ + --go_opt=paths=source_relative \ + --go_opt=Mconfidence/iam/v1/auth_api.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/iam/v1 \ + --go_opt=Mconfidence/iam/v1/iam.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/iam/v1 \ + --go_opt=Mconfidence/auth/v1/auth.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1 \ + --go_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + --go-grpc_out=proto \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_opt=Mconfidence/iam/v1/auth_api.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/iam/v1 \ + --go-grpc_opt=Mconfidence/iam/v1/iam.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/iam/v1 \ + --go-grpc_opt=Mconfidence/auth/v1/auth.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/auth/v1 \ + --go-grpc_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go-grpc_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + confidence/iam/v1/auth_api.proto + +# Note: All supporting types have been generated in previous steps + +# Generate resolver API and WASM API proto (for resolver interface) - must be last as it depends on other protos +mkdir -p proto/resolver +protoc --proto_path=../../confidence-resolver/protos \ + --proto_path=../java/target/protoc-dependencies/fb94b2d0c5936e4cf7aa794a2caf00da \ + --proto_path=../java/target/protoc-dependencies/45da6e25a3df602921e82a52a83b342b \ + --go_out=proto \ + --go_opt=module=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto \ + --go_opt=Mconfidence/flags/resolver/v1/api.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/resolver \ + --go_opt=Mconfidence/flags/resolver/v1/wasm_api.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/resolver \ + --go_opt=Mconfidence/flags/resolver/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolvertypes \ + --go_opt=Mconfidence/flags/types/v1/types.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go_opt=Mconfidence/flags/types/v1/target.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/types/v1 \ + --go_opt=Mconfidence/api/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/api \ + --go_opt=Mconfidence/events/v1/annotations.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/events/v1 \ + --go_opt=Mconfidence/flags/resolver/v1/events/events.proto=github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/resolverevents \ + confidence/flags/resolver/v1/api.proto \ + confidence/flags/resolver/v1/wasm_api.proto + +echo "Protobuf generation complete!" +echo "Generated files:" +find proto -name "*.go" -type f diff --git a/openfeature-provider/go/state_fetcher.go b/openfeature-provider/go/state_fetcher.go new file mode 100644 index 0000000..1440218 --- /dev/null +++ b/openfeature-provider/go/state_fetcher.go @@ -0,0 +1,175 @@ +package confidence + +import ( + "context" + "io" + "log" + "net/http" + "sync/atomic" + "time" + + adminv1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/flags/admin/v1" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" +) + +// FlagsAdminStateFetcher fetches and updates the resolver state from the admin service +type FlagsAdminStateFetcher struct { + resolverStateService adminv1.ResolverStateServiceClient + accountName string + etag atomic.Value // stores string + rawResolverState atomic.Value // stores []byte + resolverStateURI atomic.Value // stores *adminv1.ResolverStateUriResponse + refreshTime atomic.Value // stores time.Time + accountID string + httpClient *http.Client +} + +// NewFlagsAdminStateFetcher creates a new FlagsAdminStateFetcher +func NewFlagsAdminStateFetcher( + resolverStateService adminv1.ResolverStateServiceClient, + accountName string, +) *FlagsAdminStateFetcher { + f := &FlagsAdminStateFetcher{ + resolverStateService: resolverStateService, + accountName: accountName, + httpClient: &http.Client{ + Timeout: 30 * time.Second, + }, + } + // Initialize with empty state + emptyState := &adminv1.ResolverState{} + if b, err := proto.Marshal(emptyState); err == nil { + f.rawResolverState.Store(b) + } + return f +} + +// GetRawState returns the current raw resolver state +func (f *FlagsAdminStateFetcher) GetRawState() []byte { + if state := f.rawResolverState.Load(); state != nil { + return state.([]byte) + } + return nil +} + +// GetAccountID returns the account ID +func (f *FlagsAdminStateFetcher) GetAccountID() string { + return f.accountID +} + +// Reload fetches and updates the state if it has changed +func (f *FlagsAdminStateFetcher) Reload(ctx context.Context) error { + if err := f.fetchAndUpdateStateIfChanged(ctx); err != nil { + log.Printf("Failed to reload, ignoring reload: %v", err) + return err + } + return nil +} + +// Provide implements the StateProvider interface +// Returns the latest resolver state, fetching it if needed +// On error, returns cached state (if available) to maintain availability +func (f *FlagsAdminStateFetcher) Provide(ctx context.Context) ([]byte, error) { + // Try to fetch the latest state + err := f.Reload(ctx) + // Always return the current state (cached or fresh) + // This ensures availability even if fetch fails + return f.GetRawState(), err +} + +// getResolverFileURI gets the signed URI for downloading the resolver state +func (f *FlagsAdminStateFetcher) getResolverFileURI(ctx context.Context) (*adminv1.ResolverStateUriResponse, error) { + now := time.Now() + + // Check if we have a cached URI that's still valid + if cached := f.resolverStateURI.Load(); cached != nil { + cachedURI := cached.(*adminv1.ResolverStateUriResponse) + if refreshTime := f.refreshTime.Load(); refreshTime != nil { + if now.Before(refreshTime.(time.Time)) { + return cachedURI, nil + } + } + } + + // Fetch new URI with timeout + rpcCtx, cancel := context.WithTimeout(ctx, 10*time.Second) + defer cancel() + + resp, err := f.resolverStateService.ResolverStateUri(rpcCtx, &adminv1.ResolverStateUriRequest{}) + if err != nil { + return nil, err + } + + f.resolverStateURI.Store(resp) + + // Calculate refresh time (half of TTL) + expireTime := resp.ExpireTime.AsTime() + ttl := expireTime.Sub(now) + refreshTime := now.Add(ttl / 2) + f.refreshTime.Store(refreshTime) + + return resp, nil +} + +// fetchAndUpdateStateIfChanged fetches the state from the signed URI if it has changed +func (f *FlagsAdminStateFetcher) fetchAndUpdateStateIfChanged(ctx context.Context) error { + response, err := f.getResolverFileURI(ctx) + if err != nil { + return err + } + + f.accountID = response.Account + uri := response.SignedUri + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, uri, nil) + if err != nil { + return err + } + + // Add If-None-Match header if we have a previous ETag + if previousEtag := f.etag.Load(); previousEtag != nil { + req.Header.Set("If-None-Match", previousEtag.(string)) + } + + resp, err := f.httpClient.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + + // Check if content was modified + if resp.StatusCode == http.StatusNotModified { + // Not modified, nothing to update + return nil + } + + if resp.StatusCode != http.StatusOK { + return err + } + + // Read the new state + bytes, err := io.ReadAll(resp.Body) + if err != nil { + return err + } + + // Get and store the new ETag + etag := resp.Header.Get("ETag") + f.etag.Store(etag) + + // Update the raw state + f.rawResolverState.Store(bytes) + + log.Printf("Loaded resolver state for %s, etag=%s", f.accountName, etag) + + return nil +} + +// toInstant converts a protobuf Timestamp to time.Time +func toInstant(ts *timestamppb.Timestamp) time.Time { + if ts == nil { + return time.Time{} + } + return ts.AsTime() +} diff --git a/openfeature-provider/go/swap_wasm_resolver_api.go b/openfeature-provider/go/swap_wasm_resolver_api.go new file mode 100644 index 0000000..7474332 --- /dev/null +++ b/openfeature-provider/go/swap_wasm_resolver_api.go @@ -0,0 +1,102 @@ +package confidence + +import ( + "context" + "errors" + "sync" + "sync/atomic" + + "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/resolver" + "github.com/tetratelabs/wazero" +) + +// SwapWasmResolverApi wraps ResolverApi and allows atomic swapping of instances +// Similar to Java's SwapWasmResolverApi, it creates a new instance on each state update, +// swaps it atomically, and closes the old one (which flushes logs) +type SwapWasmResolverApi struct { + // Atomic reference to the current ResolverApi instance + currentInstance atomic.Value // stores *ResolverApi + + // Mutex to protect the swap operation + swapMu sync.Mutex + + // Dependencies needed to create new instances + runtime wazero.Runtime + compiledModule wazero.CompiledModule + flagLogger WasmFlagLogger +} + +// NewSwapWasmResolverApi creates a new SwapWasmResolverApi with an initial state +func NewSwapWasmResolverApi( + ctx context.Context, + runtime wazero.Runtime, + wasmBytes []byte, + flagLogger WasmFlagLogger, + initialState []byte, + accountId string, +) (*SwapWasmResolverApi, error) { + // Initialize host functions and compile module once + compiledModule, err := InitializeWasmRuntime(ctx, runtime, wasmBytes) + if err != nil { + return nil, err + } + + swap := &SwapWasmResolverApi{ + runtime: runtime, + compiledModule: compiledModule, + flagLogger: flagLogger, + } + + // Create initial instance + initialInstance := NewResolverApiFromCompiled(ctx, runtime, compiledModule, flagLogger) + if err := initialInstance.SetResolverState(initialState, accountId); err != nil { + return nil, err + } + + swap.currentInstance.Store(initialInstance) + + return swap, nil +} + +func (s *SwapWasmResolverApi) UpdateStateAndFlushLogs(state []byte, accountId string) error { + // Lock to ensure only one swap operation happens at a time + s.swapMu.Lock() + defer s.swapMu.Unlock() + + ctx := context.Background() + + // Create a new instance with the updated state + newInstance := NewResolverApiFromCompiled(ctx, s.runtime, s.compiledModule, s.flagLogger) + if err := newInstance.SetResolverState(state, accountId); err != nil { + return err + } + + // Atomically swap to the new instance + oldInstance := s.currentInstance.Swap(newInstance).(*ResolverApi) + + // Close the old instance (which flushes logs) + oldInstance.Close(ctx) + return nil +} + +func (s *SwapWasmResolverApi) Resolve(request *resolver.ResolveFlagsRequest) (*resolver.ResolveFlagsResponse, error) { + // Lock to ensure resolve doesn't happen during swap + instance := s.currentInstance.Load().(*ResolverApi) + response, err := instance.Resolve(request) + + // If instance is closed, retry with the current instance (which may have been swapped) + if err != nil && errors.Is(err, ErrInstanceClosed) { + instance = s.currentInstance.Load().(*ResolverApi) + return instance.Resolve(request) + } + + return response, err +} + +// Close closes the current ResolverApi instance +func (s *SwapWasmResolverApi) Close(ctx context.Context) { + instance := s.currentInstance.Load().(*ResolverApi) + if instance != nil { + instance.Close(ctx) + } +} diff --git a/openfeature-provider/go/token_holder.go b/openfeature-provider/go/token_holder.go new file mode 100644 index 0000000..0792790 --- /dev/null +++ b/openfeature-provider/go/token_holder.go @@ -0,0 +1,146 @@ +package confidence + +import ( + "context" + "encoding/base64" + "encoding/json" + "fmt" + "log" + "strings" + "sync" + "time" + + iamv1 "github.com/spotify/confidence-resolver-rust/openfeature-provider/go/confidence/proto/confidence/iam/v1" +) + +const ( + accountNameClaim = "https://confidence.dev/account_name" + // Refresh token 1 hour before expiration + tokenRefreshMargin = 1 * time.Hour +) + +// Token represents an access token with its metadata +type Token struct { + AccessToken string + Account string + Expiration time.Time +} + +// TokenHolder manages access token caching and retrieval +type TokenHolder struct { + apiClientID string + apiClientSecret string + stub iamv1.AuthServiceClient + + mu sync.RWMutex + token *Token +} + +// NewTokenHolder creates a new TokenHolder +func NewTokenHolder(apiClientID, apiClientSecret string, stub iamv1.AuthServiceClient) *TokenHolder { + return &TokenHolder{ + apiClientID: apiClientID, + apiClientSecret: apiClientSecret, + stub: stub, + } +} + +// GetToken retrieves a cached or new token +func (h *TokenHolder) GetToken(ctx context.Context) (*Token, error) { + h.mu.RLock() + token := h.token + h.mu.RUnlock() + + // Check if we have a valid cached token + if token != nil && time.Now().Before(token.Expiration.Add(-tokenRefreshMargin)) { + return token, nil + } + + // Need to request a new token + h.mu.Lock() + defer h.mu.Unlock() + + // Double-check after acquiring write lock + if h.token != nil && time.Now().Before(h.token.Expiration.Add(-tokenRefreshMargin)) { + return h.token, nil + } + + // Request new token + newToken, err := h.requestAccessToken(ctx) + if err != nil { + return nil, err + } + + h.token = newToken + return newToken, nil +} + +// requestAccessToken requests a new access token from the auth service +func (h *TokenHolder) requestAccessToken(ctx context.Context) (*Token, error) { + request := &iamv1.RequestAccessTokenRequest{ + ClientId: h.apiClientID, + ClientSecret: h.apiClientSecret, + GrantType: "client_credentials", + } + + // Create a context with a 10-second deadline for the RPC + rpcCtx, cancel := context.WithTimeout(ctx, 10*time.Second) + defer cancel() + + response, err := h.stub.RequestAccessToken(rpcCtx, request) + if err != nil { + return nil, fmt.Errorf("failed to request access token: %w", err) + } + + accessToken := response.GetAccessToken() + expiresIn := response.GetExpiresIn() + + // Decode JWT to extract account name + account, err := extractAccountFromJWT(accessToken) + if err != nil { + log.Printf("Warning: failed to extract account from JWT: %v", err) + account = "unknown" + } + + expiration := time.Now().Add(time.Duration(expiresIn) * time.Second) + + return &Token{ + AccessToken: accessToken, + Account: account, + Expiration: expiration, + }, nil +} + +// extractAccountFromJWT extracts the account name claim from a JWT token +func extractAccountFromJWT(token string) (string, error) { + // JWT format: header.payload.signature + parts := strings.Split(token, ".") + if len(parts) != 3 { + return "", fmt.Errorf("invalid JWT format") + } + + // Decode the payload (second part) + payload, err := base64.RawURLEncoding.DecodeString(parts[1]) + if err != nil { + return "", fmt.Errorf("failed to decode JWT payload: %w", err) + } + + // Parse JSON + var claims map[string]interface{} + if err := json.Unmarshal(payload, &claims); err != nil { + return "", fmt.Errorf("failed to parse JWT claims: %w", err) + } + + // Extract account name claim + accountClaim, ok := claims[accountNameClaim] + if !ok { + return "", fmt.Errorf("missing required claim '%s' in JWT", accountNameClaim) + } + + accountName, ok := accountClaim.(string) + if !ok { + return "", fmt.Errorf("claim '%s' is not a string", accountNameClaim) + } + + return accountName, nil +} diff --git a/openfeature-provider/go/wasm/confidence_resolver.wasm b/openfeature-provider/go/wasm/confidence_resolver.wasm new file mode 100755 index 0000000..bade334 Binary files /dev/null and b/openfeature-provider/go/wasm/confidence_resolver.wasm differ diff --git a/openfeature-provider/go/wasm_data.go b/openfeature-provider/go/wasm_data.go new file mode 100644 index 0000000..3bd5e22 --- /dev/null +++ b/openfeature-provider/go/wasm_data.go @@ -0,0 +1,12 @@ +package confidence + +import _ "embed" + +// defaultWasmBytes contains the embedded WASM resolver module. +// This file is automatically populated during the build process from wasm/confidence_resolver.wasm. +// The WASM file is built from the Rust source in wasm/rust-guest/ and must be kept in sync. +// +// CI validates that this embedded file matches the built WASM to prevent version drift. + +//go:embed wasm/confidence_resolver.wasm +var defaultWasmBytes []byte diff --git a/release-please-config.json b/release-please-config.json index 3bbbc3c..4ff7b43 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -43,6 +43,12 @@ "release-type": "rust", "changelog-path": "CHANGELOG.md", "extra-files": ["package.json"] + }, + "openfeature-provider/go": { + "path": "openfeature-provider/go", + "release-type": "rust", + "changelog-path": "CHANGELOG.md", + "initial-version": "0.0.1" } } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e4919f2..a7b02b4 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.90" +channel = "1.90.0" components = ["rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"] profile = "minimal"