Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for withAudit (0.17 sec)

  1. staging/src/k8s.io/apiserver/pkg/admission/audit_test.go

    		ac := audit.AuditContextFrom(ctx)
    		ae := &ac.Event
    		ae.Level = auditinternal.LevelMetadata
    		auditHandler := WithAudit(handler)
    		a := attributes()
    
    		assert.Equal(t, handler.Handles(Create), auditHandler.Handles(Create), tcName+": WithAudit decorator should not effect the return value")
    
    		mutator, ok := handler.(MutationInterface)
    		require.True(t, ok)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/admission/audit.go

    var _ MutationInterface = &auditHandler{}
    var _ ValidationInterface = &auditHandler{}
    
    // WithAudit is a decorator for a admission phase. It saves annotations
    // of attribute into the audit event. Attributes passed to the Admit and
    // Validate function must be instance of privateAnnotationsGetter or
    // AnnotationsGetter, otherwise an error is returned.
    func WithAudit(i Interface) Interface {
    	if i == nil {
    		return i
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 29 00:03:53 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go

    			return snorlax, true, nil
    		}), false, time.Minute, 0)
    
    		ctx1 := withAudit(context.Background())
    		_, _, _ = a.AuthenticateToken(ctx1, "token1")
    		annotations1 := audit.AuditEventFrom(ctx1).Annotations
    
    		// guarantee different now times
    		time.Sleep(time.Second)
    
    		ctx2 := withAudit(context.Background())
    		_, _, _ = a.AuthenticateToken(ctx2, "token2")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 20.3K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/endpoints/filters/audit_test.go

    			true,
    		},
    	} {
    		t.Run(test.desc, func(t *testing.T) {
    			sink := &fakeAuditSink{}
    			fakeRuleEvaluator := policy.NewFakePolicyRuleEvaluator(auditinternal.LevelRequestResponse, test.omitStages)
    			handler := WithAudit(http.HandlerFunc(test.handler), sink, fakeRuleEvaluator, func(r *http.Request, ri *request.RequestInfo) bool {
    				// simplified long-running check
    				return ri.Verb == "watch"
    			})
    			handler = WithAuditInit(handler)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 22.6K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/endpoints/filters/audit.go

    	"k8s.io/apiserver/pkg/endpoints/responsewriter"
    )
    
    // WithAudit decorates a http.Handler with audit logging information for all the
    // requests coming to the server. Audit level is decided according to requests'
    // attributes and audit policy. Logs are emitted to the audit sink to
    // process events. If sink or audit policy is nil, no decoration takes place.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 8.6K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/delete.go

    		ctx, cancel := context.WithTimeout(ctx, requestTimeoutUpperBound)
    		defer cancel()
    
    		ctx = request.WithNamespace(ctx, namespace)
    		admit = admission.WithAudit(admit)
    
    		outputMediaType, _, err := negotiation.NegotiateOutputMediaType(req, scope.Serializer, scope)
    		if err != nil {
    			scope.err(err, w, req)
    			return
    		}
    
    		options := &metav1.DeleteOptions{}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 01 10:00:32 UTC 2023
    - 11.4K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/admission/attributes.go

    	return record.oldObject
    }
    
    func (record *attributesRecord) GetUserInfo() user.Info {
    	return record.userInfo
    }
    
    // getAnnotations implements privateAnnotationsGetter.It's a private method used
    // by WithAudit decorator.
    func (record *attributesRecord) getAnnotations(maxLevel auditinternal.Level) map[string]string {
    	record.annotationsLock.RLock()
    	defer record.annotationsLock.RUnlock()
    
    	if record.annotations == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Aug 07 17:53:14 UTC 2019
    - 6.2K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/endpoints/filters/request_deadline_test.go

    			withAudit := withFailedRequestAudit(errorHandler, test.statusErr, fakeSink, fakeRuleEvaluator)
    
    			w := httptest.NewRecorder()
    			testRequest := newRequest(t, "/apis/v1/namespaces/default/pods")
    			info := request.RequestInfo{}
    			testRequest = testRequest.WithContext(request.WithRequestInfo(testRequest.Context(), &info))
    
    			withAudit.ServeHTTP(w, testRequest)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 14 23:04:34 UTC 2022
    - 16.7K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/audit/context.go

    // It is safe to call at most parts of request flow that come after WithAuditAnnotations.
    // The notable exception being that this function must not be called via a
    // defer statement (i.e. after ServeHTTP) in a handler that runs before WithAudit
    // as at that point the audit event has already been sent to the audit sink.
    // Handlers that are unaware of their position in the overall request flow should
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/update.go

    			scope.err(err, w, req)
    			return
    		}
    		span.AddEvent("Conversion done")
    
    		audit.LogRequestObject(req.Context(), obj, objGV, scope.Resource, scope.Subresource, scope.Serializer)
    		admit = admission.WithAudit(admit)
    
    		// if this object supports namespace info
    		if objectMeta, err := meta.Accessor(obj); err == nil {
    			// ensure namespace on the object is correct, or error if a conflicting namespace was set in the object
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 20:19:46 UTC 2023
    - 11.5K bytes
    - Viewed (0)
Back to top