You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're hard at work adding much requested flexibility to the Encore framework. In this week's release, we've added native support for HTTP headers in Encore APIs and authentication handlers. No more having to use only JSON!
This means you can now easily:
Model REST APIs like you're used to
Return HTTP headers
Use the local development dashboard to see how each field will be encoded
Run encore version update to grab the latest version and experience it for yourself!
– If you're new to Encore, check out the Quick Start Guide to get started building.
Improved authentication support
Encore now supports a more flexible way to express authentication handlers, using struct payloads in the same way you're used to for regular endpoints. The struct payloads can include multiple fields that can be sourced from either HTTP Headers or query strings.
That means you can do things like:
Implement more advanced authentication methods that go beyond simple Bearer tokens
Accept client_id as a query string and an API key in the Authorization header, at the same time
Support HTTP Basic Authentication
Improved client code generation
The Encore client code generation has received a major upgrade for both TypeScript and Go clients.
Support for HTTP headers
Support for structured authentication handlers
API errors are now reported as structured errors rather than strings
The TypeScript client now properly supports raw endpoints, including specifying the request body, HTTP method, and arbitrary fetch options
Note: The Go client now validates the provided HTTP method for calling raw endpoints. In the rare case that a raw endpoint was called without a valid Method, the behavior of the new client generator will differ by returning an error. In previous versions it instead defaulted to making a GET request.
Bug fixes and other improvements
Forward slashes encoded as %2F within string path segments no longer causes that path segment to be treated as two separate segments.
In the rare case that path segment parameters conflict with reserved keywords or names the generated names are now prefixed with _ to avoid name collisions.
Blank or missing auth tokens in generated TypeScript clients will no longer be sent in the Authorization header
We rely on the community to improve Encore, and we're overwhelmed by your support and encouragement. Big thanks to @ValeriaVG, @Qolzam, Prasanna Balaji, @vilhelmmelkstam, and @MaxDanielsson for your bug reports and feedback!
Join the most pioneering developer community
Developers building with Encore are forward-thinkers working on exciting and innovative products. Join the conversation on Slack to see what's going on, learn from others, and share what you're working on.
What’s next
Over the coming weeks we'll be adding much requested flexibility to the Encore framework, with improved support for things like: middleware, configuration and dependency injection. Vote on your favorite feature on the roadmap – If you like what's going on, why not give the project a star?
As always, if you have questions or ideas, come tell us on Slack.
We’re excited to hear your feedback! ❤️
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We're hard at work adding much requested flexibility to the Encore framework. In this week's release, we've added native support for HTTP headers in Encore APIs and authentication handlers. No more having to use only JSON!
This means you can now easily:
Run
encore version update
to grab the latest version and experience it for yourself!– If you're new to Encore, check out the Quick Start Guide to get started building.
Improved authentication support
Encore now supports a more flexible way to express authentication handlers, using struct payloads in the same way you're used to for regular endpoints. The struct payloads can include multiple fields that can be sourced from either HTTP Headers or query strings.
That means you can do things like:
client_id
as a query string and an API key in theAuthorization
header, at the same timeImproved client code generation
The Encore client code generation has received a major upgrade for both TypeScript and Go clients.
fetch
optionsNote: The Go client now validates the provided HTTP method for calling raw endpoints. In the rare case that a raw endpoint was called without a valid
Method
, the behavior of the new client generator will differ by returning an error. In previous versions it instead defaulted to making aGET
request.Bug fixes and other improvements
%2F
within string path segments no longer causes that path segment to be treated as two separate segments._
to avoid name collisions.Authorization
headerencore.Meta
function now reports the correct value for theAPIBaseURL
field for local development (Meta APIBaseURL reports wrong port locally #245)encore eject docker --help
for more information.Thanks to all our contributors
We rely on the community to improve Encore, and we're overwhelmed by your support and encouragement. Big thanks to @ValeriaVG, @Qolzam, Prasanna Balaji, @vilhelmmelkstam, and @MaxDanielsson for your bug reports and feedback!
Join the most pioneering developer community
Developers building with Encore are forward-thinkers working on exciting and innovative products. Join the conversation on Slack to see what's going on, learn from others, and share what you're working on.
What’s next
Over the coming weeks we'll be adding much requested flexibility to the Encore framework, with improved support for things like: middleware, configuration and dependency injection. Vote on your favorite feature on the roadmap
– If you like what's going on, why not give the project a star?
As always, if you have questions or ideas, come tell us on Slack.
We’re excited to hear your feedback! ❤️
Catch you in the cloud,
André & the Encore team
This discussion was created from the release Introducing native HTTP headers support.
Beta Was this translation helpful? Give feedback.
All reactions