2 * Summary: interface for the libxslt security framework
3 * Description: the libxslt security framework allow to restrict
4 * the access to new resources (file or URL) from
5 * the stylesheet at runtime.
7 * Copy: See Copyright for the status of this software.
9 * Author: Daniel Veillard
12 #ifndef __XML_XSLT_SECURITY_H__
13 #define __XML_XSLT_SECURITY_H__
15 #include <libxml/tree.h>
16 #include "xsltexports.h"
17 #include "xsltInternals.h"
26 * structure to indicate the preferences for security in the XSLT
29 typedef struct _xsltSecurityPrefs xsltSecurityPrefs
;
30 typedef xsltSecurityPrefs
*xsltSecurityPrefsPtr
;
35 * the set of option that can be configured
38 XSLT_SECPREF_READ_FILE
= 1,
39 XSLT_SECPREF_WRITE_FILE
,
40 XSLT_SECPREF_CREATE_DIRECTORY
,
41 XSLT_SECPREF_READ_NETWORK
,
42 XSLT_SECPREF_WRITE_NETWORK
48 * User provided function to check the value of a string like a file
51 typedef int (*xsltSecurityCheck
) (xsltSecurityPrefsPtr sec
,
52 xsltTransformContextPtr ctxt
,
58 XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
59 xsltNewSecurityPrefs (void);
60 XSLTPUBFUN
void XSLTCALL
61 xsltFreeSecurityPrefs (xsltSecurityPrefsPtr sec
);
62 XSLTPUBFUN
int XSLTCALL
63 xsltSetSecurityPrefs (xsltSecurityPrefsPtr sec
,
64 xsltSecurityOption option
,
65 xsltSecurityCheck func
);
66 XSLTPUBFUN xsltSecurityCheck XSLTCALL
67 xsltGetSecurityPrefs (xsltSecurityPrefsPtr sec
,
68 xsltSecurityOption option
);
70 XSLTPUBFUN
void XSLTCALL
71 xsltSetDefaultSecurityPrefs (xsltSecurityPrefsPtr sec
);
72 XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
73 xsltGetDefaultSecurityPrefs (void);
75 XSLTPUBFUN
int XSLTCALL
76 xsltSetCtxtSecurityPrefs (xsltSecurityPrefsPtr sec
,
77 xsltTransformContextPtr ctxt
);
79 XSLTPUBFUN
int XSLTCALL
80 xsltSecurityAllow (xsltSecurityPrefsPtr sec
,
81 xsltTransformContextPtr ctxt
,
83 XSLTPUBFUN
int XSLTCALL
84 xsltSecurityForbid (xsltSecurityPrefsPtr sec
,
85 xsltTransformContextPtr ctxt
,
90 XSLTPUBFUN
int XSLTCALL
91 xsltCheckWrite (xsltSecurityPrefsPtr sec
,
92 xsltTransformContextPtr ctxt
,
94 XSLTPUBFUN
int XSLTCALL
95 xsltCheckRead (xsltSecurityPrefsPtr sec
,
96 xsltTransformContextPtr ctxt
,
103 #endif /* __XML_XSLT_SECURITY_H__ */