Packages
gcp_compute
0.2.0
Spawn and manage Google Compute Engine instances over the REST API, with pluggable auth, telemetry, and an ergonomic instance builder.
Current section
Files
Jump to
Current section
Files
gcp_compute
CHANGELOG.md
CHANGELOG.md
# Changelog
All notable changes to this project are documented here. The format is based on
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- **Compute REST client layer.**
- `GcpCompute` facade: `insert_instance/3`, `insert_instance_and_wait/3`,
`get_instance/3`, `list_instances/2`, `list_instances_page/2`,
`delete_instance/3`, `delete_instance_and_wait/3`, `start_instance/3`,
`stop_instance/3`, `wait_for_operation/3`, `config/2`, `clear_config/2`.
- `GcpCompute.Config` — NimbleOptions-validated config / client handle with
`new/1`, `new!/1`, `production/1`, `local/1`, `local!/1`, `from_env/2`.
- `GcpCompute.TokenProvider` behaviour with `Goth` (optional dep) and `Static`
adapters.
- `GcpCompute.Instance` — `spec/1` insert-body builder (Spot VM defaults) plus
parsing and `external_ip/1` / `internal_ip/1` accessors.
- `GcpCompute.Instances` (`list_page/2` surfaces `nextPageToken`) and
`GcpCompute.Operations` modules.
- `GcpCompute.Operation` and `GcpCompute.Error` data types.
- `GcpCompute.Telemetry` — `[:gcp_compute, :request, :start | :stop | :exception]`
spans on every API call.
### Security
- **Cleartext bearer tokens rejected.** `GcpCompute.Config.new/1` now requires an `https://`
`base_url` unless you explicitly pass `allow_insecure: true` (for a local emulator/proxy on
a trusted network). Gating on that flag rather than the token provider means even a `Static`
provider holding a real out-of-band token stays TLS-only by default. `local/1` sets
`allow_insecure: true` for you. The scheme check is case-insensitive. Applies to `from_env/2`
and any direct `new/1` use, not just `production/1`.
- **`req_options` can no longer override auth or URL.** The request `:method`,
`:url`, and `:auth` are always computed by the library and layered on top of the
app-supplied `req_options`, which is treated as trusted transport config.
- **Fail closed on a missing token.** A `nil`/empty token now returns
`{:error, %GcpCompute.Error{reason: :missing_token}}` before any request goes
out, instead of sending an unauthenticated call.
- **No secrets in error messages.** Token-fetch failures use a fixed
`"token fetch failed"` message; the raw reason is kept only in `:body`, which
`GcpCompute.Error`'s `Inspect` implementation redacts.
### Changed
- `GcpCompute.Instances.insert_and_wait/3` returns
`{:error, %GcpCompute.Error{reason: :missing_instance_name}}` for a name-less
spec instead of raising `ArgumentError`.
### Notes
- The Compute Engine API is REST/JSON only (no gRPC); transport is `Req`.
- A higher-level sandbox orchestration layer (gen_statem, DynamicSupervisor,
reaper, profiles) is planned on top of this client.
[Unreleased]: https://github.com/nyo16/gcp_compute/commits/master