mirror of
https://github.com/bitwarden/web
synced 2026-01-07 19:13:21 +00:00
rename subvault => collection
This commit is contained in:
@@ -31,8 +31,8 @@
|
||||
favorite: { url: _apiUri + '/ciphers/:id/favorite', method: 'POST', params: { id: '@id' } },
|
||||
putPartial: { url: _apiUri + '/ciphers/:id/partial', method: 'POST', params: { id: '@id' } },
|
||||
putShare: { url: _apiUri + '/ciphers/:id/share', method: 'POST', params: { id: '@id' } },
|
||||
putSubvaults: { url: _apiUri + '/ciphers/:id/subvaults', method: 'POST', params: { id: '@id' } },
|
||||
putSubvaultsAdmin: { url: _apiUri + '/ciphers/:id/subvaults-admin', method: 'POST', params: { id: '@id' } },
|
||||
putCollections: { url: _apiUri + '/ciphers/:id/collections', method: 'POST', params: { id: '@id' } },
|
||||
putCollectionsAdmin: { url: _apiUri + '/ciphers/:id/collections-admin', method: 'POST', params: { id: '@id' } },
|
||||
del: { url: _apiUri + '/ciphers/:id/delete', method: 'POST', params: { id: '@id' } },
|
||||
delAdmin: { url: _apiUri + '/ciphers/:id/delete-admin', method: 'POST', params: { id: '@id' } }
|
||||
});
|
||||
@@ -63,18 +63,18 @@
|
||||
del: { url: _apiUri + '/organizations/:orgId/users/:id/delete', method: 'POST', params: { id: '@id', orgId: '@orgId' } }
|
||||
});
|
||||
|
||||
_service.subvaults = $resource(_apiUri + '/organizations/:orgId/subvaults/:id', {}, {
|
||||
_service.collections = $resource(_apiUri + '/organizations/:orgId/collections/:id', {}, {
|
||||
get: { method: 'GET', params: { id: '@id', orgId: '@orgId' } },
|
||||
listMe: { url: _apiUri + '/subvaults', method: 'GET', params: {} },
|
||||
listMe: { url: _apiUri + '/collections', method: 'GET', params: {} },
|
||||
listOrganization: { method: 'GET', params: { orgId: '@orgId' } },
|
||||
post: { method: 'POST', params: { orgId: '@orgId' } },
|
||||
put: { method: 'POST', params: { id: '@id', orgId: '@orgId' } },
|
||||
del: { url: _apiUri + '/organizations/:orgId/subvaults/:id/delete', method: 'POST', params: { id: '@id', orgId: '@orgId' } }
|
||||
del: { url: _apiUri + '/organizations/:orgId/collections/:id/delete', method: 'POST', params: { id: '@id', orgId: '@orgId' } }
|
||||
});
|
||||
|
||||
_service.subvaultUsers = $resource(_apiUri + '/organizations/:orgId/subvaultUsers/:id', {}, {
|
||||
listSubvault: { url: _apiUri + '/organizations/:orgId/subvaultUsers/:subvaultId', method: 'GET', params: { subvaultId: '@subvaultId', orgId: '@orgId' } },
|
||||
del: { url: _apiUri + '/organizations/:orgId/subvaultUsers/:id/delete', method: 'POST', params: { id: '@id', orgId: '@orgId' } }
|
||||
_service.collectionUsers = $resource(_apiUri + '/organizations/:orgId/collectionUsers/:id', {}, {
|
||||
listCollection: { url: _apiUri + '/organizations/:orgId/collectionUsers/:collectionId', method: 'GET', params: { collectionId: '@collectionId', orgId: '@orgId' } },
|
||||
del: { url: _apiUri + '/organizations/:orgId/collectionUsers/:id/delete', method: 'POST', params: { id: '@id', orgId: '@orgId' } }
|
||||
});
|
||||
|
||||
_service.accounts = $resource(_apiUri + '/accounts', {}, {
|
||||
|
||||
@@ -26,7 +26,7 @@ angular
|
||||
var login = {
|
||||
id: encryptedLogin.Id,
|
||||
organizationId: encryptedLogin.OrganizationId,
|
||||
subvaultIds: encryptedLogin.SubvaultIds || [],
|
||||
collectionIds: encryptedLogin.CollectionIds || [],
|
||||
'type': 1,
|
||||
folderId: encryptedLogin.FolderId,
|
||||
favorite: encryptedLogin.Favorite,
|
||||
@@ -51,7 +51,7 @@ angular
|
||||
var login = {
|
||||
id: encryptedCipher.Id,
|
||||
organizationId: encryptedCipher.OrganizationId,
|
||||
subvaultIds: encryptedCipher.SubvaultIds || [],
|
||||
collectionIds: encryptedCipher.CollectionIds || [],
|
||||
folderId: encryptedCipher.FolderId,
|
||||
favorite: encryptedCipher.Favorite,
|
||||
name: _service.decryptProperty(encryptedCipher.Data.Name, key, false),
|
||||
@@ -90,28 +90,28 @@ angular
|
||||
};
|
||||
};
|
||||
|
||||
_service.decryptSubvaults = function (encryptedSubvaults, orgId, catchError) {
|
||||
if (!encryptedSubvaults) throw "encryptedSubvaults is undefined or null";
|
||||
_service.decryptCollections = function (encryptedCollections, orgId, catchError) {
|
||||
if (!encryptedCollections) throw "encryptedCollections is undefined or null";
|
||||
|
||||
var unencryptedSubvaults = [];
|
||||
for (var i = 0; i < encryptedSubvaults.length; i++) {
|
||||
unencryptedSubvaults.push(_service.decryptSubvault(encryptedSubvaults[i], orgId, catchError));
|
||||
var unencryptedCollections = [];
|
||||
for (var i = 0; i < encryptedCollections.length; i++) {
|
||||
unencryptedCollections.push(_service.decryptCollection(encryptedCollections[i], orgId, catchError));
|
||||
}
|
||||
|
||||
return unencryptedSubvaults;
|
||||
return unencryptedCollections;
|
||||
};
|
||||
|
||||
_service.decryptSubvault = function (encryptedSubvault, orgId, catchError) {
|
||||
if (!encryptedSubvault) throw "encryptedSubvault is undefined or null";
|
||||
_service.decryptCollection = function (encryptedCollection, orgId, catchError) {
|
||||
if (!encryptedCollection) throw "encryptedCollection is undefined or null";
|
||||
|
||||
catchError = catchError === true ? true : false;
|
||||
orgId = orgId || encryptedSubvault.OrganizationId;
|
||||
orgId = orgId || encryptedCollection.OrganizationId;
|
||||
var key = cryptoService.getOrgKey(orgId);
|
||||
|
||||
return {
|
||||
id: encryptedSubvault.Id,
|
||||
name: catchError ? _service.decryptProperty(encryptedSubvault.Name, key, false) :
|
||||
cryptoService.decrypt(encryptedSubvault.Name, key)
|
||||
id: encryptedCollection.Id,
|
||||
name: catchError ? _service.decryptProperty(encryptedCollection.Name, key, false) :
|
||||
cryptoService.decrypt(encryptedCollection.Name, key)
|
||||
};
|
||||
};
|
||||
|
||||
@@ -182,23 +182,23 @@ angular
|
||||
};
|
||||
};
|
||||
|
||||
_service.encryptSubvaults = function (unencryptedSubvaults, orgId) {
|
||||
if (!unencryptedSubvaults) throw "unencryptedSubvaults is undefined or null";
|
||||
_service.encryptCollections = function (unencryptedCollections, orgId) {
|
||||
if (!unencryptedCollections) throw "unencryptedCollections is undefined or null";
|
||||
|
||||
var encryptedSubvaults = [];
|
||||
for (var i = 0; i < unencryptedSubvaults.length; i++) {
|
||||
encryptedSubvaults.push(_service.encryptSubvault(unencryptedSubvaults[i], orgId));
|
||||
var encryptedCollections = [];
|
||||
for (var i = 0; i < unencryptedCollections.length; i++) {
|
||||
encryptedCollections.push(_service.encryptCollection(unencryptedCollections[i], orgId));
|
||||
}
|
||||
|
||||
return encryptedSubvaults;
|
||||
return encryptedCollections;
|
||||
};
|
||||
|
||||
_service.encryptSubvault = function (unencryptedSubvault, orgId) {
|
||||
if (!unencryptedSubvault) throw "unencryptedSubvault is undefined or null";
|
||||
_service.encryptCollection = function (unencryptedCollection, orgId) {
|
||||
if (!unencryptedCollection) throw "unencryptedCollection is undefined or null";
|
||||
|
||||
return {
|
||||
id: unencryptedSubvault.id,
|
||||
name: cryptoService.encrypt(unencryptedSubvault.name, cryptoService.getOrgKey(orgId))
|
||||
id: unencryptedCollection.id,
|
||||
name: cryptoService.encrypt(unencryptedCollection.name, cryptoService.getOrgKey(orgId))
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user