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

Allow hostnames to have dot and dash #56

Closed
wants to merge 1 commit into from

Conversation

zpieslak
Copy link
Contributor

@zpieslak zpieslak commented Jan 25, 2018

Why This Change Is Necessary

Previously keys that were namespaced with hostnames with dashes or
dots in their names were ignored and merged into __default namespace.

  • Bug Fix

It allows to use keys with hostanames with dots or dashes.

Previously keys that were namespaced with hostnames with dashes or
dots in their names were ignored and merged into __default namespace.
@jfelchner
Copy link
Collaborator

@zpieslak thank you for the PR! I'm going to have to think on this one as dots and dashes are considered "special" in delimiting possible future information I might want to put in the key filename. For example, I just added per-environment key pairs.

What about if, instead of allowing them in the filename, I stripped them from the host name? So instead of example-host.com it would be examplehostcom?

@zpieslak
Copy link
Contributor Author

@jfelchner My current situation is that I have a host, which consists multiple environments with very similar credentials. Obviously I can create multiple settings-environment.yml files but this will require multiple key-pairs and duplicate all credentials that suppose to be common for this host. I wanted to avoid that.

So If understand your idea correctly, the host will still be allowed to have dots and dashes, but the filename will need to be stripped (i.e when calling Socket.gethostname, it will still return example-host.com, but when creating a filename I will need to create a settings-examplehostcom.yml) ? If yes, that would work for me.

Thanks!

@jfelchner jfelchner force-pushed the master branch 2 times, most recently from a8271bb to bc074c8 Compare May 29, 2019 19:43
jfelchner pushed a commit that referenced this pull request May 29, 2019
Why This Change Is Necessary
========================================================================

Previously dots and dashes were not removed from the hostname, which
caused an issue where the namespaced filenames were not accurate.  We
consider dots and dashes to be special characters in Chamber filenames
and cannot have them used within namespaces.

How These Changes Address the Issue
========================================================================

This change removes dots and dashes from the hostname we've looked up.

Side Effects Caused By This Change
========================================================================

Anyone relying on the erroneous functionality will break.

------------------------------------------------------------------------
Actions:
  * References #56
@jfelchner
Copy link
Collaborator

@zpieslak Merged in 1800590 and I gave you credit for the commit. ❤

Thanks!

@jfelchner jfelchner closed this May 29, 2019
@jfelchner
Copy link
Collaborator

As soon as I released 2.12.4 I realized that this was a backwards incompatible change. I'll be releasing 2.12.5 in a few minutes. Check out the commit message for more details.

jfelchner added a commit that referenced this pull request May 29, 2019
Why This Change Is Necessary
========================================================================

Previously dots and dashes were not removed from the namespaces when
looking up the filenames for keys.  This meant that when looking up
filenames for those namespaces, the per-namespace keys were not
resolving correctly.

How These Changes Address the Issue
========================================================================

This change removes dots and dashes from the namespaces when looking up
key filenames.

Side Effects Caused By This Change
========================================================================

Anyone relying on the erroneous functionality will break.

------------------------------------------------------------------------
Actions:
  * References #56
jfelchner added a commit that referenced this pull request May 29, 2019
Why This Change Is Necessary
========================================================================

Previously dots and dashes were not removed from the namespaces when
looking up the filenames for keys.  This meant that when looking up
filenames for those namespaces, the per-namespace keys were not
resolving correctly.

How These Changes Address the Issue
========================================================================

This change removes dots and dashes from the namespaces when looking up
key filenames.

We also alter the script that generates key pairs so that it removes
dots and dashes from the filenames it generates.

Caveat
========================================================================

It's important to note that this _only_ applies to looking up the key
filename.  Inside the YAML files, dots and dashes are valid characters
and will be used when finding namespaced settings.

With a namespace of `example-host.com`, the private key filename would
be `.chamber.examplehostcom.pem`, however in the YAML file, you would
still do:

```yaml
example-host.com:
  my_setting: 'hello'
```

Side Effects Caused By This Change
========================================================================

Anyone relying on the erroneous functionality will break.

------------------------------------------------------------------------
Actions:
  * References #56
jfelchner added a commit that referenced this pull request May 29, 2019
Why This Change Is Necessary
========================================================================

Previously dots and dashes were not removed from the namespaces when
looking up the filenames for keys.  This meant that when looking up
filenames for those namespaces, the per-namespace keys were not
resolving correctly.

How These Changes Address the Issue
========================================================================

This change removes dots and dashes from the namespaces when looking up
key filenames.

We also alter the script that generates key pairs so that it removes
dots and dashes from the filenames it generates.

Caveat
========================================================================

It's important to note that this _only_ applies to looking up the key
filename.  Inside the YAML files, dots and dashes are valid characters
and will be used when finding namespaced settings.

With a namespace of `example-host.com`, the private key filename would
be `.chamber.examplehostcom.pem`, however in the YAML file, you would
still do:

```yaml
example-host.com:
  my_setting: 'hello'
```

Side Effects Caused By This Change
========================================================================

Anyone relying on the erroneous functionality will break.

------------------------------------------------------------------------
Actions:
  * References #56
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the outdated Inactive - Outdated label Dec 28, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated Inactive - Outdated
Development

Successfully merging this pull request may close these issues.

2 participants