Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
simpler user invariant: username has "@" => username is not local #56
+83
−49
Conversation
mhilton
reviewed
Oct 9, 2015
| // IsLocal returns true if the tag represents a local user. | ||
| func (t UserTag) IsLocal() bool { | ||
| - return t.Domain() == LocalUserDomain | ||
| + return t.Domain() == "" | ||
| } | ||
| // Domain returns the user domain. Users in the local database | ||
| // are from the LocalDomain. Other users are considered 'remote' users. |
|
LGTM with a thought |
voidspace
commented
Oct 9, 2015
|
LGTM |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-names |
added a commit
that referenced
this pull request
Oct 9, 2015
jujubot
merged commit 657c4ad
into
juju:master
Oct 9, 2015
added a commit
to rogpeppe/juju-names
that referenced
this pull request
Oct 14, 2015
added a commit
that referenced
this pull request
Oct 14, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rogpeppe commentedOct 9, 2015
We lose the concept of "local" as a special name, leading to a much
simpler invariant - a username is external if and only if it has an "@" suffix.
The local domain is intuitively represented by the empty string.
This means that there is no need for the Canonical method, as users
are always in canonical form, and it also means that users as stored
currently in the juju state are already in canonical form as local users,
so there will be no need for a migration when we add information about
external users to the user database.
(Review request: http://reviews.vapour.ws/r/2867/)