Skip to content

[Examples] add AWS credentials environment validator #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sadiqk2
Copy link

@sadiqk2 sadiqk2 commented Aug 12, 2025

Q A
Bug fix? no
New feature? no
Docs? no
Issues
License MIT
  • Created EnvValidator to centralize AWS credentials environment variable validation
  • Updated examples/bedrock/ to use the new validator

@carsonbot carsonbot changed the title feat: add reusable AWS credentials environment validator feat: add reusable AWS credentials environment validator Aug 12, 2025
@sadiqk2 sadiqk2 changed the title feat: add reusable AWS credentials environment validator [Platform][Examples] add reusable AWS credentials environment validator Aug 12, 2025
- Created `EnvValidator` class in `src/EnvValidator.php` to centralize AWS credentials environment variable validation
- Updated `examples/bedrock/` to use the new validator
@sadiqk2 sadiqk2 force-pushed the feat/add-aws-validator-bedrock branch from 3b229e7 to c524bd8 Compare August 12, 2025 16:01
@sadiqk2 sadiqk2 changed the title [Platform][Examples] add reusable AWS credentials environment validator [Platform][Examples] add AWS credentials environment validator Aug 13, 2025
@sadiqk2
Copy link
Author

sadiqk2 commented Aug 13, 2025

@chr-hertel Can you review this ?

@OskarStark OskarStark changed the title [Platform][Examples] add AWS credentials environment validator [Platform][Examples] add AWS credentials environment validator Aug 13, 2025
Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

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

We usually haven env() shortcut in other examples, I would prefer to use this

@sadiqk2
Copy link
Author

sadiqk2 commented Aug 13, 2025

We usually haven env() shortcut in other examples, I would prefer to use this

@OskarStark you mean to env() instead of global var thingy

@sadiqk2 sadiqk2 requested a review from OskarStark August 14, 2025 08:50
Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

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

The difference with these examples is that env(...) is usually used to access the $_SERVER and throw an error if not set. In our Bedrock bridge we don't have to do that since the aws lib we're using is fetching the env vars itself.

Again, like with #313, I'm not convinced to have an extra class here. I see the point that this looks a bit odd right now, but unless we can come up with a better idea than an extra class, i'd rather keep it like that.

@carsonbot carsonbot changed the title [Platform][Examples] add AWS credentials environment validator add AWS credentials environment validator Aug 14, 2025
@OskarStark OskarStark added the Examples Issues & PRs about the example scripts label Aug 14, 2025
@carsonbot carsonbot changed the title add AWS credentials environment validator [Examples] add AWS credentials environment validator Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Examples Issues & PRs about the example scripts Status: Needs Work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants