From ee0925e56aa36c44dccb985e69bc098cc548fc15 Mon Sep 17 00:00:00 2001 From: Meijer Date: Wed, 21 Aug 2024 11:48:19 -0700 Subject: [PATCH 1/4] Biohub Security Rules, first pass --- api/package-lock.json | 121 ++++++++--- app/package-lock.json | 200 +++++++++--------- .../20240808000000_biohub_security_rules.ts | 85 ++++++++ database/src/seeds/01_db_system_users.ts | 6 + 4 files changed, 287 insertions(+), 125 deletions(-) create mode 100644 database/src/migrations/20240808000000_biohub_security_rules.ts diff --git a/api/package-lock.json b/api/package-lock.json index 205530d1..c2cff4e2 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -583,6 +583,36 @@ "strip-ansi": "^7.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -591,6 +621,21 @@ "ansi-regex": "^6.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + } + } + }, "wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -600,6 +645,54 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + } + } } } }, @@ -8890,16 +8983,6 @@ "strip-ansi": "^6.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, "string.prototype.padend": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", @@ -8959,14 +9042,6 @@ "ansi-regex": "^5.0.1" } }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, "strip-bom": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", @@ -10019,16 +10094,6 @@ "strip-ansi": "^6.0.0" } }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/app/package-lock.json b/app/package-lock.json index a4fa1974..48915119 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1838,33 +1838,12 @@ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -1876,34 +1855,6 @@ "strip-ansi": "^7.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, "strip-ansi-cjs": { "version": "npm:strip-ansi@6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -1923,54 +1874,6 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } - }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } } } }, @@ -18213,6 +18116,40 @@ } } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "string.prototype.matchall": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", @@ -19934,6 +19871,75 @@ } } }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/database/src/migrations/20240808000000_biohub_security_rules.ts b/database/src/migrations/20240808000000_biohub_security_rules.ts new file mode 100644 index 00000000..096551df --- /dev/null +++ b/database/src/migrations/20240808000000_biohub_security_rules.ts @@ -0,0 +1,85 @@ +import { Knex } from 'knex'; + +/** + * this adds new security rules to biohub + * insert comments here + * + * @export + * @param {Knex} knex + * @return {*} {Promise} + */ +export async function up(knex: Knex): Promise { + await knex.raw(` + --------------------------------------------------- + ----- inserting reasons into category table ------- + --------------------------------------------------- + INSERT INTO security_category(name, description, record_Effective_date) + VALUES + ('Government Interests', 'Government Interests', now()), + ('Species and Ecosystems Susceptible to Persecution or Harm', 'Species and Ecosystems Susceptible to Persecution or Harm', now()), + ('Proprietary', 'Proprietary', now()), + ('Statutory Constraints', 'Statutory Constraints', now()); + + + ---------------------------------------------------------------------------- + -------------------- inserting securty rules dependent on category table -- + --------------------------------------------------------------------------- + INSERT INTO security_rule (record_effective_date, security_category_id, name, description) + VALUES + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Gyrfalcon', 'Security Concern Related to Gyrfalcon'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Peregrine Falcon', 'Security Concern Related to Peregrine Falcon'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Prairie Falcon', 'Security Concern Related to Prairie Falcon'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Sharp-tailed Grouse', 'Security Concern Related to Sharp-tailed Grouse'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Spotted Owl', 'Security Concern Related to Spotted Owl'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Bull Trout', 'Security Concern Related to Bull Trout'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Big Brown Bat', 'Security Concern Related to Big Brown Bat'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Bighorn Sheep', 'Security Concern Related to Bighorn Sheep'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'California Myotis', 'Security Concern Related to California Myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Dalls Sheep', 'Security Concern Related to Dalls Sheep'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Fringed Myotis', 'Security Concern Related to Fringed Myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Keens Myotis (now Long-eared Myotis)', 'Security Concern Related to Keens Myotis (now Long-eared Myotis)'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Little Brown Myotis', 'Security Concern Related to Little Brown Myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Long-eared Myotis', 'Security Concern Related to Long-eared Myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Long-legged Myotis', 'Security Concern Related to Long-legged Myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Mountain Goat', 'Security Concern Related to Mountain Goat'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Northern Myotis', 'Security Concern Related to Northern Myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Pallid Bat', 'Security Concern Related to Pallid Bat'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Roosevelt Elk', 'Security Concern Related to Roosevelt Elk'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Silver-haired Bat', 'Security Concern Related to Silver-haired Bat'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Stones Sheep', 'Security Concern Related to Stones Sheep'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Townsends Big-eared Bat', 'Security Concern Related to Townsends Big-eared Bat'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Western Small-footed Myotis', 'Security Concern Related to Western Small-footed Myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Yuma Myotis', 'Security Concern Related to Yuma Myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Slender yoke-moss', 'Security Concern Related to Slender yoke-moss'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Gopher Snake', 'Security Concern Related to Gopher Snake'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'North American Racer', 'Security Concern Related to North American Racer'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Western Rattle Snake', 'Security Concern Related to Western Rattle Snake'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Mineral Lick Locations', 'Security Concern Related to Mineral Lick Locations'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Telemetry Hardware', 'Security Concern Related to Telemetry Hardware'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Proprietary'), 'Private Land', 'Proprietary due to Private Land'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Proprietary'), 'Time-Limited Restriction', 'Proprietary due to Time-Limited Restriction'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Proprietary'), 'First Nations Land', 'Proprietary due to First Nations Land'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Statutory Constraints'), 'Provincial Statute', 'Secured due to Provincial Statute'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Statutory Constraints'), 'Federal Statute', 'Secured due to Federal Statute'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Mule Deer Telemetry', 'Secured due to Mule Deer Telemetry'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Mule Deer Survey Data', 'Secured due to Mule Deer Survey Data'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Modeled Freshwater Fish Habitat Capability Mapping', 'Secured due to Experimental Technology'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Predator Reduction', 'Secured due to Predator Reduction Information'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Bighorn or Thinhorn Sheep', 'Secured due to Species of Sheep'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Rocky Mountain Elk Telemetry', 'Secured due to Rocky Mountain Elk Telemetry'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Rocky Mountain Elk Survey Data', 'Secured due to Rocky Mountain Elk Survey Data'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Harvested Species', 'Secured due to Increased Risk of Illegal Harvest'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Secured Caribou Herd', 'Secured due to association with a Secured Caribou Herd'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Secured Caribou Telemetry', 'Secured due to Caribou Telemetry'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Secured Moose Data', 'Secured Moose Data'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Secured Moose Telemetry', 'Secured due to Moose Telemetry'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Moose Stratification', 'Secured due to Moose Stratification'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grizzly Bear DNA', 'Secured due to Grizzly Bear DNA'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grizzly Bear Telemetry', 'Secured due to Grizzly Bear Telemetry'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grizzly Bear Den', 'Secured due to Grizzly Bear Den Location'); + `); +} + +export async function down(knex: Knex): Promise { + await knex.raw(``); +} diff --git a/database/src/seeds/01_db_system_users.ts b/database/src/seeds/01_db_system_users.ts index c8fc2964..8043c3a6 100644 --- a/database/src/seeds/01_db_system_users.ts +++ b/database/src/seeds/01_db_system_users.ts @@ -71,6 +71,12 @@ const systemUsers: SystemUserSeed[] = [ type: SYSTEM_IDENTITY_SOURCE.IDIR, role_name: SYSTEM_USER_ROLE_NAME.SYSTEM_ADMINISTRATOR, user_guid: '62EC624E50844486A046DC9709854F8D' + }, + { + identifier: 'ameijer', + type: SYSTEM_IDENTITY_SOURCE.IDIR, + role_name: SYSTEM_USER_ROLE_NAME.SYSTEM_ADMINISTRATOR, + user_guid: '74231b32026141a7acec6bcc0284f038' } ]; From 5f547cfdefac394eb6d13cd58805b5af3d83cf02 Mon Sep 17 00:00:00 2001 From: Meijer Date: Wed, 28 Aug 2024 14:30:27 -0700 Subject: [PATCH 2/4] updated security rules based on pull request feedback --- .../20240808000000_biohub_security_rules.ts | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/database/src/migrations/20240808000000_biohub_security_rules.ts b/database/src/migrations/20240808000000_biohub_security_rules.ts index 096551df..8f39a2a3 100644 --- a/database/src/migrations/20240808000000_biohub_security_rules.ts +++ b/database/src/migrations/20240808000000_biohub_security_rules.ts @@ -61,22 +61,16 @@ export async function up(knex: Knex): Promise { (now(), (SELECT security_category_id FROM security_category WHERE name = 'Proprietary'), 'First Nations Land', 'Proprietary due to First Nations Land'), (now(), (SELECT security_category_id FROM security_category WHERE name = 'Statutory Constraints'), 'Provincial Statute', 'Secured due to Provincial Statute'), (now(), (SELECT security_category_id FROM security_category WHERE name = 'Statutory Constraints'), 'Federal Statute', 'Secured due to Federal Statute'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Mule Deer Telemetry', 'Secured due to Mule Deer Telemetry'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Mule Deer Survey Data', 'Secured due to Mule Deer Survey Data'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Modeled Freshwater Fish Habitat Capability Mapping', 'Secured due to Experimental Technology'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Mule Deer Data', 'Secured due to Mule Deer Data'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Experimental Technology', 'Secured due to Experimental Technology'), (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Predator Reduction', 'Secured due to Predator Reduction Information'), (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Bighorn or Thinhorn Sheep', 'Secured due to Species of Sheep'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Rocky Mountain Elk Telemetry', 'Secured due to Rocky Mountain Elk Telemetry'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Rocky Mountain Elk Survey Data', 'Secured due to Rocky Mountain Elk Survey Data'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Rocky Mountain Elk Data', 'Secured due to Rocky Mountain Elk Data'), (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Harvested Species', 'Secured due to Increased Risk of Illegal Harvest'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Secured Caribou Herd', 'Secured due to association with a Secured Caribou Herd'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Secured Caribou Telemetry', 'Secured due to Caribou Telemetry'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Secured Moose Data', 'Secured Moose Data'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Secured Moose Telemetry', 'Secured due to Moose Telemetry'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Moose Stratification', 'Secured due to Moose Stratification'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grizzly Bear DNA', 'Secured due to Grizzly Bear DNA'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grizzly Bear Telemetry', 'Secured due to Grizzly Bear Telemetry'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grizzly Bear Den', 'Secured due to Grizzly Bear Den Location'); + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Caribou Data', 'Secured due to association with Secured Caribou Data'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Moose Data', 'Secured Moose Data'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grey Wolf Data', 'Secured Grey Wolf Data'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grizzly Bear Data', 'Secured due to Grizzly Bear Data'); `); } From adf6a607452bf9c191346a715ddf51471ce81a03 Mon Sep 17 00:00:00 2001 From: Meijer Date: Wed, 28 Aug 2024 15:40:45 -0700 Subject: [PATCH 3/4] format fixes --- api/package-lock.json | 121 +++-------- app/package-lock.json | 200 +++++++++--------- .../20240808000000_biohub_security_rules.ts | 4 +- 3 files changed, 127 insertions(+), 198 deletions(-) diff --git a/api/package-lock.json b/api/package-lock.json index c2cff4e2..205530d1 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -583,36 +583,6 @@ "strip-ansi": "^7.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, "strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -621,21 +591,6 @@ "ansi-regex": "^6.0.1" } }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - } - } - }, "wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -645,54 +600,6 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } - }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - } - } } } }, @@ -8983,6 +8890,16 @@ "strip-ansi": "^6.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "string.prototype.padend": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", @@ -9042,6 +8959,14 @@ "ansi-regex": "^5.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, "strip-bom": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", @@ -10094,6 +10019,16 @@ "strip-ansi": "^6.0.0" } }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/app/package-lock.json b/app/package-lock.json index 48915119..a4fa1974 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1838,12 +1838,33 @@ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, "string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -1855,6 +1876,34 @@ "strip-ansi": "^7.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "strip-ansi-cjs": { "version": "npm:strip-ansi@6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -1874,6 +1923,54 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } } } }, @@ -18116,40 +18213,6 @@ } } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, "string.prototype.matchall": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", @@ -19871,75 +19934,6 @@ } } }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/database/src/migrations/20240808000000_biohub_security_rules.ts b/database/src/migrations/20240808000000_biohub_security_rules.ts index 8f39a2a3..38ae9ef8 100644 --- a/database/src/migrations/20240808000000_biohub_security_rules.ts +++ b/database/src/migrations/20240808000000_biohub_security_rules.ts @@ -1,8 +1,8 @@ import { Knex } from 'knex'; /** - * this adds new security rules to biohub - * insert comments here + * this adds new security rules to biohub + * insert comments here * * @export * @param {Knex} knex From c8ea5481abf96c0a0c743a1d698ae4597ce38a7b Mon Sep 17 00:00:00 2001 From: Macgregor Aubertin-Young Date: Wed, 28 Aug 2024 16:19:16 -0700 Subject: [PATCH 4/4] spelling --- .../20240808000000_biohub_security_rules.ts | 118 +++++++++--------- 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/database/src/migrations/20240808000000_biohub_security_rules.ts b/database/src/migrations/20240808000000_biohub_security_rules.ts index 8f39a2a3..3ac0c858 100644 --- a/database/src/migrations/20240808000000_biohub_security_rules.ts +++ b/database/src/migrations/20240808000000_biohub_security_rules.ts @@ -1,8 +1,7 @@ import { Knex } from 'knex'; /** - * this adds new security rules to biohub - * insert comments here + * Inserts new Security Rules, but without associated conditions * * @export * @param {Knex} knex @@ -10,68 +9,71 @@ import { Knex } from 'knex'; */ export async function up(knex: Knex): Promise { await knex.raw(` - --------------------------------------------------- - ----- inserting reasons into category table ------- - --------------------------------------------------- - INSERT INTO security_category(name, description, record_Effective_date) + SET SEARCH_PATH=biohub; + + --------------------------------------------------- + -- Insert security categories + --------------------------------------------------- + INSERT INTO + security_category (name, description, record_effective_date) VALUES - ('Government Interests', 'Government Interests', now()), - ('Species and Ecosystems Susceptible to Persecution or Harm', 'Species and Ecosystems Susceptible to Persecution or Harm', now()), - ('Proprietary', 'Proprietary', now()), - ('Statutory Constraints', 'Statutory Constraints', now()); + ('Government Interests', 'Poses a risk to government programs and activities (e.g., legal investigations, treaty negotiations, government to government agreements).', now()), + ('Species and Ecosystems Susceptible to Persecution or Harm', 'Places populations, residences of species, or occurrences of species or ecosystems at risk of persecution or harm, or intereferes with their conservation or recovery.', now()), + ('Proprietary', 'Data collection required access to private or First Nations lands and the land owners or First Nations have requested the data and information not to be distributed.', now()), + ('Statutory Constraints', 'Violates provincial or federal statutes.', now()); ---------------------------------------------------------------------------- - -------------------- inserting securty rules dependent on category table -- + -- Insert security rules --------------------------------------------------------------------------- - INSERT INTO security_rule (record_effective_date, security_category_id, name, description) + INSERT INTO + security_rule (record_effective_date, security_category_id, name, description) VALUES - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Gyrfalcon', 'Security Concern Related to Gyrfalcon'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Peregrine Falcon', 'Security Concern Related to Peregrine Falcon'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Prairie Falcon', 'Security Concern Related to Prairie Falcon'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Sharp-tailed Grouse', 'Security Concern Related to Sharp-tailed Grouse'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Spotted Owl', 'Security Concern Related to Spotted Owl'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Bull Trout', 'Security Concern Related to Bull Trout'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Big Brown Bat', 'Security Concern Related to Big Brown Bat'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Bighorn Sheep', 'Security Concern Related to Bighorn Sheep'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'California Myotis', 'Security Concern Related to California Myotis'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Dalls Sheep', 'Security Concern Related to Dalls Sheep'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Fringed Myotis', 'Security Concern Related to Fringed Myotis'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Keens Myotis (now Long-eared Myotis)', 'Security Concern Related to Keens Myotis (now Long-eared Myotis)'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Little Brown Myotis', 'Security Concern Related to Little Brown Myotis'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Long-eared Myotis', 'Security Concern Related to Long-eared Myotis'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Long-legged Myotis', 'Security Concern Related to Long-legged Myotis'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Mountain Goat', 'Security Concern Related to Mountain Goat'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Northern Myotis', 'Security Concern Related to Northern Myotis'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Pallid Bat', 'Security Concern Related to Pallid Bat'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Roosevelt Elk', 'Security Concern Related to Roosevelt Elk'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Silver-haired Bat', 'Security Concern Related to Silver-haired Bat'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Stones Sheep', 'Security Concern Related to Stones Sheep'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Townsends Big-eared Bat', 'Security Concern Related to Townsends Big-eared Bat'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Western Small-footed Myotis', 'Security Concern Related to Western Small-footed Myotis'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Yuma Myotis', 'Security Concern Related to Yuma Myotis'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Slender yoke-moss', 'Security Concern Related to Slender yoke-moss'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Gopher Snake', 'Security Concern Related to Gopher Snake'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'North American Racer', 'Security Concern Related to North American Racer'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Western Rattle Snake', 'Security Concern Related to Western Rattle Snake'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Mineral Lick Locations', 'Security Concern Related to Mineral Lick Locations'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Telemetry Hardware', 'Security Concern Related to Telemetry Hardware'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Proprietary'), 'Private Land', 'Proprietary due to Private Land'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Proprietary'), 'Time-Limited Restriction', 'Proprietary due to Time-Limited Restriction'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Proprietary'), 'First Nations Land', 'Proprietary due to First Nations Land'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Statutory Constraints'), 'Provincial Statute', 'Secured due to Provincial Statute'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Statutory Constraints'), 'Federal Statute', 'Secured due to Federal Statute'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Mule Deer Data', 'Secured due to Mule Deer Data'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Experimental Technology', 'Secured due to Experimental Technology'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Predator Reduction', 'Secured due to Predator Reduction Information'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Bighorn or Thinhorn Sheep', 'Secured due to Species of Sheep'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Rocky Mountain Elk Data', 'Secured due to Rocky Mountain Elk Data'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Harvested Species', 'Secured due to Increased Risk of Illegal Harvest'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Caribou Data', 'Secured due to association with Secured Caribou Data'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Moose Data', 'Secured Moose Data'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grey Wolf Data', 'Secured Grey Wolf Data'), - (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grizzly Bear Data', 'Secured due to Grizzly Bear Data'); - `); + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Gyrfalcon', 'Security concern related to gyrfalcon'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Peregrine Falcon', 'Security concern related to peregrine falcon'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Prairie Falcon', 'Security concern related to prairie falcon'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Sharp-tailed Grouse', 'Security concern related to sharp-tailed grouse'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Spotted Owl', 'Security concern related to spotted owl'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Bull Trout', 'Security concern related to bull trout'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Big Brown Bat', 'Security concern related to big brown bat'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Bighorn Sheep', 'Security concern related to bighorn sheep'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'California Myotis', 'Security concern related to california myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Dalls Sheep', 'Security concern related to dalls sheep'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Fringed Myotis', 'Security concern related to fringed myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Little Brown Myotis', 'Security concern related to little brown myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Long-eared Myotis', 'Security concern related to long-eared myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Long-legged Myotis', 'Security concern related to long-legged myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Mountain Goat', 'Security concern related to mountain goat'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Northern Myotis', 'Security concern related to northern myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Pallid Bat', 'Security concern related to pallid bat'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Roosevelt Elk', 'Security concern related to roosevelt elk'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Silver-haired Bat', 'Security concern related to silver-haired bat'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Stones Sheep', 'Security concern related to stones sheep'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Townsends Big-eared Bat', 'Security concern related to townsend''s big-eared bat'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Western Small-footed Myotis', 'Security concern related to western small-footed myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Yuma Myotis', 'Security concern related to yuma myotis'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Slender yoke-moss', 'Security concern related to slender yoke-moss'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Gopher Snake', 'Security concern related to gopher snake'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'North American Racer', 'Security concern related to north american racer'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Western Rattle Snake', 'Security concern related to western rattle snake'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Mineral Lick Locations', 'Security concern related to mineral lick locations'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Species and Ecosystems Susceptible to Persecution or Harm'), 'Telemetry Hardware', 'Security concern related to telemetry hardware'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Proprietary'), 'Private Land', 'Proprietary due to private land'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Proprietary'), 'Time-Limited Restriction', 'Proprietary due to time-limited restriction'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Proprietary'), 'First Nations Land', 'Proprietary due to first nations land'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Statutory Constraints'), 'Provincial Statute', 'Secured due to provincial statutes'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Statutory Constraints'), 'Federal Statute', 'Secured due to federal statutes'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Mule Deer', 'Secured due to revealing sensitive information about mule deer'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Experimental Technology', 'Secured due to experimental technology potentially revealing sensitive information'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Predator Reduction', 'Secured due to potentially revealing sensitive information about predator reduction'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Bighorn or Thinhorn Sheep', 'Secured due to revealing sensitive information about bighorn or thinhorn sheep'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Rocky Mountain Elk', 'Secured due to revealing sensitive information about rocky mountain elk'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Harvested Species', 'Secured due to revealing sensitive information about harvested species'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Caribou', 'Secured due to revealing sensitive information about caribou'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Moose', 'Secured due to revealing sensitive information about moose'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grey Wolf', 'Secured due to revealing sensitive information about grey wolf'), + (now(), (SELECT security_category_id FROM security_category WHERE name = 'Government Interests'), 'Grizzly Bear', 'Secured due to revealing sensitive information about grizzly bear'); + `); } export async function down(knex: Knex): Promise {