pg_tde icon indicating copy to clipboard operation
pg_tde copied to clipboard

Implement event triggers to identify index creation on encrypted tables.

Open codeforall opened this issue 1 year ago • 0 comments

This commit implements ddl-start and ddl-end event triggers to identify index creation operations on encrypted tables. Upon creating an index on an encrypted table, the trigger function updates the global state, which can be accessed by the storage manager (mgr) to decide if smgr_create needs to do encryption or not.

The start-ddl function analyzes the CREATE TABLE and CREATE INDEX statements and identifies if the table uses the pg_tde access method. When the table is created or the one on which the index is being created utilizes the pg_tde access method, the start-ddl trigger function populates relevant information about the encrypted table into a global structure. This structure can be accessed using the GetCurrentTdeCreateEvent() function. After the execution of the current DDL command finishes, the end-ddl function clears out this structure.

codeforall avatar May 13 '24 09:05 codeforall

CI fails

Christewart avatar Oct 04 '22 23:10 Christewart

This may not work with Node 15.x

user411 avatar Oct 04 '22 23:10 user411

When running npm run build inside of oracle-electron-ts on c18e60fcc891fa670ebe40c610e0b1fb17fff37c with node v16.14.0

ERROR in ../oracle-server-ts/dist/mjs/index.js 8:0-32
Module not found: Error: Can't resolve 'common-ts/index' in '/home/chris/dev/bitcoin-s-ts/oracle-server-ts/dist/mjs'
Did you mean 'index.js'?
BREAKING CHANGE: The request 'common-ts/index' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
resolve 'common-ts/index' in '/home/chris/dev/bitcoin-s-ts/oracle-server-ts/dist/mjs'
  Parsed request is a module
  using description file: /home/chris/dev/bitcoin-s-ts/oracle-server-ts/package.json (relative path: ./dist/mjs)
    resolve as module
      /home/chris/dev/bitcoin-s-ts/oracle-server-ts/dist/mjs/node_modules doesn't exist or is not a directory
      /home/chris/dev/bitcoin-s-ts/oracle-server-ts/dist/node_modules doesn't exist or is not a directory
      /home/chris/dev/bitcoin-s-ts/oracle-server-ts/node_modules doesn't exist or is not a directory
      looking for modules in /home/chris/dev/bitcoin-s-ts/node_modules
        existing directory /home/chris/dev/bitcoin-s-ts/node_modules/common-ts
          using description file: /home/chris/dev/bitcoin-s-ts/node_modules/common-ts/package.json (relative path: .)
            using exports field: ./dist/mjs/index
              using description file: /home/chris/dev/bitcoin-s-ts/node_modules/common-ts/package.json (relative path: ./dist/mjs/index)
                /home/chris/dev/bitcoin-s-ts/node_modules/common-ts/dist/mjs/index doesn't exist
      /home/chris/dev/node_modules doesn't exist or is not a directory
      /home/chris/node_modules doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
 @ ./middleware/download.ts 3:0-69 21:4-27
 @ ./routes/proxy.ts 4:0-99 15:59-73 16:68-91 17:61-77
 @ ./routes/index.ts 3:0-48 6:16-27
 @ ./server.ts 33:0-40 34:26-32

webpack 5.74.0 compiled with 1 error and 2 warnings in 5022 ms

Christewart avatar Oct 04 '22 23:10 Christewart

Minimum Node version is 16.15 to use fetch, which we need.

user411 avatar Oct 04 '22 23:10 user411

What i see when using node v16.15.1

ERROR in ../oracle-server-ts/dist/mjs/index.js 8:0-32
Module not found: Error: Can't resolve 'common-ts/index' in '/home/chris/dev/bitcoin-s-ts/oracle-server-ts/dist/mjs'
Did you mean 'index.js'?
BREAKING CHANGE: The request 'common-ts/index' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
resolve 'common-ts/index' in '/home/chris/dev/bitcoin-s-ts/oracle-server-ts/dist/mjs'
  Parsed request is a module
  using description file: /home/chris/dev/bitcoin-s-ts/oracle-server-ts/package.json (relative path: ./dist/mjs)
    resolve as module
      /home/chris/dev/bitcoin-s-ts/oracle-server-ts/dist/mjs/node_modules doesn't exist or is not a directory
      /home/chris/dev/bitcoin-s-ts/oracle-server-ts/dist/node_modules doesn't exist or is not a directory
      /home/chris/dev/bitcoin-s-ts/oracle-server-ts/node_modules doesn't exist or is not a directory
      looking for modules in /home/chris/dev/bitcoin-s-ts/node_modules
        existing directory /home/chris/dev/bitcoin-s-ts/node_modules/common-ts
          using description file: /home/chris/dev/bitcoin-s-ts/node_modules/common-ts/package.json (relative path: .)
            using exports field: ./dist/mjs/index
              using description file: /home/chris/dev/bitcoin-s-ts/node_modules/common-ts/package.json (relative path: ./dist/mjs/index)
                /home/chris/dev/bitcoin-s-ts/node_modules/common-ts/dist/mjs/index doesn't exist
      /home/chris/dev/node_modules doesn't exist or is not a directory
      /home/chris/node_modules doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
 @ ./middleware/download.ts 3:0-69 21:4-27
 @ ./routes/proxy.ts 4:0-99 15:59-73 16:68-91 17:61-77
 @ ./routes/index.ts 3:0-48 6:16-27
 @ ./server.ts 33:0-40 34:26-32

webpack 5.74.0 compiled with 1 error and 2 warnings in 5179 ms
npm ERR! Lifecycle script `webpack` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: [email protected]
npm ERR!   at location: /home/chris/dev/bitcoin-s-ts/oracle-server-ui-proxy

Christewart avatar Oct 04 '22 23:10 Christewart

683a64b fixes the build for me.

Now when i start the electron app with npm run start, logging in seems to never occur automatically. It sits at the login screen spinning forever.

Screenshot from 2022-10-04 18-57-38

Christewart avatar Oct 04 '22 23:10 Christewart

I think there probably need to be different config values to run through electron vs how I’m testing in dev. I will debug through and report back.

user411 avatar Oct 05 '22 00:10 user411

It seems pretty consistently I get this error in the console

Screenshot from 2022-10-04 19-09-40

Christewart avatar Oct 05 '22 00:10 Christewart

This should withstand startup in Electron now. Screen Shot 2022-10-06 at 11 08 29 AM

user411 avatar Oct 06 '22 17:10 user411