Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Change collections gaia auth token scope to ArchivalPrefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
yknl committed Aug 26, 2019
1 parent 7937c54 commit 08071e0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/js/utils/collection-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const DEFAULT_NEW_COLLECTION_SETTING_ARRAY = [{
encryptionKeyIndex: 0
}]

const ARCHIVAL_GAIA_AUTH_SCOPE = 'putFileArchivalPrefix'
const COLLECTION_GAIA_PREFIX = 'collection'

export function getCollectionEncryptionIndex(collectionName, settings, updateIdentityCollectionSettings) {
if(!settings.collection
|| !settings.collection[collectionName]
Expand Down Expand Up @@ -41,7 +44,11 @@ export function getCollectionGaiaHubConfigs(scopes, node, gaiaHubUrl) {
const hubConfigPromises = scopes.map((scope) => {
const collectionPrivateKey =
node.getCollectionNode(scope).getCollectionPrivateKey()
return connectToGaiaHub(gaiaHubUrl, collectionPrivateKey)
const scopes = [{
scope: ARCHIVAL_GAIA_AUTH_SCOPE,
domain: COLLECTION_GAIA_PREFIX
}]
return connectToGaiaHub(gaiaHubUrl, collectionPrivateKey, "", scopes)
})

return Promise.all(hubConfigPromises)
Expand Down

0 comments on commit 08071e0

Please sign in to comment.