Microservices - Authentication and Authorization
What will be the output of this pseudocode if the API key is missing?
function validateKey(request) {
key = request.headers['Authorization']
if (!key) {
return 'No API key provided'
}
if (key == 'valid-key') {
return 'Access granted'
}
return 'Access denied'
}
print(validateKey({headers: {}}))