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

Populate sso-session and services sections when loading config files #993

Merged

Conversation

trivikr
Copy link
Contributor

@trivikr trivikr commented Oct 6, 2023

Issue #, if available:
Fixes: #991

Description of changes:
Populate sso-session and services sections when loading config files

  • Adds enum IniSectionType in @smithy/types
  • Populates sections in parseIni by using CONFIG_PREFIX_SEPARATOR between prefix and config name.
  • Replaces redundant utility getProfileData with getConfigData

Tested with relative import from bug report in #991

Code:

// ...
import { loadSharedConfigFiles } from "../smithy-typescript/packages/shared-ini-file-loader/dist-cjs/index.js";
// ...

sso-session:

{
  "configFile": {
    "profile-with-sso-session": {
      "sso_session": "my-sso",
      "sso_account_id": "111122223333",
      "sso_role_name": "SampleRole"
    },
    "sso-session.my-sso": {
      "sso_region": "us-east-1",
      "sso_start_url": "https://my-sso-portal.awsapps.com/start"
    }
  },
  "credentialsFile": {}
}

services:

{
  "configFile": {
    "profile-with-services": {
      "services": "my-services",
      "endpoint_url": "http://localhost:5567"
    },
    "services.my-services": {
      "s3.endpoint_url": "https://localhost:1234"
    }
  },
  "credentialsFile": {}
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr force-pushed the populate-non-profiles-in-shared-config branch from f69d353 to 74424fd Compare October 6, 2023 18:48
@trivikr trivikr force-pushed the populate-non-profiles-in-shared-config branch from 74424fd to 647ef1b Compare October 6, 2023 18:51
@trivikr trivikr force-pushed the populate-non-profiles-in-shared-config branch from 2fa918e to 65d3abc Compare October 6, 2023 19:19
@trivikr trivikr force-pushed the populate-non-profiles-in-shared-config branch from 65d3abc to 52dbe3f Compare October 6, 2023 19:21
@trivikr trivikr marked this pull request as ready for review October 6, 2023 19:59
@trivikr trivikr requested review from a team as code owners October 6, 2023 19:59
@trivikr trivikr merged commit d6b4c09 into smithy-lang:main Oct 6, 2023
@trivikr trivikr deleted the populate-non-profiles-in-shared-config branch October 6, 2023 21:48
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.

Load sso-session and services sections of config files in loadSharedConfigFiles
3 participants