{"id":19623624,"url":"https://github.com/flowcore-io/library-testing-nestjs-oidc-protect-ts","last_synced_at":"2026-06-10T04:31:35.357Z","repository":{"id":65170183,"uuid":"584555644","full_name":"flowcore-io/library-testing-nestjs-oidc-protect-ts","owner":"flowcore-io","description":"A NestJS OidcProtect plugin for the @jbiskur/nestjs-test-utilities testing library. To facilitate mocking successfull calls to protected routes during testing.","archived":false,"fork":false,"pushed_at":"2023-05-26T13:36:26.000Z","size":193,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T05:25:51.310Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flowcore-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-02T22:49:27.000Z","updated_at":"2023-01-31T23:00:47.000Z","dependencies_parsed_at":"2024-11-11T11:37:25.686Z","dependency_job_id":"86fc9fda-4870-4c4e-a84a-16a4248290e0","html_url":"https://github.com/flowcore-io/library-testing-nestjs-oidc-protect-ts","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/flowcore-io/library-testing-nestjs-oidc-protect-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowcore-io%2Flibrary-testing-nestjs-oidc-protect-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowcore-io%2Flibrary-testing-nestjs-oidc-protect-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowcore-io%2Flibrary-testing-nestjs-oidc-protect-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowcore-io%2Flibrary-testing-nestjs-oidc-protect-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flowcore-io","download_url":"https://codeload.github.com/flowcore-io/library-testing-nestjs-oidc-protect-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowcore-io%2Flibrary-testing-nestjs-oidc-protect-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34137570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T11:34:57.044Z","updated_at":"2026-06-10T04:31:35.326Z","avatar_url":"https://github.com/flowcore-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build](https://github.com/flowcore-io/library-testing-nestjs-oidc-protect-ts/actions/workflows/publish.yml/badge.svg)\n\n# Testing Nestjs-oidc-protect\n\nA NestJS OidcProtect plugin for\nthe [@jbiskur/nestjs-test-utilities](https://www.npmjs.com/package/@jbiskur/nestjs-test-utilities) testing library. To\nfacilitate mocking\nsuccessfull\ncalls to protected routes during testing.\n\n## Installation\n\ninstall with npm:\n\n```bash\nnpm install @flowcore/testing-nestjs-oidc-protect @flowcore/nestjs-oidc-protect\n```\n\nor yarn:\n\n```bash\nyarn add @flowcore/testing-nestjs-oidc-protect @flowcore/nestjs-oidc-protect\n```\n\n## Usage\n\nTo use the library with the `@jbiskur/nestjs-test-utilities` testing library, you need to invoke it using `with`:\n\n```typescript\nimport {OidcProtectModulePlugin} from '@flowcore/testing-nestjs-oidc-protect';\n\napp = await new NestApplicationBuilder()\n  .withTestModule((testModule) =\u003e testModule.withModule(TestModule))\n  // ... other plugins\n  .with(OidcProtectModulePlugin)\n  // ... other plugins\n  .build();\n```\n\nIt is possible to set the authenticated payload that will be returned by the `AuthGuard`:\n\n```typescript\nimport {OidcProtectModulePlugin} from '@flowcore/testing-nestjs-oidc-protect';\n\napp = await new NestApplicationBuilder()\n  .withTestModule((testModule) =\u003e testModule.withModule(TestModule))\n  // ... other plugins\n  .with(OidcProtectModulePlugin, pluginBuilder =\u003e pluginBuilder.usingAuthenticatedPayload(validTokenPayload))\n  .build();\n\n```\n\nIt is also possible to set the module to always act as if the user is unauthenticated:\n\n```typescript\nimport {OidcProtectModulePlugin} from '@flowcore/testing-nestjs-oidc-protect';\n\napp = await new NestApplicationBuilder()\n  .withTestModule((testModule) =\u003e testModule.withModule(TestModule))\n  // ... other plugins\n  .with(OidcProtectModulePlugin, pluginBuilder =\u003e pluginBuilder.forceUnauthenticatedUser())\n  .build();\n\n```\n\n## Development\n\n  ```bash\nyarn install\n```\n\nor with npm:\n\n```bash\nnpm install\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowcore-io%2Flibrary-testing-nestjs-oidc-protect-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflowcore-io%2Flibrary-testing-nestjs-oidc-protect-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowcore-io%2Flibrary-testing-nestjs-oidc-protect-ts/lists"}