[
  {
    "path": ".commitlintrc.yml",
    "content": "extends:\n  - '@commitlint/config-conventional'\n"
  },
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\nindent_style = space\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.{ts,js,json,yaml,yml}]\nindent_size = 2\n\n[*.cs]\nindent_size = 4\n"
  },
  {
    "path": ".gitattributes",
    "content": "*.sh text eol=lf\n"
  },
  {
    "path": ".github/workflows/pr.yaml",
    "content": "name: PR\n\non:\n  pull_request:\n    paths-ignore:\n      - README.md\n\n  workflow_dispatch:\n\nconcurrency:\n  group: pr-${{ github.head_ref || github.run_id }}\n  cancel-in-progress: true\n\nenv:\n  TILT_VERSION: 'v0.34.2'\n\njobs:\n  tests:\n    name: Tests\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Setup Tilt\n        run: curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/${TILT_VERSION}/scripts/install.sh | bash\n\n      - name: Setup pnpm\n        uses: pnpm/action-setup@v4\n\n      - uses: actions/setup-node@v4\n        with:\n          node-version-file: .nvmrc\n          cache: pnpm\n\n      - name: Run npm install\n        run: pnpm install --frozen-lockfile\n\n      - name: Install playwright dependencies\n        run: pnpm --filter e2e exec playwright install --with-deps chromium\n\n      - name: Eslint\n        run: pnpm run lint\n\n      - name: Run Tests\n        run: pnpm run tilt:ci\n"
  },
  {
    "path": ".github/workflows/tag.yaml",
    "content": "name: Build and push new version\n\non:\n  create:\n\nenv:\n  TILT_VERSION: 'v0.34.2'\n\njobs:\n  build_push_docker:\n    name: Build and Push Docker image\n    if: ${{ startsWith(github.ref, 'refs/tags/v') }}\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Login to GHCR\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n\n      - id: get_version\n        name: Format docker image tag\n        uses: battila7/get-version-action@v2\n\n      - id: repository_owner\n        name: Format repository owner\n        uses: ASzc/change-string-case-action@v6\n        with:\n          string: ${{ github.repository_owner }}\n\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n\n      - name: Build and export to Docker\n        uses: docker/build-push-action@v6\n        with:\n          load: true\n          context: ./src\n          file: ./src/Dockerfile\n          tags: ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/oidc-server-mock:${{ steps.get_version.outputs.version-without-v }}-test\n\n      - name: Setup Tilt\n        run: curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/${TILT_VERSION}/scripts/install.sh | bash\n\n      - name: Setup pnpm\n        uses: pnpm/action-setup@v4\n\n      - uses: actions/setup-node@v4\n        with:\n          node-version-file: .nvmrc\n          cache: pnpm\n\n      - name: Run npm install\n        run: pnpm install --frozen-lockfile\n\n      - name: Install playwright dependencies\n        run: pnpm --filter e2e exec playwright install --with-deps chromium\n\n      - name: Run Tests\n        run: pnpm run tilt:ci\n        env:\n          IMAGE_TAG: ${{ steps.get_version.outputs.version-without-v }}-test\n\n      - name: Build and push new docker image\n        uses: docker/build-push-action@v6\n        with:\n          push: true\n          context: ./src\n          file: ./src/Dockerfile\n          platforms: linux/amd64,linux/arm64\n          tags: |\n            ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/oidc-server-mock:latest\n            ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/oidc-server-mock:${{ steps.get_version.outputs.version-without-v }}\n          labels: |\n            org.opencontainers.image.source=${{ github.event.repository.html_url }}\n\n  build_push_nuget:\n    name: Build and Push Nuget package\n    if: ${{ startsWith(github.ref, 'refs/tags/v') }}\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    defaults:\n      run:\n        working-directory: src\n    env:\n      NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      dotnet-version: '8.0'\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Download UI\n        run: ./getui.sh\n\n      - name: Setup .NET Core SDK ${{ env.dotnet-version }}\n        uses: actions/setup-dotnet@v4\n        with:\n          dotnet-version: ${{ env.dotnet-version }}\n          source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json\n\n      - name: Install dependencies\n        run: dotnet restore\n\n      - id: get_version\n        name: Format nuget package version\n        uses: battila7/get-version-action@v2\n\n      - name: Build Nuget package\n        run: |\n          dotnet pack --no-restore --configuration Release \\\n            /p:VersionPrefix=${{ steps.get_version.outputs.version-without-v }} \\\n            /p:RepositoryCommit=${{ github.sha }}\n\n      - name: Push Nuget package\n        run: dotnet nuget push bin/Release/*.nupkg -k ${{ env.NUGET_AUTH_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": "# TypeScript project\nnode_modules\ndist\n\n# .Net project\nbin\nobj\n\n# Docker\n.docker\n\n# UI\nsrc/Pages\nsrc/wwwroot\n\n# Runtime data\nkeys\ntempkey.jwk\n"
  },
  {
    "path": ".husky/commit-msg",
    "content": "#!/usr/bin/env sh\n. \"$(dirname -- \"$0\")/_/husky.sh\"\n\nnpx --no-install commitlint --edit \"$1\"\n"
  },
  {
    "path": ".husky/pre-commit",
    "content": "#!/usr/bin/env sh\n. \"$(dirname -- \"$0\")/_/husky.sh\"\n\nnpx lint-staged\nnpx pretty-quick --staged\n"
  },
  {
    "path": ".lintstagedrc",
    "content": "\"**/*.js\":\n  - prettier --write\n\"**/*.ts\":\n  - bash -c \"tsc --noEmit\"\n  - eslint --fix\n  - prettier --write\n\"**/*.{json,yaml,yml,md}\":\n  - prettier --write\n\n"
  },
  {
    "path": ".nvmrc",
    "content": "v22\n"
  },
  {
    "path": ".prettierignore",
    "content": "**/node_modules\n**/dist\ncoverage\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"printWidth\": 120,\n  \"singleQuote\": true,\n  \"arrowParens\": \"avoid\"\n}\n"
  },
  {
    "path": ".vscode/launch.json",
    "content": "{\n   // Use IntelliSense to find out which attributes exist for C# debugging\n   // Use hover for the description of the existing attributes\n   // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md\n   \"version\": \"0.2.0\",\n   \"configurations\": [\n        {\n            \"name\": \".NET Core Launch (web)\",\n            \"type\": \"coreclr\",\n            \"request\": \"launch\",\n            \"preLaunchTask\": \"build\",\n            // If you have changed target frameworks, make sure to update the program path.\n            \"program\": \"${workspaceFolder}/src/bin/Debug/netcoreapp3.1/OpenIdConnectServerMock.dll\",\n            \"args\": [],\n            \"cwd\": \"${workspaceFolder}/src\",\n            \"stopAtEntry\": false,\n            // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser\n            \"serverReadyAction\": {\n                \"action\": \"openExternally\",\n                \"pattern\": \"^\\\\s*Now listening on:\\\\s+(https?://\\\\S+)\"\n            },\n            \"env\": {\n                \"ASPNETCORE_ENVIRONMENT\": \"Development\"\n            },\n            \"sourceFileMap\": {\n                \"/Views\": \"${workspaceFolder}/Views\"\n            }\n        },\n        {\n            \"name\": \".NET Core Attach\",\n            \"type\": \"coreclr\",\n            \"request\": \"attach\",\n            \"processId\": \"${command:pickProcess}\"\n        }\n    ]\n}"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n  \"editor.formatOnPaste\": false,\n  \"editor.formatOnSave\": true,\n  \"editor.detectIndentation\": false,\n  \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n  \"[json]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[properties]\": {\n    \"editor.defaultFormatter\": \"foxundermoon.shell-format\"\n  },\n  \"[dotenv]\": {\n    \"editor.defaultFormatter\": \"foxundermoon.shell-format\"\n  },\n  \"files.eol\": \"\\n\",\n  \"eslint.workingDirectories\": [\n    {\n      \"mode\": \"auto\"\n    }\n  ],\n  \"[typescript]\": {\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"typescript.tsdk\": \"node_modules/typescript/lib\",\n  \"typescript.enablePromptUseWorkspaceTsdk\": true,\n  \"[dockerfile]\": {\n    \"editor.defaultFormatter\": \"ms-azuretools.vscode-docker\"\n  }\n}\n"
  },
  {
    "path": ".vscode/tasks.json",
    "content": "{\n    \"version\": \"2.0.0\",\n    \"tasks\": [\n        {\n            \"label\": \"build\",\n            \"command\": \"dotnet\",\n            \"type\": \"process\",\n            \"args\": [\n                \"build\",\n                \"${workspaceFolder}/src/OpenIdConnectServerMock.csproj\",\n                \"/property:GenerateFullPaths=true\",\n                \"/consoleloggerparameters:NoSummary\"\n            ],\n            \"problemMatcher\": \"$msCompile\"\n        },\n        {\n            \"label\": \"publish\",\n            \"command\": \"dotnet\",\n            \"type\": \"process\",\n            \"args\": [\n                \"publish\",\n                \"${workspaceFolder}/src/OpenIdConnectServerMock.csproj\",\n                \"/property:GenerateFullPaths=true\",\n                \"/consoleloggerparameters:NoSummary\"\n            ],\n            \"problemMatcher\": \"$msCompile\"\n        },\n        {\n            \"label\": \"watch\",\n            \"command\": \"dotnet\",\n            \"type\": \"process\",\n            \"args\": [\n                \"watch\",\n                \"run\",\n                \"${workspaceFolder}/src/OpenIdConnectServerMock.csproj\",\n                \"/property:GenerateFullPaths=true\",\n                \"/consoleloggerparameters:NoSummary\"\n            ],\n            \"problemMatcher\": \"$msCompile\"\n        }\n    ]\n}"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# OpenId Connect Server Mock\n\n![Run Tests badge](https://github.com/Soluto/oidc-server-mock/workflows/Run%20Tests/badge.svg)\n\nThis project allows you to run configurable mock server with OpenId Connect functionality.\n\n## Important\n\n> Free for development, testing and personal projects. For production you need to purchase [Duende IdentityServer license](https://duendesoftware.com/products/identityserver).\n\n## Simple Configuration\n\nThe image is stored in `github` registry. Use the following to pull the image:\n\n```bash\ndocker pull ghcr.io/soluto/oidc-server-mock:latest\n```\n\nThis is the sample of using the server in `docker-compose` configuration:\n\n```yaml\nservices:\n  oidc-server-mock:\n    container_name: oidc-server-mock\n    image: ghcr.io/soluto/oidc-server-mock:latest\n    ports:\n      - '4011:80'\n    environment:\n      ASPNETCORE_ENVIRONMENT: Development\n      SERVER_OPTIONS_INLINE: |\n        {\n          \"AccessTokenJwtType\": \"JWT\",\n          \"Discovery\": {\n            \"ShowKeySet\": true\n          },\n          \"Authentication\": {\n            \"CookieSameSiteMode\": \"Lax\",\n            \"CheckSessionCookieSameSiteMode\": \"Lax\"\n          }\n        }\n      LOGIN_OPTIONS_INLINE: |\n        {\n          \"AllowRememberLogin\": false\n        }\n      LOGOUT_OPTIONS_INLINE: |\n        {\n          \"AutomaticRedirectAfterSignOut\": true\n        }\n      API_SCOPES_INLINE: |\n        - Name: some-app-scope-1\n        - Name: some-app-scope-2\n      API_RESOURCES_INLINE: |\n        - Name: some-app\n          Scopes:\n            - some-app-scope-1\n            - some-app-scope-2\n      USERS_CONFIGURATION_INLINE: |\n        [\n          {\n            \"SubjectId\":\"1\",\n            \"Username\":\"User1\",\n            \"Password\":\"pwd\",\n            \"Claims\": [\n              {\n                \"Type\": \"name\",\n                \"Value\": \"Sam Tailor\",\n                \"ValueType\": \"string\"\n              },\n              {\n                \"Type\": \"email\",\n                \"Value\": \"sam.tailor@gmail.com\",\n                \"ValueType\": \"string\"\n              },\n              {\n                \"Type\": \"some-api-resource-claim\",\n                \"Value\": \"Sam's Api Resource Custom Claim\",\n                \"ValueType\": \"string\"\n              },\n              {\n                \"Type\": \"some-api-scope-claim\",\n                \"Value\": \"Sam's Api Scope Custom Claim\",\n                \"ValueType\": \"string\"\n              },\n              {\n                \"Type\": \"some-identity-resource-claim\",\n                \"Value\": \"Sam's Identity Resource Custom Claim\",\n                \"ValueType\": \"string\"\n              }\n            ]\n          }\n        ]\n      CLIENTS_CONFIGURATION_PATH: /tmp/config/clients-config.json\n      ASPNET_SERVICES_OPTIONS_INLINE: |\n        {\n          \"ForwardedHeadersOptions\": {\n            \"ForwardedHeaders\" : \"All\"\n          }\n        }\n    volumes:\n      - .:/tmp/config:ro\n```\n\nWhen `clients-config.json` is as following:\n\n```json\n[\n  {\n    \"ClientId\": \"implicit-mock-client\",\n    \"Description\": \"Client for implicit flow\",\n    \"AllowedGrantTypes\": [\"implicit\"],\n    \"AllowAccessTokensViaBrowser\": true,\n    \"RedirectUris\": [\"http://localhost:3000/auth/oidc\", \"http://localhost:4004/auth/oidc\"],\n    \"AllowedScopes\": [\"openid\", \"profile\", \"email\"],\n    \"IdentityTokenLifetime\": 3600,\n    \"AccessTokenLifetime\": 3600\n  },\n  {\n    \"ClientId\": \"client-credentials-mock-client\",\n    \"ClientSecrets\": [\"client-credentials-mock-client-secret\"],\n    \"Description\": \"Client for client credentials flow\",\n    \"AllowedGrantTypes\": [\"client_credentials\"],\n    \"AllowedScopes\": [\"some-app-scope-1\"],\n    \"ClientClaimsPrefix\": \"\",\n    \"Claims\": [\n      {\n        \"Type\": \"string_claim\",\n        \"Value\": \"string_claim_value\",\n        \"ValueType\": \"string\"\n      },\n      {\n        \"Type\": \"json_claim\",\n        \"Value\": \"[\\\"value1\\\", \\\"value2\\\"]\",\n        \"ValueType\": \"json\"\n      }\n    ]\n  }\n]\n```\n\nThis is the sample of using the server in `Dockerfile` configuration:\n\n```\n# Use the base image\nFROM ghcr.io/soluto/oidc-server-mock:0.8.6\n\n# Set environment variables\n# additional configuration can be found in the readme\n# https://github.com/Soluto/oidc-server-mock/blob/master/README.md?plain=1#L145\nENV ASPNETCORE_ENVIRONMENT=Development\nENV SERVER_OPTIONS_INLINE=\"{ \\\n  \\\"AccessTokenJwtType\\\": \\\"JWT\\\", \\\n  \\\"Discovery\\\": { \\\n    \\\"ShowKeySet\\\": true \\\n  }, \\\n  \\\"Authentication\\\": { \\\n    \\\"CookieSameSiteMode\\\": \\\"Lax\\\", \\\n    \\\"CheckSessionCookieSameSiteMode\\\": \\\"Lax\\\" \\\n  } \\\n}\"\nENV USERS_CONFIGURATION_INLINE=\"[ \\\n  { \\\n    \\\"SubjectId\\\": \\\"1\\\", \\\n    \\\"Username\\\": \\\"User1\\\", \\\n    \\\"Password\\\": \\\"pwd\\\", \\\n    \\\"Claims\\\": [ \\\n      { \\\n        \\\"Type\\\": \\\"name\\\", \\\n        \\\"Value\\\": \\\"Sam Tailor\\\", \\\n        \\\"ValueType\\\": \\\"string\\\" \\\n      }, \\\n      { \\\n        \\\"Type\\\": \\\"email\\\", \\\n        \\\"Value\\\": \\\"sam.tailor@gmail.com\\\", \\\n        \\\"ValueType\\\": \\\"string\\\" \\\n      }, \\\n      { \\\n        \\\"Type\\\": \\\"some-api-resource-claim\\\", \\\n        \\\"Value\\\": \\\"Sam's Api Resource Custom Claim\\\", \\\n        \\\"ValueType\\\": \\\"string\\\" \\\n      }, \\\n      { \\\n        \\\"Type\\\": \\\"some-api-scope-claim\\\", \\\n        \\\"Value\\\": \\\"Sam's Api Scope Custom Claim\\\", \\\n        \\\"ValueType\\\": \\\"string\\\" \\\n      }, \\\n      { \\\n        \\\"Type\\\": \\\"some-identity-resource-claim\\\", \\\n        \\\"Value\\\": \\\"Sam's Identity Resource Custom Claim\\\", \\\n        \\\"ValueType\\\": \\\"string\\\" \\\n      } \\\n    ] \\\n  } \\\n]\"\nENV CLIENTS_CONFIGURATION_INLINE=\"[ \\\n  { \\\n    \\\"ClientId\\\": \\\"some-client-di\\\", \\\n    \\\"ClientSecrets\\\": [\\\"some-client-Secret\\\"], \\\n    \\\"Description\\\": \\\"Client for authorization code flow\\\", \\\n    \\\"AllowedGrantTypes\\\": [\\\"authorization_code\\\"], \\\n    \\\"RequirePkce\\\": false, \\\n    \\\"AllowAccessTokensViaBrowser\\\": true, \\\n    \\\"RedirectUris\\\": [\\\"http://some-callback-url\"], \\\n    \\\"AllowedScopes\\\": [\\\"openid\\\", \\\"profile\\\", \\\"email\\\"], \\\n    \\\"IdentityTokenLifetime\\\": 3600, \\\n    \\\"AccessTokenLifetime\\\": 3600, \\\n    \\\"RequireClientSecret\\\": false \\\n  } \\\n]\"\nENV ASPNET_SERVICES_OPTIONS_INLINE=\"{ \\\n  \\\"ForwardedHeadersOptions\\\": { \\\n    \\\"ForwardedHeaders\\\": \\\"All\\\" \\\n  } \\\n}\"\n\n# Expose the port\nEXPOSE 80\n\n# Command to run the application\nCMD [\"dotnet\", \"Soluto.OidcServerMock.dll\"]\n```\n\nClients configuration should be provided. Test user configuration is optional (used for implicit flow only).\n\nThere are two ways to provide configuration for supported scopes, clients and users. You can either provide it inline as environment variable:\n\n- `SERVER_OPTIONS_INLINE`\n- `LOGIN_OPTIONS_INLINE`\n- `LOGOUT_OPTIONS_INLINE`\n- `API_SCOPES_INLINE`\n- `USERS_CONFIGURATION_INLINE`\n- `CLIENTS_CONFIGURATION_INLINE`\n- `API_RESOURCES_INLINE`\n- `IDENTITY_RESOURCES_INLINE`\n\n  or mount volume and provide the path to configuration json as environment variable:\n\n- `SERVER_OPTIONS_PATH`\n- `LOGIN_OPTIONS_PATH`\n- `LOGOUT_OPTIONS_PATH`\n- `API_SCOPES_PATH`\n- `USERS_CONFIGURATION_PATH`\n- `CLIENTS_CONFIGURATION_PATH`\n- `API_RESOURCES_PATH`\n- `IDENTITY_RESOURCES_PATH`\n\nThe configuration format can be Yaml or JSON both for inline or file path options.\n\nIn order to be able to override standard identity resources set `OVERRIDE_STANDARD_IDENTITY_RESOURCES` env var to `True`.\n\n## Base path\n\nThe server can be configured to run with base path. So all the server endpoints will be also available with some prefix segment.\nFor example `http://localhost:8080/my-base-path/.well-known/openid-configuration` and `http://localhost:8080/my-base-path/connect/token`.\nJust set `BasePath` property in `ASPNET_SERVICES_OPTIONS_INLINE/PATH` env var.\n\n## Custom endpoints\n\n### User management\n\nUsers can be added (in future also removed and altered) via `user management` endpoint.\n\n- Create new user: `POST` request to `/api/v1/user` path.\n  The request body should be the `User` object. Just as in `USERS_CONFIGURATION`.\n  The response is subjectId as sent in request.\n\n- Get user: `GET` request to `/api/v1/user/{subjectId}` path.\n  The response is `User` object\n\n- Update user `PUT` request to `/api/v1/user` path. (**Not implemented yet**)\n  The request body should be the `User` object. Just as in `USERS_CONFIGURATION`.\n  The response is subjectId as sent in request.\n\n  > If user doesn't exits it will be created.\n\n- Delete user: `DELETE` request to `/api/v1/user/{subjectId}` path. (**Not implemented yet**)\n  The response is `User` object\n\n## HTTPS\n\nTo use `https` protocol with the server just add the following environment variables to the `docker run`/`docker-compose up` command, expose ports and mount volume containing the pfx file:\n\n```yaml\nenvironment:\n  ASPNETCORE_URLS: https://+:443;http://+:80\n  ASPNETCORE_Kestrel__Certificates__Default__Password: <password for pfx file>\n  ASPNETCORE_Kestrel__Certificates__Default__Path: /path/to/pfx/file\nvolumes:\n  - ./local/path/to/pfx/file:/path/to/pfx/file:ro\nports:\n  - 8080:80\n  - 8443:443\n```\n\n---\n\n## Cookie SameSite mode\n\nSince Aug 2020 Chrome has a new [secure-by-default model](https://blog.chromium.org/2019/10/developers-get-ready-for-new.html) for cookies, enabled by a new cookie classification system. Other browsers will join in near future.\n\nThere are two ways to use `oidc-server-mock` with this change.\n\n1. Run the container with HTTPS enabled (see above).\n2. Change cookies `SameSite` mode from default `None` to `Lax`. To do so just add the following to `SERVER_OPTIONS_INLINE` (or the file at `SERVER_OPTIONS_PATH`):\n\n```javascript\n{\n  // Existing configuration\n  // ...\n  \"Authentication\": {\n    \"CookieSameSiteMode\": \"Lax\",\n    \"CheckSessionCookieSameSiteMode\": \"Lax\"\n  }\n}\n```\n\n## Contributing\n\n### Requirements\n\n1. [Docker](https://www.docker.com/) (version 18.09 or higher)\n\n2. [NodeJS](https://nodejs.org/en/) (version 10.0.0 or higher)\n\n### Getting started\n\n1. Clone the repo:\n\n   ```sh\n   git clone git@github.com:Soluto/oidc-server-mock.git\n   ```\n\n2. Install `npm` packages (run from `/e2e` folder):\n\n   ```sh\n   npm install\n   ```\n\n   > Note: During the build of Docker image UI source code is fetched from [github](https://github.com/IdentityServer/IdentityServer4.Quickstart.UI/tree/main). If you experience some issues on project compile step of Docker build or on runtime try to change the branch or commit in the [script](./src/getmain.sh).\n\n3. Run tests:\n\n   ```sh\n   npm run test\n   ```\n\n## Used by\n\n1. [Tweek](https://github.com/Soluto/tweek) blackbox [tests](https://github.com/Soluto/tweek-blackbox).\n\n2. [Stitch](https://github.com/Soluto/Stitch) e2e tests.\n"
  },
  {
    "path": "Tiltfile",
    "content": "dockerComps = ['./e2e/docker-compose.yml']\n\nimageTag = os.getenv('IMAGE_TAG', '')\nif imageTag == '':\n    docker_build('oidc-server-mock', './src')\nelse:\n    dockerComps.append( './e2e/docker-compose.override.yml')\n\ndocker_compose(dockerComps)\n\ndc_resource('oidc-server-mock')\nlocal_resource('tests', cmd='npm run test --workspace=e2e', resource_deps=['oidc-server-mock'])\n"
  },
  {
    "path": "e2e/config/api-resources.yaml",
    "content": "- Name: some-app\n  Scopes:\n    - some-app-scope-1\n    - some-app-scope-2\n  ApiSecrets:\n    - some-app-secret-1\n  UserClaims:\n    - some-app-user-custom-claim\n"
  },
  {
    "path": "e2e/config/clients.json",
    "content": "[\n  {\n    \"ClientId\": \"implicit-flow-client-id\",\n    \"Description\": \"Client for implicit flow\",\n    \"AllowedGrantTypes\": [\"implicit\"],\n    \"AllowAccessTokensViaBrowser\": true,\n    \"RedirectUris\": [\"https://*.google.com\"],\n    \"AllowedScopes\": [\"openid\", \"profile\", \"email\", \"some-custom-identity\", \"some-app-scope-1\"],\n    \"IdentityTokenLifetime\": 3600,\n    \"AccessTokenLifetime\": 3600\n  },\n  {\n    \"ClientId\": \"client-credentials-flow-client-id\",\n    \"ClientSecrets\": [\"client-credentials-flow-client-secret\"],\n    \"Description\": \"Client for client credentials flow\",\n    \"AllowedGrantTypes\": [\"client_credentials\"],\n    \"AllowedScopes\": [\"some-app-scope-1\"],\n    \"ClientClaimsPrefix\": \"\",\n    \"Claims\": [\n      {\n        \"Type\": \"string_claim\",\n        \"Value\": \"string_claim_value\",\n        \"ValueType\": \"string\"\n      },\n      {\n        \"Type\": \"json_claim\",\n        \"Value\": \"[\\\"value1\\\", \\\"value2\\\"]\",\n        \"ValueType\": \"json\"\n      }\n    ]\n  },\n  {\n    \"ClientId\": \"password-flow-client-id\",\n    \"ClientSecrets\": [\"password-flow-client-secret\"],\n    \"Description\": \"Client for password flow\",\n    \"AllowedGrantTypes\": [\"password\"],\n    \"AllowedScopes\": [\"openid\", \"profile\", \"email\", \"some-custom-identity\", \"some-app-scope-1\"],\n    \"ClientClaimsPrefix\": \"\",\n    \"Claims\": [\n      {\n        \"Type\": \"string_claim\",\n        \"Value\": \"string_claim_value\",\n        \"ValueType\": \"string\"\n      },\n      {\n        \"Type\": \"json_claim\",\n        \"Value\": \"[\\\"value1\\\", \\\"value2\\\"]\",\n        \"ValueType\": \"json\"\n      }\n    ],\n    \"RequireClientSecret\": false\n  },\n  {\n    \"ClientId\": \"authorization-code-client-id\",\n    \"ClientSecrets\": [\"authorization-code-client-secret\"],\n    \"Description\": \"Client for authorization code flow\",\n    \"AllowedGrantTypes\": [\"authorization_code\"],\n    \"AllowAccessTokensViaBrowser\": true,\n    \"RedirectUris\": [\"https://*.google.com\"],\n    \"RequirePkce\": false,\n    \"AllowedScopes\": [\"openid\", \"profile\", \"email\", \"some-custom-identity\", \"some-app-scope-1\"],\n    \"IdentityTokenLifetime\": 3600,\n    \"AccessTokenLifetime\": 3600,\n    \"RequireClientSecret\": false\n  },\n  {\n    \"ClientId\": \"authorization-code-with-pkce-client-id\",\n    \"ClientSecrets\": [\"authorization-code-with-pkce-client-secret\"],\n    \"Description\": \"Client for authorization code flow\",\n    \"AllowedGrantTypes\": [\"authorization_code\"],\n    \"AllowAccessTokensViaBrowser\": true,\n    \"RedirectUris\": [\"https://*.google.com\"],\n    \"AllowedScopes\": [\"openid\", \"profile\", \"email\", \"some-custom-identity\", \"some-app-scope-1\"],\n    \"IdentityTokenLifetime\": 3600,\n    \"AccessTokenLifetime\": 3600,\n    \"RequireClientSecret\": false\n  }\n]\n"
  },
  {
    "path": "e2e/config/identity-resources.json",
    "content": "[\n  {\n    \"Name\": \"some-custom-identity\",\n    \"ClaimTypes\": [\"some-custom-identity-user-claim\"]\n  }\n]\n"
  },
  {
    "path": "e2e/config/server-options.json",
    "content": "{\n  \"AccessTokenJwtType\": \"JWT\",\n  \"Discovery\": {\n    \"ShowKeySet\": true\n  }\n}"
  },
  {
    "path": "e2e/config/users.yaml",
    "content": "[\n  { 'SubjectId': 'simple_user', 'Username': 'simple_user', 'Password': 'pwd' },\n  {\n    'SubjectId': 'user_with_standard_claims',\n    'Username': 'user_with_standard_claims',\n    'Password': 'pwd',\n    'Claims':\n      [\n        { 'Type': 'name', 'Value': 'John Smith', 'ValueType': 'string' },\n        { 'Type': 'email', 'Value': 'john.smith@gmail.com', 'ValueType': 'emailaddress' },\n        { 'Type': 'email_verified', 'Value': 'true', 'ValueType': 'boolean' },\n      ],\n  },\n  {\n    'SubjectId': 'user_with_custom_identity_claims',\n    'Username': 'user_with_custom_identity_claims',\n    'Password': 'pwd',\n    'Claims':\n      [\n        { 'Type': 'name', 'Value': 'Jack Sparrow', 'ValueType': 'string' },\n        { 'Type': 'email', 'Value': 'jack.sparrow@gmail.com', 'ValueType': 'emailaddress' },\n        { 'Type': 'some-custom-identity-user-claim', 'Value': \"Jack's Custom User Claim\", 'ValueType': 'string' },\n      ],\n  },\n  {\n    'SubjectId': 'user_with_custom_api_resource_claims',\n    'Username': 'user_with_custom_api_resource_claims',\n    'Password': 'pwd',\n    'Claims':\n      [\n        { 'Type': 'name', 'Value': 'Sam Tailor', 'ValueType': 'string' },\n        { 'Type': 'email', 'Value': 'sam.tailor@gmail.com', 'ValueType': 'emailaddress' },\n        { 'Type': 'some-app-user-custom-claim', 'Value': \"Sam's Custom User Claim\", 'ValueType': 'string' },\n        {\n          'Type': 'some-app-scope-1-custom-user-claim',\n          'Value': \"Sam's Scope Custom User Claim\",\n          'ValueType': 'string',\n        },\n      ],\n  },\n  {\n    'SubjectId': 'user_with_all_claim_types',\n    'Username': 'user_with_all_claim_types',\n    'Password': 'pwd',\n    'Claims':\n      [\n        { 'Type': 'name', 'Value': 'Oliver Hunter', 'ValueType': 'string' },\n        { 'Type': 'email', 'Value': 'oliver.hunter@gmail.com', 'ValueType': 'emailaddress' },\n        { 'Type': 'some-app-user-custom-claim', 'Value': \"Oliver's Custom User Claim\", 'ValueType': 'string' },\n        {\n          'Type': 'some-app-scope-1-custom-user-claim',\n          'Value': \"Oliver's Scope Custom User Claim\",\n          'ValueType': 'string',\n        },\n        { 'Type': 'some-custom-identity-user-claim', 'Value': \"Oliver's Custom User Claim\", 'ValueType': 'string' },\n      ],\n  },\n]\n"
  },
  {
    "path": "e2e/docker-compose.override.yml",
    "content": "services:\n  oidc-server-mock:\n    image: ghcr.io/soluto/oidc-server-mock:${IMAGE_TAG}\n"
  },
  {
    "path": "e2e/docker-compose.yml",
    "content": "services:\n  oidc-server-mock:\n    container_name: oidc-server-mock\n    image: oidc-server-mock\n    environment:\n      ASPNETCORE_ENVIRONMENT: Development\n      ASPNETCORE_URLS: https://+:443;http://+:80\n      ASPNETCORE_Kestrel__Certificates__Default__Password: oidc-server-mock-pwd\n      ASPNETCORE_Kestrel__Certificates__Default__Path: /https/aspnetapp.pfx\n      SERVER_OPTIONS_PATH: /config/server-options.json\n      LOGIN_OPTIONS_INLINE: |\n        {\n          \"AllowRememberLogin\": false\n        }\n      LOGOUT_OPTIONS_INLINE: |\n        {\n          \"AutomaticRedirectAfterSignOut\": true\n        }\n      API_RESOURCES_PATH: /config/api-resources.yaml\n      API_SCOPES_INLINE: |\n        - Name: some-app-scope-1\n          UserClaims:\n            - some-app-scope-1-custom-user-claim\n        - Name: some-app-scope-2\n      USERS_CONFIGURATION_PATH: /config/users.yaml\n      CLIENTS_CONFIGURATION_PATH: /config/clients.json\n      IDENTITY_RESOURCES_PATH: /config/identity-resources.json\n      ASPNET_SERVICES_OPTIONS_INLINE: |\n        {\n          \"BasePath\": \"/some-base-path\"\n        }\n    volumes:\n      - ./config:/config:ro\n      - ./https:/https:ro\n    ports:\n      - 8080:80\n      - 8443:443\n"
  },
  {
    "path": "e2e/helpers/authorization-endpoint.ts",
    "content": "import { expect } from '@jest/globals';\nimport { Page } from 'playwright-chromium';\n\nimport { User } from '../types';\nimport { oidcAuthorizeUrl } from './endpoints';\n\nconst authorizationEndpoint = async (\n  page: Page,\n  parameters: URLSearchParams,\n  user: User,\n  redirect_uri: string,\n): Promise<URL> => {\n  const url = `${oidcAuthorizeUrl.href}?${parameters.toString()}`;\n  const response = await page.goto(url);\n  expect(response.ok()).toBe(true);\n\n  await page.waitForSelector('[id=Input_Username]');\n  await page.type('[id=Input_Username]', user.Username);\n  await page.type('[id=Input_Password]', user.Password);\n  await page.keyboard.press('Enter');\n  await page.waitForURL(url => url.origin === redirect_uri);\n  const redirectedUrl = new URL(page.url());\n  return redirectedUrl;\n};\n\nexport default authorizationEndpoint;\n"
  },
  {
    "path": "e2e/helpers/endpoints.ts",
    "content": "import { from, logger } from 'env-var';\nimport * as dotenv from 'dotenv';\nimport { URL } from 'node:url';\ndotenv.config();\nconst env = from(process.env, undefined, logger);\n\nexport const oidcBaseUrl = env.get('OIDC_BASE_URL').required().asUrlObject();\nexport const basePath = 'some-base-path';\n\nexport const oidcTokenUrl = new URL('/connect/token', oidcBaseUrl);\nexport const oidcTokenUrlWithBasePath = new URL(`/${basePath}/connect/token`, oidcBaseUrl);\nexport const oidcAuthorizeUrl = new URL('connect/authorize', oidcBaseUrl);\nexport const oidcIntrospectionUrl = new URL('/connect/introspect', oidcBaseUrl);\nexport const oidcUserInfoUrl = new URL('/connect/userinfo', oidcBaseUrl);\nexport const oidcGrantsUrl = new URL('/grants', oidcBaseUrl);\nexport const oidcUserManagementUrl = new URL('/api/v1/user', oidcBaseUrl);\nexport const oidcDiscoveryEndpoint = new URL('/.well-known/openid-configuration', oidcBaseUrl);\nexport const oidcDiscoveryEndpointWithBasePath = new URL(`/${basePath}/.well-known/openid-configuration`, oidcBaseUrl);\n"
  },
  {
    "path": "e2e/helpers/grants.ts",
    "content": "import { expect } from '@jest/globals';\nimport { Page } from 'playwright-chromium';\n\nimport { User } from '../types';\nimport { oidcGrantsUrl } from './endpoints';\n\nconst grantsEndpoint = async (page: Page, user: User): Promise<void> => {\n  const response = await page.goto(oidcGrantsUrl.href);\n  expect(response.ok()).toBe(true);\n\n  await page.waitForSelector('[id=Input_Username]');\n  await page.type('[id=Input_Username]', user.Username);\n  await page.type('[id=Input_Password]', user.Password);\n  await page.keyboard.press('Enter');\n  await page.waitForNavigation();\n  expect(await page.content()).toMatchSnapshot();\n};\n\nexport default grantsEndpoint;\n"
  },
  {
    "path": "e2e/helpers/index.ts",
    "content": "export { default as authorizationEndpoint } from './authorization-endpoint';\nexport { default as grants } from './grants';\nexport { default as introspectEndpoint } from './introspect-endpoint';\nexport { default as tokenEndpoint } from './token-endpoint';\nexport { default as userInfoEndpoint } from './user-info-endpoint';\n"
  },
  {
    "path": "e2e/helpers/introspect-endpoint.ts",
    "content": "import { expect } from '@jest/globals';\nimport { ApiResource } from 'e2e/types';\nimport * as fs from 'fs/promises';\nimport path from 'path';\n\nimport * as yaml from 'yaml';\nimport { oidcIntrospectionUrl } from './endpoints';\n\nconst introspectEndpoint = async (\n  token: string,\n  apiResourceId: string,\n  snapshotPropertyMatchers: Record<string, unknown> = {},\n): Promise<void> => {\n  const apiResources = yaml.parse(\n    await fs.readFile(path.join(process.cwd(), './config/api-resources.yaml'), { encoding: 'utf8' }),\n  ) as ApiResource[];\n  const apiResource = apiResources.find(aR => aR.Name === apiResourceId);\n  expect(apiResource).toBeDefined();\n  const auth = Buffer.from(`${apiResource.Name}:${apiResource.ApiSecrets?.[0]}`).toString('base64');\n  const headers = {\n    Authorization: `Basic ${auth}`,\n    'Content-Type': 'application/x-www-form-urlencoded',\n  };\n  const requestBody = new URLSearchParams({\n    token,\n  });\n\n  const response = await fetch(oidcIntrospectionUrl, {\n    method: 'POST',\n    body: requestBody,\n    headers,\n  });\n\n  expect(response.ok).toBe(true);\n  const result = (await response.json()) as unknown;\n  expect(result).toMatchSnapshot(snapshotPropertyMatchers);\n};\n\nexport default introspectEndpoint;\n"
  },
  {
    "path": "e2e/helpers/token-endpoint.ts",
    "content": "import { expect } from '@jest/globals';\nimport { decode as decodeJWT } from 'jws';\nimport { oidcTokenUrl } from './endpoints';\n\nconst tokenEndpoint = async (\n  parameters: URLSearchParams,\n  snapshotPropertyMatchers: Record<string, unknown> = {},\n): Promise<string> => {\n  const response = await fetch(oidcTokenUrl, {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/x-www-form-urlencoded',\n    },\n    body: parameters.toString(),\n  });\n  expect(response.ok).toBe(true);\n  const result = (await response.json()) as { access_token: string };\n  expect(result.access_token).toBeDefined();\n  const token = result.access_token;\n  const decodedToken = decodeJWT(token);\n\n  expect(decodedToken).toMatchSnapshot(snapshotPropertyMatchers);\n  return token;\n};\n\nexport default tokenEndpoint;\n"
  },
  {
    "path": "e2e/helpers/user-info-endpoint.ts",
    "content": "import { expect } from '@jest/globals';\nimport { oidcUserInfoUrl } from './endpoints';\n\nconst userInfoEndpoint = async (\n  token: string,\n  snapshotPropertyMatchers: Record<string, unknown> = {},\n): Promise<void> => {\n  const response = await fetch(oidcUserInfoUrl, {\n    headers: { authorization: `Bearer ${token}` },\n  });\n  expect(response.ok).toBe(true);\n  const result = (await response.json()) as unknown;\n  expect(result).toMatchSnapshot(snapshotPropertyMatchers);\n};\n\nexport default userInfoEndpoint;\n"
  },
  {
    "path": "e2e/jest.config.ts",
    "content": "import type { Config } from '@jest/types';\n\nconst config: Config.InitialOptions = {\n  projects: [\n    {\n      displayName: 'Backend Tests',\n      preset: 'ts-jest',\n      rootDir: '.',\n      snapshotSerializers: ['<rootDir>/utils/jwt-serializer.js', '<rootDir>/utils/jwt-payload-serializer.js'],\n      testMatch: ['<rootDir>/tests/**/*.spec.ts'],\n      testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/dist/', '<rootDir>/tests/*.e2e-spec.ts'],\n      testEnvironment: 'node',\n    },\n    {\n      displayName: 'Frontend Tests',\n      preset: 'jest-playwright-preset',\n      rootDir: '.',\n      snapshotSerializers: ['<rootDir>/utils/jwt-serializer.js', '<rootDir>/utils/jwt-payload-serializer.js'],\n      testMatch: ['<rootDir>/tests/**/*.e2e-spec.ts'],\n      testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/dist/'],\n      transform: {\n        '^.+\\\\.ts$': 'ts-jest',\n      },\n      testEnvironment: 'node',\n    },\n  ],\n  testTimeout: 60000,\n};\n\nexport default config;\n"
  },
  {
    "path": "e2e/package.json",
    "content": "{\n  \"name\": \"e2e\",\n  \"version\": \"1.0.0\",\n  \"scripts\": {\n    \"test\": \"NODE_TLS_REJECT_UNAUTHORIZED=0 jest --runInBand --ci --config jest.config.ts\"\n  },\n  \"license\": \"MIT\",\n  \"engines\": {\n    \"node\": \">=20.0.0\"\n  },\n  \"dependencies\": {\n    \"chance\": \"^1.1.12\",\n    \"dotenv\": \"^16.5.0\",\n    \"env-var\": \"^7.5.0\",\n    \"jws\": \"^4.0.0\",\n    \"playwright-chromium\": \"^1.52.0\",\n    \"wait-on\": \"^8.0.3\",\n    \"yaml\": \"^2.7.1\"\n  },\n  \"devDependencies\": {\n    \"@jest/types\": \"^29.6.3\",\n    \"@types/chance\": \"^1.1.6\",\n    \"@types/jest\": \"^29.5.14\",\n    \"@types/jws\": \"^3.2.10\",\n    \"@types/node\": \"^22.15.3\",\n    \"@types/wait-on\": \"^5.3.4\",\n    \"jest\": \"^29.7.0\",\n    \"jest-playwright-preset\": \"^4.0.0\",\n    \"ts-jest\": \"^29.3.2\",\n    \"ts-node\": \"^10.9.2\",\n    \"typescript\": \"^5.8.3\"\n  }\n}\n"
  },
  {
    "path": "e2e/tests/__snapshots__/base-path.spec.ts.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Base path Discovery Endpoint 1`] = `\n{\n  \"access-control-allow-origin\": \"https://google.com\",\n  \"content-type\": \"application/json; charset=UTF-8\",\n  \"date\": Any<String>,\n  \"server\": \"Kestrel\",\n  \"transfer-encoding\": \"chunked\",\n}\n`;\n"
  },
  {
    "path": "e2e/tests/base-path.spec.ts",
    "content": "import { describe, test, beforeAll, expect } from '@jest/globals';\n\nimport clients from '../config/clients.json';\nimport type { Client } from '../types';\nimport { oidcDiscoveryEndpointWithBasePath, oidcTokenUrlWithBasePath } from 'e2e/helpers/endpoints';\n\ndescribe('Base path', () => {\n  let client: Client | undefined;\n\n  beforeAll(() => {\n    client = clients.find(c => c.ClientId === 'client-credentials-flow-client-id');\n    expect(client).toBeDefined();\n  });\n\n  test('Discovery Endpoint', async () => {\n    const response = await fetch(oidcDiscoveryEndpointWithBasePath, {\n      headers: {\n        origin: 'https://google.com',\n      },\n    });\n    expect(response.ok).toBe(true);\n    const result = (await response.json()) as unknown;\n    expect(result).toHaveProperty('token_endpoint', oidcTokenUrlWithBasePath.href);\n    expect(Object.fromEntries(response.headers.entries())).toMatchSnapshot({ date: expect.any(String) });\n  });\n\n  test('Token Endpoint', async () => {\n    if (!client) throw new Error('Client not found');\n\n    const parameters = new URLSearchParams({\n      client_id: client.ClientId,\n      client_secret: client.ClientSecrets?.[0] ?? '',\n      grant_type: 'client_credentials',\n      scope: client.AllowedScopes.join(' '),\n    });\n\n    const response = await fetch(oidcTokenUrlWithBasePath, {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/x-www-form-urlencoded',\n      },\n      body: parameters.toString(),\n    });\n    expect(response.ok).toBe(true);\n    const result = (await response.json()) as { access_token: string };\n    expect(result.access_token).toBeDefined();\n  });\n});\n"
  },
  {
    "path": "e2e/tests/custom-endpoints/__snapshots__/user-management.spec.ts.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`User management Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": {\n    \"inverse\": false\n  },\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": {\n    \"inverse\": false\n  },\n  \"some-app-scope-1-custom-user-claim\": {\n    \"inverse\": false\n  },\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`User management Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"email\",\n    \"openid\",\n    \"profile\",\n    \"some-app-scope-1\",\n    \"some-custom-identity\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": {\n    \"inverse\": false\n  },\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": {\n    \"inverse\": false\n  },\n  \"some-app-scope-1-custom-user-claim\": {\n    \"inverse\": false\n  }\n}\n`;\n\nexports[`User management UserInfo Endpoint 1`] = `\n{\n  \"email\": Any<String>,\n  \"name\": Any<String>,\n  \"some-custom-identity-user-claim\": Any<String>,\n  \"sub\": Any<String>,\n}\n`;\n"
  },
  {
    "path": "e2e/tests/custom-endpoints/user-management.spec.ts",
    "content": "import { describe, test, beforeAll, expect } from '@jest/globals';\nimport Chance from 'chance';\n\nimport clients from '../../config/clients.json';\nimport { introspectEndpoint, tokenEndpoint, userInfoEndpoint } from '../../helpers';\nimport { Client, User } from '../../types';\nimport { oidcUserManagementUrl } from 'e2e/helpers/endpoints';\n\ndescribe('User management', () => {\n  const chance = new Chance();\n  const subjectId = chance.guid({ version: 4 });\n  const firstName = chance.first();\n  const lastName = chance.last();\n  const username = `${firstName}_${lastName}`;\n  const password = chance.string({ length: 8 });\n  const email = chance.email();\n\n  let client: Client | undefined;\n  let token: string;\n\n  beforeAll(() => {\n    client = clients.find(c => c.ClientId === 'password-flow-client-id');\n  });\n\n  test('Get user from configuration', async () => {\n    const configUserId = 'user_with_all_claim_types';\n    const configUsername = 'user_with_all_claim_types';\n    const response = await fetch(`${oidcUserManagementUrl.href}/${configUserId}`);\n    expect(response.status).toBe(200);\n    const receivedUser = (await response.json()) as User;\n    expect(receivedUser).toHaveProperty('username', configUsername);\n  });\n\n  test('Create user', async () => {\n    const user: User = {\n      SubjectId: subjectId,\n      Username: username,\n      Password: password,\n      Claims: [\n        {\n          Type: 'name',\n          Value: `${firstName} ${lastName}`,\n        },\n        {\n          Type: 'email',\n          Value: email,\n        },\n        {\n          Type: 'some-app-user-custom-claim',\n          Value: `${firstName}'s Custom User Claim`,\n        },\n        {\n          Type: 'some-app-scope-1-custom-user-claim',\n          Value: `${firstName}'s Scope Custom User Claim`,\n        },\n        {\n          Type: 'some-custom-identity-user-claim',\n          Value: `${firstName}'s Custom User Claim`,\n        },\n      ],\n    };\n    const response = await fetch(oidcUserManagementUrl, {\n      method: 'POST',\n      body: JSON.stringify(user),\n      headers: { 'Content-Type': 'application/json' },\n    });\n    expect(response.status).toBe(200);\n    const result = (await response.json()) as unknown;\n    expect(result).toEqual(subjectId);\n  });\n\n  test('Get user', async () => {\n    const response = await fetch(`${oidcUserManagementUrl.href}/${subjectId}`);\n    expect(response.status).toBe(200);\n    const receivedUser = (await response.json()) as User;\n    expect(receivedUser).toHaveProperty('username', username);\n    expect(receivedUser).toHaveProperty('isActive', true);\n  });\n\n  test('Token Endpoint', async () => {\n    const parameters = new URLSearchParams({\n      client_id: client.ClientId,\n      username: username,\n      password: password,\n      grant_type: 'password',\n      scope: client.AllowedScopes.join(' '),\n    });\n\n    token = await tokenEndpoint(parameters, {\n      payload: {\n        sub: expect.any(String) as unknown,\n        ['some-app-user-custom-claim']: expect.any(String) as unknown,\n        ['some-app-scope-1-custom-user-claim']: expect.any(String) as unknown,\n      },\n    });\n  });\n\n  test('UserInfo Endpoint', async () => {\n    await userInfoEndpoint(token, {\n      sub: expect.any(String),\n      name: expect.any(String),\n      email: expect.any(String),\n      ['some-custom-identity-user-claim']: expect.any(String) as unknown,\n    });\n  }, 10000);\n\n  test('Introspection Endpoint', async () => {\n    await introspectEndpoint(token, 'some-app', {\n      sub: expect.any(String),\n      ['some-app-user-custom-claim']: expect.any(String) as unknown,\n      ['some-app-scope-1-custom-user-claim']: expect.any(String) as unknown,\n    });\n  });\n});\n"
  },
  {
    "path": "e2e/tests/flows/__snapshots__/authorization-code-pkce.e2e-spec.ts.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Authorization Code Flow (with PKCE) - simple_user - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"authorization-code-with-pkce-client-id\",\n  \"sub\": \"simple_user\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - simple_user - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"authorization-code-with-pkce-client-id\",\n  \"sub\": \"simple_user\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - simple_user - UserInfo Endpoint 1`] = `\n{\n  \"sub\": \"simple_user\",\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_all_claim_types - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"authorization-code-with-pkce-client-id\",\n  \"sub\": \"user_with_all_claim_types\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Oliver's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Oliver's Scope Custom User Claim\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_all_claim_types - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"authorization-code-with-pkce-client-id\",\n  \"sub\": \"user_with_all_claim_types\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Oliver's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Oliver's Scope Custom User Claim\"\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_all_claim_types - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"oliver.hunter@gmail.com\",\n  \"name\": \"Oliver Hunter\",\n  \"some-custom-identity-user-claim\": \"Oliver's Custom User Claim\",\n  \"sub\": \"user_with_all_claim_types\",\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_custom_api_resource_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"authorization-code-with-pkce-client-id\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Sam's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Sam's Scope Custom User Claim\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_custom_api_resource_claims - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"authorization-code-with-pkce-client-id\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Sam's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Sam's Scope Custom User Claim\"\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_custom_api_resource_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"sam.tailor@gmail.com\",\n  \"name\": \"Sam Tailor\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_custom_identity_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"authorization-code-with-pkce-client-id\",\n  \"sub\": \"user_with_custom_identity_claims\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_custom_identity_claims - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"authorization-code-with-pkce-client-id\",\n  \"sub\": \"user_with_custom_identity_claims\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_custom_identity_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"jack.sparrow@gmail.com\",\n  \"name\": \"Jack Sparrow\",\n  \"some-custom-identity-user-claim\": \"Jack's Custom User Claim\",\n  \"sub\": \"user_with_custom_identity_claims\",\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_standard_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"authorization-code-with-pkce-client-id\",\n  \"sub\": \"user_with_standard_claims\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_standard_claims - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"authorization-code-with-pkce-client-id\",\n  \"sub\": \"user_with_standard_claims\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Authorization Code Flow (with PKCE) - user_with_standard_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"john.smith@gmail.com\",\n  \"email_verified\": \"true\",\n  \"name\": \"John Smith\",\n  \"sub\": \"user_with_standard_claims\",\n}\n`;\n"
  },
  {
    "path": "e2e/tests/flows/__snapshots__/authorization-code.e2e-spec.ts.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Authorization Code Flow - simple_user - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"authorization-code-client-id\",\n  \"sub\": \"simple_user\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Authorization Code Flow - simple_user - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"authorization-code-client-id\",\n  \"sub\": \"simple_user\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Authorization Code Flow - simple_user - UserInfo Endpoint 1`] = `\n{\n  \"sub\": \"simple_user\",\n}\n`;\n\nexports[`Authorization Code Flow - user_with_all_claim_types - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"authorization-code-client-id\",\n  \"sub\": \"user_with_all_claim_types\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Oliver's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Oliver's Scope Custom User Claim\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Authorization Code Flow - user_with_all_claim_types - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"authorization-code-client-id\",\n  \"sub\": \"user_with_all_claim_types\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Oliver's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Oliver's Scope Custom User Claim\"\n}\n`;\n\nexports[`Authorization Code Flow - user_with_all_claim_types - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"oliver.hunter@gmail.com\",\n  \"name\": \"Oliver Hunter\",\n  \"some-custom-identity-user-claim\": \"Oliver's Custom User Claim\",\n  \"sub\": \"user_with_all_claim_types\",\n}\n`;\n\nexports[`Authorization Code Flow - user_with_custom_api_resource_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"authorization-code-client-id\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Sam's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Sam's Scope Custom User Claim\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Authorization Code Flow - user_with_custom_api_resource_claims - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"authorization-code-client-id\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Sam's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Sam's Scope Custom User Claim\"\n}\n`;\n\nexports[`Authorization Code Flow - user_with_custom_api_resource_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"sam.tailor@gmail.com\",\n  \"name\": \"Sam Tailor\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n}\n`;\n\nexports[`Authorization Code Flow - user_with_custom_identity_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"authorization-code-client-id\",\n  \"sub\": \"user_with_custom_identity_claims\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Authorization Code Flow - user_with_custom_identity_claims - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"authorization-code-client-id\",\n  \"sub\": \"user_with_custom_identity_claims\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Authorization Code Flow - user_with_custom_identity_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"jack.sparrow@gmail.com\",\n  \"name\": \"Jack Sparrow\",\n  \"some-custom-identity-user-claim\": \"Jack's Custom User Claim\",\n  \"sub\": \"user_with_custom_identity_claims\",\n}\n`;\n\nexports[`Authorization Code Flow - user_with_standard_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"authorization-code-client-id\",\n  \"sub\": \"user_with_standard_claims\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Authorization Code Flow - user_with_standard_claims - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"authorization-code-client-id\",\n  \"sub\": \"user_with_standard_claims\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Authorization Code Flow - user_with_standard_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"john.smith@gmail.com\",\n  \"email_verified\": \"true\",\n  \"name\": \"John Smith\",\n  \"sub\": \"user_with_standard_claims\",\n}\n`;\n"
  },
  {
    "path": "e2e/tests/flows/__snapshots__/client-credentials-flow.spec.ts.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Client Credentials Flow Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"client_id\": \"client-credentials-flow-client-id\",\n  \"string_claim\": \"string_claim_value\",\n  \"json_claim\": [\n    \"value1\",\n    \"value2\"\n  ],\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Client Credentials Flow Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"some-app-scope-1\"\n  ],\n  \"client_id\": \"client-credentials-flow-client-id\",\n  \"string_claim\": \"string_claim_value\",\n  \"json_claim\": [\n    \"value1\",\n    \"value2\"\n  ]\n}\n`;\n"
  },
  {
    "path": "e2e/tests/flows/__snapshots__/implicit-flow.e2e-spec.ts.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Implicit Flow - simple_user - Authorization Endpoint (id_token only) 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"implicit-flow-client-id\",\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"nonce\": \"xyz\",\n  \"sub\": \"simple_user\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Implicit Flow - simple_user - Authorization Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"implicit-flow-client-id\",\n  \"sub\": \"simple_user\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Implicit Flow - simple_user - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"implicit-flow-client-id\",\n  \"sub\": \"simple_user\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Implicit Flow - simple_user - UserInfo Endpoint 1`] = `\n{\n  \"sub\": \"simple_user\",\n}\n`;\n\nexports[`Implicit Flow - user_with_all_claim_types - Authorization Endpoint (id_token only) 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"implicit-flow-client-id\",\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"nonce\": \"xyz\",\n  \"sub\": \"user_with_all_claim_types\",\n  \"idp\": \"local\",\n  \"name\": \"Oliver Hunter\",\n  \"email\": \"oliver.hunter@gmail.com\",\n  \"some-custom-identity-user-claim\": \"Oliver's Custom User Claim\"\n}\n`;\n\nexports[`Implicit Flow - user_with_all_claim_types - Authorization Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"implicit-flow-client-id\",\n  \"sub\": \"user_with_all_claim_types\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Oliver's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Oliver's Scope Custom User Claim\"\n}\n`;\n\nexports[`Implicit Flow - user_with_all_claim_types - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"implicit-flow-client-id\",\n  \"sub\": \"user_with_all_claim_types\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Oliver's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Oliver's Scope Custom User Claim\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Implicit Flow - user_with_all_claim_types - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"oliver.hunter@gmail.com\",\n  \"name\": \"Oliver Hunter\",\n  \"some-custom-identity-user-claim\": \"Oliver's Custom User Claim\",\n  \"sub\": \"user_with_all_claim_types\",\n}\n`;\n\nexports[`Implicit Flow - user_with_custom_api_resource_claims - Authorization Endpoint (id_token only) 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"implicit-flow-client-id\",\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"nonce\": \"xyz\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n  \"idp\": \"local\",\n  \"name\": \"Sam Tailor\",\n  \"email\": \"sam.tailor@gmail.com\"\n}\n`;\n\nexports[`Implicit Flow - user_with_custom_api_resource_claims - Authorization Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"implicit-flow-client-id\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Sam's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Sam's Scope Custom User Claim\"\n}\n`;\n\nexports[`Implicit Flow - user_with_custom_api_resource_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"implicit-flow-client-id\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Sam's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Sam's Scope Custom User Claim\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Implicit Flow - user_with_custom_api_resource_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"sam.tailor@gmail.com\",\n  \"name\": \"Sam Tailor\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n}\n`;\n\nexports[`Implicit Flow - user_with_custom_identity_claims - Authorization Endpoint (id_token only) 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"implicit-flow-client-id\",\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"nonce\": \"xyz\",\n  \"sub\": \"user_with_custom_identity_claims\",\n  \"idp\": \"local\",\n  \"name\": \"Jack Sparrow\",\n  \"email\": \"jack.sparrow@gmail.com\",\n  \"some-custom-identity-user-claim\": \"Jack's Custom User Claim\"\n}\n`;\n\nexports[`Implicit Flow - user_with_custom_identity_claims - Authorization Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"implicit-flow-client-id\",\n  \"sub\": \"user_with_custom_identity_claims\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Implicit Flow - user_with_custom_identity_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"implicit-flow-client-id\",\n  \"sub\": \"user_with_custom_identity_claims\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Implicit Flow - user_with_custom_identity_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"jack.sparrow@gmail.com\",\n  \"name\": \"Jack Sparrow\",\n  \"some-custom-identity-user-claim\": \"Jack's Custom User Claim\",\n  \"sub\": \"user_with_custom_identity_claims\",\n}\n`;\n\nexports[`Implicit Flow - user_with_standard_claims - Authorization Endpoint (id_token only) 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"implicit-flow-client-id\",\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"nonce\": \"xyz\",\n  \"sub\": \"user_with_standard_claims\",\n  \"idp\": \"local\",\n  \"name\": \"John Smith\",\n  \"email\": \"john.smith@gmail.com\",\n  \"email_verified\": \"true\"\n}\n`;\n\nexports[`Implicit Flow - user_with_standard_claims - Authorization Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"openid\",\n    \"profile\",\n    \"email\",\n    \"some-custom-identity\",\n    \"some-app-scope-1\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"implicit-flow-client-id\",\n  \"sub\": \"user_with_standard_claims\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Implicit Flow - user_with_standard_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"implicit-flow-client-id\",\n  \"sub\": \"user_with_standard_claims\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Implicit Flow - user_with_standard_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"john.smith@gmail.com\",\n  \"email_verified\": \"true\",\n  \"name\": \"John Smith\",\n  \"sub\": \"user_with_standard_claims\",\n}\n`;\n"
  },
  {
    "path": "e2e/tests/flows/__snapshots__/password-flow.spec.ts.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Password Flow - simple_user - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": \"simple_user\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Password Flow - simple_user - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"email\",\n    \"openid\",\n    \"profile\",\n    \"some-app-scope-1\",\n    \"some-custom-identity\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": \"simple_user\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Password Flow - simple_user - UserInfo Endpoint 1`] = `\n{\n  \"sub\": \"simple_user\",\n}\n`;\n\nexports[`Password Flow - user_with_all_claim_types - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": \"user_with_all_claim_types\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Oliver's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Oliver's Scope Custom User Claim\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Password Flow - user_with_all_claim_types - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"email\",\n    \"openid\",\n    \"profile\",\n    \"some-app-scope-1\",\n    \"some-custom-identity\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": \"user_with_all_claim_types\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Oliver's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Oliver's Scope Custom User Claim\"\n}\n`;\n\nexports[`Password Flow - user_with_all_claim_types - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"oliver.hunter@gmail.com\",\n  \"name\": \"Oliver Hunter\",\n  \"some-custom-identity-user-claim\": \"Oliver's Custom User Claim\",\n  \"sub\": \"user_with_all_claim_types\",\n}\n`;\n\nexports[`Password Flow - user_with_custom_api_resource_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Sam's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Sam's Scope Custom User Claim\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Password Flow - user_with_custom_api_resource_claims - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"email\",\n    \"openid\",\n    \"profile\",\n    \"some-app-scope-1\",\n    \"some-custom-identity\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n  \"idp\": \"local\",\n  \"some-app-user-custom-claim\": \"Sam's Custom User Claim\",\n  \"some-app-scope-1-custom-user-claim\": \"Sam's Scope Custom User Claim\"\n}\n`;\n\nexports[`Password Flow - user_with_custom_api_resource_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"sam.tailor@gmail.com\",\n  \"name\": \"Sam Tailor\",\n  \"sub\": \"user_with_custom_api_resource_claims\",\n}\n`;\n\nexports[`Password Flow - user_with_custom_identity_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": \"user_with_custom_identity_claims\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Password Flow - user_with_custom_identity_claims - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"email\",\n    \"openid\",\n    \"profile\",\n    \"some-app-scope-1\",\n    \"some-custom-identity\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": \"user_with_custom_identity_claims\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Password Flow - user_with_custom_identity_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"jack.sparrow@gmail.com\",\n  \"name\": \"Jack Sparrow\",\n  \"some-custom-identity-user-claim\": \"Jack's Custom User Claim\",\n  \"sub\": \"user_with_custom_identity_claims\",\n}\n`;\n\nexports[`Password Flow - user_with_standard_claims - Introspection Endpoint 1`] = `\n{\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"amr\": \"pwd\",\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": \"user_with_standard_claims\",\n  \"idp\": \"local\",\n  \"active\": true,\n  \"scope\": \"some-app-scope-1\"\n}\n`;\n\nexports[`Password Flow - user_with_standard_claims - Token Endpoint 1`] = `\n{\n  \"alg\": \"RS256\",\n  \"typ\": \"JWT\",\n  \"iss\": \"https://localhost:8443\",\n  \"aud\": \"some-app\",\n  \"scope\": [\n    \"email\",\n    \"openid\",\n    \"profile\",\n    \"some-app-scope-1\",\n    \"some-custom-identity\"\n  ],\n  \"amr\": [\n    \"pwd\"\n  ],\n  \"client_id\": \"password-flow-client-id\",\n  \"sub\": \"user_with_standard_claims\",\n  \"idp\": \"local\"\n}\n`;\n\nexports[`Password Flow - user_with_standard_claims - UserInfo Endpoint 1`] = `\n{\n  \"email\": \"john.smith@gmail.com\",\n  \"email_verified\": \"true\",\n  \"name\": \"John Smith\",\n  \"sub\": \"user_with_standard_claims\",\n}\n`;\n"
  },
  {
    "path": "e2e/tests/flows/authorization-code-pkce.e2e-spec.ts",
    "content": "import { describe, test, beforeAll, afterAll, beforeEach, afterEach, expect } from '@jest/globals';\nimport * as crypto from 'crypto';\nimport * as fs from 'fs';\nimport path from 'path';\n\nimport { Browser, BrowserContext, chromium, Page } from 'playwright-chromium';\nimport * as yaml from 'yaml';\n\nimport clients from '../../config/clients.json';\nimport { authorizationEndpoint, introspectEndpoint, tokenEndpoint, userInfoEndpoint } from '../../helpers';\nimport type { Client, User } from '../../types';\n\nconst users = yaml.parse(\n  fs.readFileSync(path.join(process.cwd(), './config/users.yaml'), { encoding: 'utf8' }),\n) as User[];\n\nconst testCases: User[] = users\n  .map(u => ({\n    ...u,\n    toString: function () {\n      return (this as User).SubjectId;\n    },\n  }))\n  .sort((u1, u2) => (u1.SubjectId < u2.SubjectId ? -1 : 1));\n\nconst base64URLEncode = (buffer: Buffer) =>\n  buffer.toString('base64').replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '');\n\nconst sha256 = (buffer: crypto.BinaryLike) => crypto.createHash('sha256').update(buffer).digest();\n\ndescribe('Authorization Code Flow (with PKCE)', () => {\n  let codeVerifier: string;\n  let code: string;\n  let token: string;\n\n  let browser: Browser;\n  let context: BrowserContext;\n  let page: Page;\n  let client: Client | undefined;\n\n  beforeAll(async () => {\n    browser = await chromium.launch();\n    client = clients.find(c => c.ClientId === 'authorization-code-with-pkce-client-id');\n    expect(client).toBeDefined();\n  });\n\n  beforeEach(async () => {\n    context = await browser.newContext({ ignoreHTTPSErrors: true });\n    page = await context.newPage();\n  });\n\n  afterEach(async () => {\n    await page.close();\n    await context.close();\n  });\n\n  afterAll(async () => {\n    await browser.close();\n  });\n\n  describe.each(testCases)('- %s -', (user: User) => {\n    test('Authorization Endpoint', async () => {\n      codeVerifier = base64URLEncode(crypto.randomBytes(32));\n\n      const codeChallenge = base64URLEncode(sha256(codeVerifier));\n\n      const parameters = new URLSearchParams({\n        client_id: client.ClientId,\n        scope: client.AllowedScopes.join(' '),\n        response_type: 'code',\n        redirect_uri: client.RedirectUris?.[0].replace('*', 'www'),\n        code_challenge: codeChallenge,\n        code_challenge_method: 'S256',\n        state: 'abc',\n        nonce: 'xyz',\n      });\n      const redirectedUrl = await authorizationEndpoint(page, parameters, user, parameters.get('redirect_uri'));\n      expect(redirectedUrl.searchParams.has('code')).toBeTruthy();\n      code = redirectedUrl.searchParams.get('code');\n    });\n\n    test('Token Endpoint', async () => {\n      const parameters = new URLSearchParams({\n        client_id: client.ClientId,\n        code,\n        grant_type: 'authorization_code',\n        redirect_uri: client.RedirectUris?.[0].replace('*', 'www'),\n        code_verifier: codeVerifier,\n        scope: client.AllowedScopes.join(' '),\n      });\n\n      token = await tokenEndpoint(parameters);\n    });\n\n    test('UserInfo Endpoint', async () => {\n      await userInfoEndpoint(token);\n    });\n\n    test('Introspection Endpoint', async () => {\n      await introspectEndpoint(token, 'some-app');\n    });\n  });\n});\n"
  },
  {
    "path": "e2e/tests/flows/authorization-code.e2e-spec.ts",
    "content": "import { describe, test, beforeAll, afterAll, beforeEach, afterEach, expect } from '@jest/globals';\nimport * as fs from 'fs';\nimport path from 'path';\n\nimport { Browser, BrowserContext, chromium, Page } from 'playwright-chromium';\nimport * as yaml from 'yaml';\n\nimport clients from '../../config/clients.json';\nimport { authorizationEndpoint, introspectEndpoint, tokenEndpoint, userInfoEndpoint } from '../../helpers';\nimport type { Client, User } from '../../types';\n\nconst users = yaml.parse(\n  fs.readFileSync(path.join(process.cwd(), './config/users.yaml'), { encoding: 'utf8' }),\n) as User[];\n\nconst testCases: User[] = users\n  .map(u => ({\n    ...u,\n    toString: function () {\n      return (this as User).SubjectId;\n    },\n  }))\n  .sort((u1, u2) => (u1.SubjectId < u2.SubjectId ? -1 : 1));\n\ndescribe('Authorization Code Flow', () => {\n  let code: string;\n  let token: string;\n\n  let browser: Browser;\n  let context: BrowserContext;\n  let page: Page;\n  let client: Client | undefined;\n\n  beforeAll(async () => {\n    browser = await chromium.launch();\n    client = clients.find(c => c.ClientId === 'authorization-code-client-id');\n    expect(client).toBeDefined();\n  });\n\n  beforeEach(async () => {\n    context = await browser.newContext({ ignoreHTTPSErrors: true });\n    page = await context.newPage();\n  });\n\n  afterEach(async () => {\n    await page.close();\n    await context.close();\n  });\n\n  afterAll(async () => {\n    await browser.close();\n  });\n\n  describe.each(testCases)('- %s -', (user: User) => {\n    test('Authorization Endpoint', async () => {\n      const parameters = new URLSearchParams({\n        client_id: client.ClientId,\n        scope: client.AllowedScopes.join(' '),\n        response_type: 'code',\n        redirect_uri: client.RedirectUris?.[0].replace('*', 'www'),\n        state: 'abc',\n        nonce: 'xyz',\n      });\n      const redirectedUrl = await authorizationEndpoint(page, parameters, user, parameters.get('redirect_uri'));\n      expect(redirectedUrl.searchParams.has('code')).toBeTruthy();\n      code = redirectedUrl.searchParams.get('code');\n    });\n\n    test('Token Endpoint', async () => {\n      const parameters = new URLSearchParams({\n        client_id: client.ClientId,\n        code,\n        grant_type: 'authorization_code',\n        redirect_uri: client.RedirectUris?.[0].replace('*', 'www'),\n        scope: client.AllowedScopes.join(' '),\n      });\n\n      token = await tokenEndpoint(parameters);\n    });\n\n    test('UserInfo Endpoint', async () => {\n      await userInfoEndpoint(token);\n    });\n\n    test('Introspection Endpoint', async () => {\n      await introspectEndpoint(token, 'some-app');\n    });\n  });\n});\n"
  },
  {
    "path": "e2e/tests/flows/client-credentials-flow.spec.ts",
    "content": "import { describe, test, beforeAll, expect } from '@jest/globals';\n\nimport clients from '../../config/clients.json';\nimport { introspectEndpoint, tokenEndpoint } from '../../helpers';\nimport type { Client } from '../../types';\n\ndescribe('Client Credentials Flow', () => {\n  let client: Client | undefined;\n  let token: string;\n\n  beforeAll(() => {\n    client = clients.find(c => c.ClientId === 'client-credentials-flow-client-id');\n    expect(client).toBeDefined();\n  });\n\n  test('Token Endpoint', async () => {\n    if (!client) throw new Error('Client not found');\n\n    const parameters = new URLSearchParams({\n      client_id: client.ClientId,\n      client_secret: client.ClientSecrets?.[0] ?? '',\n      grant_type: 'client_credentials',\n      scope: client.AllowedScopes.join(' '),\n    });\n\n    token = await tokenEndpoint(parameters);\n  });\n\n  test('Introspection Endpoint', async () => {\n    await introspectEndpoint(token, 'some-app');\n  });\n});\n"
  },
  {
    "path": "e2e/tests/flows/implicit-flow.e2e-spec.ts",
    "content": "import { describe, test, beforeAll, afterAll, beforeEach, afterEach, expect } from '@jest/globals';\n\nimport * as fs from 'fs';\nimport path from 'path';\n\nimport { decode as decodeJWT } from 'jws';\nimport { Browser, BrowserContext, chromium, Page } from 'playwright-chromium';\nimport * as yaml from 'yaml';\n\nimport clients from '../../config/clients.json';\nimport { authorizationEndpoint, introspectEndpoint, userInfoEndpoint } from '../../helpers';\nimport type { Client, User } from '../../types';\n\nconst users = yaml.parse(\n  fs.readFileSync(path.join(process.cwd(), './config/users.yaml'), { encoding: 'utf8' }),\n) as User[];\n\nconst testCases: User[] = users\n  .map(u => ({\n    ...u,\n    toString: function () {\n      return (this as User).SubjectId;\n    },\n  }))\n  .sort((u1, u2) => (u1.SubjectId < u2.SubjectId ? -1 : 1));\n\ndescribe('Implicit Flow', () => {\n  let token: string;\n\n  let browser: Browser;\n  let context: BrowserContext;\n  let page: Page;\n  let client: Client | undefined;\n\n  beforeAll(async () => {\n    browser = await chromium.launch();\n    client = clients.find(c => c.ClientId === 'implicit-flow-client-id');\n    expect(client).toBeDefined();\n  });\n\n  beforeEach(async () => {\n    context = await browser.newContext({ ignoreHTTPSErrors: true });\n    page = await context.newPage();\n  });\n\n  afterEach(async () => {\n    await page.close();\n    await context.close();\n  });\n\n  afterAll(async () => {\n    await browser.close();\n  });\n\n  describe.each(testCases)('- %s -', (user: User) => {\n    test('Authorization Endpoint', async () => {\n      const parameters = new URLSearchParams({\n        client_id: client.ClientId,\n        scope: client.AllowedScopes.join(' '),\n        response_type: 'id_token token',\n        redirect_uri: client.RedirectUris?.[0].replace('*', 'www'),\n        state: 'abc',\n        nonce: 'xyz',\n      });\n\n      const redirectedUrl = await authorizationEndpoint(page, parameters, user, parameters.get('redirect_uri'));\n      const hash = redirectedUrl.hash.slice(1);\n      const query = new URLSearchParams(hash);\n\n      const tokenParameter = query.get('access_token');\n      expect(typeof tokenParameter).toBe('string');\n      token = tokenParameter;\n      const decodedAccessToken = decodeJWT(token);\n      expect(decodedAccessToken).toMatchSnapshot();\n    });\n\n    test('UserInfo Endpoint', async () => {\n      await userInfoEndpoint(token);\n    });\n\n    test('Introspection Endpoint', async () => {\n      await introspectEndpoint(token, 'some-app');\n    });\n\n    test('Authorization Endpoint (id_token only)', async () => {\n      const parameters = new URLSearchParams({\n        client_id: client.ClientId,\n        scope: 'openid profile email some-custom-identity',\n        response_type: 'id_token',\n        redirect_uri: client.RedirectUris?.[0].replace('*', 'www'),\n        state: 'abc',\n        nonce: 'xyz',\n      });\n      const redirectedUrl = await authorizationEndpoint(page, parameters, user, parameters.get('redirect_uri'));\n      const hash = redirectedUrl.hash.slice(1);\n      const query = new URLSearchParams(hash);\n\n      const tokenParameter = query.get('id_token');\n      expect(typeof tokenParameter).toBe('string');\n      token = tokenParameter;\n      const decodedAccessToken = decodeJWT(token);\n      expect(decodedAccessToken).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "e2e/tests/flows/password-flow.spec.ts",
    "content": "import { describe, test, beforeAll, expect } from '@jest/globals';\n\nimport * as fs from 'fs';\nimport path from 'path';\n\nimport * as yaml from 'yaml';\n\nimport clients from '../../config/clients.json';\nimport { introspectEndpoint, tokenEndpoint, userInfoEndpoint } from '../../helpers';\nimport type { Client, User } from '../../types';\n\nconst users = yaml.parse(\n  fs.readFileSync(path.join(process.cwd(), './config/users.yaml'), { encoding: 'utf8' }),\n) as User[];\n\nconst testCases: User[] = users\n  .map(u => ({\n    ...u,\n    toString: function () {\n      return (this as User).SubjectId;\n    },\n  }))\n  .sort((u1, u2) => (u1.SubjectId < u2.SubjectId ? -1 : 1));\n\ndescribe('Password Flow', () => {\n  let client: Client | undefined;\n  let token: string;\n\n  beforeAll(() => {\n    client = clients.find(c => c.ClientId === 'password-flow-client-id');\n    expect(client).toBeDefined();\n  });\n\n  describe.each(testCases)('- %s -', (user: User) => {\n    test('Token Endpoint', async () => {\n      if (!client) throw new Error('Client not found');\n\n      const parameters = new URLSearchParams({\n        client_id: client.ClientId,\n        username: user.Username,\n        password: user.Password,\n        grant_type: 'password',\n        scope: client.AllowedScopes.join(' '),\n      });\n\n      token = await tokenEndpoint(parameters);\n    });\n\n    test('UserInfo Endpoint', async () => {\n      await userInfoEndpoint(token);\n    });\n\n    test('Introspection Endpoint', async () => {\n      await introspectEndpoint(token, 'some-app');\n    });\n  });\n});\n"
  },
  {
    "path": "e2e/tsconfig.json",
    "content": "{\n  \"extends\": \"../tsconfig.json\",\n  \"exclude\": [\"node_modules\"]\n}\n"
  },
  {
    "path": "e2e/types/api-resource.ts",
    "content": "export default interface ApiResource {\n  Name: string;\n  Scopes?: string[];\n  ApiSecrets?: string[];\n}\n"
  },
  {
    "path": "e2e/types/claim.ts",
    "content": "export default interface Claim {\n  Type: string;\n  Value: string;\n  ValueType?: string;\n}\n"
  },
  {
    "path": "e2e/types/client.ts",
    "content": "import type Claim from './claim';\n\nexport default interface Client {\n  ClientId: string;\n  ClientSecrets?: string[];\n  Description?: string;\n  AllowedGrantTypes: string[];\n  AllowedScopes: string[];\n  RedirectUris?: string[];\n  AllowAccessTokensViaBrowser?: boolean;\n  AccessTokenLifetime?: number;\n  IdentityTokenLifetime?: number;\n  Claims?: Claim[];\n  ClientClaimsPrefix?: string;\n}\n"
  },
  {
    "path": "e2e/types/index.ts",
    "content": "export { default as ApiResource } from './api-resource';\nexport { default as Claim } from './claim';\nexport { default as Client } from './client';\nexport { default as User } from './user';\n"
  },
  {
    "path": "e2e/types/user.ts",
    "content": "import type Claim from './claim';\n\nexport default interface User {\n  SubjectId: string;\n  Username: string;\n  Password: string;\n  Claims?: Claim[];\n}\n"
  },
  {
    "path": "e2e/utils/jwt-payload-serializer.js",
    "content": "module.exports = {\n  test(argument) {\n    return argument.iat && argument.exp && argument.nbf;\n  },\n  print(value) {\n    const { exp, iat, jti, nbf, auth_time, sid, at_hash, ...payload } = value;\n    return JSON.stringify(payload, undefined, 2);\n  },\n};\n"
  },
  {
    "path": "e2e/utils/jwt-serializer.js",
    "content": "module.exports = {\n  test(argument) {\n    return argument.header && argument.payload && argument.signature;\n  },\n  print(value) {\n    const { alg, typ } = value.header;\n    const { exp, iat, jti, nbf, auth_time, sid, at_hash, ...payload } = value.payload;\n    return JSON.stringify({ alg, typ, ...payload }, undefined, 2);\n  },\n};\n"
  },
  {
    "path": "eslint.config.js",
    "content": "import js from '@eslint/js';\nimport eslintConfigPrettier from 'eslint-config-prettier';\nimport globals from 'globals';\nimport tseslint from 'typescript-eslint';\n\nexport default tseslint.config(\n  { ignores: ['dist'] },\n  {\n    files: ['**/*.{ts,tsx}'],\n    languageOptions: {\n      ecmaVersion: 2020,\n      globals: globals.browser,\n      parserOptions: {\n        project: ['./tsconfig.json'],\n        tsconfigRootDir: import.meta.dirname,\n      },\n    },\n    extends: [js.configs.recommended, ...tseslint.configs.recommendedTypeChecked],\n    settings: {\n      node: {\n        allowModules: ['jest-playwright-preset', 'wait-on'],\n        tryExtensions: ['.ts', '.json', '.node'],\n      },\n    },\n    ignores: ['**/node_modules/**', '**/dist/**', '**/coverage/**'],\n  },\n  eslintConfigPrettier,\n);\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"oidc-server-mock\",\n  \"version\": \"1.0.0\",\n  \"private\": true,\n  \"license\": \"MIT\",\n  \"type\": \"module\",\n  \"engines\": {\n    \"node\": \">=20.0.0\"\n  },\n  \"scripts\": {\n    \"tilt:up\": \"tilt up\",\n    \"tilt:down\": \"tilt down\",\n    \"tilt:ci\": \"tilt ci\",\n    \"lint\": \"eslint .\",\n    \"format\": \"prettier --write **/*.ts\",\n    \"prepare\": \"husky\"\n  },\n  \"workspaces\": [\n    \"e2e\"\n  ],\n  \"devDependencies\": {\n    \"@commitlint/cli\": \"^19.8.0\",\n    \"@commitlint/config-conventional\": \"^19.8.0\",\n    \"@eslint/js\": \"^9.26.0\",\n    \"@jest/globals\": \"^29.7.0\",\n    \"eslint\": \"^9.26.0\",\n    \"eslint-config-prettier\": \"^10.1.2\",\n    \"eslint-plugin-prettier\": \"^5.2.6\",\n    \"globals\": \"^16.0.0\",\n    \"husky\": \"^9.1.7\",\n    \"lint-staged\": \"^15.5.1\",\n    \"prettier\": \"^3.5.3\",\n    \"prettier-plugin-packagejson\": \"^2.5.10\",\n    \"pretty-quick\": \"^4.1.1\",\n    \"typescript\": \"^5.8.3\",\n    \"typescript-eslint\": \"^8.31.1\"\n  },\n  \"packageManager\": \"pnpm@10.10.0\"\n}\n"
  },
  {
    "path": "pnpm-workspace.yaml",
    "content": "packages:\n  - e2e\n"
  },
  {
    "path": "src/.dockerignore",
    "content": "bin/\nobj/\n\nPages\nwwwroot\n\nkeys/\ntempkey.jwk\n\nDockerfile\n.dockerignore\n"
  },
  {
    "path": "src/Config.cs",
    "content": "using Duende.IdentityServer.Configuration;\nusing Duende.IdentityServer.Models;\nusing Duende.IdentityServer.Test;\nusing OpenIdConnectServer.Helpers;\nusing OpenIdConnectServer.YamlConverters;\nusing YamlDotNet.Serialization;\n\nnamespace OpenIdConnectServer\n{\n    public static class Config\n    {\n        public static AspNetServicesOptions GetAspNetServicesOptions()\n        {\n            string aspNetServicesOptionsStr = Environment.GetEnvironmentVariable(\"ASPNET_SERVICES_OPTIONS_INLINE\");\n            if (string.IsNullOrWhiteSpace(aspNetServicesOptionsStr))\n            {\n                var aspNetServicesOptionsPath = Environment.GetEnvironmentVariable(\"ASPNET_SERVICES_OPTIONS_PATH\");\n                if (string.IsNullOrWhiteSpace(aspNetServicesOptionsPath))\n                {\n                    return new AspNetServicesOptions();\n                }\n                aspNetServicesOptionsStr = File.ReadAllText(aspNetServicesOptionsPath);\n            }\n            var aspNetServicesOptions = DeserializeObject<AspNetServicesOptions>(aspNetServicesOptionsStr);\n            return aspNetServicesOptions;\n        }\n\n        public static IdentityServerOptions GetServerOptions()\n        {\n            string serverOptionsStr = Environment.GetEnvironmentVariable(\"SERVER_OPTIONS_INLINE\");\n            if (string.IsNullOrWhiteSpace(serverOptionsStr))\n            {\n                var serverOptionsFilePath = Environment.GetEnvironmentVariable(\"SERVER_OPTIONS_PATH\");\n                if (string.IsNullOrWhiteSpace(serverOptionsFilePath))\n                {\n                    return new IdentityServerOptions();\n                }\n                serverOptionsStr = File.ReadAllText(serverOptionsFilePath);\n            }\n            var serverOptions = DeserializeObject<IdentityServerOptions>(serverOptionsStr);\n            return serverOptions;\n        }\n\n        public static void ConfigureOptions<T>(string optionsName)\n        {\n            string optionsStr = Environment.GetEnvironmentVariable($\"{optionsName.ToUpper()}_OPTIONS_INLINE\");\n            if (string.IsNullOrWhiteSpace(optionsStr))\n            {\n                var optionsFilePath = Environment.GetEnvironmentVariable($\"{optionsName.ToUpper()}_OPTIONS_PATH\");\n                if (string.IsNullOrWhiteSpace(optionsFilePath))\n                {\n                    return;\n                }\n                optionsStr = File.ReadAllText(optionsFilePath);\n            }\n            OptionsHelper.ConfigureOptions<T>(optionsStr);\n        }\n\n        public static IEnumerable<string> GetServerCorsAllowedOrigins()\n        {\n            string allowedOriginsStr = Environment.GetEnvironmentVariable(\"SERVER_CORS_ALLOWED_ORIGINS_INLINE\");\n            if (string.IsNullOrWhiteSpace(allowedOriginsStr))\n            {\n                var allowedOriginsFilePath = Environment.GetEnvironmentVariable(\"SERVER_CORS_ALLOWED_ORIGINS_PATH\");\n                if (string.IsNullOrWhiteSpace(allowedOriginsFilePath))\n                {\n                    return null;\n                }\n                allowedOriginsStr = File.ReadAllText(allowedOriginsFilePath);\n            }\n            var allowedOrigins = DeserializeObject<IEnumerable<string>>(allowedOriginsStr);\n            return allowedOrigins;\n        }\n\n        public static IEnumerable<ApiScope> GetApiScopes()\n        {\n            string apiScopesStr = Environment.GetEnvironmentVariable(\"API_SCOPES_INLINE\");\n            if (string.IsNullOrWhiteSpace(apiScopesStr))\n            {\n                var apiScopesFilePath = Environment.GetEnvironmentVariable(\"API_SCOPES_PATH\");\n                if (string.IsNullOrWhiteSpace(apiScopesFilePath))\n                {\n                    return new List<ApiScope>();\n                }\n                apiScopesStr = File.ReadAllText(apiScopesFilePath);\n            }\n            var apiScopes = DeserializeObject<IEnumerable<ApiScope>>(apiScopesStr);\n            return apiScopes;\n        }\n\n        public static IEnumerable<ApiResource> GetApiResources()\n        {\n            string apiResourcesStr = Environment.GetEnvironmentVariable(\"API_RESOURCES_INLINE\");\n            if (string.IsNullOrWhiteSpace(apiResourcesStr))\n            {\n                var apiResourcesFilePath = Environment.GetEnvironmentVariable(\"API_RESOURCES_PATH\");\n                if (string.IsNullOrWhiteSpace(apiResourcesFilePath))\n                {\n                    return new List<ApiResource>();\n                }\n                apiResourcesStr = File.ReadAllText(apiResourcesFilePath);\n            }\n            var apiResources = DeserializeObject<IEnumerable<ApiResource>>(apiResourcesStr);\n            return apiResources;\n        }\n\n        public static IEnumerable<Client> GetClients()\n        {\n            string configStr = Environment.GetEnvironmentVariable(\"CLIENTS_CONFIGURATION_INLINE\");\n            if (string.IsNullOrWhiteSpace(configStr))\n            {\n                var configFilePath = Environment.GetEnvironmentVariable(\"CLIENTS_CONFIGURATION_PATH\");\n                if (string.IsNullOrWhiteSpace(configFilePath))\n                {\n                    throw new ArgumentNullException(\"You must set either CLIENTS_CONFIGURATION_INLINE or CLIENTS_CONFIGURATION_PATH env variable\");\n                }\n                configStr = File.ReadAllText(configFilePath);\n            }\n            var configClients = DeserializeObject<IEnumerable<Client>>(configStr);\n            return configClients;\n        }\n\n        public static IEnumerable<IdentityResource> GetIdentityResources()\n        {\n            IEnumerable<IdentityResource> identityResources = new List<IdentityResource>();\n            var overrideStandardResources = Environment.GetEnvironmentVariable(\"OVERRIDE_STANDARD_IDENTITY_RESOURCES\");\n            if (string.IsNullOrEmpty(overrideStandardResources) || Boolean.Parse(overrideStandardResources) != true)\n            {\n                var standardResources = new List<IdentityResource>\n                {\n                    new IdentityResources.OpenId(),\n                    new IdentityResources.Profile(),\n                    new IdentityResources.Email()\n                };\n                identityResources = identityResources.Union(standardResources);\n            }\n            return identityResources.Union(GetCustomIdentityResources());\n        }\n\n        public static List<TestUser> GetUsers()\n        {\n            string configStr = Environment.GetEnvironmentVariable(\"USERS_CONFIGURATION_INLINE\");\n            if (string.IsNullOrWhiteSpace(configStr))\n            {\n                var configFilePath = Environment.GetEnvironmentVariable(\"USERS_CONFIGURATION_PATH\");\n                if (string.IsNullOrWhiteSpace(configFilePath))\n                {\n                    return new List<TestUser>();\n                }\n                configStr = File.ReadAllText(configFilePath);\n            }\n            var configUsers = DeserializeObject<List<TestUser>>(configStr);\n            return configUsers;\n        }\n\n        private static IEnumerable<IdentityResource> GetCustomIdentityResources()\n        {\n            string identityResourcesStr = Environment.GetEnvironmentVariable(\"IDENTITY_RESOURCES_INLINE\");\n            if (string.IsNullOrWhiteSpace(identityResourcesStr))\n            {\n                var identityResourcesFilePath = Environment.GetEnvironmentVariable(\"IDENTITY_RESOURCES_PATH\");\n                if (string.IsNullOrWhiteSpace(identityResourcesFilePath))\n                {\n                    return new List<IdentityResource>();\n                }\n                identityResourcesStr = File.ReadAllText(identityResourcesFilePath);\n            }\n\n            var identityResourceConfig = DeserializeObject<IdentityResourceConfig[]>(identityResourcesStr);\n            return identityResourceConfig.Select(c => new IdentityResource(c.Name, c.ClaimTypes));\n        }\n\n        private static T DeserializeObject<T>(string value)\n        {\n            var deserializer = new DeserializerBuilder()\n                .WithTypeConverter(new ClaimYamlConverter())\n                .WithTypeConverter(new SecretYamlConverter())\n                .Build();\n            return deserializer.Deserialize<T>(value);\n        }\n\n        private class IdentityResourceConfig\n        {\n            public string Name { get; set; }\n            public IEnumerable<string> ClaimTypes { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Controllers/HealthController.cs",
    "content": "using Microsoft.AspNetCore.Mvc;\n\nnamespace OpenIdConnectServer.Controllers\n{\n    public class HealthController : Controller\n    {\n        [HttpGet(\"/health\")]\n        public IActionResult Get()\n        {\n            return Ok();\n        }\n    }\n}"
  },
  {
    "path": "src/Controllers/UserController.cs",
    "content": "using System.Collections.Generic;\nusing System.Reflection;\nusing System.Security.Claims;\nusing Duende.IdentityServer.Test;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.Extensions.Logging;\n\nnamespace OpenIdConnectServer.Controllers\n{\n  [Route(\"api/v1/user\")]\n    public class UserController: Controller\n    {\n        private readonly TestUserStore _usersStore;\n        private readonly ILogger Logger;\n\n        public UserController(TestUserStore userStore, ILogger<UserController> logger)\n        {\n            _usersStore = userStore;\n            Logger = logger;\n        }\n\n        [HttpGet(\"{subjectId}\")]\n        public IActionResult GetUser([FromRoute]string subjectId)\n        {\n            var user = _usersStore.FindBySubjectId(subjectId);\n            Logger.LogDebug(\"User found: {subjectId}\", subjectId);\n            return Json(user);\n        }\n\n        [HttpPost]\n        public IActionResult AddUser([FromBody]TestUser user)\n        {\n            var claims = new List<Claim>(user.Claims);\n            claims.Add(new Claim(ClaimTypes.Name, user.Username));\n            var newUser =_usersStore.AutoProvisionUser(\"Alex\", user.SubjectId, new List<Claim>(user.Claims));\n            newUser.SubjectId = user.SubjectId;\n            newUser.Username = user.Username;\n            newUser.Password = user.Password;\n            newUser.ProviderName = string.Empty;\n            newUser.ProviderSubjectId = string.Empty;\n\n            Logger.LogDebug(\"New user added: {user}\", user.SubjectId);\n\n            return Json(user.SubjectId);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Dockerfile",
    "content": "# Stage 1: Build\n\nFROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS source\nARG TARGETARCH\n\nARG target=\"Release\"\n\nRUN apk add --no-cache unzip curl bash\n\nWORKDIR /src\n\nCOPY ./getui.sh ./getui.sh\nRUN ./getui.sh\n\nCOPY ./OpenIdConnectServerMock.csproj ./OpenIdConnectServerMock.csproj\nRUN dotnet restore -a $TARGETARCH\n\nCOPY . .\n\nRUN dotnet publish -a $TARGETARCH --no-restore -c $target -o obj/docker/publish\n\nRUN cp -r /src/obj/docker/publish /OpenIdConnectServerMock\n\n# Stage 2: Release\nFROM  --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS release\n\nARG target=\"Release\"\n\nRUN apk add --no-cache curl\nRUN if [ $target = \"Debug\" ]; then apk add --no-cache bash unzip && curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg; fi\n\nCOPY --from=source /OpenIdConnectServerMock /OpenIdConnectServerMock\nWORKDIR /OpenIdConnectServerMock\n\nENV ASPNETCORE_ENVIRONMENT=Development\n\nEXPOSE 80\nEXPOSE 443\n\nHEALTHCHECK --start-period=2s --interval=1s --timeout=100ms --retries=10 \\\n    CMD curl -k --location https://localhost/health || exit 1\n\nENTRYPOINT [\"dotnet\", \"OpenIdConnectServerMock.dll\" ]\n"
  },
  {
    "path": "src/Helpers/AspNetServicesHelper.cs",
    "content": "using Microsoft.AspNetCore.Authentication;\nusing Microsoft.AspNetCore.Authentication.Cookies;\nusing AspNetCorsOptions = Microsoft.AspNetCore.Cors.Infrastructure.CorsOptions;\n\nnamespace OpenIdConnectServer.Helpers\n{\n    public class AspNetServicesOptions\n    {\n        public AspNetCorsOptions? Cors { get; set; }\n\n        public IDictionary<string, AuthenticationOptions>? Authentication { get; set; }\n        public SessionOptions? Session { get; set; }\n\n        public ForwardedHeadersOptions? ForwardedHeadersOptions { get; set; }\n\n        public string? BasePath { get; set; }\n    }\n\n    public class AuthenticationOptions\n    {\n        public CookieAuthenticationOptions? CookieAuthenticationOptions { get; set; }\n    }\n\n    public static class AspNetServicesHelper\n    {\n        public static void ConfigureAspNetServices(IServiceCollection services, AspNetServicesOptions config)\n        {\n            if (config.Authentication != null)\n            {\n                ConfigureAuthenticationOptions(services, config.Authentication);\n            }\n\n            if (config.Session != null)\n            {\n                ConfigureSessionOptions(services, config.Session);\n            }\n        }\n\n        public static void UseAspNetServices(IApplicationBuilder app, AspNetServicesOptions config)\n        {\n            if (config.Cors != null)\n            {\n                app.UseCors();\n            }\n\n            if (config.ForwardedHeadersOptions != null)\n            {\n                config.ForwardedHeadersOptions.KnownNetworks.Clear();\n                config.ForwardedHeadersOptions.KnownProxies.Clear();\n                app.UseForwardedHeaders(config.ForwardedHeadersOptions);\n            }\n        }\n\n        public static void ConfigureAuthenticationOptions(IServiceCollection services, IDictionary<string, AuthenticationOptions> config)\n        {\n            foreach (var schemaConfig in config)\n            {\n                var builder = services.AddAuthentication(schemaConfig.Key);\n                ConfigureAuthenticationOptionsForScheme(builder, schemaConfig.Value);\n            }\n        }\n\n        private static void ConfigureAuthenticationOptionsForScheme(AuthenticationBuilder builder, AuthenticationOptions schemaConfig)\n        {\n            builder.AddCookie(options => {\n                MergeHelper.Merge(schemaConfig.CookieAuthenticationOptions, options);\n            });\n        }\n\n        private static void ConfigureSessionOptions(IServiceCollection services, SessionOptions config)\n        {\n            services.AddSession(options => {\n                MergeHelper.Merge(config, options);\n            });\n        }\n\n        private static void ConfigureCors(IServiceCollection services, AspNetCorsOptions corsConfig)\n        {\n            services.AddCors(options =>\n                {\n                    MergeHelper.Merge(corsConfig, options);\n                }\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "src/Helpers/MergeHelper.cs",
    "content": "namespace OpenIdConnectServer.Helpers\n{\n    public static class MergeHelper\n    {\n        public static void Merge<T>(T source, T target)\n        {\n            Type t = typeof(T);\n\n            var properties = t.GetProperties().Where(prop => prop.CanRead && prop.CanWrite);\n\n            foreach (var prop in properties)\n            {\n                var value = prop.GetValue(source, null);\n                if (value != null)\n                {\n                    prop.SetValue(target, value, null);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Helpers/OptionsHelper.cs",
    "content": "using Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace OpenIdConnectServer.Helpers\n{\n    public class OptionsHelper\n    {\n        public static void ConfigureOptions<T>(string optionsStr)\n        {\n            var options = JsonConvert.DeserializeObject<JObject>(optionsStr);\n            var targetFields = typeof(T).GetFields();\n            var jValueValueProp = typeof(JValue).GetProperty(nameof(JValue.Value));\n            Array.ForEach(targetFields, k => {\n                if (options != null && options.ContainsKey(k.Name)) {\n                    var fieldJValue = options[k.Name] as JValue;\n                    var fieldValue = jValueValueProp?.GetValue(fieldJValue);\n                    k.SetValue(null, fieldValue);\n                }\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "src/JsonConverters/ClaimJsonConverter.cs",
    "content": "using System.Security.Claims;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n\nnamespace OpenIdConnectServer.JsonConverters\n{\n    public class ClaimJsonConverter : JsonConverter<Claim>\n    {\n        public override void WriteJson(JsonWriter writer, Claim value, JsonSerializer serializer)\n        {\n            throw new NotSupportedException();\n        }\n\n        public override Claim ReadJson(JsonReader reader, Type objectType, Claim existingValue, bool hasExistingValue,\n            JsonSerializer serializer)\n        {\n            var jObject = JObject.Load(reader);\n            var type = jObject[\"Type\"].Value<string>();\n            var value = jObject[\"Value\"].Value<string>();\n            var valueType = jObject.ContainsKey(\"ValueType\") ? jObject[\"ValueType\"].Value<string>() : ClaimValueTypes.String;\n            return new Claim(type, value, valueType);\n        }\n\n        public override bool CanRead => true;\n        public override bool CanWrite => false;\n    }\n}\n"
  },
  {
    "path": "src/Middlewares/BasePathMiddleware.cs",
    "content": "using Duende.IdentityServer.Extensions;\nusing Duende.IdentityServer.Configuration;\nusing Duende.IdentityServer.Services;\n\n#pragma warning disable 1591\n\nnamespace OpenIdConnectServer.Middlewares\n{\n    public class BasePathMiddleware\n    {\n        private readonly RequestDelegate _next;\n        private readonly IdentityServerOptions _options;\n\n        public BasePathMiddleware(RequestDelegate next, IdentityServerOptions options)\n        {\n            _next = next;\n            _options = options;\n        }\n\n        public async Task Invoke(HttpContext context)\n        {\n            var basePath = Config.GetAspNetServicesOptions().BasePath;\n            var request = context.Request;\n            if(request.Path.Value?.Length > basePath.Length)\n            {\n                request.Path = request.Path.Value.Substring(basePath.Length);\n                context.RequestServices.GetRequiredService<IServerUrls>().BasePath = basePath;\n            }\n            await _next(context);\n        }\n    }\n}\n"
  },
  {
    "path": "src/OpenIdConnectServerMock.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk.Web\">\n\n  <PropertyGroup>\n    <TargetFramework>net8.0</TargetFramework>\n    <Nullable>enable</Nullable>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>\n\n    <IsPackable>true</IsPackable>\n    <Description>Configurable mock server with OpenId Connect functionality</Description>\n    <VersionPrefix>0.11.1</VersionPrefix>\n    <PackageProjectUrl>https://github.com/Soluto/oidc-server-mock</PackageProjectUrl>\n    <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>\n    <PackageTags>OIDC</PackageTags>\n    <RepositoryUrl>https://github.com/Soluto/oidc-server-mock</RepositoryUrl>\n    <RepositoryType>git</RepositoryType>\n    <PackAsTool>true</PackAsTool>\n    <ToolCommandName>oidc-mock</ToolCommandName>\n    <IncludeContentInPack>false</IncludeContentInPack>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Content Remove=\"keys\\**\" />\n    <Content Remove=\"wwwroot\\**\" />\n    <EmbeddedResource Include=\"wwwroot\\**\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Duende.IdentityServer\" Version=\"7.2.2\" />\n    <PackageReference Include=\"Microsoft.AspNetCore.Mvc.NewtonsoftJson\" Version=\"8.0.11\" />\n    <PackageReference Include=\"Microsoft.Extensions.FileProviders.Embedded\" Version=\"8.0.11\" />\n    <PackageReference Include=\"Serilog.AspNetCore\" Version=\"8.0.3\" />\n    <PackageReference Include=\"YamlDotNet\" Version=\"15.3.0\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Program.cs",
    "content": "﻿using Duende.IdentityServer.Hosting;\nusing Microsoft.Extensions.FileProviders;\nusing OpenIdConnectServer;\nusing OpenIdConnectServer.Helpers;\nusing OpenIdConnectServer.JsonConverters;\nusing OpenIdConnectServer.Middlewares;\nusing OpenIdConnectServer.Services;\nusing OpenIdConnectServer.Validation;\nusing Serilog;\nusing Serilog.Events;\nusing Serilog.Sinks.SystemConsole.Themes;\n\nLog.Logger = new LoggerConfiguration()\n    .MinimumLevel.Debug()\n    .MinimumLevel.Override(\"Microsoft\", LogEventLevel.Warning)\n    .MinimumLevel.Override(\"Microsoft.Hosting.Lifetime\", LogEventLevel.Information)\n    .MinimumLevel.Override(\"System\", LogEventLevel.Warning)\n    .MinimumLevel.Override(\"Microsoft.AspNetCore.Authentication\", LogEventLevel.Information)\n    .Enrich.FromLogContext()\n    .WriteTo.Console(outputTemplate: \"[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}\", theme: AnsiConsoleTheme.Code)\n    .CreateLogger();\n\nvar builder = WebApplication.CreateBuilder(args);\n\n// Configure Serilog\nbuilder.Host.UseSerilog();\n\n// Add services to the container.\nbuilder.Services.AddRazorPages();\n\nbuilder.Services\n    .AddControllersWithViews()\n    .AddNewtonsoftJson(options =>\n        {\n            options.SerializerSettings.Converters.Add(new ClaimJsonConverter());\n        });\n\nbuilder.Services\n    .AddIdentityServer(options =>\n        {\n            var configuredOptions = Config.GetServerOptions();\n            MergeHelper.Merge(configuredOptions, options);\n        })\n    .AddDeveloperSigningCredential()\n    .AddInMemoryIdentityResources(Config.GetIdentityResources())\n    .AddInMemoryApiResources(Config.GetApiResources())\n    .AddInMemoryApiScopes(Config.GetApiScopes())\n    .AddInMemoryClients(Config.GetClients())\n    .AddTestUsers(Config.GetUsers())\n    .AddRedirectUriValidator<RedirectUriValidator>()\n    .AddProfileService<ProfileService>()\n    .AddCorsPolicyService<CorsPolicyService>();\n\nvar app = builder.Build();\n\napp.UsePathBase(Config.GetAspNetServicesOptions().BasePath);\n\nvar aspNetServicesOptions = Config.GetAspNetServicesOptions();\nAspNetServicesHelper.ConfigureAspNetServices(builder.Services, aspNetServicesOptions);\nAspNetServicesHelper.UseAspNetServices(app, aspNetServicesOptions);\n\n// Config.ConfigureOptions<IdentityServerHost.Pages.Login.LoginOptions>(\"LOGIN\");\n// Config.ConfigureOptions<IdentityServerHost.Pages.Logout.LogoutOptions>(\"LOGOUT\");\n\napp.UseDeveloperExceptionPage();\n\napp.UseIdentityServer();\n\napp.UseHttpsRedirection();\n\nvar manifestEmbeddedProvider = new ManifestEmbeddedFileProvider(typeof(Program).Assembly, \"wwwroot\");\napp.UseStaticFiles(new StaticFileOptions\n{\n    FileProvider = manifestEmbeddedProvider\n});\n\napp.UseRouting();\napp.UseAuthorization();\napp.MapDefaultControllerRoute();\napp.MapRazorPages();\n\napp.Run();\n"
  },
  {
    "path": "src/Services/CorsPolicyService.cs",
    "content": "using System.Text.RegularExpressions;\nusing Duende.IdentityServer.Services;\n\nnamespace OpenIdConnectServer.Services\n{\n    public class CorsPolicyService : ICorsPolicyService\n    {\n        public Task<bool> IsOriginAllowedAsync(string origin)\n        {\n            var allowedOrigins = Config.GetServerCorsAllowedOrigins();\n            if (allowedOrigins != null && allowedOrigins.Count() > 0)\n            {\n                return Task.FromResult(allowedOrigins.Any(allowedOrigin =>\n                    Regex.Match(origin, Regex.Escape(allowedOrigin).Replace(\"\\\\*\", \"[a-zA-Z0-9.]+?\")).Success));\n            }\n            return Task.FromResult(true);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Services/ProfileService.cs",
    "content": "using Duende.IdentityServer.Extensions;\nusing Duende.IdentityServer.Models;\nusing Duende.IdentityServer.Services;\nusing Duende.IdentityServer.Test;\n\nnamespace OpenIdConnectServer.Services\n{\n    internal class ProfileService : IProfileService\n  {\n    private readonly TestUserStore _userStore;\n    private readonly ILogger Logger;\n\n    public ProfileService(TestUserStore userStore, ILogger<ProfileService> logger)\n    {\n        _userStore = userStore;\n        Logger = logger;\n    }\n\n    public Task GetProfileDataAsync(ProfileDataRequestContext context)\n    {\n        var subjectId = context.Subject.GetSubjectId();\n        Logger.LogDebug(\"Getting profile data for subjectId: {subjectId}\", subjectId);\n        var user = this._userStore.FindBySubjectId(subjectId);\n        if (user != null)\n        {\n            Logger.LogDebug(\"The user was found in store\");\n            var claims = context.FilterClaims(user.Claims);\n            context.AddRequestedClaims(claims);\n        }\n        return Task.CompletedTask;\n    }\n\n    public Task IsActiveAsync(IsActiveContext context)\n    {\n        var subjectId = context.Subject.GetSubjectId();\n        Logger.LogDebug(\"Checking if the user is active for subjectId: {subject}\", subjectId);\n        var user = this._userStore.FindBySubjectId(subjectId);\n        context.IsActive = user?.IsActive ?? false;\n        Logger.LogDebug(\"The user is active: {isActive}\", context.IsActive);\n        return Task.CompletedTask;\n    }\n  }\n}\n"
  },
  {
    "path": "src/Validation/RedirectUriValidator.cs",
    "content": "using Duende.IdentityServer.Models;\nusing Duende.IdentityServer.Validation;\nusing System.Text.RegularExpressions;\n\nnamespace OpenIdConnectServer.Validation\n{\n    internal class RedirectUriValidator : IRedirectUriValidator\n    {\n        protected bool Validate(string requestedUri, ICollection<string> allowedUris) =>\n            allowedUris.Any(allowedUri => Regex.Match(requestedUri, Regex.Escape(allowedUri).Replace(\"\\\\*\", \"[a-zA-Z0-9.]+?\")).Success);\n\n        public Task<bool> IsPostLogoutRedirectUriValidAsync(string requestedUri, Client client)\n        {\n            return Task.FromResult(Validate(requestedUri, client.PostLogoutRedirectUris));\n        }\n\n        public Task<bool> IsRedirectUriValidAsync(string requestedUri, Client client)\n        {\n            return Task.FromResult(Validate(requestedUri, client.RedirectUris));\n        }\n    }\n}\n"
  },
  {
    "path": "src/YamlConverters/ClaimYamlConverter.cs",
    "content": "using System.Security.Claims;\nusing YamlDotNet.Core;\nusing YamlDotNet.Core.Events;\nusing YamlDotNet.Serialization;\n\nnamespace OpenIdConnectServer.YamlConverters\n{\n    public class ClaimYamlConverter : IYamlTypeConverter\n    {\n        public bool Accepts(Type type)\n        {\n            return type == typeof(Claim);\n        }\n\n#nullable enable\n        public void WriteYaml(IEmitter emitter, object? value, Type type)\n        {\n            throw new NotSupportedException();\n        }\n#nullable disable\n\n\n        public object ReadYaml(IParser parser, Type type)\n        {\n            if (parser.Current.GetType() != typeof(MappingStart)) // You could also use parser.Accept<MappingStart>()\n            {\n                throw new InvalidDataException(\"Invalid YAML content.\");\n            }\n            string claimType = \"\", claimValue = \"\", claimValueType = \"\";\n\n            parser.MoveNext(); // move on from the map start\n\n            do\n            {\n                var scalar = parser.Consume<Scalar>();\n                switch (scalar.Value)\n                {\n                    case \"Type\":\n                        claimType = parser.Consume<Scalar>().Value;\n                        break;\n\n                    case \"Value\":\n                        claimValue = parser.Consume<Scalar>().Value;\n                        break;\n\n                    case \"ValueType\":\n                        claimValueType = parser.Consume<Scalar>().Value;\n                        break;\n                }\n            } while (parser.Current.GetType() != typeof(MappingEnd));\n\n            parser.MoveNext(); // skip the mapping end (or crash)\n\n            if (string.IsNullOrEmpty(claimType)) throw new InvalidDataException(\"Type is required property of Claim\");\n            if (string.IsNullOrEmpty(claimValue)) throw new InvalidDataException(\"Value is required property of Claim\");\n            if (string.IsNullOrEmpty(claimValueType)) claimValueType = ClaimValueTypes.String;\n            return new Claim(claimType, claimValue, claimValueType);\n        }\n\n    }\n}\n"
  },
  {
    "path": "src/YamlConverters/SecretYamlConverter.cs",
    "content": "using Duende.IdentityServer.Models;\nusing YamlDotNet.Core;\nusing YamlDotNet.Core.Events;\nusing YamlDotNet.Serialization;\n\nnamespace OpenIdConnectServer.YamlConverters\n{\n    public class SecretYamlConverter : IYamlTypeConverter //<Claim>\n    {\n        public bool Accepts(Type type)\n        {\n            return type == typeof(Secret);\n        }\n\n        public void WriteYaml(IEmitter emitter, object value, Type type)\n        {\n            throw new NotSupportedException();\n        }\n\n        public object ReadYaml(IParser parser, Type type)\n        {\n            string s = parser.Consume<Scalar>().Value;\n            return new Secret(s.Sha256());\n        }\n    }\n}\n"
  },
  {
    "path": "src/getui.sh",
    "content": "#!/usr/bin/env bash\n\nset -e\n\nTAG=\"6.3.0\"\n\ngit clone -n --depth=1 --filter=tree:0 \\\n  -b is-7.2.2 --single-branch \\\n  https://github.com/DuendeSoftware/products\ncd products\ngit sparse-checkout set --no-cone /identity-server/hosts/main\ngit checkout\n\ncd -\n\n[[ -d Pages ]] || mkdir Pages\n[[ -d wwwroot ]] || mkdir wwwroot\n\ncp -r ./products/identity-server/hosts/main/Pages/* Pages\ncp -r ./products/identity-server/hosts/main/wwwroot/* wwwroot\n\nrm -rf products\n"
  },
  {
    "path": "src/tempkey.rsa",
    "content": "{\"KeyId\":\"73239b28fa5e71f10e0f478fb4d25d01\",\"Parameters\":{\"D\":\"prsrSaYh19e1aP81scihMxY2ibjG61GZd53on0LbRm21vwAlhzNcY9BAx8Y9xEFpNIqAhO6R2VLqD+PSPvO+y7IojXemeDcmEoLJQKuzGvVQfxBmDYQ3GUChs7F4hkTqnVs32VXHF08ValDBd/1/nmgSi0fsvFx71kcArp7Qx61yUmoaN+nLEzE8csQjipFzlXcH/yHMdIWooP2rqPVP5cLv7WIcIvDVZNiAwEVSY1KiGARHNsWbEm5HtJTK66I15Zp0dZp4oVXVZJIZye78Pjo5X0vmGm7F/x+cc6WTHsFtDUP31NPxv7b5umqnoUYxUyM1wdYy6TYmghXh59TNnQ==\",\"DP\":\"5lfdYu8v+rINrLorfha7fdglzjk9OOT30kniQbnsds0EYgs8IeyPPf1GAmJKPyOobcDM+kWQKlvvgCPdk9IgsDRgmZycdVwKggtQpQzkJrIOcJe3h8L+hPLSlcXE5yTY3+qXn+mmloDSale5G4fd3M/dhAe5dAugJDCsLC16EM0=\",\"DQ\":\"000qbMhWiCYORQ8wZIT7g/rDxcswx6GxmcBr7k6TSYISWynlqPctytGm0tQZZoiFXXtvhlMDCFas2pRbST3FZSKMgccjuBu0in29y/xrpbL70zQSHEmvQNKhWS6lwlLN17jlGEFGQpakpKuT6Qdx6dhfvWE2QQyxEdD2TQwr+QU=\",\"Exponent\":\"AQAB\",\"InverseQ\":\"kPvqNF07ozNcO/y+gA6kOj03ExEWmNUKjNvqMrmydsY2XBBaqEbZcj+GC2J3jGljPzJsG3dNLl4p01zR8prwk5nkaIgBZWzbBp/J68c1tw+hD/NQJiIEFgnI4t7Jwr235J8bKVFgl0gqdVYLxdNIrOQVRwrBAXhFR4YRs8tQ1Ww=\",\"Modulus\":\"zAD8Egjll/WgBekLAI+MvPm0JnsI7HMrKzK8E2IBKaq5+HeVZY/mzIiUWnDoI4RHAyrXzqJBZDkornUxJoRtSwbvpdeOZvJk9XS3kLh3Ior5LAl82jNrgDw8G4aG/4sUnWx3EUkOMf5Zi1hCr56c2brO4Pqh/rcjgotVjfhg9Sne4v86+NaaUCDuGXbfS7cJtquSva2Lk63R/FwFcj2RBXTojRbpiCRKDJoESrBnlPNJBYmySFzEmN1B95VfIZQ9s7fwUC6tWr5G6QDDpwBa+JnCaHC6GyYKskfAkzF9+dFXGghpXPjOnp/bXqZRyibVWUQBA29ugmATGyRS/zANSQ==\",\"P\":\"6LnaI7YJVlHy2FoT+IaqBY4twiEeHvc7xbEaDcxK3Kb4LJRKR4/8ABS6PxlxN73KSNPVIuPaxn+b1e1ApuR+hXZclElN6+fo0Wnl1+ib+9NIGVh9uINuQoNre+agRFyqixuJnKlJjqrL7OAV7KJKIrSO4dhRoWmGXXl0OwwwJEc=\",\"Q\":\"4GfNELaLgXEjTK1tYF+2fmMuBmrf2EBsCiFtQZjgYYbudQ2m2osIqXP44h5Vlbmb4bQBPDiOntvnvsInkO0E9x0jGvz+k/9KBofjKtARRCty4Rf94KMQmImatgRLG3ko8F8rI+TQM35/zVtXubCLdY0gycisyJBw1M5+OGmS2e8=\"}}"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \"./\",\n    \"esModuleInterop\": true,\n    \"module\": \"commonjs\",\n    \"moduleResolution\": \"node\",\n    \"outDir\": \"./dist\",\n    \"resolveJsonModule\": true,\n    \"rootDir\": \".\",\n    \"target\": \"ES2022\"\n  },\n  \"include\": [\"e2e/**/*.ts\"],\n  \"exclude\": [\"e2e/node_modules/**/*\", \"e2e/dist/**/*\"]\n}\n"
  }
]