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 credential method to access GitHub with Personal Access Token #813

Merged
merged 5 commits into from Mar 3, 2023

Conversation

taiga-nada
Copy link
Contributor

@taiga-nada taiga-nada commented Feb 27, 2023

Motivation:

It'd be nice if a user can use GitHub Personal Access Token (PAT) to mirror a GitHub repository.

Modifications:

  • Added AccessTokenMirrorCredential to access a GitHub repository with PAT.
  • Added documentation.

Result:

@CLAassistant
Copy link

CLAassistant commented Feb 27, 2023

CLA assistant check
All committers have signed the CLA.

@taiga-nada taiga-nada changed the title add credential for access token. Add credential method to access GitHub with Personal Access Token Feb 27, 2023
@codecov
Copy link

codecov bot commented Feb 27, 2023

Codecov Report

Patch coverage: 30.00% and project coverage change: -0.08 ⚠️

Comparison is base (30d0128) 65.74% compared to head (4afa19b) 65.66%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #813      +/-   ##
============================================
- Coverage     65.74%   65.66%   -0.08%     
+ Complexity     3291     3289       -2     
============================================
  Files           350      351       +1     
  Lines         13731    13751      +20     
  Branches       1488     1491       +3     
============================================
+ Hits           9027     9030       +3     
- Misses         3862     3872      +10     
- Partials        842      849       +7     
Impacted Files Coverage Δ
...ntraldogma/server/internal/mirror/GitWithAuth.java 56.89% <0.00%> (-2.04%) ⬇️
...p/centraldogma/server/mirror/MirrorCredential.java 100.00% <ø> (ø)
...mirror/credential/AccessTokenMirrorCredential.java 37.50% <37.50%> (ø)
...aldogma/client/armeria/CompositeEndpointGroup.java 75.00% <0.00%> (-18.75%) ⬇️
...ient/armeria/legacy/LegacyCentralDogmaBuilder.java 81.48% <0.00%> (-3.71%) ⬇️
...r/internal/admin/auth/FileBasedSessionManager.java 76.25% <0.00%> (-1.44%) ⬇️
...al/storage/repository/cache/CachingRepository.java 94.53% <0.00%> (-0.79%) ⬇️
...raldogma/server/internal/api/ContentServiceV1.java 85.82% <0.00%> (-0.75%) ⬇️
...centraldogma/server/internal/api/WatchService.java 76.27% <0.00%> (ø)
.../linecorp/centraldogma/client/AbstractWatcher.java 80.00% <0.00%> (+2.00%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@trustin trustin added this to the 0.60.2 milestone Feb 27, 2023
Copy link
Collaborator

@trustin trustin left a comment

Choose a reason for hiding this comment

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

So far so good! Could you continue to:

  • Add documentation; and
  • Update GitMirrorAuthTest so we can test access-token-based authentication manually? (I already gave you the read permission to the private test repository.)

@trustin
Copy link
Collaborator

trustin commented Mar 2, 2023

@taiga-nada will send a follow-up PR that updates GitMirrorAuthTest that tests access-token-based authentication. This PR will be ready for review after adding documentation.

@taiga-nada
Copy link
Contributor Author

I updated documentations.

@taiga-nada taiga-nada marked this pull request as ready for review March 2, 2023 12:26
Copy link
Collaborator

@trustin trustin left a comment

Choose a reason for hiding this comment

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

🚀🚀🚀 (Build failure will be fixed once you merge the latest master)

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Thanks, @taiga-nada! 🚀💯 LGTM if CI builds pass.

site/src/sphinx/mirroring.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks 🙇 👍 🚀

@trustin trustin added this pull request to the merge queue Mar 3, 2023
Merged via the queue into line:master with commit 6f13d12 Mar 3, 2023
8 of 9 checks passed
trustin pushed a commit that referenced this pull request Mar 13, 2023
…t` (#820)

Motivation:

We want to verify access token credential using [GitHub Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).

Modifications:

- Added test codes for GitHub Personal Access Token into `GitMirrorAuthTest`

Related:

- We can do auth test with access token (relates to: #813)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use github access token for git mirroring
5 participants