Microservices - Authentication and Authorization
Consider the following pseudocode for API key validation:
What will be the output of this code?
function checkApiKey(request) {
key = request.headers['X-API-Key'];
if (key === '12345') {
return 'Authorized';
} else {
return 'Unauthorized';
}
}
print(checkApiKey({headers: {'X-API-Key': 'abcde'}}));What will be the output of this code?
