Multi-Project Isolation
GCP resource names follow projects/{project}/.... floci-gcp uses the GCP project ID as the multi-tenancy boundary — resources created in one project are invisible to another.
How It Works
Every GCP resource name is scoped to a project:
projects/my-project/topics/my-topic
projects/my-project/subscriptions/my-sub
projects/my-project/databases/(default)/documents/...
projects/my-project/secrets/my-secret
floci-gcp extracts the project ID from each request and uses it to namespace all storage keys via ProjectAwareStorageBackend. Two requests with different project IDs see completely independent data sets.
Project ID Resolution Order
floci-gcp resolves the project ID in this order:
- URL path segment —
projects/{project}/... x-goog-request-paramsheader —project=...FLOCI_GCP_DEFAULT_PROJECT_IDfallback (default:floci-local)
Working with Multiple Projects
export PUBSUB_EMULATOR_HOST=localhost:4578
# Create the same topic name in two different projects — fully isolated
gcloud pubsub topics create my-topic --project=project-a
gcloud pubsub topics create my-topic --project=project-b
# List topics in each project independently
gcloud pubsub topics list --project=project-a
gcloud pubsub topics list --project=project-b
Default Project
The default project ID is floci-local. Change it with:
Or via Docker Compose:
SDK Examples
// Pub/Sub — specify project explicitly
TopicName topicA = TopicName.of("project-a", "my-topic");
TopicName topicB = TopicName.of("project-b", "my-topic");
topicAdminClient.createTopic(topicA);
topicAdminClient.createTopic(topicB);
// These are fully independent — listing topics for project-a won't show project-b