@pgpm/totp 0.5.0 → 0.7.0

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.
package/Makefile CHANGED
@@ -1,5 +1,5 @@
1
1
  EXTENSION = launchql-totp
2
- DATA = sql/launchql-totp--0.4.0.sql
2
+ DATA = sql/launchql-totp--0.6.0.sql
3
3
 
4
4
  PG_CONFIG = pg_config
5
5
  PGXS := $(shell $(PG_CONFIG) --pgxs)
package/README.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @pgpm/totp
2
2
 
3
+ <p align="center" width="100%">
4
+ <img height="250" src="https://raw.githubusercontent.com/launchql/launchql/refs/heads/main/assets/outline-logo.svg" />
5
+ </p>
6
+
7
+ <p align="center" width="100%">
8
+ <a href="https://github.com/launchql/pgpm-modules/actions/workflows/ci.yml">
9
+ <img height="20" src="https://github.com/launchql/pgpm-modules/actions/workflows/ci.yml/badge.svg" />
10
+ </a>
11
+ <a href="https://github.com/launchql/pgpm-modules/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
12
+ <a href="https://www.npmjs.com/package/@pgpm/totp"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/pgpm-modules?filename=packages%2Fsecurity%2Ftotp%2Fpackage.json"/></a>
13
+ </p>
14
+
3
15
  TOTP implementation in pure PostgreSQL plpgsql
4
16
 
5
17
  This extension provides the HMAC Time-Based One-Time Password Algorithm (TOTP) as specified in RFC 4226 as pure plpgsql functions.
@@ -32,40 +44,42 @@ This is a quick way to get started. The sections below provide more detailed ins
32
44
  ### Prerequisites
33
45
 
34
46
  ```bash
35
- # Install pgpm globally
47
+ # Install pgpm CLI
36
48
  npm install -g pgpm
37
49
 
38
- # Start PostgreSQL
50
+ # Start local Postgres (via Docker) and export env vars
39
51
  pgpm docker start
40
-
41
- # Set environment variables
42
52
  eval "$(pgpm env)"
43
53
  ```
44
54
 
45
- ### Deploy
55
+ > **Tip:** Already running Postgres? Skip the Docker step and just export your `PG*` environment variables.
46
56
 
47
- #### Option 1: Deploy by installing with pgpm
57
+ ### **Add to an Existing Package**
48
58
 
49
59
  ```bash
60
+ # 1. Install the package
50
61
  pgpm install @pgpm/totp
51
- pgpm deploy
62
+
63
+ # 2. Deploy locally
64
+ pgpm deploy
52
65
  ```
53
66
 
54
- #### Option 2: Deploy from Package Directory
67
+ ### **Add to a New Project**
55
68
 
56
69
  ```bash
57
- cd packages/security/totp
58
- pgpm deploy --createdb
59
- ```
70
+ # 1. Create a workspace
71
+ pgpm init --workspace
72
+ cd my-app
60
73
 
61
- #### Option 3: Deploy from Workspace Root
74
+ # 2. Create your first module
75
+ pgpm init
76
+ cd packages/your-module
62
77
 
63
- ```bash
64
- # Install workspace dependencies
65
- pgpm install
78
+ # 3. Install a package
79
+ pgpm install @pgpm/totp
66
80
 
67
- # Deploy with dependencies
68
- pgpm deploy mydb1 --yes --createdb
81
+ # 4. Deploy everything
82
+ pgpm deploy --createdb --database mydb1
69
83
  ```
70
84
 
71
85
  ## Usage
@@ -241,139 +255,6 @@ https://gist.github.com/bwbroersma/676d0de32263ed554584ab132434ebd9
241
255
 
242
256
  ---
243
257
 
244
- ## Development
245
-
246
- ## start the postgres db process
247
-
248
- First you'll want to start the postgres docker (you can also just use `docker-compose up -d`):
249
-
250
- ```sh
251
- make up
252
- ```
253
-
254
- ## install modules
255
-
256
- Install modules
257
-
258
- ```sh
259
- yarn install
260
- ```
261
-
262
- ## install the Postgres extensions
263
-
264
- Now that the postgres process is running, install the extensions:
265
-
266
- ```sh
267
- make install
268
- ```
269
-
270
- This basically `ssh`s into the postgres instance with the `packages/` folder mounted as a volume, and installs the bundled sql code as pgxn extensions.
271
-
272
- ## testing
273
-
274
- Testing will load all your latest sql changes and create fresh, populated databases for each sqitch module in `packages/`.
275
-
276
- ```sh
277
- yarn test:watch
278
- ```
279
-
280
- ## building new modules
281
-
282
- Create a new folder in `packages/`
283
-
284
- ```sh
285
- pgpm init
286
- ```
287
-
288
- Then, run a generator:
289
-
290
- ```sh
291
- pgpm generate
292
- ```
293
-
294
- You can also add arguments if you already know what you want to do:
295
-
296
- ```sh
297
- pgpm generate schema --schema myschema
298
- pgpm generate table --schema myschema --table mytable
299
- ```
300
-
301
- ## deploy code as extensions
302
-
303
- `cd` into `packages/<module>`, and run `pgpm package`. This will make an sql file in `packages/<module>/sql/` used for `CREATE EXTENSION` calls to install your sqitch module as an extension.
304
-
305
- ## recursive deploy
306
-
307
- You can also deploy all modules utilizing versioning as sqtich modules. Remove `--createdb` if you already created your db:
308
-
309
- ```sh
310
- pgpm deploy mydb1 --yes --createdb
311
- ```
312
-
313
- ---
314
-
315
- ### **Before You Begin**
316
-
317
- ```bash
318
- # 1. Install pgpm
319
- npm install -g pgpm
320
-
321
- # 2. Start Postgres (Docker or local)
322
- pgpm docker start
323
-
324
- # 3. Load PG* environment variables (PGHOST, PGUSER, ...)
325
- eval "$(pgpm env)"
326
- ```
327
-
328
- ---
329
-
330
- ### **Starting a New Project**
331
-
332
- ```bash
333
- # 1. Create a workspace
334
- pgpm init --workspace
335
- cd my-app
336
-
337
- # 2. Create your first module
338
- pgpm init
339
-
340
- # 3. Add a migration
341
- pgpm add some_change
342
-
343
- # 4. Deploy (auto-creates database)
344
- pgpm deploy --createdb
345
- ```
346
-
347
- ---
348
-
349
- ### **Working With an Existing Project**
350
-
351
- ```bash
352
- # 1. Clone and enter the project
353
- git clone <repo> && cd <project>
354
-
355
- # 2. Install dependencies
356
- pnpm install
357
-
358
- # 3. Deploy locally
359
- pgpm deploy --createdb
360
- ```
361
-
362
- ---
363
-
364
- ### **Testing a Module Inside a Workspace**
365
-
366
- ```bash
367
- # 1. Install workspace deps
368
- pnpm install
369
-
370
- # 2. Enter the module directory
371
- cd packages/<some-module>
372
-
373
- # 3. Run tests in watch mode
374
- pnpm test:watch
375
- ```
376
-
377
258
  ## Related Tooling
378
259
 
379
260
  * [pgpm](https://github.com/launchql/launchql/tree/main/packages/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
@@ -1,6 +1,6 @@
1
1
  # launchql-totp extension
2
2
  comment = 'launchql-totp extension'
3
- default_version = '0.4.0'
3
+ default_version = '0.6.0'
4
4
  module_pathname = '$libdir/launchql-totp'
5
5
  requires = 'pgcrypto,plpgsql,launchql-base32,launchql-verify'
6
6
  relocatable = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpm/totp",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Time-based One-Time Password (TOTP) authentication",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -11,19 +11,19 @@
11
11
  "test:watch": "jest --watch"
12
12
  },
13
13
  "dependencies": {
14
- "@pgpm/base32": "0.5.0",
15
- "@pgpm/verify": "0.5.0"
14
+ "@pgpm/base32": "0.7.0",
15
+ "@pgpm/verify": "0.7.0"
16
16
  },
17
17
  "devDependencies": {
18
18
  "pgpm": "^0.2.0"
19
19
  },
20
20
  "repository": {
21
21
  "type": "git",
22
- "url": "https://github.com/launchql/extensions"
22
+ "url": "https://github.com/launchql/pgpm-modules"
23
23
  },
24
- "homepage": "https://github.com/launchql/extensions",
24
+ "homepage": "https://github.com/launchql/pgpm-modules",
25
25
  "bugs": {
26
- "url": "https://github.com/launchql/extensions/issues"
26
+ "url": "https://github.com/launchql/pgpm-modules/issues"
27
27
  },
28
- "gitHead": "d8eedbb24ad22a106634bc3b919bfb8d41976c16"
28
+ "gitHead": "1f24d8fa95fb141f16e5b8345458c3b687d80908"
29
29
  }