Documentation ¶
Overview ¶
Package role manages roles in Kvdb and provides validation Copyright 2018 Portworx
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package role manages roles in Kvdb and provides validation Copyright 2018 Portworx
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type RoleManager
- type SdkRoleManager
- func (r *SdkRoleManager) Create(ctx context.Context, req *api.SdkRoleCreateRequest) (*api.SdkRoleCreateResponse, error)
- func (r *SdkRoleManager) Delete(ctx context.Context, req *api.SdkRoleDeleteRequest) (*api.SdkRoleDeleteResponse, error)
- func (r *SdkRoleManager) Enumerate(ctx context.Context, req *api.SdkRoleEnumerateRequest) (*api.SdkRoleEnumerateResponse, error)
- func (r *SdkRoleManager) Inspect(ctx context.Context, req *api.SdkRoleInspectRequest) (*api.SdkRoleInspectResponse, error)
- func (r *SdkRoleManager) Update(ctx context.Context, req *api.SdkRoleUpdateRequest) (*api.SdkRoleUpdateResponse, error)
- func (r *SdkRoleManager) Verify(ctx context.Context, roles []string, fullmethod string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RoleManager ¶
type RoleManager interface { api.OpenStorageRoleServer // Verify returns no error if the role exists and is allowed // to run the requested method Verify(ctx context.Context, roles []string, method string) error }
RoleManager provides an implementation of the SDK Role handler and the necessary verification methods
type SdkRoleManager ¶
type SdkRoleManager struct {
// contains filtered or unexported fields
}
SdkRoleManager is an implementation of the RoleManager for the SDK
func NewSdkRoleManager ¶
func NewSdkRoleManager(kv kvdb.Kvdb) (*SdkRoleManager, error)
NewSdkRoleManager returns a new SDK role manager
func (*SdkRoleManager) Create ¶
func (r *SdkRoleManager) Create( ctx context.Context, req *api.SdkRoleCreateRequest, ) (*api.SdkRoleCreateResponse, error)
Create saves a role in Kvdb
func (*SdkRoleManager) Delete ¶
func (r *SdkRoleManager) Delete( ctx context.Context, req *api.SdkRoleDeleteRequest, ) (*api.SdkRoleDeleteResponse, error)
Delete removes a role from Kvdb
func (*SdkRoleManager) Enumerate ¶
func (r *SdkRoleManager) Enumerate( ctx context.Context, req *api.SdkRoleEnumerateRequest, ) (*api.SdkRoleEnumerateResponse, error)
Enumerate returns a list of role names
func (*SdkRoleManager) Inspect ¶
func (r *SdkRoleManager) Inspect( ctx context.Context, req *api.SdkRoleInspectRequest, ) (*api.SdkRoleInspectResponse, error)
Inspect returns a role object
func (*SdkRoleManager) Update ¶
func (r *SdkRoleManager) Update( ctx context.Context, req *api.SdkRoleUpdateRequest, ) (*api.SdkRoleUpdateResponse, error)
Update replaces an existing role.