Skip to content

Fix forward the permission error of scheduler lambda#22

Merged
waisingyiu merged 2 commits intomainfrom
wsy/fix-forward-permission-error
Jul 29, 2025
Merged

Fix forward the permission error of scheduler lambda#22
waisingyiu merged 2 commits intomainfrom
wsy/fix-forward-permission-error

Conversation

@waisingyiu
Copy link
Contributor

@waisingyiu waisingyiu commented Jul 29, 2025

What does this change?

After we bumped the pan-domain-node library to v1.2.0 in #20, we found that the scheduler lambda threw an access denied exception.

In #20, we granted the "Express" lambda with the permission to read objects from the bucket pan-domain-auth-settings so that it could load the public settings file with the new version of pan-domain-node.

While the scheduler lambda does not do any authentication, it still set up the PanDomainAuthentication class due to the fact that their code are bundled together.

This pull request grant the scheduler lambda with this permission to fix the error.

How to test

Previously we could see the error log from scheduler:
Screenshot 2025-07-28 at 20 08 24

After deploying the fix, we can see the scheduler can run properly:
Screenshot 2025-07-29 at 09 16 08

I also shared a Google sheet with gudoc. I could see new data coming through after I added new data to the spreadsheet.
Screenshot 2025-07-29 at 09 33 35

Screenshot 2025-07-29 at 09 33 43

@waisingyiu waisingyiu marked this pull request as ready for review July 29, 2025 08:34
@waisingyiu waisingyiu requested a review from SHession July 29, 2025 08:34
Copy link
Contributor

@SHession SHession left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solution makes sense! Slightly unfortunate we need to make this change but the most pragmatic solution for now.

});
scheduledLambda.addToRolePolicy(s3BucketPolicy)
scheduledLambda.addToRolePolicy(sharedParametersPolicy)
scheduledLambda.addToRolePolicy(pandaS3BucketPolcy)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment to explain why this is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I've added in the last commit.

@waisingyiu waisingyiu merged commit f50a599 into main Jul 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump pan-domain-node in gudocs2 to load public settings using AWS SDK

2 participants

Comments