1 /* 2 Copyright 2021 The Flux authors 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package acl 18 19 // AccessFrom defines an ACL for allowing cross-namespace references to a source object 20 // based on the caller's namespace labels. 21 type AccessFrom struct { 22 // NamespaceSelectors is the list of namespace selectors to which this ACL applies. 23 // Items in this list are evaluated using a logical OR operation. 24 // +required 25 NamespaceSelectors []NamespaceSelector `json:"namespaceSelectors"` 26 } 27 28 // NamespaceSelector selects the namespaces to which this ACL applies. 29 // An empty map of MatchLabels matches all namespaces in a cluster. 30 type NamespaceSelector struct { 31 // MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels 32 // map is equivalent to an element of matchExpressions, whose key field is "key", the 33 // operator is "In", and the values array contains only "value". The requirements are ANDed. 34 // +optional 35 MatchLabels map[string]string `json:"matchLabels,omitempty"` 36 } 37