Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Upgraded Altinn.ApiClients.Maskinporten, specify TokenExchangeEnvironment #1328

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

knuhau
Copy link
Collaborator

@knuhau knuhau commented Oct 22, 2024

Upgraded Altinn.ApiClients.Maskinporten, specify TokenExchangeEnvironment under Maskinporten in appsettings

Description

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • Documentation is updated (either in docs-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)

Summary by CodeRabbit

  • New Features

    • Introduced a new configuration property, TokenExchangeEnvironment, across multiple environment settings (development, production, staging, test, and yt01) for enhanced token exchange configuration.
  • Updates

    • Updated the version of the Altinn.ApiClients.Maskinporten package to 9.2.1.

@knuhau knuhau requested a review from a team as a code owner October 22, 2024 10:43
Copy link
Contributor

coderabbitai bot commented Oct 22, 2024

📝 Walkthrough

Walkthrough

This pull request includes updates to the project configuration and settings files for the Digdir.Domain.Dialogporten application. It modifies the version of the Altinn.ApiClients.Maskinporten package in the project file and introduces a new configuration property, TokenExchangeEnvironment, across multiple environment-specific JSON files. The new property specifies the environment for token exchange and has been added to the development, production, staging, test, and yt01 configuration files.

Changes

File Change Summary
src/Digdir.Domain.Dialogporten.Infrastructure/Digdir.Domain.Dialogporten.Infrastructure.csproj Updated Altinn.ApiClients.Maskinporten package version from 9.1.0 to 9.2.1.
src/Digdir.Domain.Dialogporten.WebApi/appsettings.Development.json Added "TokenExchangeEnvironment": "tt02" in the "Maskinporten" section.
src/Digdir.Domain.Dialogporten.WebApi/appsettings.prod.json Added "TokenExchangeEnvironment": "prod" in the "Maskinporten" section.
src/Digdir.Domain.Dialogporten.WebApi/appsettings.staging.json Added "TokenExchangeEnvironment": "tt02" in the "Maskinporten" section.
src/Digdir.Domain.Dialogporten.WebApi/appsettings.test.json Added "TokenExchangeEnvironment": "tt02" in the "Maskinporten" section.
src/Digdir.Domain.Dialogporten.WebApi/appsettings.yt01.json Added "TokenExchangeEnvironment": "yt01" in the "Maskinporten" section.

Possibly related PRs

  • chore(deps): update FusionCache #1177: This PR updates the version of the ZiggyCreatures.FusionCache package in the same project file (Digdir.Domain.Dialogporten.Infrastructure.csproj), indicating a related change in package dependencies.
  • chore(applications): add appsettings for yt01 #1312: This PR introduces new appsettings files for the yt01 environment, which may relate to the configuration changes in the main PR regarding the Maskinporten settings in the appsettings files.

Suggested reviewers

  • oskogstad
  • arealmaas

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@knuhau knuhau merged commit 5156799 into main Oct 22, 2024
23 of 24 checks passed
@knuhau knuhau deleted the fix/token-exchange-environment branch October 22, 2024 10:47
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
src/Digdir.Domain.Dialogporten.WebApi/appsettings.yt01.json (1)

19-20: LGTM! Consider adding a comment for clarity.

The addition of the TokenExchangeEnvironment property is correct and aligns with the PR objectives. The value "yt01" is consistent with the file name, which is good.

Consider adding a brief comment above the TokenExchangeEnvironment property to explain its purpose and potential values. For example:

"Maskinporten": {
  // ... other properties ...
  "EncodedJwk": "TODO: Add to local secrets",
  // Specifies the environment for token exchange (e.g., "yt01", "tt02", "prod")
  "TokenExchangeEnvironment": "yt01"
}

This would improve the maintainability and clarity of the configuration file.

🧰 Tools
🪛 Biome

[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ec7e049 and 62365fa.

📒 Files selected for processing (6)
  • src/Digdir.Domain.Dialogporten.Infrastructure/Digdir.Domain.Dialogporten.Infrastructure.csproj (1 hunks)
  • src/Digdir.Domain.Dialogporten.WebApi/appsettings.Development.json (1 hunks)
  • src/Digdir.Domain.Dialogporten.WebApi/appsettings.prod.json (1 hunks)
  • src/Digdir.Domain.Dialogporten.WebApi/appsettings.staging.json (1 hunks)
  • src/Digdir.Domain.Dialogporten.WebApi/appsettings.test.json (1 hunks)
  • src/Digdir.Domain.Dialogporten.WebApi/appsettings.yt01.json (2 hunks)
🧰 Additional context used
🪛 Biome
src/Digdir.Domain.Dialogporten.WebApi/appsettings.Development.json

[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/Digdir.Domain.Dialogporten.WebApi/appsettings.prod.json

[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/Digdir.Domain.Dialogporten.WebApi/appsettings.staging.json

[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/Digdir.Domain.Dialogporten.WebApi/appsettings.test.json

[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/Digdir.Domain.Dialogporten.WebApi/appsettings.yt01.json

[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

🔇 Additional comments (5)
src/Digdir.Domain.Dialogporten.WebApi/appsettings.prod.json (1)

19-20: LGTM: TokenExchangeEnvironment correctly specified for production.

The addition of the "TokenExchangeEnvironment" property with the value "prod" in the Maskinporten section is appropriate for the production environment. This change aligns with the PR objectives and is consistent with the updates mentioned in the summary.

To ensure consistency across all environment files, please run the following script:

✅ Verification successful

[/run_scripts]


Verified: TokenExchangeEnvironment correctly configured across all environments.

All appsettings files have the "TokenExchangeEnvironment" property set correctly for their respective environments.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify TokenExchangeEnvironment across all appsettings files

# Test: Check TokenExchangeEnvironment in all appsettings files
echo "Checking TokenExchangeEnvironment in appsettings files:"
rg -A 1 '"Maskinporten"' src/Digdir.Domain.Dialogporten.WebApi/appsettings*.json

# Expected output:
# prod.json: "TokenExchangeEnvironment": "prod"
# Development.json: "TokenExchangeEnvironment": "tt02"
# staging.json: "TokenExchangeEnvironment": "tt02"
# test.json: "TokenExchangeEnvironment": "tt02"
# yt01.json: "TokenExchangeEnvironment": "yt01"

Length of output: 2739


Script:

#!/bin/bash
# Description: Verify the presence and values of TokenExchangeEnvironment in all appsettings files

echo "Verifying TokenExchangeEnvironment in appsettings files:"
fd "appsettings.*.json" src/Digdir.Domain.Dialogporten.WebApi/ | xargs grep -H '"TokenExchangeEnvironment"'

Length of output: 747

🧰 Tools
🪛 Biome

[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/Digdir.Domain.Dialogporten.WebApi/appsettings.staging.json (1)

22-23: LGTM: TokenExchangeEnvironment added as specified.

The addition of "TokenExchangeEnvironment": "tt02" in the Maskinporten section aligns with the PR objectives. The value "tt02" is appropriate for the staging environment.

Let's verify the consistency of this configuration across different environment files:

✅ Verification successful

Verified: TokenExchangeEnvironment is consistently set across all environment files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check TokenExchangeEnvironment across different environment files

# Test: Verify TokenExchangeEnvironment in different appsettings files
echo "Checking TokenExchangeEnvironment in different appsettings files:"
fd appsettings.*json$ --exec grep -H '"TokenExchangeEnvironment"' {} \;

Length of output: 744

🧰 Tools
🪛 Biome

[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/Digdir.Domain.Dialogporten.WebApi/appsettings.test.json (1)

22-23: LGTM: New TokenExchangeEnvironment configuration added.

The addition of the "TokenExchangeEnvironment" configuration with the value "tt02" aligns with the PR objectives and is appropriate for the test environment.

To ensure consistency across different environment configurations, please run the following script:

Remember to replace the "TODO" placeholders in this file with actual values using a secure method, such as local secrets or a secure key management system.

✅ Verification successful

Verified: TokenExchangeEnvironment is consistently set across all appsettings files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify TokenExchangeEnvironment values across different appsettings files

# Test: Check TokenExchangeEnvironment values in all appsettings files
echo "TokenExchangeEnvironment values in appsettings files:"
rg -g 'appsettings*.json' '"TokenExchangeEnvironment"' src/Digdir.Domain.Dialogporten.WebApi/

Length of output: 727

🧰 Tools
🪛 Biome

[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/Digdir.Domain.Dialogporten.Infrastructure/Digdir.Domain.Dialogporten.Infrastructure.csproj (1)

4-4: LGTM: Package version update looks good.

The update of Altinn.ApiClients.Maskinporten from version 9.1.0 to 9.2.1 aligns with the PR objectives. This change is likely to bring improvements or bug fixes.

To ensure this update doesn't introduce any conflicts, please run the following verification script:

Additionally, as mentioned in the PR objectives, please ensure that manual testing has been conducted to verify the functionality with the updated package.

src/Digdir.Domain.Dialogporten.WebApi/appsettings.Development.json (1)

22-23: LGTM! Consider documenting the new configuration.

The addition of "TokenExchangeEnvironment": "tt02" aligns with the PR objectives to specify the TokenExchangeEnvironment. This change looks good and should improve the integration with Maskinporten.

To ensure consistency across environments, please run the following script:

Consider adding a comment or updating the documentation to explain the purpose of TokenExchangeEnvironment and its possible values (e.g., "tt02", "yt01", "prod"). This will help other developers understand the configuration's impact.

As mentioned in the PR objectives, documentation updates are pending. Would you like assistance in drafting documentation for this new configuration option?

✅ Verification successful

TokenExchangeEnvironment configuration verified and consistent across all environments.

All environments have the correct TokenExchangeEnvironment values:

  • Development: tt02
  • Test: tt02
  • Staging: tt02
  • yt01: yt01
  • Production: prod

This ensures proper configuration alignment as per the PR objectives.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify TokenExchangeEnvironment values across different environment configurations

# Test: Check TokenExchangeEnvironment values in all appsettings files
echo "TokenExchangeEnvironment values in different environments:"
rg -g 'appsettings*.json' '"TokenExchangeEnvironment":\s*"([^"]*)"' -o -r '$1'

Length of output: 542

🧰 Tools
🪛 Biome

[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 22-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

oskogstad pushed a commit that referenced this pull request Oct 22, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.26.0](v1.25.0...v1.26.0)
(2024-10-22)


### Features

* Add masstransit outbox system
([#1277](#1277))
([bc04860](bc04860))


### Bug Fixes

* **infrastructure:** use correct networking for servicebus
([#1320](#1320))
([4fb42bb](4fb42bb))
* Return distinct actions in GetAlinnActions
([#1298](#1298))
([49948b2](49948b2))
* Upgraded Altinn.ApiClients.Maskinporten, specify
TokenExchangeEnvironment
([#1328](#1328))
([5156799](5156799))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants