end-point
support
#462
Replies: 4 comments 1 reply
-
Authentication for another ServiceWe will implement |
Beta Was this translation helpful? Give feedback.
-
How FPM Proxy Works with ServicesIn this example, we are using
|
Beta Was this translation helpful? Give feedback.
-
TODO
|
Beta Was this translation helpful? Give feedback.
-
Package has to use package Urlslink example
Need to check in case of dynamic parameters http-processor example
How will it work
object api call example, which should work
How will it Work
For Document, both will work
For the endpoint urls
Let's say, If a request comes for the path /-/fifthtry.github.io/todos/add-todo/
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Status: In Progress
Tasks
fpm
fpm.dependency
sectionend-point
support for dependency #590X-FPM-*
headersPR: #505
PR: #501
PR: #590
PR: #593
Next: #526
FPM Apps: FPM APPs: https://github.com/ftd-lang/fpm/discussions/599
19th Sep 2022
16th Sep 2022
12th Sep 2022
9th Sep 2022
8th Sep 2022
In first release we will no implement environment headers (some more thought is needed).
As app package and hosting we mentioned
end-point
:Here we are added an attribute
end-point
.Note:
end-point
is not a property of package, but of the unique deployment of the package.abrark.com/analytics
could be deployed for amitu.com on one end-point andfifthtry.com
on another.URL Of An API
How does FPM discover what all links / APIs are available in abrark.com/analytics? We want to create link in header/footer etc to analytics related pages.
Say tomorrow we want to use
amitu.com/analytics
instead:The Dockerfile for amitu.com/analytics would be used for hosting, but it would be assumed that it has the same links/APIs as abrark.com, so no other line in the package has to change other than the
fpm.dependency
lines shown above.End-point Is For Proxying
When a dependency has end-point, any request to
/-/<dependenc-package>/*
is "proxy passed" to<end-point>/*
. So for example in above case, any request coming tohttps://amitu.com/-/abrark.com/analytics/foo
will be proxy passed byfpm
tohttps://<heroku-app-id>.herokuapps.com/foo
.fpm
will preserve http method, query params, headers, cookies etc to the endpoint, and whatever responsefpm
gets from theend-point
we will return it back to browser.In future we may implement caching.
Extra Arguments
If we are running some Django app on behalf of current package, we have to configure that Django app somehow. And ideally the configuration of that Django app should be in
FPM.ftd
of current package, so things are managed in more central way etc.With that in mind, we will pass all the configuration specified in the dependency, like in our example we specified
theme: ganesh-salunke.com/analytics
. These arguments will be passed toend-point
as header:X-FPM-theme: ganesh-salunke.com/analytics
.Security Sensitive Headers
This does not mean every configuration must be in
FPM.ftd
, some configurations are security sensitive, so they should not be inFPM.ftd
file at all.Some such configurations can be passed to
fpm
as environment variable. Say when we are deployingfpm
package somewhere, in a totally different interfaces, the way Github or Heroku do it, the secrets added. These get passed to the fpm and ftd files as environment variable.To forward some environment variable to
end-point
we can use the syntax:Here we have read the environment variable named
FOO
using the$ENV.FOO
and passed it to endpoint asfoo
, and the value of the environment variable will get passed as headerX-FPM-FOO
.Can Main Package Use
end-point
?Means any request to
https://amitu.com/<foo>
will be proxy passed tohttps://<heroku-app-id>.herokuapps.com/<foo>
. This will only happen if<foo>
is not handled by a document in the package (there is nofoo.ftd
norfoo/index.ftd
, foo.md etc).<foo>
can not start with/-/
.Beta Was this translation helpful? Give feedback.
All reactions