Class AuditAnnotation

  • All Implemented Interfaces:
    com.marcnuri.yakc.model.Model

    public class AuditAnnotation
    extends java.lang.Object
    implements com.marcnuri.yakc.model.Model
    AuditAnnotation describes how to produce an audit annotation for an API request.
    • Constructor Summary

      Constructors 
      Constructor Description
      AuditAnnotation()  
      AuditAnnotation​(@NonNull java.lang.String key, @NonNull java.lang.String valueExpression)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static AuditAnnotation.Builder builder()  
      protected boolean canEqual​(java.lang.Object other)  
      boolean equals​(java.lang.Object o)  
      @NonNull java.lang.String getKey()
      key specifies the audit annotation key.
      @NonNull java.lang.String getValueExpression()
      valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value.
      int hashCode()  
      void setKey​(@NonNull java.lang.String key)
      key specifies the audit annotation key.
      void setValueExpression​(@NonNull java.lang.String valueExpression)
      valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value.
      AuditAnnotation.Builder toBuilder()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AuditAnnotation

        public AuditAnnotation​(@NonNull
                               @NonNull java.lang.String key,
                               @NonNull
                               @NonNull java.lang.String valueExpression)
      • AuditAnnotation

        public AuditAnnotation()
    • Method Detail

      • getKey

        @NonNull
        public @NonNull java.lang.String getKey()
        key specifies the audit annotation key. The audit annotation keys of a ValidatingAdmissionPolicy must be unique. The key must be a qualified name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.


        The key is combined with the resource name of the ValidatingAdmissionPolicy to construct an audit annotation key: "{ValidatingAdmissionPolicy name}/{key}".


        If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy and the same audit annotation key, the annotation key will be identical. In this case, the first annotation written with the key will be included in the audit event and all subsequent annotations with the same key will be discarded.


        Required.

      • getValueExpression

        @NonNull
        public @NonNull java.lang.String getValueExpression()
        valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value. The expression must evaluate to either a string or null value. If the expression evaluates to a string, the audit annotation is included with the string value. If the expression evaluates to null or empty string the audit annotation will be omitted. The valueExpression may be no longer than 5kb in length. If the result of the valueExpression is more than 10kb in length, it will be truncated to 10kb.


        If multiple ValidatingAdmissionPolicyBinding resources match an API request, then the valueExpression will be evaluated for each binding. All unique values produced by the valueExpressions will be joined together in a comma-separated list.


        Required.

      • setKey

        public void setKey​(@NonNull
                           @NonNull java.lang.String key)
        key specifies the audit annotation key. The audit annotation keys of a ValidatingAdmissionPolicy must be unique. The key must be a qualified name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.


        The key is combined with the resource name of the ValidatingAdmissionPolicy to construct an audit annotation key: "{ValidatingAdmissionPolicy name}/{key}".


        If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy and the same audit annotation key, the annotation key will be identical. In this case, the first annotation written with the key will be included in the audit event and all subsequent annotations with the same key will be discarded.


        Required.

      • setValueExpression

        public void setValueExpression​(@NonNull
                                       @NonNull java.lang.String valueExpression)
        valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value. The expression must evaluate to either a string or null value. If the expression evaluates to a string, the audit annotation is included with the string value. If the expression evaluates to null or empty string the audit annotation will be omitted. The valueExpression may be no longer than 5kb in length. If the result of the valueExpression is more than 10kb in length, it will be truncated to 10kb.


        If multiple ValidatingAdmissionPolicyBinding resources match an API request, then the valueExpression will be evaluated for each binding. All unique values produced by the valueExpressions will be joined together in a comma-separated list.


        Required.

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object