model

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Copyright 2022 The Casbin Authors. All Rights Reserved.

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.

Copyright 2022 The Casbin Authors. All Rights Reserved.

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

Constants

This section is empty.

Variables

View Source
var IsExternalClient bool = true

Functions

func Init

func Init()

func ModelMacroSubstitution

func ModelMacroSubstitution(originalModelText string) string

func MountDeploymentObject

func MountDeploymentObject(admissionReview *admission.AdmissionReview) error

func MountIngressObject

func MountIngressObject(admissionReview *admission.AdmissionReview) error

func MountPodObject

func MountPodObject(admissionReview *admission.AdmissionReview) error

func MountServiceObject

func MountServiceObject(admissionReview *admission.AdmissionReview) error

Types

type EnforcerWrapper

type EnforcerWrapper struct {
	Enforcer  *casbin.Enforcer
	ModelName string
}

type ModelAdaptorPair

type ModelAdaptorPair struct {
	Name    string
	Model   model.Model
	Adaptor persist.Adapter
}

type ModelLoader

type ModelLoader struct {
	// contains filtered or unexported fields
}

func NewModelLoader

func NewModelLoader(namespace string, isExternalClient bool) (*ModelLoader, error)

func (*ModelLoader) GetModelAndAdaptors

func (m *ModelLoader) GetModelAndAdaptors() ([]ModelAdaptorPair, error)

type SyncEnforcerList

type SyncEnforcerList struct {
	sync.Mutex
	Enforcers []*EnforcerWrapper
	// contains filtered or unexported fields
}
var EnforcerList *SyncEnforcerList

func NewSyncEnforcerList

func NewSyncEnforcerList() *SyncEnforcerList

func (*SyncEnforcerList) Enforce

func (s *SyncEnforcerList) Enforce(admission *admission.AdmissionReview) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL