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

Add initial version of login to Octopus with OIDC or API keys #3

Merged
merged 43 commits into from Aug 23, 2023

Conversation

geofflamrock
Copy link
Collaborator

@geofflamrock geofflamrock commented Aug 9, 2023

This PR adds initial support for the OctopusDeploy/login action for:

  • OpenID Connect
  • API Key

It includes some additional steps to the test-login workflow, that perform a login to our internal test instance using OIDC and API key.

[sc-54889]

@geofflamrock geofflamrock changed the title Wip login to octopus Add initial version of login to Octopus with OIDC or API keys Aug 11, 2023
"plugin:prettier/recommended",
],
ignorePatterns: ["node_modules/", ".eslintrc.js", "esbuild.js", "esbuild.mjs", "dist/", "bin/", "rollup.config.js", "step-package.config.js", "jest.config.js"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:jest/recommended", "plugin:prettier/recommended"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Have adjusted the eslint config to match up more closely to what we use elsewhere in the Octopus portal. It's not 100% the same, but much closer.

"jest": "29.6.2",
"jest-expect-message": "1.1.3",
"jest-extended": "4.0.1",
"jest-runner-eslint": "2.1.0",
"msw": "0.49.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This isn't the current version of msw, unfotunately there is an issue in versions after this where some of the imports in node just plain don't compile. Using this version also means we need to use typescript 4 not 5, which is a bummer but doesn't really impact us that much.

},
"dependencies": {
"@actions/core": "1.10.0"
"@actions/core": "1.10.0",
"node-fetch": "2.6.12"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This also isn't the current version of node-fetch, the latest version has a bunch of issues when used with jest because it uses ESM, which jest doesn't handle all that well. I tried a bunch of workarounds I found with no luck, so have just gone with an older version for the moment.

@geofflamrock geofflamrock marked this pull request as ready for review August 11, 2023 04:30
@geofflamrock geofflamrock requested a review from a team as a code owner August 11, 2023 04:30
@changeset-bot
Copy link

changeset-bot bot commented Aug 15, 2023

🦋 Changeset detected

Latest commit: b48e7f1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@octopusdeploy/login Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@geofflamrock geofflamrock linked an issue Aug 22, 2023 that may be closed by this pull request
@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #54889: Create octopusdeploy/login GitHub Action.

README.md Outdated

- Create a service account in Octopus with the permissions required.
- Configure an OIDC identity that matches the GitHub Actions subject claim for your repository and workflow. See the [GitHub documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#defining-trust-conditions-on-cloud-roles-using-oidc-claims) for examples of the subject claim.
- Copy the `Service Account Id` value from the Octopus service account. This will be a guid.

Choose a reason for hiding this comment

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

guid -> GUID if you are feeling it 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had to push up a merge conflict fix anyway, so I've done this 😄

Copy link

@dylanlerch dylanlerch left a comment

Choose a reason for hiding this comment

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

I really have to hype myself up to review JavaScript. Looks good though. Just one petty comment about capitalisation.

@geofflamrock geofflamrock merged commit e635f8e into main Aug 23, 2023
3 checks passed
@geofflamrock geofflamrock deleted the geoffl/add-login branch August 23, 2023 02:47
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.

Create OctopusDeploy/login GitHub Action
2 participants