Class: CDK8sPlus25::K8S::Subject
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- CDK8sPlus25::K8S::Subject
- Defined in:
- k8_s/subject.rb
Overview
Subject contains a reference to the object or user identities a role binding applies to.
This can either hold a direct API object reference, or a value for non-objects such as user and group names.
Instance Attribute Summary collapse
-
#api_group ⇒ String?
readonly
APIGroup holds the API group of the referenced subject.
-
#kind ⇒ String
readonly
Kind of object being referenced.
-
#name ⇒ String
readonly
Name of the object being referenced.
-
#namespace ⇒ String?
readonly
Namespace of the referenced object.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(kind:, name:, api_group: nil, namespace: nil) ⇒ Subject
constructor
A new instance of Subject.
- #to_jsii ⇒ Object
Constructor Details
#initialize(kind:, name:, api_group: nil, namespace: nil) ⇒ Subject
Returns a new instance of Subject.
13 14 15 16 17 18 19 20 21 22 |
# File 'k8_s/subject.rb', line 13 def initialize(kind:, name:, api_group: nil, namespace: nil) @kind = kind Jsii::Type.check_type(@kind, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "kind") @name = name Jsii::Type.check_type(@name, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "name") @api_group = api_group Jsii::Type.check_type(@api_group, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "apiGroup") unless @api_group.nil? @namespace = namespace Jsii::Type.check_type(@namespace, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "namespace") unless @namespace.nil? end |
Instance Attribute Details
#api_group ⇒ String? (readonly)
Default: for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
APIGroup holds the API group of the referenced subject.
Defaults to "" for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io" for User and Group subjects.
40 41 42 |
# File 'k8_s/subject.rb', line 40 def api_group @api_group end |
#kind ⇒ String (readonly)
Kind of object being referenced.
Values defined by this API group are "User", "Group", and "ServiceAccount". If the Authorizer does not recognized the kind value, the Authorizer should report an error.
29 30 31 |
# File 'k8_s/subject.rb', line 29 def kind @kind end |
#name ⇒ String (readonly)
Name of the object being referenced.
33 34 35 |
# File 'k8_s/subject.rb', line 33 def name @name end |
#namespace ⇒ String? (readonly)
Namespace of the referenced object.
If the object kind is non-namespace, such as "User" or "Group", and this value is not empty the Authorizer should report an error.
46 47 48 |
# File 'k8_s/subject.rb', line 46 def namespace @namespace end |
Class Method Details
.jsii_properties ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'k8_s/subject.rb', line 48 def self.jsii_properties { :kind => "kind", :name => "name", :api_group => "apiGroup", :namespace => "namespace", } end |
Instance Method Details
#to_jsii ⇒ Object
57 58 59 60 61 62 63 64 65 66 |
# File 'k8_s/subject.rb', line 57 def to_jsii result = {} result.merge!({ "kind" => @kind, "name" => @name, "apiGroup" => @api_group, "namespace" => @namespace, }) result.compact end |