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
Copy file name to clipboardExpand all lines: plugins/search-backend-module-stack-overflow-teams-collator/src/collators/StackOverflowQuestionsCollatorFactory.ts
+28-25Lines changed: 28 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -80,16 +80,16 @@ export class StackOverflowQuestionsCollatorFactory
Copy file name to clipboardExpand all lines: plugins/stack-overflow-teams-backend/README.md
+14-67Lines changed: 14 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,109 +6,56 @@ Backend counterpart of the Stack Overflow for Teams Plugin.
6
6
7
7
The **Stack Overflow for Teams Backend plugin** is responsible for:
8
8
9
-
10
-
11
-
-**Indexing all questions** from the private Stack Overflow instance (an enhanced version of the existing community plugins in the Backstage repository).
12
-
13
-
-**Handling API requests** via ``createStackOverflowApi`` and ``createStackOverflowService`` to the Stack Overflow instance for retrieving:
14
-
15
-
-`/users`
16
-
17
-
-`/tags`
18
-
19
-
-`/questions`
20
-
21
-
- Posting new questions via `/questions`
22
-
23
-
-**Managing OAuth authentication flow** to securely access Stack Overflow private instances via ``createStackOverflowAuth``
24
-
25
-
9
+
-**Indexing all questions** from the private Stack Overflow instance (an enhanced version of the existing community plugins in the Backstage repository).
10
+
-**Handling API requests** via ``createStackOverflowApi`` and ``createStackOverflowService`` to the Stack Overflow instance for retrieving:
11
+
-`/users`
12
+
-`/tags`
13
+
-`/questions`
14
+
- Posting new questions via `/questions`
15
+
-**Managing OAuth authentication flow** to securely access Stack Overflow private instances via ``createStackOverflowAuth``
16
+
-**Encrypts** the Stack Overflow Token before sending it as an http-only cookie to the frontend.
26
17
27
18
## OAuth Authentication Flow
28
19
29
-
30
-
31
-
The backend is the only component that directly utilizes **Stack Overflow access tokens** for requests.
32
-
33
-
20
+
The backend is the only component that directly utilizes the **encrypted Stack Overflow access tokens** for requests.
- Hashes Code Verifier to obtain **Code Challenge**.
48
-
49
28
- Generates a **state** (random string).
50
-
51
29
- Stores **Code Verifier** and **State** in a **secure, HTTP-only cookie** accessible only to the server.
52
30
53
-
54
-
55
31
#### **`/callback`**
56
32
57
33
- Retrieves the stored **Code Verifier** and **State**.
58
-
59
34
- Validates that the received **state** matches the one from Stack Overflow's query string parameter.
60
-
61
35
- The backend requests an **Access Token** using the stored **Code Verifier**.
62
-
63
-
- Stores the **Stack Overflow Access Token** in a **secure, HTTP-only cookie**.
64
-
65
-
66
-
36
+
- Backend **encrypts the token**, using the JWT secret stored in memory.
37
+
- Stores the **encrypted Stack Overflow Access Token** in a **secure, HTTP-only cookie**.
67
38
68
39
## Installation
69
40
70
-
71
-
72
41
This plugin is installed via the `backstage-plugin-stack-overflow-teams-backend` package. To install it to your backend package, run the following command:
This plugin backend can be started in a standalone mode from directly in this
107
-
108
-
package with `yarn start`. It is a limited setup that is most convenient when
109
-
110
-
developing the plugin backend itself.
111
-
112
-
59
+
This plugin backend can be started in a standalone mode from directly in this package with `yarn start`. It is a limited setup that is most convenient when developing the plugin backend itself.
113
60
114
61
If you want to run the entire project, including the frontend, run `yarn dev` from the root directory.
0 commit comments