Skip to content

Commit

Permalink
Ensure backbeat retrieve the account quotas
Browse files Browse the repository at this point in the history
The route backbeat also calls the doAuth function, but we never
map the value to accountQuotas

Issue: CLDSRV-590
  • Loading branch information
williamlardier committed Dec 6, 2024
1 parent 2ac5a57 commit 5d1b31e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/routes/routeBackbeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ function routeBackbeat(clientIP, request, response, log) {
const path = request.url.replace('/_/backbeat/api', '/_/');
const { host, port } = config.backbeat;
const target = `http://${host}:${port}${path}`;
return auth.server.doAuth(request, log, (err, userInfo) => {
return auth.server.doAuth(request, log, (err, userInfo, streamingV4Params, infos) => {
if (err) {
log.debug('authentication error', {
error: err,
Expand All @@ -1398,6 +1398,8 @@ function routeBackbeat(clientIP, request, response, log) {
});
return responseJSONBody(err, null, response, log);
}
// eslint-disable-next-line no-param-reassign
request.accountQuotas = infos?.accountQuota;
// FIXME for now, any authenticated user can access API
// routes. We should introduce admin accounts or accounts
// with admin privileges, and restrict access to those
Expand Down

0 comments on commit 5d1b31e

Please sign in to comment.