@backstage/plugin-auth-backend 0.18.3-next.0 → 0.18.3-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Copyright 2023 The Backstage Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ // @ts-check
18
+
19
+ /**
20
+ * @param {import('knex').Knex} knex
21
+ */
22
+ exports.up = async function up(knex) {
23
+ // See https://github.com/gx0r/connect-session-knex
24
+ // Modeled loosely after https://github.com/gx0r/connect-session-knex/blob/4e0e36a9afbb13c3000a89f5e341f2d2d4339a02/lib/index.js#L114
25
+ // For simplicity we always make the session a string
26
+ // Do NOT change around this table or column names; the connect-session-knex library makes assumptions about them
27
+ await knex.schema.createTable('sessions', table => {
28
+ table.comment('Session data');
29
+ table.string('sid').primary().notNullable().comment('ID of the session');
30
+ table
31
+ .text('sess', 'longtext')
32
+ .notNullable()
33
+ .comment('Session data, JSON serialized');
34
+ table
35
+ .timestamp('expired')
36
+ .notNullable()
37
+ .comment('The point in time when the session expires');
38
+ table.index('sid', 'sessions_sid_idx');
39
+ table.index('expired', 'sessions_expired_idx');
40
+ });
41
+ };
42
+
43
+ /**
44
+ * @param {import('knex').Knex} knex
45
+ */
46
+ exports.down = async function down(knex) {
47
+ await knex.schema.alterTable('sessions', table => {
48
+ table.dropIndex([], 'sessions_sid_idx');
49
+ table.dropIndex([], 'sessions_expired_idx');
50
+ });
51
+ await knex.schema.dropTable('sessions');
52
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-auth-backend",
3
3
  "description": "A Backstage backend plugin that handles authentication",
4
- "version": "0.18.3-next.0",
4
+ "version": "0.18.3-next.2",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -32,18 +32,19 @@
32
32
  "clean": "backstage-cli package clean"
33
33
  },
34
34
  "dependencies": {
35
- "@backstage/backend-common": "^0.18.5-next.0",
35
+ "@backstage/backend-common": "^0.18.5-next.1",
36
36
  "@backstage/catalog-client": "^1.4.1",
37
37
  "@backstage/catalog-model": "^1.3.0",
38
38
  "@backstage/config": "^1.0.7",
39
39
  "@backstage/errors": "^1.1.5",
40
- "@backstage/plugin-auth-node": "^0.2.14-next.0",
40
+ "@backstage/plugin-auth-node": "^0.2.14-next.1",
41
41
  "@backstage/types": "^1.0.2",
42
42
  "@davidzemon/passport-okta-oauth": "^0.0.5",
43
43
  "@google-cloud/firestore": "^6.0.0",
44
44
  "@types/express": "^4.17.6",
45
45
  "@types/passport": "^1.0.3",
46
46
  "compression": "^1.7.4",
47
+ "connect-session-knex": "^3.0.1",
47
48
  "cookie-parser": "^1.4.5",
48
49
  "cors": "^2.8.5",
49
50
  "express": "^4.17.1",
@@ -76,7 +77,7 @@
76
77
  "yn": "^4.0.0"
77
78
  },
78
79
  "devDependencies": {
79
- "@backstage/backend-test-utils": "^0.1.37-next.0",
80
+ "@backstage/backend-test-utils": "^0.1.37-next.1",
80
81
  "@backstage/cli": "^0.22.7-next.0",
81
82
  "@types/body-parser": "^1.19.0",
82
83
  "@types/cookie-parser": "^1.4.2",