Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions runtime/internal/routes/auth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package routes

import "net/http"

func init() {
registerPrivateRoute(authSecretsHandler)
}

func authSecretsHandler(c Config) (Path, http.Handler, error) {
}

Check failure on line 10 in runtime/internal/routes/auth.go

View workflow job for this annotation

GitHub Actions / MacOSRuntimeTests

missing return

Check failure on line 10 in runtime/internal/routes/auth.go

View workflow job for this annotation

GitHub Actions / WindowsRuntimeTests

missing return

Check failure on line 10 in runtime/internal/routes/auth.go

View workflow job for this annotation

GitHub Actions / Unit Tests

missing return
26 changes: 26 additions & 0 deletions runtime/internal/services/authsecrets/authsecrets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package authsecrets

import (
"context"

"github.com/docker/secrets-engine/runtime/internal/registry"
"github.com/docker/secrets-engine/x/logging"
"github.com/docker/secrets-engine/x/secrets"
"github.com/docker/secrets-engine/x/telemetry"
)

func New() Service {
return &authService{}

Check failure on line 13 in runtime/internal/services/authsecrets/authsecrets.go

View workflow job for this annotation

GitHub Actions / MacOSRuntimeTests

cannot use &authService{} (value of type *authService) as Service value in return statement: *authService does not implement Service (missing method Delete)

Check failure on line 13 in runtime/internal/services/authsecrets/authsecrets.go

View workflow job for this annotation

GitHub Actions / WindowsRuntimeTests

cannot use &authService{} (value of type *authService) as Service value in return statement: *authService does not implement Service (missing method Delete)

Check failure on line 13 in runtime/internal/services/authsecrets/authsecrets.go

View workflow job for this annotation

GitHub Actions / Unit Tests

cannot use &authService{} (value of type *authService) as Service value in return statement: *authService does not implement Service (missing method Delete)
}

type Service interface {
Save(ctx context.Context, id secrets.ID, secret secrets.Envelope) error
Delete(ctx context.Context, id secrets.ID) error
Get(ctx context.Context, id secrets.ID) (secrets.Envelope, error)
}

type authService struct {
reg registry.Registry
logger logging.Logger
tracker telemetry.Tracker
}
1 change: 1 addition & 0 deletions x/api/authsecrets/secrets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package authsecrets
68 changes: 68 additions & 0 deletions x/api/authsecrets/v1/api.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
edition = "2023";

package resolver.v1;

import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";

option go_package = "github.com/docker/secrets-engine/x/api/authsecrets/v1;authsecretsv1";

service AuthSecretsService {
// Resolve a secret by its ID.
rpc GetSecrets(GetAuthSecretRequest) returns (GetAuthSecretResponse);
rpc SetSecret(SetAuthSecretRequest) returns (SetAuthSecretResponse);
rpc DeleteSecret(DeleteAuthSecretRequest) returns (DeleteAuthSecretResponse);
}

message DeleteAuthSecretRequest {
// ID of the secret
string id = 1;
}

message DeleteAuthSecretResponse {}

message GetAuthSecretRequest {
// ID of the secret to resolve.
string pattern = 1;
}

message SetAuthSecretRequest {
// ID of the secret
string id = 1;
string username = 2;
string email = 3;
// The secret value
bytes value = 4;
// The public metadata of the secret
map<string, string> metadata = 5;
google.protobuf.Timestamp expires_at = 10;
}

message SetAuthSecretResponse {}

message GetAuthSecretResponse {
repeated AuthSecret secrets = 1;

message AuthSecret {
// ID of the secret to resolve.
string id = 1;
// The resolved secret value.
bytes value = 2;

string username = 3;

string email = 4;

string provider = 5;

map<string, string> metadata = 6;

string version = 7;

google.protobuf.Timestamp created_at = 8;

google.protobuf.Timestamp resolved_at = 9;

google.protobuf.Timestamp expires_at = 10;
}
}
Loading