globus_connect_gridftp_server  17.0~b1
/build/globus-connect-gridftp-server-17.0~b1/globus_i_gfs_acl.h
1 /*
2  * Copyright The University of Chicago
3  *
4  * All Rights Reserved.
5  */
6 
7 #ifndef GLOBUS_I_GFS_ACL_H
8 #define GLOBUS_I_GFS_ACL_H
9 
10 struct globus_i_gfs_acl_handle_s;
11 
12 typedef enum globus_l_gfs_acl_type_e
13 {
14  GLOBUS_L_GFS_ACL_TYPE_INIT,
15  GLOBUS_L_GFS_ACL_TYPE_AUTHORIZE
16 } globus_i_gfs_acl_type_t;
17 
18 /* keep some legacy actions internal only; no current use case */
19 enum globus_i_gfs_acl_action_internal_e
20 {
21  /* internal use only */
22  GFS_ACL_ACTION_INIT = 100,
23  /* speficy an authorization assertion. client may submit data to
24  * influence future authorization decisions. data is in an unspecified
25  * format. */
26  GFS_ACL_ACTION_AUTHZ_ASSERT,
27  /* report data safely written to disk. failure means data written has
28  * overrun acceptable limits. */
29  GFS_ACL_ACTION_COMMIT,
30  /* increase previously requested write limits for an object */
31  GFS_ACL_ACTION_GROW
32  /* the named object. will be deleted. */
33 };
34 
35 /* object descriptor. this provides various info about the object of the
36  * action attempt. */
37 typedef struct globus_i_gfs_acl_object_desc_s
38 {
39  /* ALL: name of the object. commonly a filename.
40  * value is NULL when not known or not used. */
41  char * name;
42 
43  /* WRITE/CREATE: size being requested to write.
44  * COMMIT: amount of data already written safely.
45  * GROW: new full size being requested to write.
46  * value is 0 when not known or not used. */
47  globus_off_t size;
48 
49  /* AUTHZ_ASSERT: assertion data from the client.
50  * value is NULL when not known or not used. */
51  char * data;
52 
53  /* COMMIT: all data has been safely written
54  * value is FALSE when not known or not used. */
55  globus_bool_t final;
56 
58  globus_gfs_op_info_t op_info;
59 } globus_i_gfs_acl_object_desc_t;
60 
61 typedef void
62 (*globus_gfs_acl_cb_t)(
63  globus_i_gfs_acl_object_desc_t * object,
64  int action,
65  void * user_arg,
66  globus_result_t result);
67 
68 typedef globus_result_t
69 (*globus_gfs_acl_info_cb_t)(
70  void * info_arg,
71  int info,
72  va_list ap);
73 
74 void
75 globus_i_gfs_acl_add_module(
76  globus_gfs_acl_module_t * module);
77 
78 int
79 globus_i_gfs_acl_authorize(
80  struct globus_i_gfs_acl_handle_s * acl_handle,
81  int action,
82  globus_i_gfs_acl_object_desc_t * object,
83  globus_result_t * out_res,
84  globus_gfs_acl_cb_t cb,
85  void * user_arg);
86 
87 int
88 globus_i_gfs_acl_init(
89  struct globus_i_gfs_acl_handle_s * acl_handle,
90  globus_result_t * out_res,
91  globus_gfs_acl_cb_t cb,
92  void * user_arg,
93  globus_gfs_acl_info_cb_t info_cb,
94  void * info_arg);
95 
96 void
97 globus_i_gfs_acl_destroy(
98  struct globus_i_gfs_acl_handle_s * acl_handle);
99 
100 typedef struct globus_i_gfs_acl_handle_s
101 {
102  char * password;
103  char * ipaddr;
104  globus_i_gfs_acl_type_t type;
105  char * subject;
106  char * username;
107  char * hostname;
108  globus_gfs_acl_cb_t cb;
109  void * user_arg;
110  globus_gfs_acl_info_cb_t info_cb;
111  void * info_arg;
112  globus_list_t * module_list;
113  globus_list_t * current_list;
114  globus_result_t cached_res;
115  gss_ctx_id_t context;
116  int auth_action;
117  globus_i_gfs_acl_object_desc_t auth_object;
118 } globus_i_gfs_acl_handle_t;
119 
120 
121 
122 #endif