Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

add support for mutual TLS authentication (client certificates) #794

Merged
merged 1 commit into from
Jul 21, 2021

Conversation

hexagonal-sun
Copy link
Contributor

Description

This PR implements mutual TLS auth. Two new options have been created client_cert and client_key. These allow the respective PEM files to be passed to glab which then allows us to use it for mutual TLS auth.

(Apologies for any obvious errors here, I've never coded in go before!)

Related Issue
N/A

How Has This Been Tested?
I've ran this against my local gitlab instance and it works fine.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)

@codecov
Copy link

codecov bot commented Jul 20, 2021

Codecov Report

Merging #794 (6ac7680) into trunk (f7c7d6e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##            trunk     #794   +/-   ##
=======================================
  Coverage   59.41%   59.41%           
=======================================
  Files          93       93           
  Lines        7341     7341           
=======================================
  Hits         4362     4362           
  Misses       2599     2599           
  Partials      380      380           

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 f7c7d6e...6ac7680. Read the comment docs.

Copy link
Owner

@profclems profclems left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @hexagonal-sun.

This looks good except that it's not gofmt'ed.

api/client.go Outdated Show resolved Hide resolved
Add options that allow client certificate and key file paths to be set.
This allows us to implement mutual TLS auth.
@hexagonal-sun
Copy link
Contributor Author

@profclems Oops, sorry, I missed the gofmt step. That should now be fixed.

Copy link
Owner

@profclems profclems left a comment

Choose a reason for hiding this comment

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

Great! Looks good...

Thanks fir working on this @hexagonal-sun

@profclems profclems merged commit 0fb95ea into profclems:trunk Jul 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants