Mercurial > projects > dstep
annotate dstep/security/Authorization.d @ 11:07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sat, 01 Aug 2009 15:03:28 +0200 |
parents | |
children |
rev | line source |
---|---|
11
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
1 /** |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
3 * Authors: Jacob Carlborg |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
4 * Version: Initial created: Jul 22, 2009 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
6 */ |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
7 module dstep.security.Authorization; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
8 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
9 version (Tango) |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
10 import tango.stdc.stdio; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
11 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
12 else |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
13 import std.c.stdio; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
14 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
15 import dstep.coreservices.carboncore.MacTypes; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
16 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
17 struct AuthorizationOpaqueRef; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
18 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
19 alias uint AuthorizationFlags; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
20 alias AuthorizationOpaqueRef* AuthorizationRef; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
21 alias char* AuthorizationString; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
22 alias AuthorizationItemSet AuthorizationRights; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
23 alias AuthorizationItemSet AuthorizationEnvironment; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
24 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
25 enum |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
26 { |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
27 errAuthorizationSuccess = 0, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
28 errAuthorizationInvalidSet = -60001, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
29 errAuthorizationInvalidRef = -60002, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
30 errAuthorizationInvalidTag = -60003, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
31 errAuthorizationInvalidPointer = -60004, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
32 errAuthorizationDenied = -60005, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
33 errAuthorizationCanceled = -60006, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
34 errAuthorizationInteractionNotAllowed = -60007, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
35 errAuthorizationInternal = -60008, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
36 errAuthorizationExternalizeNotAllowed = -60009, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
37 errAuthorizationInternalizeNotAllowed = -60010, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
38 errAuthorizationInvalidFlags = -60011, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
39 errAuthorizationToolExecuteFailure = -60031, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
40 errAuthorizationToolEnvironmentError = -60032, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
41 errAuthorizationBadAddress = -60033 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
42 } |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
43 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
44 enum |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
45 { |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
46 kAuthorizationFlagDefaults = 0, |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
47 kAuthorizationFlagInteractionAllowed = (1 << 0), |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
48 kAuthorizationFlagExtendRights = (1 << 1), |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
49 kAuthorizationFlagPartialRights = (1 << 2), |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
50 kAuthorizationFlagDestroyRights = (1 << 3), |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
51 kAuthorizationFlagPreAuthorize = (1 << 4), |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
52 kAuthorizationFlagNoData = (1 << 20) |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
53 } |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
54 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
55 enum |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
56 { |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
57 kAuthorizationFlagCanNotPreAuthorize = (1 << 0) |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
58 } |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
59 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
60 enum |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
61 { |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
62 kAuthorizationExternalFormLength = 32 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
63 } |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
64 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
65 struct AuthorizationItem |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
66 { |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
67 char* name; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
68 uint valueLength; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
69 void* value; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
70 uint flags; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
71 } |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
72 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
73 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
74 struct AuthorizationItemSet |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
75 { |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
76 uint count; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
77 AuthorizationItem* items; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
78 } |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
79 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
80 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
81 struct AuthorizationExternalForm |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
82 { |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
83 char* bytes; |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
84 } |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
85 |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
86 extern (C) |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
87 { |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
88 int AuthorizationCreate (AuthorizationRights* rights, AuthorizationEnvironment* environment, uint flags, AuthorizationRef* authorization); |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
89 int AuthorizationFree (AuthorizationRef authorization, uint flags); |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
90 int AuthorizationCopyRights (AuthorizationRef authorization, AuthorizationRights* rights, AuthorizationEnvironment* environment, uint flags, AuthorizationRights** authorizedRights); |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
91 int AuthorizationCopyInfo (AuthorizationRef authorization, char* tag, AuthorizationItemSet** info); |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
92 int AuthorizationMakeExternalForm (AuthorizationRef authorization, AuthorizationExternalForm* extForm); |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
93 int AuthorizationCreateFromExternalForm (AuthorizationExternalForm* extForm, AuthorizationRef* authorization); |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
94 int AuthorizationFreeItemSet (AuthorizationItemSet* set); |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
95 int AuthorizationExecuteWithPrivileges (AuthorizationRef authorization, char* pathToTool, uint options, char** arguments, FILE** communicationsPipe); |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
96 int AuthorizationCopyPrivilegedReference (AuthorizationRef* authorization, uint flags); |
07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
97 } |