hashicorp / hashicorp/consul

Reduce Duplication in TLSUtils and Connect.go Packages.

Open
#9,603 1 comment 0 reactions 0 assignees View on GitHub
needs-discussion theme/certificates theme/internal-cleanup type/enhancement
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

#### Feature Description

[`./tlsutils/generate.go`](https://github.com/hashicorp/consul/blob/master/tlsutil/generate.go) shares code with [`agent/connect/generate.go`](https://github.com/hashicorp/consul/blob/master/agent/connect/generate.go) where they are both doing similar things. The Connect generate.go file says that the connect based ParseSigner should be the function used, rather than TLSUtils. This ticket is to track if [this comment](https://github.com/hashicorp/consul/blob/master/agent/connect/generate.go#L97-L98).

Potential solution:
TLSUtils holds all TLS based functions. Connect references the TLSUtils and we remove this comment.
Deprecate TLSUtils and move all cert logic to Connect generation. Update references from TLSUtils to point to connect methods.

This arose from #7623 and #8898 changes

#### Use Case(s)

Clean Code.

Contributor guide

Open the contributing guide

Research direction

Compare tlsutil/generate.go with agent/connect/generate.go, starting at the Connect ParseSigner comment referenced in the issue. Determine which of the two proposed ownership directions is intended before changing references. Done means the duplicated TLS certificate logic and outdated comment are resolved consistently across both packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
security
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.