feat: complete MVP epics E7-E10 (provisioning, console proxy, audit, frontend)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package sshkey
|
||||
|
||||
import "context"
|
||||
|
||||
type PublicKeyResolver struct {
|
||||
repository Repository
|
||||
}
|
||||
|
||||
func NewPublicKeyResolver(repository Repository) PublicKeyResolver {
|
||||
return PublicKeyResolver{repository: repository}
|
||||
}
|
||||
|
||||
func (r PublicKeyResolver) GetPublicKey(ctx context.Context, profileID string, keyID string) (string, bool, error) {
|
||||
key, found, err := r.repository.Get(ctx, profileID, keyID)
|
||||
if err != nil {
|
||||
return "", false, err
|
||||
}
|
||||
if !found {
|
||||
return "", false, nil
|
||||
}
|
||||
return key.PublicKey, true, nil
|
||||
}
|
||||
Reference in New Issue
Block a user