Skip to content

Commit 7bce9c7

Browse files
authored
Update faas.js
remove application Id authentication method instead a user is required to implement authentication and authorization to the functions
1 parent f5d62c2 commit 7bce9c7

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/faas.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,20 @@ class FaaS {
4848
* @private
4949
*/
5050
this._auth = function (request, response, next) {
51-
const applicationIdFromHeader = request.get('bfast-application-id');
52-
const applicationIdFromQueryParams = request.query.appId;
53-
request.headers['x-bfast-app-id'] = this._appId;
54-
request.headers['x-bfast-project-id'] = this._projectId;
55-
if (this._appId && this._appId !== '' && this._appId === applicationIdFromHeader) {
56-
next();
57-
} else if (applicationIdFromQueryParams && applicationIdFromQueryParams === this._appId) {
58-
next();
59-
} else {
60-
response.status(401).json({message: 'Unauthorized request'});
61-
}
51+
// const applicationIdFromHeader = request.get('bfast-application-id');
52+
// const applicationIdFromQueryParams = request.query.appId;
53+
// request.headers['x-bfast-app-id'] = this._appId;
54+
// request.headers['x-bfast-project-id'] = this._projectId;
55+
// if (this._appId && this._appId !== '' && this._appId === applicationIdFromHeader) {
56+
// next();
57+
// } else if (applicationIdFromQueryParams && applicationIdFromQueryParams === this._appId) {
58+
// next();
59+
// } else {
60+
// response.status(401).json({message: 'Unauthorized request'});
61+
// }
62+
63+
// user required to implement authentication logic to his/her functions
64+
next();
6265
};
6366

6467
/**

0 commit comments

Comments
 (0)