xerofun/owaspantisamy

System.IO.StreamReader Constructor for Policy (Patch Included)

Closed this issue · 3 comments

To simplify deployment we store our policy files as embedded resources in
the DLL. However the current Policy does not support reading Policy files
either from a string or a stream. Attached is a patch to Policy.cs that
will construct a Policy object given a StreamReader. This required some
slight re-organisation of the Policy file to move XML parsing into its own
method (Initialise) which is called by the constructors.

Given this patch it is possible to read the policy from the assembly with;
System.Reflection.Assembly asm = typeof(MyClass).Assembly;
System.IO.Stream stream = asm.GetManifestResourceStream("MyClass.Policy");
Policy policy = Policy.getInstance(new System.IO.StreamReady(stream)

The patch provided is against the current head (R72)

Original issue reported on code.google.com by Mr.M.Dav...@gmail.com on 18 Jan 2009 at 10:33

Attachments:

Original comment by arshan.d...@gmail.com on 20 Jan 2009 at 4:35

  • Added labels: Priority-High, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect
This is a really useful patch, I'd like to see it applied.

Original comment by arnout.engelen on 13 Aug 2010 at 11:59

We don't officially maintain the .NET port anymore and it should be considered 
"as is" until developers come along that want to take ownership.

Original comment by arshan.d...@gmail.com on 15 Nov 2010 at 10:04

  • Changed state: WontFix