Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for GetObjectLegalHoldMeta (0.3 sec)

  1. cmd/bucket-object-lock.go

    func enforceRetentionForDeletion(ctx context.Context, objInfo ObjectInfo) (locked bool) {
    	if objInfo.DeleteMarker {
    		return false
    	}
    
    	lhold := objectlock.GetObjectLegalHoldMeta(objInfo.UserDefined)
    	if lhold.Status.Valid() && lhold.Status == objectlock.LegalHoldOn {
    		return true
    	}
    
    	ret := objectlock.GetObjectRetentionMeta(objInfo.UserDefined)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  2. internal/bucket/object/lock/lock.go

    			retainTill = RetentionDate{t.UTC()}
    		}
    	}
    	return ObjectRetention{XMLNS: "http://s3.amazonaws.com/doc/2006-03-01/", Mode: mode, RetainUntilDate: retainTill}
    }
    
    // GetObjectLegalHoldMeta constructs ObjectLegalHold from metadata
    func GetObjectLegalHoldMeta(meta map[string]string) ObjectLegalHold {
    	holdStr, ok := meta[strings.ToLower(AmzObjectLockLegalHold)]
    	if !ok {
    		holdStr, ok = meta[AmzObjectLockLegalHold]
    	}
    	if ok {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Jun 29 01:20:27 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  3. internal/bucket/object/lock/lock_test.go

    		},
    		{
    			metadata: map[string]string{
    				"x-amz-object-lock-legal-hold": "X",
    			},
    			expected: ObjectLegalHold{Status: ""},
    		},
    	}
    
    	for i, tt := range tests {
    		o := GetObjectLegalHoldMeta(tt.metadata)
    		if o.Status != tt.expected.Status {
    			t.Fatalf("Case %d expected %v, got %v", i, tt.expected.Status, o.Status)
    		}
    	}
    }
    
    func TestParseObjectLegalHold(t *testing.T) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Jun 29 01:20:27 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  4. cmd/object-handlers.go

    		return
    	}
    
    	objInfo, err := getObjectInfo(ctx, bucket, object, opts)
    	if err != nil {
    		writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
    		return
    	}
    
    	legalHold := objectlock.GetObjectLegalHoldMeta(objInfo.UserDefined)
    	if legalHold.IsEmpty() {
    		writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrNoSuchObjectLockConfiguration), r.URL)
    		return
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Oct 05 05:16:15 UTC 2024
    - 117.4K bytes
    - Viewed (0)
Back to top