Skip to content
This repository was archived by the owner on Apr 10, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/apollo/resolvers/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,8 @@ const clusterResolvers = {
try {
logger.info({ req_id, user, org_id, registration }, `${queryName} validating`);

//step where IAM is authorized
context.IAM_PERF = true;
await validAuth(me, org_id, ACTIONS.REGISTER, TYPES.CLUSTER, queryName, context);

logger.info({ req_id, user, org_id, registration }, `${queryName} validating - authorized`);
Expand Down
5 changes: 5 additions & 0 deletions app/apollo/resolvers/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ const validAuth = async (me, org_id, action, type, queryName, context, attrs = n
}
return;
}

// Debug: Find how long registerCluster() IAM validation takes
const startTime = Date.now();
if (me === null || !(await models.User.isAuthorized(me, org_id, action, type, attrs, context))) {
logger.error({req_id, me: whoIs(me), org_id, action, type}, `ForbiddenError - ${queryName}`);
if (type === TYPES.RESOURCE){
Expand All @@ -183,6 +186,8 @@ const validAuth = async (me, org_id, action, type, queryName, context, attrs = n

}
}
const endTime = Date.now();
if( context.IAM_PERF ) logger.info( {req_id, org_id, me, iam_time: endTime - startTime }, 'IAM api call completed' );
};

// a helper function to render clusterInfo for a list of resources
Expand Down