Bug 29234: Further clean Z3950 Tests
[srvgit] / api / v1 / swagger / paths / patrons_password.yaml
1 ---
2 "/patrons/{patron_id}/password":
3   post:
4     x-mojo-to: Patrons::Password#set
5     operationId: setPatronPassword
6     tags:
7       - patrons
8     summary: Set password for a patron
9     parameters:
10       - $ref: "../swagger.yaml#/parameters/patron_id_pp"
11       - name: body
12         in: body
13         description: A JSON object containing password information
14         schema:
15           type: object
16           properties:
17             password:
18               description: New password (plain text)
19               type: string
20             password_2:
21               description: Repeated new password (plain text)
22               type: string
23           required:
24             - password
25             - password_2
26           additionalProperties: false
27     produces:
28       - application/json
29     responses:
30       "200":
31         description: Password changed
32       "400":
33         description: Bad request
34         schema:
35           $ref: "../swagger.yaml#/definitions/error"
36       "401":
37         description: Authentication required
38         schema:
39           $ref: "../swagger.yaml#/definitions/error"
40       "403":
41         description: Access forbidden
42         schema:
43           $ref: "../swagger.yaml#/definitions/error"
44       "404":
45         description: Patron not found
46         schema:
47           $ref: "../swagger.yaml#/definitions/error"
48       "500":
49         description: |
50           Internal server error. Possible `error_code` attribute values:
51
52           * `internal_server_error`
53         schema:
54           $ref: "../swagger.yaml#/definitions/error"
55       "503":
56         description: Under maintenance
57         schema:
58           $ref: "../swagger.yaml#/definitions/error"
59     x-koha-authorization:
60       permissions:
61         borrowers: "1"
62 "/patrons/{patron_id}/password/expiration_date":
63   put:
64     x-mojo-to: Patrons::Password::Expiration#set
65     operationId: setPatronPasswordExpiration
66     tags:
67       - patrons
68     summary: Set password expiration for a patron
69     parameters:
70       - $ref: ../swagger.yaml#/parameters/patron_id_pp
71       - name: body
72         in: body
73         description: A JSON object containing password expiration date
74         schema:
75           type: object
76           properties:
77             expiration_date:
78               description: Date to expire password
79               type: string
80               format: date
81           required:
82             - expiration_date
83           additionalProperties: false
84     produces:
85       - application/json
86     responses:
87       "200":
88         description: Password expiration changed
89       "400":
90         description: Bad request
91         schema:
92           $ref: ../swagger.yaml#/definitions/error
93       "401":
94         description: Authentication required
95         schema:
96           $ref: ../swagger.yaml#/definitions/error
97       "403":
98         description: Access forbidden
99         schema:
100           $ref: ../swagger.yaml#/definitions/error
101       "404":
102         description: Patron not found
103         schema:
104           $ref: ../swagger.yaml#/definitions/error
105       "500":
106         description: |
107           Internal server error. Possible `error_code` attribute values:
108
109           * `internal_server_error`
110         schema:
111           $ref: ../swagger.yaml#/definitions/error
112       "503":
113         description: Under maintenance
114         schema:
115           $ref: ../swagger.yaml#/definitions/error
116     x-koha-authorization:
117       permissions:
118         superlibrarian: "1"