-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flush out resource client a bit more
- Loading branch information
1 parent
d7a41ce
commit 3a05175
Showing
3 changed files
with
138 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package vault | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/solo-io/solo-kit/pkg/api/v1/resources" | ||
) | ||
|
||
var _ error = new(UnrecoverableConversionError) | ||
|
||
type SecretConverter interface { | ||
// FromSecret accepts the raw value of a Vault secret and returns the Gloo representation | ||
// of that secret. An error is returned if the conversion failed | ||
FromSecret(ctx context.Context, secret Secret) (resources.Resource, error) | ||
} | ||
|
||
type UnrecoverableConversionError struct { | ||
Err error | ||
} | ||
|
||
func UnrecoverableConversionErr(err error) UnrecoverableConversionError { | ||
return UnrecoverableConversionError{ | ||
Err: err, | ||
} | ||
} | ||
|
||
func (u UnrecoverableConversionError) Error() string { | ||
return fmt.Sprintf("UnrecoverableConversionError: %v", u.Err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package vault | ||
|
||
// Resources represents the raw data models returned by the Vault API | ||
|
||
type Certificate map[string]string | ||
|
||
type Secret struct { | ||
Certificate | ||
} | ||
|
||
type SecretList []Secret |