Replies: 4 comments 1 reply
-
here's a very rough sequence diagram of a proxy based approach (mermaid syntax in the issue here) option 1: keeping client ID and secret sequenceDiagram
actor user as User
participant browser as Browser
participant docs as Docs Server
participant api as Platform API
user->>browser: Enter Region, Client Id, project key, secret (credentials)
browser->>+docs: Please save credentials
docs->>-browser: OK (data in encrypted JWE, set HttpOnly,SameSite,Secure cookie)
user->>browser: Please check my task result in the project
browser->>+docs: GET me the data from the API (includes the JWE cookie)
docs-->>+api: get a token (if not in the JWE)
api-->>-docs: here's a token
docs->>+api: GET data
api->>-docs: Project data
docs->-browser: return data (and set JWE including token OR a separate JWE for the token)
browser->user: Task Verification Result
But It may be overkill to keep client ID and secret, I guess just keeping the token and optionally a refresh token is the better architecture. They time out naturally and can be invalidated. option 2: just keeping a token and refresh token sequenceDiagram
actor user as User
participant browser as Browser
participant docs as Docs Server
participant api as Platform API
user->>browser: Enter Region, Client Id, project key, secret (credentials)
browser->>+docs: Please get and save a token
docs-->>docs: maybe do some checks like no production projects, no write permissions...
docs->>+api: get a token and refresh token
api->>-docs: here's a token
docs->>-browser: OK (token in encrypted JWE, set HttpOnly,SameSite,Secure cookie)
browser->>user: allow selecting that project as your current project connection
user->>browser: Please check my task result in the project
browser->>+docs: GET me the data from the API (includes the JWE cookie)
docs-->>docs: checks like no PII sensitive endpoints, no mutations, ??
docs->>+api: GET data
api->>-docs: Project data
docs->-browser: return data
browser->user: Task Verification Result
|
Beta Was this translation helpful? Give feedback.
-
I found a first place that has a similar feature that goes beyond standard https://developers.freshdesk.com/api/ (simply asking to put a project / database key and aPI secret that's it. ) |
Beta Was this translation helpful? Give feedback.
-
the above architecture (option 1 or 2) allows us to check any type of mutations that a user executes on their end and then we (docs server) checks if they did it right. but what about queries ? if we are talking about fetching something .. maybe something like building complex filters and facets. |
Beta Was this translation helpful? Give feedback.
-
@FFawzy to be honest I don't really understand this comment. What do you infer from that it would only work for mutations? My "... no mutations???" text in the graph was more a brainstorming idea whether it could make sense to restrict that kind of API access to certain operations. Same for the requirements checklist in the original ticket text - some have question marks as a reminder to discuss the question, that's all. |
Beta Was this translation helpful? Give feedback.
-
We are getting more request for interactive and personalized features directly in the platform docs. Examples
In any case this means that we need to keep authentication data and e.g. a list of project keys the user used last. It would also require a UI similar to being logged in.
Before going into design and further exploration we would have to do a security and feasibility analysis of how it could be done, esp. how project access credentials can be safely made available in a user session across page views , reloads and evetually also browser sessions.
Generally I can think of three approaches:
ideas only, but we should start the conversation and give it the time it needs.
UPDATE: a list of requirements to first decide upon before drafting an architecture.
Beta Was this translation helpful? Give feedback.
All reactions