Skip to content

Commit

Permalink
Delay replacement of [ORG] and [APP] in policy.xml (#9513)
Browse files Browse the repository at this point in the history
* Replace [ORG] and [APP] in policy.xml for use in localtest.

* Added inn pre-deploy replacements of [ORG] and [APP] in policy.xml

* Stop replacing [ORG] and [APP] in policy.xml when creating a new app.

Co-authored-by: Ivar <[email protected]>
  • Loading branch information
ivarne and ivarne authored Jan 9, 2023
1 parent 03e8796 commit bacda4e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public async Task<XacmlPolicy> GetPolicyAsync(XacmlContextRequest request)
var app = request.GetResourceAttributes().Attributes.Where(a => a.AttributeId.ToString() == XacmlRequestAttribute.AppAttribute).Select(a => a.AttributeValues.FirstOrDefault()).FirstOrDefault().Value;
var org = request.GetResourceAttributes().Attributes.Where(a => a.AttributeId.ToString() == XacmlRequestAttribute.OrgAttribute).Select(a => a.AttributeValues.FirstOrDefault()).FirstOrDefault().Value;
string policyString = await _localApp.GetXACMLPolicy($"{org}/{app}");
policyString = policyString.Replace("[ORG]", org).Replace("[APP]", app);
return ParsePolicyContent(policyString);
}

Expand All @@ -45,7 +46,7 @@ public Task<XacmlPolicy> GetPolicyAsync(string org, string app)
{
throw new NotImplementedException();
}

public static XacmlPolicy ParsePolicyContent(string policyContent)
{
XacmlPolicy policy;
Expand Down

0 comments on commit bacda4e

Please sign in to comment.