Configurable HTTP(S) support for VES messaging
[sim/o1-interface.git] / ntsimulator / deploy / o-ran / yang / o-ran-usermgmt.yang
1 module o-ran-usermgmt {
2   yang-version 1.1;
3   namespace "urn:o-ran:user-mgmt:1.0";
4   prefix "o-ran-usermgmt";
5
6   import ietf-netconf-acm {
7     prefix nacm;
8     reference
9       "RFC 8341: Network Configuration Access Control Model";
10   }
11
12   organization "O-RAN Alliance";
13
14   contact
15     "www.o-ran.org";
16
17   description
18     "This module defines the user management model for the O-RAN Equipment.
19
20     Copyright 2019 the O-RAN Alliance.
21
22     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
23     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32     POSSIBILITY OF SUCH DAMAGE.
33
34     Redistribution and use in source and binary forms, with or without
35     modification, are permitted provided that the following conditions are met:
36
37     * Redistributions of source code must retain the above copyright notice,
38     this list of conditions and the above disclaimer.
39     * Redistributions in binary form must reproduce the above copyright notice,
40     this list of conditions and the above disclaimer in the documentation
41     and/or other materials provided with the distribution.
42     * Neither the Members of the O-RAN Alliance nor the names of its
43     contributors may be used to endorse or promote products derived from
44     this software without specific prior written permission.";
45
46   revision "2019-07-03" {
47     description
48       "version 1.1.0
49
50       1) change name leaf to type nacm:user-name-type
51       2) added account-type to qualify when password is required ";
52
53     reference "ORAN-WG4.M.0-v01.00";
54   }
55
56   revision "2019-02-04" {
57     description
58       "version 1.0.0
59
60       1) imported model from xRAN
61       2) changed namespace and reference from xran to o-ran";
62
63     reference "ORAN-WG4.M.0-v01.00";
64   }
65
66   typedef password-type {
67     type string {
68       length "8..128";
69       pattern "[a-zA-Z0-9!$%\\^()\\[\\]_\\-~{}.+]*" {
70         error-message "Password content does not meet the requirements";
71       }
72     }
73     description
74       "The password for this entry. This shouldn't be in clear text
75        The Password must contain at least 2 characters from
76        each of the following groups:
77        a) Lower case alphabetic (a-z)
78        b) Upper case alphabetic (A-Z)
79        c) Numeric 0-9
80        d) Special characters Allowed !$%^()[]_-~{}.+
81        Password must not contain Username.";
82   }
83
84   grouping user-list {
85     list user {
86       key "name";
87       description
88         "The list of local users configured on this device.";
89       leaf name {
90         type nacm:user-name-type;
91         description
92           "The user name string identifying this entry.
93
94           NOTE: o-ran-usermgmt:user-profile/user/name is
95           identical to nacm:nacm/groups/group/user-name
96           but the current schema is preserved for backwards
97           compatibility.";
98       }
99       leaf account-type {
100         type enumeration {
101           enum PASSWORD {
102             description "the user-name is for password based authentication";
103           }
104           enum CERTIFICATE {
105             description "the user-name is for certificate based authentciation";
106           }
107         }
108         default "PASSWORD";
109       }
110
111       leaf password {
112         nacm:default-deny-all;
113         type password-type;
114         description
115           "The password for this entry.
116
117           This field is only valid when account-type is NOT set to CERTIFICATE,
118           i.e., when account-type is NOT present or present and set to
119           PASSWORD.";
120       }
121       leaf enabled {
122         type boolean;
123         description
124           "Indicates whether an account is enabled or disabled.";
125       }
126     }
127   }
128
129   container users {
130     // must "user/enabled='true'" {
131     //   error-message "At least one account needs to be enabled.";
132     // }
133     //checkAL - above must is commented out for installing reasons
134     //TAKE NOTE - any configuration with zero enabled users is invalid.
135     //This will typically be the case when using a simulated NETCONF Server
136     //and so this constraint should be removed when operating in those scenarios
137
138     //The config data base of the O-RAN equipment should ensure that the user
139     //default account is enabled on factory restart
140
141     description "list of user accounts";
142     uses user-list;
143   }
144
145   rpc chg-password {
146     nacm:default-deny-all;
147     input {
148       leaf currentPassword {
149         type password-type;
150         mandatory true;
151         description
152           "provide the current password";
153       }
154       leaf newPassword {
155         type password-type;
156         mandatory true;
157         description
158           "provide a new password";
159       }
160       leaf newPasswordConfirm {
161         type password-type;
162         mandatory true;
163         description
164           "re-enter the new password ";
165       }
166     }
167     output {
168       leaf status {
169         type enumeration {
170           enum "Successful" {
171             value 1;
172           }
173           enum "Failed" {
174             value 2;
175           }
176         }
177         mandatory true;
178         description
179           "Successful or Failed";
180       }
181       leaf status-message {
182         type string;
183         description
184           "Gives a more detailed reason for success / failure";
185       }
186     }
187   }
188
189 }