chore(API): add set/remove alias suffix API definitions (#6757)
* chore: add set/remove alias suffix API definitions * fix(test): revert alias_test changes * revert alias_test.go changes
This commit is contained in:
1 parent
6f03523372
commit
969bd5f66d
8 files changed
+891
-46
No files matched your search
@@ -645,6 +645,16 @@ func (s *Service) DetachStoragePolicy(ctx context.Context, req *pbs.DetachStorag
|
||||
return nil, status.Errorf(codes.Unimplemented, "Policies are an Enterprise-only feature")
|
||||
}
|
||||
|
||||
// SetAliasSuffix implements the interface pbs.ScopeServiceServer.
|
||||
func (s *Service) SetAliasSuffix(ctx context.Context, req *pbs.SetAliasSuffixRequest) (*pbs.SetAliasSuffixResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "Alias suffixes are an Enterprise-only feature")
|
||||
}
|
||||
|
||||
// RemoveAliasSuffix implements the interface pbs.ScopeServiceServer.
|
||||
func (s *Service) RemoveAliasSuffix(ctx context.Context, req *pbs.RemoveAliasSuffixRequest) (*pbs.RemoveAliasSuffixResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "Alias suffixes are an Enterprise-only feature")
|
||||
}
|
||||
|
||||
func (s *Service) getFromRepo(ctx context.Context, id string) (*iam.Scope, error) {
|
||||
repo, err := s.repoFn()
|
||||
if err != nil {
|
||||
|
||||
@@ -3188,3 +3188,27 @@ func TestDetachStoragePolicy(t *testing.T) {
|
||||
assert.Equal(t, gotStatus.Message(), "Policies are an Enterprise-only feature")
|
||||
})
|
||||
}
|
||||
|
||||
func TestSetAliasSuffix(t *testing.T) {
|
||||
t.Run("unimplemented", func(t *testing.T) {
|
||||
service := &scopes.Service{}
|
||||
_, err := service.SetAliasSuffix(context.Background(), &pbs.SetAliasSuffixRequest{})
|
||||
require.Error(t, err)
|
||||
gotStatus, ok := status.FromError(err)
|
||||
require.True(t, ok)
|
||||
assert.Equal(t, gotStatus.Code(), codes.Unimplemented)
|
||||
assert.Equal(t, gotStatus.Message(), "Alias suffixes are an Enterprise-only feature")
|
||||
})
|
||||
}
|
||||
|
||||
func TestRemoveAliasSuffix(t *testing.T) {
|
||||
t.Run("unimplemented", func(t *testing.T) {
|
||||
service := &scopes.Service{}
|
||||
_, err := service.RemoveAliasSuffix(context.Background(), &pbs.RemoveAliasSuffixRequest{})
|
||||
require.Error(t, err)
|
||||
gotStatus, ok := status.FromError(err)
|
||||
require.True(t, ok)
|
||||
assert.Equal(t, gotStatus.Code(), codes.Unimplemented)
|
||||
assert.Equal(t, gotStatus.Message(), "Alias suffixes are an Enterprise-only feature")
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user