Skip to content

Latest commit

 

History

43 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcloud.wasm

Google Cloud APIs as WebAssembly Components (WASI Preview 2).

Components

auth

Google Cloud authentication component. Exports gcloud:auth/token-source interface.

Supports Application Default Credentials (ADC) with authorized_user refresh token flow.

cd auth
make build

storage

Google Cloud Storage component. Exports gcloud:storage/buckets interface.

cd storage
make build

secretmanager

Google Cloud Secret Manager component. Exports gcloud:secretmanager/secrets interface.

cd secretmanager
make build

Examples

Prerequisites

  • Rust (wasm32-wasip2 target)
  • wkg (WIT dependency management)
  • wac (component composition)
  • wasmtime

examples/auth

Demonstrates using the gcloud:auth/token-source interface to obtain an access token.

cd examples/auth
make build
make run

examples/storage

Demonstrates using the gcloud:storage/buckets interface to list buckets.

cd examples/storage
make build
GOOGLE_CLOUD_PROJECT=your-project make run

examples/secretmanager

Demonstrates using the gcloud:secretmanager/secrets interface to access a secret.

cd examples/secretmanager
make build
SECRET_NAME=projects/your-project/secrets/your-secret/versions/latest make run

How it works

  1. cargo build --target wasm32-wasip2 builds each component/example as a WASM component
  2. wac compose composes components using a declarative compose.wac file to satisfy imports
  3. wasmtime run executes the composed component

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages