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

api/uniter: validate unit name before relation-get #677

Merged
merged 1 commit into from Sep 4, 2014
Merged

api/uniter: validate unit name before relation-get #677

merged 1 commit into from Sep 4, 2014

Conversation

davecheney
Copy link
Contributor

The name of the unit passed in from the cli is not a string form of a tag so we have to validate that it actaully is a unit name (the id part of a unit tag).

The name of the unit passed in from the cli is not a string for of a tag so we have to validate that it actaully is a unit name (the id part of a unit tag).
@jameinel
Copy link
Member

jameinel commented Sep 4, 2014

So I think this is correct from a case of "validate input before turning it into objects", and on the case of fixing 1.20 this seems perfectly ok.
It feels like we're missing a standard, unified way of turning user input (service, unit/0, 0, etc) into names.Tag objects so that we can hand them around and be sure they are safe.
If NewUnitTag isn't intended to be this (you mentioned it is intended only for testing code), then we need something like this.
So I'm LGTM on landing this because it does fix a serious issue, but it feels like we're going to be playing whack-a-mole unless we have a consistent way of validating our inputs.

@davecheney
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Sep 4, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Sep 4, 2014
…name

api/uniter: validate unit name before relation-get

The name of the unit passed in from the cli is not a string form of a tag so we have to validate that it actaully is a unit name (the id part of a unit tag).
@jujubot jujubot merged commit 24a9a15 into juju:master Sep 4, 2014
wallyworld pushed a commit to wallyworld/juju that referenced this pull request Sep 5, 2014
…nit-name

api/uniter: validate unit name before relation-get

The name of the unit passed in from the cli is not a string form of a tag so we have to validate that it actaully is a unit name (the id part of a unit tag).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants