SDKs
The Speedle SDKs are client libraries for the decision API POST /authz-check/v1/is-allowed. They work with a self-hosted Speedle ADS and with Speedle Cloud. Each language page shows how to add the package and gives a complete, tested program for both. The source and the full reference are in teramoby/speedle-sdk.
Packages
All packages are version 0.1.0. Each language page shows the install command.
- Java: Maven Central
io.speedle:speedle-sdk, published. - Python: PyPI
speedle, published. - Go: Go module
github.com/teramoby/speedle-sdk/go, published. - C#/.NET: NuGet
Speedle.Sdk, published. - Rust: crates.io
speedle, published. - Node.js / TypeScript: npm
@speedle/sdk, not yet published.
Features
| Feature | Status |
|---|---|
isAllowed: returns the decision |
All six SDKs |
check: returns the decision and the reason, for example that no policy applies |
All six SDKs |
| Self-hosted Speedle ADS | All six SDKs |
| Speedle Cloud | Coming soon |
The method names follow each language’s conventions: is_allowed and check in Python and Rust, IsAllowed and Check in Go, IsAllowedAsync and CheckAsync in .NET.
For the other operations, such as granted permissions, diagnosis and policy management, use the REST APIs: the authorization decision API and the policy management API.
Example policy
Every example asks whether user alice may get and delete the resource /docs/public in the service docs. To get the documented answers from a local Speedle, build it and start PMS on port 6733 and ADS on port 6734 as in the Quick Start, then create the service and the policy:
./bin/spctl --pms-endpoint http://127.0.0.1:6733/policy-mgmt/v1/ create service docs
./bin/spctl --pms-endpoint http://127.0.0.1:6733/policy-mgmt/v1/ create policy -c "grant user alice get,list /docs/public" --service-name=docsThe local examples connect to http://localhost:6734 without credentials. The SDKs accept plain http:// only for a loopback host; use HTTPS for any other ADS.
Speedle Cloud is coming soon. The Speedle Cloud examples connect to https://cloud.speedle.io and read the service name and its service-scoped token from the environment variables SPEEDLE_SERVICE and SPEEDLE_TOKEN. Create the same policy in that service to get the same answers. The token is a server-side secret: never ship it to browsers, mobile apps or desktop clients.