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

feat: add organization as an optional parameter in Azure DevOps connection form #7459

Merged
merged 6 commits into from
May 17, 2024

Conversation

mr-ks
Copy link
Contributor

@mr-ks mr-ks commented May 12, 2024

Summary

Users can now create an Azure DevOps connection using a PAT that is limited to a single organization. This means users are not required to use PATs with access to all their organizations. Currently, this feature is only applicable to the Azure DevOps Go plugin. Once confirmed that everything works as intended, it should be moderate effort to also integrate it into the python version and the new onboarding screens.

Does this close any open issues?

Closes #7243

Screenshots

The Azure DevOps Go connection form now includes a new section called Personal Access Token Scope, where users can choose whether the PAT is scoped or unscoped.

  • Unscoped: The plugin attempts to retrieve all organizations initially, allowing the user to then select projects. The PAT must be created with the All accessible organizations option.
  • Scoped: The user can set up a connection to a specific Azure DevOps organization, from which the plugin will read the data.

image

image

Other Information

The following endpoints are called to check if the connection is working (test connection button)

  • Unscoped: GET /_apis/profile/profiles/me
  • Scoped: GET /<organization>/_apis/projects

mr-ks added 4 commits May 11, 2024 19:22
…ction creation.

Users can now create an Azure DevOps connection using a PAT that is limited to a single organization. This means users are not required to use PATs with access to all their organizations.
…ction creation.

Users can now create an Azure DevOps connection using a PAT that is limited to a single organization. This means users are not required to use PATs with access to all their organizations.
The test case was incorrect. When an invalid PAT is provided, the Azure DevOps API redirects the user to the login page. Go's HTTP client automatically follows the redirect when it receives a 302 status code. To circumvent this, I made adjustments to the test case.
klesh
klesh previously approved these changes May 15, 2024
Copy link
Contributor

@klesh klesh left a comment

Choose a reason for hiding this comment

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

LGTM overall, minor suggestions are optional. You are free to merge it, let me know if you can't see the button.

backend/plugins/azuredevops_go/api/connection_api.go Outdated Show resolved Hide resolved
@mr-ks mr-ks merged commit 466db44 into apache:main May 17, 2024
11 checks passed
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.

[Feature][Azure DevOps] Support PATs with the scope less than ALL ACCESSIBLE ORGANIZATIONS
2 participants