@@ -141,19 +141,19 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
141
141
. route (
142
142
web:: put ( )
143
143
. to ( logstream:: put_stream)
144
- . authorise_for_stream ( Action :: CreateStream ) ,
144
+ . authorize_for_stream ( Action :: CreateStream ) ,
145
145
)
146
146
// POST "/logstream/{logstream}" ==> Post logs to given log stream
147
147
. route (
148
148
web:: post ( )
149
149
. to ( ingest:: post_event)
150
- . authorise_for_stream ( Action :: Ingest ) ,
150
+ . authorize_for_stream ( Action :: Ingest ) ,
151
151
)
152
152
// DELETE "/logstream/{logstream}" ==> Delete log stream
153
153
. route (
154
154
web:: delete ( )
155
155
. to ( logstream:: delete)
156
- . authorise_for_stream ( Action :: DeleteStream ) ,
156
+ . authorize_for_stream ( Action :: DeleteStream ) ,
157
157
)
158
158
. app_data ( web:: PayloadConfig :: default ( ) . limit ( MAX_EVENT_PAYLOAD_SIZE ) ) ,
159
159
)
@@ -163,29 +163,29 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
163
163
. route (
164
164
web:: put ( )
165
165
. to ( logstream:: put_alert)
166
- . authorise_for_stream ( Action :: PutAlert ) ,
166
+ . authorize_for_stream ( Action :: PutAlert ) ,
167
167
)
168
168
// GET "/logstream/{logstream}/alert" ==> Get alert for given log stream
169
169
. route (
170
170
web:: get ( )
171
171
. to ( logstream:: get_alert)
172
- . authorise_for_stream ( Action :: GetAlert ) ,
172
+ . authorize_for_stream ( Action :: GetAlert ) ,
173
173
) ,
174
174
)
175
175
. service (
176
176
// GET "/logstream/{logstream}/schema" ==> Get schema for given log stream
177
177
web:: resource ( "/schema" ) . route (
178
178
web:: get ( )
179
179
. to ( logstream:: schema)
180
- . authorise_for_stream ( Action :: GetSchema ) ,
180
+ . authorize_for_stream ( Action :: GetSchema ) ,
181
181
) ,
182
182
)
183
183
. service (
184
184
// GET "/logstream/{logstream}/stats" ==> Get stats for given log stream
185
185
web:: resource ( "/stats" ) . route (
186
186
web:: get ( )
187
187
. to ( logstream:: get_stats)
188
- . authorise_for_stream ( Action :: GetStats ) ,
188
+ . authorize_for_stream ( Action :: GetStats ) ,
189
189
) ,
190
190
)
191
191
. service (
@@ -194,13 +194,13 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
194
194
. route (
195
195
web:: put ( )
196
196
. to ( logstream:: put_retention)
197
- . authorise_for_stream ( Action :: PutRetention ) ,
197
+ . authorize_for_stream ( Action :: PutRetention ) ,
198
198
)
199
199
// GET "/logstream/{logstream}/retention" ==> Get retention for given logstream
200
200
. route (
201
201
web:: get ( )
202
202
. to ( logstream:: get_retention)
203
- . authorise_for_stream ( Action :: GetRetention ) ,
203
+ . authorize_for_stream ( Action :: GetRetention ) ,
204
204
) ,
205
205
) ;
206
206
@@ -209,19 +209,19 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
209
209
. service (
210
210
web:: resource ( "/{username}" )
211
211
// PUT /user/{username} => Create a new user
212
- . route ( web:: put ( ) . to ( rbac:: put_user) . authorise ( Action :: PutUser ) )
212
+ . route ( web:: put ( ) . to ( rbac:: put_user) . authorize ( Action :: PutUser ) )
213
213
// DELETE /user/{username} => Delete a user
214
214
. route (
215
215
web:: delete ( )
216
216
. to ( rbac:: delete_user)
217
- . authorise ( Action :: DeleteUser ) ,
217
+ . authorize ( Action :: DeleteUser ) ,
218
218
)
219
- . route ( web:: put ( ) . to ( rbac:: put_roles) . authorise ( Action :: PutUser ) ) ,
219
+ . route ( web:: put ( ) . to ( rbac:: put_roles) . authorize ( Action :: PutUser ) ) ,
220
220
)
221
221
. service (
222
222
web:: resource ( "/{username}/roles" )
223
223
// PUT /user/{username}/roles => Put roles for user
224
- . route ( web:: put ( ) . to ( rbac:: put_roles) . authorise ( Action :: PutRoles ) ) ,
224
+ . route ( web:: put ( ) . to ( rbac:: put_roles) . authorize ( Action :: PutRoles ) ) ,
225
225
)
226
226
. wrap_fn ( |req, srv| {
227
227
// The credentials set in the env vars (P_USERNAME & P_PASSWORD) are treated
@@ -247,7 +247,7 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
247
247
web:: resource ( "/query" ) . route (
248
248
web:: post ( )
249
249
. to ( query:: query)
250
- . authorise_for_stream ( Action :: Query ) ,
250
+ . authorize_for_stream ( Action :: Query ) ,
251
251
) ,
252
252
)
253
253
// POST "/ingest" ==> Post logs to given log stream based on header
@@ -256,7 +256,7 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
256
256
. route (
257
257
web:: post ( )
258
258
. to ( ingest:: ingest)
259
- . authorise_for_stream ( Action :: Ingest ) ,
259
+ . authorize_for_stream ( Action :: Ingest ) ,
260
260
)
261
261
. app_data ( web:: PayloadConfig :: default ( ) . limit ( MAX_EVENT_PAYLOAD_SIZE ) ) ,
262
262
)
@@ -269,7 +269,7 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
269
269
. service (
270
270
// GET "/logstream" ==> Get list of all Log Streams on the server
271
271
web:: resource ( "" )
272
- . route ( web:: get ( ) . to ( logstream:: list) . authorise ( Action :: ListStream ) ) ,
272
+ . route ( web:: get ( ) . to ( logstream:: list) . authorize ( Action :: ListStream ) ) ,
273
273
)
274
274
. service (
275
275
// logstream API
@@ -292,19 +292,19 @@ pub fn metrics_path() -> String {
292
292
}
293
293
294
294
trait RouteExt {
295
- fn authorise ( self , action : Action ) -> Self ;
296
- fn authorise_for_stream ( self , action : Action ) -> Self ;
295
+ fn authorize ( self , action : Action ) -> Self ;
296
+ fn authorize_for_stream ( self , action : Action ) -> Self ;
297
297
}
298
298
299
299
impl RouteExt for Route {
300
- fn authorise ( self , action : Action ) -> Self {
300
+ fn authorize ( self , action : Action ) -> Self {
301
301
self . wrap ( Authorization {
302
302
action,
303
303
stream : false ,
304
304
} )
305
305
}
306
306
307
- fn authorise_for_stream ( self , action : Action ) -> Self {
307
+ fn authorize_for_stream ( self , action : Action ) -> Self {
308
308
self . wrap ( Authorization {
309
309
action,
310
310
stream : true ,
0 commit comments