xp-forge / aws

AWS Core for the XP Framework
0 stars 0 forks source link

Accept credential functions in ServiceEndpoint constructor #11

Closed thekid closed 3 months ago

thekid commented 3 months ago

These functions are then executed when sign(), open() or request() are called, providing the credentials to the signing function. This way, ServiceEndpoint instances can refresh expiring credentials easily:

// Always use the given credentials
new ServiceEndpoint('lambda', new Credentials(/* ... */));

// Use the default credential provider
new ServiceEndpoint('lambda', CredentialProvider::default());

// Use a custom function
new ServiceEndpoint('lambda', fn() => new Credentials(/* ... */));
thekid commented 3 months ago

Released in https://github.com/xp-forge/aws/releases/tag/v2.0.0

thekid commented 3 months ago

Lambda library made compatible with ^2.0, see https://github.com/xp-forge/lambda/releases/tag/v5.4.0