Skip to content

Commit 12d6f15

Browse files
committed
Fix
1 parent db014cf commit 12d6f15

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

server/src/handlers/http.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,19 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
141141
.route(
142142
web::put()
143143
.to(logstream::put_stream)
144-
.authorise_for_stream(Action::CreateStream),
144+
.authorize_for_stream(Action::CreateStream),
145145
)
146146
// POST "/logstream/{logstream}" ==> Post logs to given log stream
147147
.route(
148148
web::post()
149149
.to(ingest::post_event)
150-
.authorise_for_stream(Action::Ingest),
150+
.authorize_for_stream(Action::Ingest),
151151
)
152152
// DELETE "/logstream/{logstream}" ==> Delete log stream
153153
.route(
154154
web::delete()
155155
.to(logstream::delete)
156-
.authorise_for_stream(Action::DeleteStream),
156+
.authorize_for_stream(Action::DeleteStream),
157157
)
158158
.app_data(web::PayloadConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
159159
)
@@ -163,29 +163,29 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
163163
.route(
164164
web::put()
165165
.to(logstream::put_alert)
166-
.authorise_for_stream(Action::PutAlert),
166+
.authorize_for_stream(Action::PutAlert),
167167
)
168168
// GET "/logstream/{logstream}/alert" ==> Get alert for given log stream
169169
.route(
170170
web::get()
171171
.to(logstream::get_alert)
172-
.authorise_for_stream(Action::GetAlert),
172+
.authorize_for_stream(Action::GetAlert),
173173
),
174174
)
175175
.service(
176176
// GET "/logstream/{logstream}/schema" ==> Get schema for given log stream
177177
web::resource("/schema").route(
178178
web::get()
179179
.to(logstream::schema)
180-
.authorise_for_stream(Action::GetSchema),
180+
.authorize_for_stream(Action::GetSchema),
181181
),
182182
)
183183
.service(
184184
// GET "/logstream/{logstream}/stats" ==> Get stats for given log stream
185185
web::resource("/stats").route(
186186
web::get()
187187
.to(logstream::get_stats)
188-
.authorise_for_stream(Action::GetStats),
188+
.authorize_for_stream(Action::GetStats),
189189
),
190190
)
191191
.service(
@@ -194,13 +194,13 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
194194
.route(
195195
web::put()
196196
.to(logstream::put_retention)
197-
.authorise_for_stream(Action::PutRetention),
197+
.authorize_for_stream(Action::PutRetention),
198198
)
199199
// GET "/logstream/{logstream}/retention" ==> Get retention for given logstream
200200
.route(
201201
web::get()
202202
.to(logstream::get_retention)
203-
.authorise_for_stream(Action::GetRetention),
203+
.authorize_for_stream(Action::GetRetention),
204204
),
205205
);
206206

@@ -209,19 +209,19 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
209209
.service(
210210
web::resource("/{username}")
211211
// 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))
213213
// DELETE /user/{username} => Delete a user
214214
.route(
215215
web::delete()
216216
.to(rbac::delete_user)
217-
.authorise(Action::DeleteUser),
217+
.authorize(Action::DeleteUser),
218218
)
219-
.route(web::put().to(rbac::put_roles).authorise(Action::PutUser)),
219+
.route(web::put().to(rbac::put_roles).authorize(Action::PutUser)),
220220
)
221221
.service(
222222
web::resource("/{username}/roles")
223223
// 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)),
225225
)
226226
.wrap_fn(|req, srv| {
227227
// 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) {
247247
web::resource("/query").route(
248248
web::post()
249249
.to(query::query)
250-
.authorise_for_stream(Action::Query),
250+
.authorize_for_stream(Action::Query),
251251
),
252252
)
253253
// POST "/ingest" ==> Post logs to given log stream based on header
@@ -256,7 +256,7 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
256256
.route(
257257
web::post()
258258
.to(ingest::ingest)
259-
.authorise_for_stream(Action::Ingest),
259+
.authorize_for_stream(Action::Ingest),
260260
)
261261
.app_data(web::PayloadConfig::default().limit(MAX_EVENT_PAYLOAD_SIZE)),
262262
)
@@ -269,7 +269,7 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
269269
.service(
270270
// GET "/logstream" ==> Get list of all Log Streams on the server
271271
web::resource("")
272-
.route(web::get().to(logstream::list).authorise(Action::ListStream)),
272+
.route(web::get().to(logstream::list).authorize(Action::ListStream)),
273273
)
274274
.service(
275275
// logstream API
@@ -292,19 +292,19 @@ pub fn metrics_path() -> String {
292292
}
293293

294294
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;
297297
}
298298

299299
impl RouteExt for Route {
300-
fn authorise(self, action: Action) -> Self {
300+
fn authorize(self, action: Action) -> Self {
301301
self.wrap(Authorization {
302302
action,
303303
stream: false,
304304
})
305305
}
306306

307-
fn authorise_for_stream(self, action: Action) -> Self {
307+
fn authorize_for_stream(self, action: Action) -> Self {
308308
self.wrap(Authorization {
309309
action,
310310
stream: true,

0 commit comments

Comments
 (0)