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 issue where ecdsa and other key types are not synced from LDAP (#5092) #5094

Merged
merged 12 commits into from
Oct 31, 2018
Merged

Fix issue where ecdsa and other key types are not synced from LDAP (#5092) #5094

merged 12 commits into from
Oct 31, 2018

Conversation

xor-gate
Copy link
Contributor

@xor-gate xor-gate commented Oct 17, 2018

Implements #5092

Currently LDAP sync support only ssh prefixed keytypes, so other keytypes are simply ignored. This PR improves the check by using the native parsing of the public authorized key line. I tried to find out to add a test ecdsa key but not sure where to place it.

I think this are only the calculated fingerprints:

https://github.com/go-gitea/gitea/blob/master/integrations/auth_ldap_test.go#L43-L46

Based on this

https://github.com/go-gitea/gitea/blob/master/integrations/api_admin_test.go
or this
https://github.com/go-gitea/gitea/blob/master/integrations/api_keys_test.go

I would like some advice on the test, as it is highly valuable.

@codecov-io
Copy link

codecov-io commented Oct 17, 2018

Codecov Report

Merging #5094 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5094      +/-   ##
=========================================
+ Coverage   37.48%   37.5%   +0.01%     
=========================================
  Files         310     310              
  Lines       45922   45923       +1     
=========================================
+ Hits        17215   17223       +8     
+ Misses      26233   26229       -4     
+ Partials     2474    2471       -3
Impacted Files Coverage Δ
models/user.go 44.64% <100%> (-0.24%) ⬇️
models/repo_list.go 64.55% <0%> (+1.26%) ⬆️
models/repo_indexer.go 47.88% <0%> (+3.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b686bd0...b7fadfd. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 17, 2018
@bkcsoft bkcsoft added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Oct 17, 2018
@xor-gate
Copy link
Contributor Author

Could somebody help me out how to test this case?

@lunny
Copy link
Member

lunny commented Oct 17, 2018

@xor-gate drone CI has LDAP service by @lafriks, maybe you can test with it.

@xor-gate
Copy link
Contributor Author

Yes I understand, I had a look at the CI some time ago. We should add at least an ecdsa key to the LDAP server test image then. At here https://github.com/go-gitea/test-openldap/blob/master/bootstrap/data/10_people_hermes.ldif#L24

@xor-gate
Copy link
Contributor Author

I have added an ecdsa key to the test-openldap image as PR.

@lafriks
Copy link
Member

lafriks commented Oct 17, 2018

@xor-gate feel free to submit PR to add key to that test ldap server

@techknowlogick techknowlogick added the type/enhancement An improvement of existing functionality label Oct 23, 2018
@xor-gate
Copy link
Contributor Author

I updated the PR with the latest changes from master e2292c7 seems master has broken CI build: https://drone.gitea.io/go-gitea/gitea/3652/10

@lafriks
Copy link
Member

lafriks commented Oct 30, 2018

@xor-gate you need to update tests as more ssh keys are now returned from ldap in test TestLDAPUserSSHKeySync

@xor-gate
Copy link
Contributor Author

@lafriks finaly the ldap integration test passes now horay 👍 gives me more trust with the added test key

@bkcsoft bkcsoft added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 31, 2018
@techknowlogick techknowlogick merged commit 22ad514 into go-gitea:master Oct 31, 2018
@xor-gate xor-gate deleted the feature/issue-5092 branch October 31, 2018 00:25
@lunny lunny added this to the 1.7.0 milestone Oct 31, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants