Port envd from e2b with internalized shared packages and Connect RPC
- Copy envd source from e2b-dev/infra, internalize shared dependencies
into envd/internal/shared/ (keys, filesystem, id, smap, utils)
- Switch from gRPC to Connect RPC for all envd services
- Update module paths to git.omukk.dev/wrenn/{sandbox,sandbox/envd}
- Add proto specs (process, filesystem) with buf-based code generation
- Implement full envd: process exec, filesystem ops, port forwarding,
cgroup management, MMDS integration, and HTTP API
- Update main module dependencies (firecracker SDK, pgx, goose, etc.)
- Remove placeholder .gitkeep files replaced by real implementations
This commit is contained in:
20
envd/internal/shared/keys/sha512.go
Normal file
20
envd/internal/shared/keys/sha512.go
Normal file
@ -0,0 +1,20 @@
|
||||
package keys
|
||||
|
||||
import (
|
||||
"crypto/sha512"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
// HashAccessToken computes the SHA-512 hash of an access token.
|
||||
func HashAccessToken(token string) string {
|
||||
h := sha512.Sum512([]byte(token))
|
||||
|
||||
return hex.EncodeToString(h[:])
|
||||
}
|
||||
|
||||
// HashAccessTokenBytes computes the SHA-512 hash of an access token from bytes.
|
||||
func HashAccessTokenBytes(token []byte) string {
|
||||
h := sha512.Sum512(token)
|
||||
|
||||
return hex.EncodeToString(h[:])
|
||||
}
|
||||
Reference in New Issue
Block a user