added user and password for maas upstream proxy

Change-Id: If48000e957796bf151694f90d37b83c6f8551a51
diff --git a/README.rst b/README.rst
index 178b0c9..6b3548e 100644
--- a/README.rst
+++ b/README.rst
@@ -26,6 +26,8 @@
       upstream_proxy:
         address: 10.0.0.1
         port: 8080
+        user: username      #OPTIONAL
+        password: password  #OPTIONAL
       theme: mirantis
       bind:
         host: 192.168.0.10:5240
diff --git a/maas/files/maas-proxy.conf.template b/maas/files/maas-proxy.conf.template
index c35cf93..99b0107 100644
--- a/maas/files/maas-proxy.conf.template
+++ b/maas/files/maas-proxy.conf.template
@@ -62,6 +62,8 @@
 {{endif}}
 {% endraw %}
 {% if region.upstream_proxy is defined %}
-cache_peer {{ region.upstream_proxy.address }} parent {{ region.upstream_proxy.port }} 0 no-query default
+cache_peer {{ region.upstream_proxy.address }} parent {{ region.upstream_proxy.port }} 0 no-query default {% if region.upstream_proxy.user is defined -%}
+login={{ region.upstream_proxy.user }}:{{ region.upstream_proxy.password }}
+{%- endif %}
 never_direct allow all
 {%- endif %}