brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geomacy <>
Subject [GitHub] brooklyn-server pull request #790: Adds HttpFeed.preemptiveBasicAuth
Date Fri, 04 Aug 2017 09:17:02 GMT
Github user geomacy commented on a diff in the pull request:
    --- Diff: core/src/main/java/org/apache/brooklyn/feed/http/ ---
    @@ -228,6 +235,25 @@ public Builder httpExecutor(HttpExecutor val) {
                 this.httpExecutor = val;
                 return this;
    +        public Map<String, String> buildBaseHeaders() {
    +            if (Boolean.TRUE.equals(preemptiveBasicAuth)) {
    +                Credentials creds = credentials;
    +                if (creds == null) {
    +                    throw new IllegalArgumentException("Must not enable preemptiveBasicAuth
when there are no credentials, in feed for "+baseUri);
    +                }
    +                String username = checkNotNull(creds.getUserPrincipal().getName(), "username");
    --- End diff --
    Should this be trimmed, or is it guaranteed to come trimmed by `getName`?  Hm I guess
by the time we get here we should rely on just the value of `getName` and not do any more
munging. What do you think? However it might be worth verifying in here that the username
doesn't contain a colon.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message