Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:44:22

0001 /*
0002  * Summary: interface for the libxslt security framework
0003  * Description: the libxslt security framework allow to restrict
0004  *              the access to new resources (file or URL) from
0005  *              the stylesheet at runtime.
0006  *
0007  * Copy: See Copyright for the status of this software.
0008  *
0009  * Author: Daniel Veillard
0010  */
0011 
0012 #ifndef __XML_XSLT_SECURITY_H__
0013 #define __XML_XSLT_SECURITY_H__
0014 
0015 #include <libxml/tree.h>
0016 #include "xsltexports.h"
0017 #include "xsltInternals.h"
0018 
0019 #ifdef __cplusplus
0020 extern "C" {
0021 #endif
0022 
0023 /**
0024  * xsltSecurityPref:
0025  *
0026  * structure to indicate the preferences for security in the XSLT
0027  * transformation.
0028  */
0029 typedef struct _xsltSecurityPrefs xsltSecurityPrefs;
0030 typedef xsltSecurityPrefs *xsltSecurityPrefsPtr;
0031 
0032 /**
0033  * xsltSecurityOption:
0034  *
0035  * the set of option that can be configured
0036  */
0037 typedef enum {
0038     XSLT_SECPREF_READ_FILE = 1,
0039     XSLT_SECPREF_WRITE_FILE,
0040     XSLT_SECPREF_CREATE_DIRECTORY,
0041     XSLT_SECPREF_READ_NETWORK,
0042     XSLT_SECPREF_WRITE_NETWORK
0043 } xsltSecurityOption;
0044 
0045 /**
0046  * xsltSecurityCheck:
0047  *
0048  * User provided function to check the value of a string like a file
0049  * path or an URL ...
0050  */
0051 typedef int (*xsltSecurityCheck)    (xsltSecurityPrefsPtr sec,
0052                      xsltTransformContextPtr ctxt,
0053                      const char *value);
0054 
0055 /*
0056  * Module interfaces
0057  */
0058 XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
0059             xsltNewSecurityPrefs    (void);
0060 XSLTPUBFUN void XSLTCALL
0061             xsltFreeSecurityPrefs   (xsltSecurityPrefsPtr sec);
0062 XSLTPUBFUN int XSLTCALL
0063             xsltSetSecurityPrefs    (xsltSecurityPrefsPtr sec,
0064                          xsltSecurityOption option,
0065                          xsltSecurityCheck func);
0066 XSLTPUBFUN xsltSecurityCheck XSLTCALL
0067             xsltGetSecurityPrefs    (xsltSecurityPrefsPtr sec,
0068                          xsltSecurityOption option);
0069 
0070 XSLTPUBFUN void XSLTCALL
0071             xsltSetDefaultSecurityPrefs (xsltSecurityPrefsPtr sec);
0072 XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
0073             xsltGetDefaultSecurityPrefs (void);
0074 
0075 XSLTPUBFUN int XSLTCALL
0076             xsltSetCtxtSecurityPrefs    (xsltSecurityPrefsPtr sec,
0077                          xsltTransformContextPtr ctxt);
0078 
0079 XSLTPUBFUN int XSLTCALL
0080             xsltSecurityAllow       (xsltSecurityPrefsPtr sec,
0081                          xsltTransformContextPtr ctxt,
0082                          const char *value);
0083 XSLTPUBFUN int XSLTCALL
0084             xsltSecurityForbid      (xsltSecurityPrefsPtr sec,
0085                          xsltTransformContextPtr ctxt,
0086                          const char *value);
0087 /*
0088  * internal interfaces
0089  */
0090 XSLTPUBFUN int XSLTCALL
0091             xsltCheckWrite      (xsltSecurityPrefsPtr sec,
0092                          xsltTransformContextPtr ctxt,
0093                          const xmlChar *URL);
0094 XSLTPUBFUN int XSLTCALL
0095             xsltCheckRead       (xsltSecurityPrefsPtr sec,
0096                          xsltTransformContextPtr ctxt,
0097                          const xmlChar *URL);
0098 
0099 #ifdef __cplusplus
0100 }
0101 #endif
0102 
0103 #endif /* __XML_XSLT_SECURITY_H__ */
0104