Compare commits
No commits in common. "6ba2ae50ab19da3bddde7d001a4bbc6ef9f1d079" and "a99a6d9d971ec57500b396616cfadf50df1f725a" have entirely different histories.
6ba2ae50ab
...
a99a6d9d97
|
@ -36,7 +36,6 @@ export type ParsedRetention =
|
||||||
export default class ObjectLockConfiguration {
|
export default class ObjectLockConfiguration {
|
||||||
_parsedXml: any;
|
_parsedXml: any;
|
||||||
_config: Config;
|
_config: Config;
|
||||||
_days: number | null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an Object Lock Configuration instance
|
* Create an Object Lock Configuration instance
|
||||||
|
@ -46,7 +45,6 @@ export default class ObjectLockConfiguration {
|
||||||
constructor(xml: any) {
|
constructor(xml: any) {
|
||||||
this._parsedXml = xml;
|
this._parsedXml = xml;
|
||||||
this._config = {};
|
this._config = {};
|
||||||
this._days = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -185,8 +183,6 @@ export default class ObjectLockConfiguration {
|
||||||
this._config.rule = {};
|
this._config.rule = {};
|
||||||
this._config.rule.mode = validMode.mode;
|
this._config.rule.mode = validMode.mode;
|
||||||
this._config.rule[validTime.timeType!] = validTime.timeValue;
|
this._config.rule[validTime.timeType!] = validTime.timeValue;
|
||||||
// Store the number of days
|
|
||||||
this._days = validTime.timeType === 'years' ? 365 * validTime.timeValue : validTime.timeValue;
|
|
||||||
}
|
}
|
||||||
return validConfig;
|
return validConfig;
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,7 +171,6 @@ export default class RequestContext {
|
||||||
_needTagEval: boolean;
|
_needTagEval: boolean;
|
||||||
_foundAction?: string;
|
_foundAction?: string;
|
||||||
_foundResource?: string;
|
_foundResource?: string;
|
||||||
_objectLockRetentionDays?: number | null;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
headers: { [key: string]: string | string[] },
|
headers: { [key: string]: string | string[] },
|
||||||
|
@ -193,7 +192,6 @@ export default class RequestContext {
|
||||||
requestObjTags?: string,
|
requestObjTags?: string,
|
||||||
existingObjTag?: string,
|
existingObjTag?: string,
|
||||||
needTagEval?: false,
|
needTagEval?: false,
|
||||||
objectLockRetentionDays?: number,
|
|
||||||
) {
|
) {
|
||||||
this._headers = headers;
|
this._headers = headers;
|
||||||
this._query = query;
|
this._query = query;
|
||||||
|
@ -226,7 +224,6 @@ export default class RequestContext {
|
||||||
this._requestObjTags = requestObjTags || null;
|
this._requestObjTags = requestObjTags || null;
|
||||||
this._existingObjTag = existingObjTag || null;
|
this._existingObjTag = existingObjTag || null;
|
||||||
this._needTagEval = needTagEval || false;
|
this._needTagEval = needTagEval || false;
|
||||||
this._objectLockRetentionDays = objectLockRetentionDays || null;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,7 +255,6 @@ export default class RequestContext {
|
||||||
requestObjTags: this._requestObjTags,
|
requestObjTags: this._requestObjTags,
|
||||||
existingObjTag: this._existingObjTag,
|
existingObjTag: this._existingObjTag,
|
||||||
needTagEval: this._needTagEval,
|
needTagEval: this._needTagEval,
|
||||||
objectLockRetentionDays: this._objectLockRetentionDays,
|
|
||||||
};
|
};
|
||||||
return JSON.stringify(requestInfo);
|
return JSON.stringify(requestInfo);
|
||||||
}
|
}
|
||||||
|
@ -299,7 +295,6 @@ export default class RequestContext {
|
||||||
obj.requestObjTags,
|
obj.requestObjTags,
|
||||||
obj.existingObjTag,
|
obj.existingObjTag,
|
||||||
obj.needTagEval,
|
obj.needTagEval,
|
||||||
obj.objectLockRetentionDays,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -703,24 +698,4 @@ export default class RequestContext {
|
||||||
getNeedTagEval() {
|
getNeedTagEval() {
|
||||||
return this._needTagEval;
|
return this._needTagEval;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get object lock retention days
|
|
||||||
*
|
|
||||||
* @returns objectLockRetentionDays - object lock retention days
|
|
||||||
*/
|
|
||||||
getObjectLockRetentionDays() {
|
|
||||||
return this._objectLockRetentionDays;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set object lock retention days
|
|
||||||
*
|
|
||||||
* @param objectLockRetentionDays - object lock retention days
|
|
||||||
* @returns itself
|
|
||||||
*/
|
|
||||||
setObjectLockRetentionDays(objectLockRetentionDays: number) {
|
|
||||||
this._objectLockRetentionDays = objectLockRetentionDays;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,9 +166,6 @@ export function findConditionKey(
|
||||||
return requestContext.getNeedTagEval() && requestContext.getRequestObjTags()
|
return requestContext.getNeedTagEval() && requestContext.getRequestObjTags()
|
||||||
? getTagKeys(requestContext.getRequestObjTags()!)
|
? getTagKeys(requestContext.getRequestObjTags()!)
|
||||||
: undefined;
|
: undefined;
|
||||||
// The maximum retention period is 100 years.
|
|
||||||
case 's3:object-lock-remaining-retention-days':
|
|
||||||
return requestContext.getObjectLockRetentionDays() || undefined;
|
|
||||||
default:
|
default:
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,6 @@ describe('RequestContext', () => {
|
||||||
specificResource: 'specific-resource',
|
specificResource: 'specific-resource',
|
||||||
sslEnabled: true,
|
sslEnabled: true,
|
||||||
tokenIssueTime: null,
|
tokenIssueTime: null,
|
||||||
objectLockRetentionDays: null,
|
|
||||||
};
|
};
|
||||||
it('serialize()', () => {
|
it('serialize()', () => {
|
||||||
assert.deepStrictEqual(JSON.parse(rc.serialize()), SerializedFields);
|
assert.deepStrictEqual(JSON.parse(rc.serialize()), SerializedFields);
|
||||||
|
|
Loading…
Reference in New Issue