hashicorp / hashicorp/consul

Implementation of hostname conformance in peering connections is incorrect.

Open
#18,261 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
2d 6h
Merged PRs (30d)
43

Description

#### Overview of the Issue

The dialog box that appears when creating a new peering token says the following:

```
Must be a valid DNS hostname. Must contain 1-64 characters (numbers, letters, and hyphens), and must begin with a letter. Once created, this cannot be changed.
```

Note that it enforces no constraints on the ending character. This is in-line (sort-of) with the description of a valid hostname as per RFC952 and its subsequent errata. When attempting to submit the new peer, a new error shows up with additional constraints:

```
consul-example1 is not a valid peer name: a valid peering name must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character.
```

---

#### Reproduction Steps

Attempt to create a consul peering token with a hostname that ends with a number.

### Consul info for both Client and Server

Verified on v1.16.0 on Debian amd64.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.