Updated list of upstream contributions in Blazar
[promise.git] / deprecated / source / schema / access-control-models.yang
1 module access-control-models {
2   prefix acm;
3   namespace "urn:opnfv:promise:acm";
4
5   import complex-types { prefix ct; }
6   import ietf-yang-types { prefix yang; }
7   import ietf-inet-types { prefix inet; }
8
9   typedef password {
10     type string {
11       length 1..255;
12     }
13   }
14
15   grouping access-credentials {
16     leaf strategy {
17       type enumeration {
18         enum oauth;
19         enum keystone;
20       }
21       default oauth;
22     }
23     leaf endpoint {
24       type inet:uri;
25       description "The target endpoint for authentication";
26       mandatory true;
27     }
28     leaf username {
29       type string;
30       mandatory true;
31     }
32     leaf password {
33       type acm:password;
34       mandatory true;
35     }
36   }
37   
38   /*********************************************
39    * Identity Models
40    *********************************************/
41
42   ct:complex-type Identity {
43     ct:abstract true;
44     description "Identity represents an administrative access model entity";
45
46     key "id";
47     leaf id { type yang:uuid; mandatory true; }
48     leaf name { type string; mandatory true; }
49     leaf description { type string; }
50     leaf enabled { type boolean; default true; }
51   }
52
53   ct:complex-type User {
54     ct:extends Identity;
55
56     leaf credential {
57       //type instance-identifier { ct:instance-type IdentityCredential; }
58       type string;
59       mandatory true;
60     }
61     
62     container contact {
63       leaf fullName { type string; }
64       leaf email { type string; }
65     }
66
67     leaf-list groups { type instance-identifer { ct:instance-type Group; } }
68     leaf domain { type instance-identifier { ct:instance-type Domain; } }
69   }
70
71   ct:complex-type Group {
72     ct:extends Identity;
73     
74     leaf-list users { type instance-identifier { ct:instance-type User; } }
75     leaf domain { type instance-identifier { ct:instance-type Domain; } }
76   }
77
78   ct:complex-type Domain {
79     ct:extends Identity;
80     description
81       "Domain represent a distinct administrative domain across
82        collection of users and groups.";
83
84     ct:instance-list users { ct:instance-type User; }
85     ct:instance-list groups { ct:instance-type Group; }
86   }
87
88   rpc create-user;
89   rpc remove-user;
90   rpc create-group;
91   rpc remove-group;
92 }