mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix ALF-10402: PUB: Access tokens are not being stored in encrypted properties
- NOTE: this fix means that any existing publishing channels in the repo will cease to work and will cause the publishing generally to have problems. If you have publishing channels in your repo then you must remove them following this fix. This can be done by either cleaning your repo out completely or deleting the node underneath "Data Dictionary/Publishing Root" (it has a UUID as its name). git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30646 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.publishing.youtube;
|
||||
|
||||
import org.alfresco.repo.node.encryption.MetadataEncryptor;
|
||||
import org.alfresco.repo.publishing.PublishingModel;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -30,12 +31,17 @@ public class YouTubePublishingHelper
|
||||
{
|
||||
private static final Log log = LogFactory.getLog(YouTubePublishingHelper.class);
|
||||
private NodeService nodeService;
|
||||
private MetadataEncryptor encryptor;
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
public void setEncryptor(MetadataEncryptor encryptor)
|
||||
{
|
||||
this.encryptor = encryptor;
|
||||
}
|
||||
|
||||
public YouTubeService getYouTubeServiceForNode(NodeRef publishNode)
|
||||
{
|
||||
@@ -45,8 +51,10 @@ public class YouTubePublishingHelper
|
||||
NodeRef parent = nodeService.getPrimaryParent(publishNode).getParentRef();
|
||||
if (nodeService.hasAspect(parent, YouTubePublishingModel.ASPECT_DELIVERY_CHANNEL))
|
||||
{
|
||||
String youtubeUsername = (String) nodeService.getProperty(parent, PublishingModel.PROP_CHANNEL_USERNAME);
|
||||
String youtubePassword = (String) nodeService.getProperty(parent, PublishingModel.PROP_CHANNEL_PASSWORD);
|
||||
String youtubeUsername = (String) encryptor.decrypt(PublishingModel.PROP_CHANNEL_USERNAME, nodeService
|
||||
.getProperty(parent, PublishingModel.PROP_CHANNEL_USERNAME));
|
||||
String youtubePassword = (String) encryptor.decrypt(PublishingModel.PROP_CHANNEL_PASSWORD, nodeService
|
||||
.getProperty(parent, PublishingModel.PROP_CHANNEL_PASSWORD));
|
||||
service = new YouTubeService("Alfresco",
|
||||
"AI39si78RHlniONCtnu9o8eBfwZToBAp2ZbbURm5eoJjj4gZi0LcxjDqJTzD35oYokmtFXbCo5ojofbimGnMlRbmNrh7-M7ZCw");
|
||||
try
|
||||
|
Reference in New Issue
Block a user