You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Phase Secrets SDK provides a Go package for managing secrets in your application environments using the Phase service. This SDK let's you create, retrieve, update, and delete secrets, with end-to-end encryption with just a few lines of code.
3
+
The Phase Secrets SDK provides a Go package for managing secrets in your application environments using the Phase service. This SDK allows you to create, retrieve, update, and delete secrets with end-to-end encryption using just a few lines of code.
4
4
5
-
## Features:
5
+
## Features
6
6
7
-
- End-to-end encrypting secret CRUD
8
-
- Cross and local env secret referencing
9
-
-Built in handling of rate limiting
7
+
- End-to-end encrypted secret CRUD operations
8
+
- Cross-environment and local environment secret referencing
|`${KEY}`|same environment |`/`| KEY | Local reference in the same environment and path root (/).|
16
-
|`${staging.DEBUG}`|`dev`|`/` (root of staging environment) | DEBUG | Cross-environment reference to a secret at the root (/).|
17
-
|`${prod./frontend/SECRET_KEY}`|`prod`|`/frontend/`| SECRET_KEY | Cross-environment reference to a secret in a specific path.|
18
-
|`${/backend/payments/STRIPE_KEY}`|same environment |`/backend/payments/`| STRIPE_KEY | Local reference with a specified path within the same environment.|
|`${KEY}`|Same environment |`/`| KEY | Local reference in the same environment and root path (/). |
16
+
|`${staging.DEBUG}`|`staging`|`/` (root of staging environment) | DEBUG | Cross-environment reference to a secret at the root (/). |
17
+
|`${prod./frontend/SECRET_KEY}`|`prod`|`/frontend/`| SECRET_KEY | Cross-environment reference to a secret in a specific path. |
18
+
|`${/backend/payments/STRIPE_KEY}`|Same environment |`/backend/payments/`| STRIPE_KEY | Local reference with a specified path. |
19
19
20
20
## Installation
21
21
22
22
This SDK uses the `sodium` package to perform cryptographic operations, on most system you will need to install the `libsodium` library as a system dependency. Here's how you can install `libsodium` or its development packages on different platforms, including macOS, Ubuntu, Debian, Arch Linux, Alpine Linux, and Windows.
23
23
24
-
### macOS
24
+
This SDK uses the `sodium` package for cryptographic operations. On most systems, you'll need to install the `libsodium` library as a system dependency.
For Windows, download pre-built binaries from the [libsodium GitHub releases page](https://github.com/jedisct1/libsodium/releases). Choose the appropriate version for your system architecture and follow the included instructions.
55
53
56
54
On Windows, the process is a bit different due to the variety of development environments. However, you can download pre-built binaries from the official [libsodium GitHub releases page](https://github.com/jedisct1/libsodium/releases). Choose the appropriate version for your system architecture (e.g., Win32 or Win64), download it, and follow the instructions included to integrate `libsodium` with your development environment. For development with Visual Studio, you'll typically include the header files and link against the `libsodium.lib` or `libsodium.dll` file.
57
55
@@ -66,23 +64,23 @@ If you're using a package manager like `vcpkg` or `chocolatey`, you can also fin
66
64
choco install libsodium
67
65
```
68
66
69
-
Remember, after installing the library, you might need to configure your project or environment variables to locate the `libsodium` libraries correctly, especially on Windows.
67
+
### Installing the SDK
70
68
71
-
Next, start using the Phase SDK in your Go project, install it using `go get`:
69
+
To start using the Phase SDK in your Go project, install it using `go get`:
72
70
73
71
```bash
74
72
go get github.com/phasehq/golang-sdk/phase
75
73
```
76
74
77
-
Make sure to import the SDK in your Go files:
75
+
Import the SDK in your Go files:
78
76
79
77
```go
80
78
import"github.com/phasehq/golang-sdk/phase"
81
79
```
82
80
83
81
## Configuration
84
82
85
-
Before you can interact with the Phase service, you need to initialize the SDK with your service token and the host information.
83
+
Initialize the SDK with your service token and host information:
86
84
87
85
```go
88
86
package main
@@ -94,8 +92,8 @@ import (
94
92
95
93
funcmain() {
96
94
serviceToken:="pss_service:v1:....."
97
-
host:="https://console.phase.dev"// Change this for a selfhosted instance of Phase
98
-
debug:=false
95
+
host:="https://console.phase.dev"// Change this for a self-hosted instance of Phase
96
+
debug:=false// For logging verbosity, disable in production
For more information and advanced usage, refer to the [Phase Docs](https://docs.phase.dev/sdks/go).
183
+
For more information on advanced usage, including detailed API references and best practices, please refer to the [Phase Docs](https://docs.phase.dev/sdks/go).
184
+
184
185
185
-
---
186
+
If you encounter any issues or have questions, please file an issue on the [GitHub repository](https://github.com/phasehq/golang-sdk) or contact our support team over [Slack](https://slack.phase.dev).
0 commit comments