Skip to content

Add space e2e tests, fixed a few minor bugs#1072

Merged
nwmac merged 144 commits into
susefrom
add-space-e2e
Jun 7, 2017
Merged

Add space e2e tests, fixed a few minor bugs#1072
nwmac merged 144 commits into
susefrom
add-space-e2e

Conversation

@richard-cox
Copy link
Copy Markdown
Contributor

  • Added tests for creating/deleting a space and whether an org can be deleted given it's space count
  • Fixed bug where the org tile would allow delete when it contained spaces
  • Fixed bug where action menu would show even if all it's actions are hidden

irfanhabib and others added 30 commits January 11, 2017 15:08
* wip

* Delivery pipeline e2e

* Delivery pipeline e2e

* Delivery pipeline e2e

* Delivery pipeline e2e

* Delivery pipeline e2e

* Delivery pipeline e2e

* Added tests for invalid token
* wip

* Delivery pipeline e2e

* Delivery pipeline e2e

* Delivery pipeline e2e

* Delivery pipeline e2e

* Delivery pipeline e2e

* Delivery pipeline e2e

* Added tests for invalid token

* Removed duplicate async-dialog-view

* GitHub Token Management E2E tests

* Fixed lint issues

* Added test to check duplicate tokens cant be added
…#947)

* HSC-1467: Get app wall test that use mock data working (and add more)

* Check that CLI Commands displays and we can copy to clipboard
HSC-1463: Update assign users dialogue to use wizard onNext to complete wizard process
* Fix leakage of apps

* Update cf-model.po.js
HSC-1477 - E2E tests: Instrument VCS api
* Remove superfluous wait. Close notifications to avoid toasts receiving clicks

* Check specific missing scope error is shown. Close more toasts

* HSC-1417 - Fix and enable empty dashboard tests
)

* Delivery Pipeline summary tests

* Fix leakage of apps

* Delivery Pipeline summary page E2E tests

* Fixed actions-menu click

* HSC-1469 - E2E tests: Add tests for Delivery Pipeline summary page

* remove debug file

* Delivery Pipeline E2E tests: Allow concurrent tests to run

* minor refactor

* Delivery Pipeline E2E tests: Allow concurrent tests to run

* Fix test
* HSC-1472: Handle new HCE project based permissions
Basic handling of new hce project permissions
- Do not allow application to be deleted if user does not have project permission
- Display permissions notice on delivery pipeline + logs pages

Note - We may want to refactor delivery-pipeline-status.html in the future,
there's a fair few ng-if conditions in the template

* Fix project role holes
- Delete application button state is updated given changes to project roles while app pages are shown
- Delete application process will now correctly fail and stop progression if..
-- The delete project request fails (user is only a project developer)
-- The request project previously failed due to a 403 (user has no project role)
- Delete pipeline process remains as before

Note - We should look to improve the project developer use case. Need
to check beforehand what roles user has for project.
* More unit tests. Fix service e2e test when no services are left.

* Update default-image.directive.spec.js

* Fix lint issue
* Refresh routes and service instances when entering a Space. Also pre-sort various arrays to avoid smart-table flicker

* Fallback consistent with smart-table

* Revert "Fallback consistent with smart-table"

This reverts commit 23107a6.

* Fixed comment

* Correctly handle service instances when coming from app-wall

* Fix test data

* Let's not forget to update from cache
- We fetch roles via orgs. If the user is not an org_user of any org they
will see no users.
- Add a simple message to avoid showing an ugly empty table
- Not needed at space level (only org_user is needed to view roles)
- Add link to github user
- Add github user icon, if present
- Add link to commit
Irfan Habib and others added 14 commits June 1, 2017 12:08
commit 5dad190
Merge: 3b13b8e 044208f
Author: Neil MacDougall <neil.macdougall@suse.com>
Date:   Thu Jun 1 15:06:44 2017 +0100

    Merge remote-tracking branch 'origin/suse' into remove-old-refs

commit 3b13b8e
Author: Neil MacDougall <nwmac@users.noreply.github.com>
Date:   Thu Jun 1 14:55:30 2017 +0100

    gate check

commit 044208f
Author: Irfan Habib <irfan.habib@suse.com>
Date:   Thu Jun 1 14:53:19 2017 +0100

    Merge Portal Proxy (#1059)

    * update logging to use appropriate levels. remove logging that exposed sensitive info. remove extraneous debugging logs

    * drop unneeded headers var

    * update glide deps to include logrus

    * update new log entries from rebase to use logger instead of log

    * DRY up error messages

    * prevent API from registering same cluster multiple times

    * rename and return only bool for existing CNSI endpoint check function

    * throw a regular Error instead of a Fatal if VCS Clients can't be parsed

    * List VCS clients endpoint

    * Using clientNotFound template in handleVCSAuth

    * Use logger instead of log

    * Refactor the use of inline markup to templates

    * Copt templates to container; fix file paths

    * fix logger call

    * Update the template names for clarity

    * Fixed logger statements

    * Initial commit

    Initial commit to get etcd stood up in a cluster

    * Finalize initial version of the init script & Dockerfile

    * Clean up and document init script

    * Convert LONGGGG command to multiline

    * Rename the Dockerfile

    * Fix paths

    * Rename folder

    * Rename refs to etcd folder

    * create PGStore mock

    * update tests to use mocked db returned from setupHTTPTest()

    * drop logging from mocks, make sure StoreSession.Options is initialized in mock

    * add SessionStorer interface

    * Expose pgsql EncryptToken function so we can use it in our tests

    * use insertErr instead of err

    * expand from 3-5 instances

    * Remove ENV VAR based approach

    * TEAMFOUR-541 Implement stolon for Postgres HA

    This change adds stolon related container assets to the proxy project for the sake of Postgres HA.

    - cut over to use stolon proxy instead of single user Postgres
    - DRY up params in SDL
    - remove ENV VARs from postflight Dockerfile
    - DRY up ENV VARs in the postflight script
    - rename the stratos user/pwd to stackato
    - update the README
    - tighten up connection string
    - override the default stolon startup script with mechanics necessary for HCP.
    - provide an initial cluster config file that directs stolon to elect a leader when multiple masters are in play.
    - move the etcd initial cluster def into SDL
    - add reconfig check
    - move several env vars over to SDL

    * TEAMFOUR-1052: Allow the API Host URL to be changed by the UI

    * Remove debug info

    * Fixed api prefix

    * Address feedback from Chris

    * TEAMFOUR-1044 - Added endpoint to validate HCF credentials

    * drop sensitive DB config data from logs

    * update vcs.go to send logs to flight recorder

    * HSC-1040: Move versions api so that it does not require auth

    * Support proxy for Noaa consumer

    * HSC-1093: Fix JSON parse error

    * add skip_ssl_validation to CNSI records

    * use skip_ssl_validation flag to pick which http client to use for requests

    * store VCS tokens in the db for reuse

    * Refresh token on verifySession

    * HSC-1097

    * Set Session expiry time to 20 minutes
    * Correctly enable the cleanup tick in pgstore

    * Reordered time

    * s/vcs_user_id/user_guid

    * check skip_ssl_validation flag on HCE endpoints, remove unused param from initializeHttpClients

    * Extend the expires_on of the session after verifySession is called

    * Change distro from debian to ubuntu

    * HSC-1097 - expose expiry time to clients

    * HSC-1106: Changes to ensure no_proxy applies to the http URLs that are used

    * Revert etcd containers to debian jessie

    * Update the logger command usage

    Update logger command to use:
    - FLIGHT_RECORDER_HOST
    - FLIGHT_RECORDER_PORT
    - -u to overcome issue with the version of logger that ships with trusty
    src: http://serverfault.com/questions/524480/ubuntu-12-04-logger-wont-write-to-remote-syslog

    * Specify the full hostname

    * Put this config file back

    * Address review feedback

    * Don't use shadow error when there is no parent error. Added missing SkipTLSVerification

    * Align field [trivial]

    * Removed unused code

    * Don't log DB username password. Forward exit code but still popd

    * Let's return 503 error when the db is not available

    * HSC-1109 Add SkipSSL bool to each VCS_CLIENT entry

    - added an optional bool to the vcs clients dta to allow the admin to indicate whether the Console should skipp SSL to a specific VCS endpoint.
    - fixed a few lint errors

    * HSC-1134 Secure our cookies

    Secure out session cookies with the ‘HttpOnly’ and ‘Secure’ attributes.

    * Also return 503 in admin middleware

    * HSC-1141 Ensure DB password is set for both install & upgrade

    The Stackato DB password is (currently) only getting set for install, not upgrade. This pulls that statement out of the IF clause and sets it always.

    * Changed approach to set NO_PROXY to reduce risk

    * Ensure all etcd host names are added to the NO_PROXY

    * Tweak if statement & remove cruft

    * Removed unused environment variable

    * Do not forward the Connection header to HCF

    * Add HCP CA to the OS CA certificate store (#124)

    * Add HCP CA to the OS CA certificate store

    * Added new line

    * Added new line

    * Extracted len(clientData) as variable [trivial]

    * Use the correct global http client in all vcs requests

    * Oops, pass the pointer to client, not the value

    * Return on error or else panic!

    * Initial changes to embed version in exe

    - Remove use of CONSOLE_VERSION
    - Add a new var to the interface for console version
    - Pull version in within main.go
    - Dockerfile change is WRONG and prob needs changing; don’t think we have access to env vars within Dockefile

    * Finish up the version logic update

    * Remove the use of the ‘Secure’ option for now

    * Added a Jira to cover this

    * HSC-1034 - Check VCS token is valid on OAuth (#125)

    * Check VCS token is valid on OAuth

    * Moved response.status read after error check to avoid panic

    * Fixed HSC-1166

    * HSC-1042 Log all stolon logs to FlightRecorder

    * Revert back to the use of ENTRYPOINT

    As Neil corrrectly pointed out, the behavior of CMD vs ENTRYPOINT is different. Given I’m not seeing the logs get sent to FlightRecorder, yet I can do so manually, the likely culprit is that the default stolon ENTRYPOINT is boing run and my CMD is being run afterwards. Oops. This change (hopefully) fixes that.

    * Update user

    * Fix incorrect (and missing) transport timeouts (#123)

    * Correctly configure transport overall timeout. Set a connection timeout. Remove unused kill channel and superfluous timer

    * Removed unused select blocks

    * Reindent portal_config after merging master

    * Work around certain browsers sending back an empty cookie after logout

    * Renamed function to removeEmptyCookie

    * Better fix using regex

    * Also moved HttpOnly option into the sessionStore defaults instead of
    in Save

    * Remove redundant call to SetCookie as this is covered by clearSession

    * Drop cookies from request in login

    * Will separate secure cookie into another PR

    * Secure our cookie to only be sent over HTTPS (#131)

    * Detect error when the DB does not have an entry for a valid session cookie id (#133)

    * Refactor to remove stolon, etcd and use postgres alone

    * Enable migration of the database from stolon HA to single instance

    - Update the postfllight job container to use postgres 9.4
    - refactor/simplify the RUN statements to reduce layers in the db container
    - Enable the database to be dumped from the stolon cluster and loaded on the single instance of postgres

    * HSC-1250 Containers need to include Third Party license text files

    * Typo

    * Update LICENSE file location

    * Fix for error logic to check for db and assume session issue otherwise

    * Default to returning 401, only return 503 when we get dial type errors

    * Trim whitespaces from VCS_CLIENTS param values (#135)

    * 1017 refactor unit tests (#104)

    * factor out SQL statements

    * return errors instead of ok

    * DRY up the queries, arguments, and expected rows

    * er -> err [trivial]

    * make sure verifySession() always returns HTTP Errors, fix panicky tests

    * factor out SQL statements

    * return errors instead of ok

    * DRY up the queries, arguments, and expected rows

    * fix up a few more tests

    * update calls to initializeHTTPClients and pp.doRequest to match new function signatures

    * Implement Goconvey (BDD) DSL (#140)

    * factor out SQL statements

    * DRY up the queries, arguments, and expected rows

    * Initial effort with  the goconvey DSL

    * fixups

    * clean up these tests

    * refactor multiple funcs into one big one

    * Further refactor, DRY up these tests

    * Edge cases, more DRYing things up (85% coverage)

    * Need to call the correct method - I’m an idiot!

    * Add goose db version tests

    * Refactor datastore

    * Refactor to dry up encrypt/decrypt

    - Refactor to dry up encrypt/decrypt
    - fix up lint errors

    * Fix several annoying lint errors

    * Further test development, slight refactoring of ReadKey metyhod name

    * Skip unnecessary backup/restore to speed up upgrades

    * HSC-1185 - detect SSL verification problems

    * HSC-1276 - send regular WebSocket Ping messages to avoid proxies closing the connection if the app is quiet

    * Send pings every 27s

    Protect against very aggressive proxies by sending pings more frequently

    * HSC-1276 - close the connection if we miss a pong

    * Comment: ping -> pong

    * No ;

    * Bring docker registry, image name up to date (#137)

    * Detect a wider range of SSL errors

    * HSC-1292 - Faster deployment of Portal Proxy in dev environments (#145)

    * HSC-1292 - Faster deployment of Portal Proxy in dev environments

    * Optimised Goose file

    * HSC-1310 - Removed Dockerfile.goose.base (#146)

    This has migrated to stratos-deploy

    * Migrate Console to use GitHub/BitBucket Personal Access Tokens

    * Return empty array instead of JSON null in list calls when the list is empty

    * Check token scopes and report to the UI

    * On upgrade, automatically migrate VCS from connected Code Engines

    * Update to go1.7. Tidied up Pre/Post flight dockerfiles. Made the world debian-jessie

    * Removed reference to old git oauth flow templates

    * Remove bad sudo

    * Install missing lsb-release

    * Pin to earlier Postgres image

    * Fix volume name in middleware.go

    * Fix volume name in migrate-vcs.go

    * Wait for upgrade to complete before migrating VCSes

    * typo

    * Relay underlying message from internal method

    * Allow deleting a VCS (#153)

    * Allow deleting a VCS

    * Fixed comment

    * Detect that we failed to delete a VCS and return the correct status code (#154)

    * When SSl errors occur, feed back detail to the caller

    * More concise error msg

    * Small update to README to cause new git tag for 4.1

    * Update README to get new hash

    * Support for HSM endpoints (#157)

    * Support for HSM endpoints

    * Remove commented out code as per Julein's review

    * CF Firehose support (#160)

    * Firehose support WIP

    * Ensure each user gets the full Firehose stream even if they share credentials

    * Refactor common code between app stream and firehose

    * Reordered funcs

    * Further polishing

    * Tidy ups and tune down logging

    * Refactor common code between firehose and app streams

    * Renamed file to represent enhanced responsibilities

    * Fix Portal Proxy tests and convert them to GoConvey (#162)

    * Fixed version_ info and pgsql_vcs_token tests

    * Fixed version_ info and pgsql_vcs_token tests

    * Fixed passthrough tests

    * Fixed version_ info and pgsql_vcs_token tests

    * Fixed passthrough tests

    * Fixed passthrough & auth_tests tests

    * Migrated OAuth requests tests to GoConvey

    * Let's not parse strings a byte at a time

    * Tests for token storage/retrieval (#163)

    * Fixed version_ info and pgsql_vcs_token tests

    * Fixed version_ info and pgsql_vcs_token tests

    * Fixed passthrough tests

    * Fixed version_ info and pgsql_vcs_token tests

    * Fixed passthrough tests

    * Fixed passthrough & auth_tests tests

    * Migrated OAuth requests tests to GoConvey

    * Added tests for CNSI/UAA Token storage/retrieval

    * Added for VCS Tokens

    * Fixed typos

    * Added additional tests to reach 80%+ coverage (#164)

    * Fixed version_ info and pgsql_vcs_token tests

    * Fixed version_ info and pgsql_vcs_token tests

    * Fixed passthrough tests

    * Fixed version_ info and pgsql_vcs_token tests

    * Fixed passthrough tests

    * Fixed passthrough & auth_tests tests

    * Migrated OAuth requests tests to GoConvey

    * Update README.md

    * Added tests for CNSI/UAA Token storage/retrieval

    * Added for VCS Tokens

    * Fixed typos

    * Added additional tests to reach 80%+ coverage

    * Initial k8s work

    * Updates to logging and configuration

    * Fix for for more log statements

    * Removed unsused HCP* config properties

    * WIP SQLite support

    * Added support for SQLite database backend

    * Remove files not needed

    * Update vendor folder

    * Add support for deploying as a Cloud Foundry application

    * Remove manifest file

    * Addressed PR issues and fixed unit tests

    * Fixes

    * Add extra metadata to the stackatoinfo call for Cloud Foundry

    * Rename stackatoInfo, fix verifySession response. Remove a couple of stackato references

    * SQLite Fix: Ensure SQL Statements use the right param substituion char and order is always 1,2,3 etc

    * Params MUST be in order - can't use indices with sqlite

    * Add check to make sure at least 1 row gets updated

    * Update README.md

    * Omit cloud foundry metadata when not applicable

    * Fixed unit test

    * Add portal-proxy concourse Dockerfile (#173)

    * Remove comment in test code

    * Change go path default

    * Remove HPE terms. Rename cookie

    * Test commit

    * Fix unit tests

    Remove `cloud-foundry` property because
    this is ommitted during marshalling if it empty

    * Optimised Postflight Job (#174)

    * Optimised Postflight Job

    * Fix unit tests

    Remove `cloud-foundry` property because
    this is ommitted during marshalling if it empty

    * Fix unit tests (#175)

    Remove `cloud-foundry` property because
    this is ommitted during marshalling if it empty

    * Missed a couple

    * Tidy up glide dependency management (#177)

    * Cleaned up glide.yaml

    * Update build script to run glide

    * Updated glide files

    * Add glide to concourse image for unit tests

    * Updated glide.lock file

    * Add openssl package to builder

    * Downgrade sqlmock-go

    * Add vendor to gitignore and downgrade sqlmock-go

    * Componentise proxy (#179)

    * Initial refactor

    * WIP

    * Get websocket/firehose working

    * Moving stuff around to write build scripts

    * Moved dockerfiles to be top level

    * renamed components to src

    * plugin load mechanism

    * fixed imports

    * plugin improvements

    * Gulp build mechanism [WIP]

    * Updated Gulp build files

    * Fixed lint issues

    * Fixed further lint issues

    * Updated Portal Proxy builder image

    * Updated load plugin mechanism

    * Dedup vendor before building plugins/core

    * Changes to interfaces

    * Updated GeneralPlugin interface

    * CloudFoundry Hosting plugin

    * Core changes

    * Moved portal proxy config definition

    * minor fixes

    * Final fixes to the CF Hosting plugin

    * Moved code around to reflect stratos-ui structure

    * Update build_portal_proxy.sh

    * Delete `build.sh`

    * remove core & misc changes

    * build updates

    * Update plugin names

    * Update build_portal_proxy.sh

    * Update portal-proxy unit tests

    * Debugging concourse tests

    * minor updates

    * Rename `EndpointSpecification` to `EndpointPlugin`

    * Renamed Dockerfile.dev

    * renamed backend Dockerfile

    * Fix lint issue

    * Rename backend gulp tasks

    * Renamed Dockerfiles

    * updated gulpfile for funnsies

    * remove hosting plugin

commit 1e765c2
Author: Neil MacDougall <neil.macdougall@suse.com>
Date:   Thu Jun 1 14:12:27 2017 +0100

    gate check

commit 5c0c89c
Author: Richard Cox <richard.cox@suse.com>
Date:   Thu Jun 1 10:35:22 2017 +0100

    Updated class name app --> console

commit b6c6021
Author: Richard Cox <richard.cox@suse.com>
Date:   Tue May 30 16:15:00 2017 +0100

    e2e fix

commit b2c765a
Author: Richard Cox <richard.cox@suse.com>
Date:   Tue May 30 15:49:45 2017 +0100

    Remove old company name

commit 6f03e32
Author: Richard Cox <richard.cox@suse.com>
Date:   Tue May 30 15:33:47 2017 +0100

    Removed references to hce
    Includes removal of code to hide/remove the 'hce' service previously
    associated with a hcf applicaiton with a hce pipeline.
    If application pipelines are included again it'll be a fresh implementation

commit 6b4d47d
Merge: 7f90d7e 2e01010
Author: Richard Cox <richard.cox@suse.com>
Date:   Tue May 30 14:27:04 2017 +0100

    Merge branch 'suse' into remove-old-refs

commit 7f90d7e
Author: Richard Cox <richard.cox@suse.com>
Date:   Tue May 30 14:07:38 2017 +0100

    Removed references to HPE

commit 97f6427
Author: Richard Cox <richard.cox@suse.com>
Date:   Tue May 30 12:02:02 2017 +0100

    Remove references to stackato

commit 787eb9b
Author: Richard Cox <richard.cox@suse.com>
Date:   Tue May 30 10:49:46 2017 +0100

    Tweak readme

commit 82f751d
Author: Neil MacDougall <neil.macdougall@suse.com>
Date:   Sat May 27 18:38:20 2017 +0100

    gate check

commit c9cb6a2
Merge: bac7625 05cb232
Author: Richard Cox <richard.cox@suse.com>
Date:   Fri May 26 17:35:27 2017 +0100

    Merge branch 'suse' into remove-helion-refs

commit bac7625
Author: Richard Cox <richard.cox@suse.com>
Date:   Fri May 26 17:31:19 2017 +0100

    Remove references to 'helion'
    - Three remaining instances, two in README and one in nginx/license.txt
    - In some places I've swapped 'helion' for 'stratos' where we might want to use 'app' instead

commit c43edb9
Author: Richard Cox <richard.cox@suse.com>
Date:   Fri May 26 16:58:09 2017 +0100

    Rename module helion.framework to app.framework
* Fixed translation typos

* Merge Portal Proxy (#1059)

* update logging to use appropriate levels. remove logging that exposed sensitive info. remove extraneous debugging logs

* drop unneeded headers var

* update glide deps to include logrus

* update new log entries from rebase to use logger instead of log

* DRY up error messages

* prevent API from registering same cluster multiple times

* rename and return only bool for existing CNSI endpoint check function

* throw a regular Error instead of a Fatal if VCS Clients can't be parsed

* List VCS clients endpoint

* Using clientNotFound template in handleVCSAuth

* Use logger instead of log

* Refactor the use of inline markup to templates

* Copt templates to container; fix file paths

* fix logger call

* Update the template names for clarity

* Fixed logger statements

* Initial commit

Initial commit to get etcd stood up in a cluster

* Finalize initial version of the init script & Dockerfile

* Clean up and document init script

* Convert LONGGGG command to multiline

* Rename the Dockerfile

* Fix paths

* Rename folder

* Rename refs to etcd folder

* create PGStore mock

* update tests to use mocked db returned from setupHTTPTest()

* drop logging from mocks, make sure StoreSession.Options is initialized in mock

* add SessionStorer interface

* Expose pgsql EncryptToken function so we can use it in our tests

* use insertErr instead of err

* expand from 3-5 instances

* Remove ENV VAR based approach

* TEAMFOUR-541 Implement stolon for Postgres HA

This change adds stolon related container assets to the proxy project for the sake of Postgres HA.

- cut over to use stolon proxy instead of single user Postgres
- DRY up params in SDL
- remove ENV VARs from postflight Dockerfile
- DRY up ENV VARs in the postflight script
- rename the stratos user/pwd to stackato
- update the README
- tighten up connection string
- override the default stolon startup script with mechanics necessary for HCP.
- provide an initial cluster config file that directs stolon to elect a leader when multiple masters are in play.
- move the etcd initial cluster def into SDL
- add reconfig check
- move several env vars over to SDL

* TEAMFOUR-1052: Allow the API Host URL to be changed by the UI

* Remove debug info

* Fixed api prefix

* Address feedback from Chris

* TEAMFOUR-1044 - Added endpoint to validate HCF credentials

* drop sensitive DB config data from logs

* update vcs.go to send logs to flight recorder

* HSC-1040: Move versions api so that it does not require auth

* Support proxy for Noaa consumer

* HSC-1093: Fix JSON parse error

* add skip_ssl_validation to CNSI records

* use skip_ssl_validation flag to pick which http client to use for requests

* store VCS tokens in the db for reuse

* Refresh token on verifySession

* HSC-1097

* Set Session expiry time to 20 minutes
* Correctly enable the cleanup tick in pgstore

* Reordered time

* s/vcs_user_id/user_guid

* check skip_ssl_validation flag on HCE endpoints, remove unused param from initializeHttpClients

* Extend the expires_on of the session after verifySession is called

* Change distro from debian to ubuntu

* HSC-1097 - expose expiry time to clients

* HSC-1106: Changes to ensure no_proxy applies to the http URLs that are used

* Revert etcd containers to debian jessie

* Update the logger command usage

Update logger command to use:
- FLIGHT_RECORDER_HOST
- FLIGHT_RECORDER_PORT
- -u to overcome issue with the version of logger that ships with trusty
src: http://serverfault.com/questions/524480/ubuntu-12-04-logger-wont-write-to-remote-syslog

* Specify the full hostname

* Put this config file back

* Address review feedback

* Don't use shadow error when there is no parent error. Added missing SkipTLSVerification

* Align field [trivial]

* Removed unused code

* Don't log DB username password. Forward exit code but still popd

* Let's return 503 error when the db is not available

* HSC-1109 Add SkipSSL bool to each VCS_CLIENT entry

- added an optional bool to the vcs clients dta to allow the admin to indicate whether the Console should skipp SSL to a specific VCS endpoint.
- fixed a few lint errors

* HSC-1134 Secure our cookies

Secure out session cookies with the ‘HttpOnly’ and ‘Secure’ attributes.

* Also return 503 in admin middleware

* HSC-1141 Ensure DB password is set for both install & upgrade

The Stackato DB password is (currently) only getting set for install, not upgrade. This pulls that statement out of the IF clause and sets it always.

* Changed approach to set NO_PROXY to reduce risk

* Ensure all etcd host names are added to the NO_PROXY

* Tweak if statement & remove cruft

* Removed unused environment variable

* Do not forward the Connection header to HCF

* Add HCP CA to the OS CA certificate store (#124)

* Add HCP CA to the OS CA certificate store

* Added new line

* Added new line

* Extracted len(clientData) as variable [trivial]

* Use the correct global http client in all vcs requests

* Oops, pass the pointer to client, not the value

* Return on error or else panic!

* Initial changes to embed version in exe

- Remove use of CONSOLE_VERSION
- Add a new var to the interface for console version
- Pull version in within main.go
- Dockerfile change is WRONG and prob needs changing; don’t think we have access to env vars within Dockefile

* Finish up the version logic update

* Remove the use of the ‘Secure’ option for now

* Added a Jira to cover this

* HSC-1034 - Check VCS token is valid on OAuth (#125)

* Check VCS token is valid on OAuth

* Moved response.status read after error check to avoid panic

* Fixed HSC-1166

* HSC-1042 Log all stolon logs to FlightRecorder

* Revert back to the use of ENTRYPOINT

As Neil corrrectly pointed out, the behavior of CMD vs ENTRYPOINT is different. Given I’m not seeing the logs get sent to FlightRecorder, yet I can do so manually, the likely culprit is that the default stolon ENTRYPOINT is boing run and my CMD is being run afterwards. Oops. This change (hopefully) fixes that.

* Update user

* Fix incorrect (and missing) transport timeouts (#123)

* Correctly configure transport overall timeout. Set a connection timeout. Remove unused kill channel and superfluous timer

* Removed unused select blocks

* Reindent portal_config after merging master

* Work around certain browsers sending back an empty cookie after logout

* Renamed function to removeEmptyCookie

* Better fix using regex

* Also moved HttpOnly option into the sessionStore defaults instead of
in Save

* Remove redundant call to SetCookie as this is covered by clearSession

* Drop cookies from request in login

* Will separate secure cookie into another PR

* Secure our cookie to only be sent over HTTPS (#131)

* Detect error when the DB does not have an entry for a valid session cookie id (#133)

* Refactor to remove stolon, etcd and use postgres alone

* Enable migration of the database from stolon HA to single instance

- Update the postfllight job container to use postgres 9.4
- refactor/simplify the RUN statements to reduce layers in the db container
- Enable the database to be dumped from the stolon cluster and loaded on the single instance of postgres

* HSC-1250 Containers need to include Third Party license text files

* Typo

* Update LICENSE file location

* Fix for error logic to check for db and assume session issue otherwise

* Default to returning 401, only return 503 when we get dial type errors

* Trim whitespaces from VCS_CLIENTS param values (#135)

* 1017 refactor unit tests (#104)

* factor out SQL statements

* return errors instead of ok

* DRY up the queries, arguments, and expected rows

* er -> err [trivial]

* make sure verifySession() always returns HTTP Errors, fix panicky tests

* factor out SQL statements

* return errors instead of ok

* DRY up the queries, arguments, and expected rows

* fix up a few more tests

* update calls to initializeHTTPClients and pp.doRequest to match new function signatures

* Implement Goconvey (BDD) DSL (#140)

* factor out SQL statements

* DRY up the queries, arguments, and expected rows

* Initial effort with  the goconvey DSL

* fixups

* clean up these tests

* refactor multiple funcs into one big one

* Further refactor, DRY up these tests

* Edge cases, more DRYing things up (85% coverage)

* Need to call the correct method - I’m an idiot!

* Add goose db version tests

* Refactor datastore

* Refactor to dry up encrypt/decrypt

- Refactor to dry up encrypt/decrypt
- fix up lint errors

* Fix several annoying lint errors

* Further test development, slight refactoring of ReadKey metyhod name

* Skip unnecessary backup/restore to speed up upgrades

* HSC-1185 - detect SSL verification problems

* HSC-1276 - send regular WebSocket Ping messages to avoid proxies closing the connection if the app is quiet

* Send pings every 27s

Protect against very aggressive proxies by sending pings more frequently

* HSC-1276 - close the connection if we miss a pong

* Comment: ping -> pong

* No ;

* Bring docker registry, image name up to date (#137)

* Detect a wider range of SSL errors

* HSC-1292 - Faster deployment of Portal Proxy in dev environments (#145)

* HSC-1292 - Faster deployment of Portal Proxy in dev environments

* Optimised Goose file

* HSC-1310 - Removed Dockerfile.goose.base (#146)

This has migrated to stratos-deploy

* Migrate Console to use GitHub/BitBucket Personal Access Tokens

* Return empty array instead of JSON null in list calls when the list is empty

* Check token scopes and report to the UI

* On upgrade, automatically migrate VCS from connected Code Engines

* Update to go1.7. Tidied up Pre/Post flight dockerfiles. Made the world debian-jessie

* Removed reference to old git oauth flow templates

* Remove bad sudo

* Install missing lsb-release

* Pin to earlier Postgres image

* Fix volume name in middleware.go

* Fix volume name in migrate-vcs.go

* Wait for upgrade to complete before migrating VCSes

* typo

* Relay underlying message from internal method

* Allow deleting a VCS (#153)

* Allow deleting a VCS

* Fixed comment

* Detect that we failed to delete a VCS and return the correct status code (#154)

* When SSl errors occur, feed back detail to the caller

* More concise error msg

* Small update to README to cause new git tag for 4.1

* Update README to get new hash

* Support for HSM endpoints (#157)

* Support for HSM endpoints

* Remove commented out code as per Julein's review

* CF Firehose support (#160)

* Firehose support WIP

* Ensure each user gets the full Firehose stream even if they share credentials

* Refactor common code between app stream and firehose

* Reordered funcs

* Further polishing

* Tidy ups and tune down logging

* Refactor common code between firehose and app streams

* Renamed file to represent enhanced responsibilities

* Fix Portal Proxy tests and convert them to GoConvey (#162)

* Fixed version_ info and pgsql_vcs_token tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed passthrough & auth_tests tests

* Migrated OAuth requests tests to GoConvey

* Let's not parse strings a byte at a time

* Tests for token storage/retrieval (#163)

* Fixed version_ info and pgsql_vcs_token tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed passthrough & auth_tests tests

* Migrated OAuth requests tests to GoConvey

* Added tests for CNSI/UAA Token storage/retrieval

* Added for VCS Tokens

* Fixed typos

* Added additional tests to reach 80%+ coverage (#164)

* Fixed version_ info and pgsql_vcs_token tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed passthrough & auth_tests tests

* Migrated OAuth requests tests to GoConvey

* Update README.md

* Added tests for CNSI/UAA Token storage/retrieval

* Added for VCS Tokens

* Fixed typos

* Added additional tests to reach 80%+ coverage

* Initial k8s work

* Updates to logging and configuration

* Fix for for more log statements

* Removed unsused HCP* config properties

* WIP SQLite support

* Added support for SQLite database backend

* Remove files not needed

* Update vendor folder

* Add support for deploying as a Cloud Foundry application

* Remove manifest file

* Addressed PR issues and fixed unit tests

* Fixes

* Add extra metadata to the stackatoinfo call for Cloud Foundry

* Rename stackatoInfo, fix verifySession response. Remove a couple of stackato references

* SQLite Fix: Ensure SQL Statements use the right param substituion char and order is always 1,2,3 etc

* Params MUST be in order - can't use indices with sqlite

* Add check to make sure at least 1 row gets updated

* Update README.md

* Omit cloud foundry metadata when not applicable

* Fixed unit test

* Add portal-proxy concourse Dockerfile (#173)

* Remove comment in test code

* Change go path default

* Remove HPE terms. Rename cookie

* Test commit

* Fix unit tests

Remove `cloud-foundry` property because
this is ommitted during marshalling if it empty

* Optimised Postflight Job (#174)

* Optimised Postflight Job

* Fix unit tests

Remove `cloud-foundry` property because
this is ommitted during marshalling if it empty

* Fix unit tests (#175)

Remove `cloud-foundry` property because
this is ommitted during marshalling if it empty

* Missed a couple

* Tidy up glide dependency management (#177)

* Cleaned up glide.yaml

* Update build script to run glide

* Updated glide files

* Add glide to concourse image for unit tests

* Updated glide.lock file

* Add openssl package to builder

* Downgrade sqlmock-go

* Add vendor to gitignore and downgrade sqlmock-go

* Componentise proxy (#179)

* Initial refactor

* WIP

* Get websocket/firehose working

* Moving stuff around to write build scripts

* Moved dockerfiles to be top level

* renamed components to src

* plugin load mechanism

* fixed imports

* plugin improvements

* Gulp build mechanism [WIP]

* Updated Gulp build files

* Fixed lint issues

* Fixed further lint issues

* Updated Portal Proxy builder image

* Updated load plugin mechanism

* Dedup vendor before building plugins/core

* Changes to interfaces

* Updated GeneralPlugin interface

* CloudFoundry Hosting plugin

* Core changes

* Moved portal proxy config definition

* minor fixes

* Final fixes to the CF Hosting plugin

* Moved code around to reflect stratos-ui structure

* Update build_portal_proxy.sh

* Delete `build.sh`

* remove core & misc changes

* build updates

* Update plugin names

* Update build_portal_proxy.sh

* Update portal-proxy unit tests

* Debugging concourse tests

* minor updates

* Rename `EndpointSpecification` to `EndpointPlugin`

* Renamed Dockerfile.dev

* renamed backend Dockerfile

* Fix lint issue

* Rename backend gulp tasks

* Renamed Dockerfiles

* updated gulpfile for funnsies

* remove hosting plugin

* Remove old references (#1052)

* Rename module helion.framework to app.framework

* Remove references to 'helion'
- Three remaining instances, two in README and one in nginx/license.txt
- In some places I've swapped 'helion' for 'stratos' where we might want to use 'app' instead

* gate check

* Tweak readme

* Remove references to stackato

* Removed references to HPE

* Removed references to hce
Includes removal of code to hide/remove the 'hce' service previously
associated with a hcf applicaiton with a hce pipeline.
If application pipelines are included again it'll be a fresh implementation

* Remove old company name

* e2e fix

* Updated class name app --> console

* gate check

* gate check
#1061)

* Move brand scss into src file so that it is watched for changes. Small branding updates.

* Merge Portal Proxy (#1059)

* update logging to use appropriate levels. remove logging that exposed sensitive info. remove extraneous debugging logs

* drop unneeded headers var

* update glide deps to include logrus

* update new log entries from rebase to use logger instead of log

* DRY up error messages

* prevent API from registering same cluster multiple times

* rename and return only bool for existing CNSI endpoint check function

* throw a regular Error instead of a Fatal if VCS Clients can't be parsed

* List VCS clients endpoint

* Using clientNotFound template in handleVCSAuth

* Use logger instead of log

* Refactor the use of inline markup to templates

* Copt templates to container; fix file paths

* fix logger call

* Update the template names for clarity

* Fixed logger statements

* Initial commit

Initial commit to get etcd stood up in a cluster

* Finalize initial version of the init script & Dockerfile

* Clean up and document init script

* Convert LONGGGG command to multiline

* Rename the Dockerfile

* Fix paths

* Rename folder

* Rename refs to etcd folder

* create PGStore mock

* update tests to use mocked db returned from setupHTTPTest()

* drop logging from mocks, make sure StoreSession.Options is initialized in mock

* add SessionStorer interface

* Expose pgsql EncryptToken function so we can use it in our tests

* use insertErr instead of err

* expand from 3-5 instances

* Remove ENV VAR based approach

* TEAMFOUR-541 Implement stolon for Postgres HA

This change adds stolon related container assets to the proxy project for the sake of Postgres HA.

- cut over to use stolon proxy instead of single user Postgres
- DRY up params in SDL
- remove ENV VARs from postflight Dockerfile
- DRY up ENV VARs in the postflight script
- rename the stratos user/pwd to stackato
- update the README
- tighten up connection string
- override the default stolon startup script with mechanics necessary for HCP.
- provide an initial cluster config file that directs stolon to elect a leader when multiple masters are in play.
- move the etcd initial cluster def into SDL
- add reconfig check
- move several env vars over to SDL

* TEAMFOUR-1052: Allow the API Host URL to be changed by the UI

* Remove debug info

* Fixed api prefix

* Address feedback from Chris

* TEAMFOUR-1044 - Added endpoint to validate HCF credentials

* drop sensitive DB config data from logs

* update vcs.go to send logs to flight recorder

* HSC-1040: Move versions api so that it does not require auth

* Support proxy for Noaa consumer

* HSC-1093: Fix JSON parse error

* add skip_ssl_validation to CNSI records

* use skip_ssl_validation flag to pick which http client to use for requests

* store VCS tokens in the db for reuse

* Refresh token on verifySession

* HSC-1097

* Set Session expiry time to 20 minutes
* Correctly enable the cleanup tick in pgstore

* Reordered time

* s/vcs_user_id/user_guid

* check skip_ssl_validation flag on HCE endpoints, remove unused param from initializeHttpClients

* Extend the expires_on of the session after verifySession is called

* Change distro from debian to ubuntu

* HSC-1097 - expose expiry time to clients

* HSC-1106: Changes to ensure no_proxy applies to the http URLs that are used

* Revert etcd containers to debian jessie

* Update the logger command usage

Update logger command to use:
- FLIGHT_RECORDER_HOST
- FLIGHT_RECORDER_PORT
- -u to overcome issue with the version of logger that ships with trusty
src: http://serverfault.com/questions/524480/ubuntu-12-04-logger-wont-write-to-remote-syslog

* Specify the full hostname

* Put this config file back

* Address review feedback

* Don't use shadow error when there is no parent error. Added missing SkipTLSVerification

* Align field [trivial]

* Removed unused code

* Don't log DB username password. Forward exit code but still popd

* Let's return 503 error when the db is not available

* HSC-1109 Add SkipSSL bool to each VCS_CLIENT entry

- added an optional bool to the vcs clients dta to allow the admin to indicate whether the Console should skipp SSL to a specific VCS endpoint.
- fixed a few lint errors

* HSC-1134 Secure our cookies

Secure out session cookies with the ‘HttpOnly’ and ‘Secure’ attributes.

* Also return 503 in admin middleware

* HSC-1141 Ensure DB password is set for both install & upgrade

The Stackato DB password is (currently) only getting set for install, not upgrade. This pulls that statement out of the IF clause and sets it always.

* Changed approach to set NO_PROXY to reduce risk

* Ensure all etcd host names are added to the NO_PROXY

* Tweak if statement & remove cruft

* Removed unused environment variable

* Do not forward the Connection header to HCF

* Add HCP CA to the OS CA certificate store (#124)

* Add HCP CA to the OS CA certificate store

* Added new line

* Added new line

* Extracted len(clientData) as variable [trivial]

* Use the correct global http client in all vcs requests

* Oops, pass the pointer to client, not the value

* Return on error or else panic!

* Initial changes to embed version in exe

- Remove use of CONSOLE_VERSION
- Add a new var to the interface for console version
- Pull version in within main.go
- Dockerfile change is WRONG and prob needs changing; don’t think we have access to env vars within Dockefile

* Finish up the version logic update

* Remove the use of the ‘Secure’ option for now

* Added a Jira to cover this

* HSC-1034 - Check VCS token is valid on OAuth (#125)

* Check VCS token is valid on OAuth

* Moved response.status read after error check to avoid panic

* Fixed HSC-1166

* HSC-1042 Log all stolon logs to FlightRecorder

* Revert back to the use of ENTRYPOINT

As Neil corrrectly pointed out, the behavior of CMD vs ENTRYPOINT is different. Given I’m not seeing the logs get sent to FlightRecorder, yet I can do so manually, the likely culprit is that the default stolon ENTRYPOINT is boing run and my CMD is being run afterwards. Oops. This change (hopefully) fixes that.

* Update user

* Fix incorrect (and missing) transport timeouts (#123)

* Correctly configure transport overall timeout. Set a connection timeout. Remove unused kill channel and superfluous timer

* Removed unused select blocks

* Reindent portal_config after merging master

* Work around certain browsers sending back an empty cookie after logout

* Renamed function to removeEmptyCookie

* Better fix using regex

* Also moved HttpOnly option into the sessionStore defaults instead of
in Save

* Remove redundant call to SetCookie as this is covered by clearSession

* Drop cookies from request in login

* Will separate secure cookie into another PR

* Secure our cookie to only be sent over HTTPS (#131)

* Detect error when the DB does not have an entry for a valid session cookie id (#133)

* Refactor to remove stolon, etcd and use postgres alone

* Enable migration of the database from stolon HA to single instance

- Update the postfllight job container to use postgres 9.4
- refactor/simplify the RUN statements to reduce layers in the db container
- Enable the database to be dumped from the stolon cluster and loaded on the single instance of postgres

* HSC-1250 Containers need to include Third Party license text files

* Typo

* Update LICENSE file location

* Fix for error logic to check for db and assume session issue otherwise

* Default to returning 401, only return 503 when we get dial type errors

* Trim whitespaces from VCS_CLIENTS param values (#135)

* 1017 refactor unit tests (#104)

* factor out SQL statements

* return errors instead of ok

* DRY up the queries, arguments, and expected rows

* er -> err [trivial]

* make sure verifySession() always returns HTTP Errors, fix panicky tests

* factor out SQL statements

* return errors instead of ok

* DRY up the queries, arguments, and expected rows

* fix up a few more tests

* update calls to initializeHTTPClients and pp.doRequest to match new function signatures

* Implement Goconvey (BDD) DSL (#140)

* factor out SQL statements

* DRY up the queries, arguments, and expected rows

* Initial effort with  the goconvey DSL

* fixups

* clean up these tests

* refactor multiple funcs into one big one

* Further refactor, DRY up these tests

* Edge cases, more DRYing things up (85% coverage)

* Need to call the correct method - I’m an idiot!

* Add goose db version tests

* Refactor datastore

* Refactor to dry up encrypt/decrypt

- Refactor to dry up encrypt/decrypt
- fix up lint errors

* Fix several annoying lint errors

* Further test development, slight refactoring of ReadKey metyhod name

* Skip unnecessary backup/restore to speed up upgrades

* HSC-1185 - detect SSL verification problems

* HSC-1276 - send regular WebSocket Ping messages to avoid proxies closing the connection if the app is quiet

* Send pings every 27s

Protect against very aggressive proxies by sending pings more frequently

* HSC-1276 - close the connection if we miss a pong

* Comment: ping -> pong

* No ;

* Bring docker registry, image name up to date (#137)

* Detect a wider range of SSL errors

* HSC-1292 - Faster deployment of Portal Proxy in dev environments (#145)

* HSC-1292 - Faster deployment of Portal Proxy in dev environments

* Optimised Goose file

* HSC-1310 - Removed Dockerfile.goose.base (#146)

This has migrated to stratos-deploy

* Migrate Console to use GitHub/BitBucket Personal Access Tokens

* Return empty array instead of JSON null in list calls when the list is empty

* Check token scopes and report to the UI

* On upgrade, automatically migrate VCS from connected Code Engines

* Update to go1.7. Tidied up Pre/Post flight dockerfiles. Made the world debian-jessie

* Removed reference to old git oauth flow templates

* Remove bad sudo

* Install missing lsb-release

* Pin to earlier Postgres image

* Fix volume name in middleware.go

* Fix volume name in migrate-vcs.go

* Wait for upgrade to complete before migrating VCSes

* typo

* Relay underlying message from internal method

* Allow deleting a VCS (#153)

* Allow deleting a VCS

* Fixed comment

* Detect that we failed to delete a VCS and return the correct status code (#154)

* When SSl errors occur, feed back detail to the caller

* More concise error msg

* Small update to README to cause new git tag for 4.1

* Update README to get new hash

* Support for HSM endpoints (#157)

* Support for HSM endpoints

* Remove commented out code as per Julein's review

* CF Firehose support (#160)

* Firehose support WIP

* Ensure each user gets the full Firehose stream even if they share credentials

* Refactor common code between app stream and firehose

* Reordered funcs

* Further polishing

* Tidy ups and tune down logging

* Refactor common code between firehose and app streams

* Renamed file to represent enhanced responsibilities

* Fix Portal Proxy tests and convert them to GoConvey (#162)

* Fixed version_ info and pgsql_vcs_token tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed passthrough & auth_tests tests

* Migrated OAuth requests tests to GoConvey

* Let's not parse strings a byte at a time

* Tests for token storage/retrieval (#163)

* Fixed version_ info and pgsql_vcs_token tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed passthrough & auth_tests tests

* Migrated OAuth requests tests to GoConvey

* Added tests for CNSI/UAA Token storage/retrieval

* Added for VCS Tokens

* Fixed typos

* Added additional tests to reach 80%+ coverage (#164)

* Fixed version_ info and pgsql_vcs_token tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed passthrough & auth_tests tests

* Migrated OAuth requests tests to GoConvey

* Update README.md

* Added tests for CNSI/UAA Token storage/retrieval

* Added for VCS Tokens

* Fixed typos

* Added additional tests to reach 80%+ coverage

* Initial k8s work

* Updates to logging and configuration

* Fix for for more log statements

* Removed unsused HCP* config properties

* WIP SQLite support

* Added support for SQLite database backend

* Remove files not needed

* Update vendor folder

* Add support for deploying as a Cloud Foundry application

* Remove manifest file

* Addressed PR issues and fixed unit tests

* Fixes

* Add extra metadata to the stackatoinfo call for Cloud Foundry

* Rename stackatoInfo, fix verifySession response. Remove a couple of stackato references

* SQLite Fix: Ensure SQL Statements use the right param substituion char and order is always 1,2,3 etc

* Params MUST be in order - can't use indices with sqlite

* Add check to make sure at least 1 row gets updated

* Update README.md

* Omit cloud foundry metadata when not applicable

* Fixed unit test

* Add portal-proxy concourse Dockerfile (#173)

* Remove comment in test code

* Change go path default

* Remove HPE terms. Rename cookie

* Test commit

* Fix unit tests

Remove `cloud-foundry` property because
this is ommitted during marshalling if it empty

* Optimised Postflight Job (#174)

* Optimised Postflight Job

* Fix unit tests

Remove `cloud-foundry` property because
this is ommitted during marshalling if it empty

* Fix unit tests (#175)

Remove `cloud-foundry` property because
this is ommitted during marshalling if it empty

* Missed a couple

* Tidy up glide dependency management (#177)

* Cleaned up glide.yaml

* Update build script to run glide

* Updated glide files

* Add glide to concourse image for unit tests

* Updated glide.lock file

* Add openssl package to builder

* Downgrade sqlmock-go

* Add vendor to gitignore and downgrade sqlmock-go

* Componentise proxy (#179)

* Initial refactor

* WIP

* Get websocket/firehose working

* Moving stuff around to write build scripts

* Moved dockerfiles to be top level

* renamed components to src

* plugin load mechanism

* fixed imports

* plugin improvements

* Gulp build mechanism [WIP]

* Updated Gulp build files

* Fixed lint issues

* Fixed further lint issues

* Updated Portal Proxy builder image

* Updated load plugin mechanism

* Dedup vendor before building plugins/core

* Changes to interfaces

* Updated GeneralPlugin interface

* CloudFoundry Hosting plugin

* Core changes

* Moved portal proxy config definition

* minor fixes

* Final fixes to the CF Hosting plugin

* Moved code around to reflect stratos-ui structure

* Update build_portal_proxy.sh

* Delete `build.sh`

* remove core & misc changes

* build updates

* Update plugin names

* Update build_portal_proxy.sh

* Update portal-proxy unit tests

* Debugging concourse tests

* minor updates

* Rename `EndpointSpecification` to `EndpointPlugin`

* Renamed Dockerfile.dev

* renamed backend Dockerfile

* Fix lint issue

* Rename backend gulp tasks

* Renamed Dockerfiles

* updated gulpfile for funnsies

* remove hosting plugin

* Remove old references (#1052)

* Rename module helion.framework to app.framework

* Remove references to 'helion'
- Three remaining instances, two in README and one in nginx/license.txt
- In some places I've swapped 'helion' for 'stratos' where we might want to use 'app' instead

* gate check

* Tweak readme

* Remove references to stackato

* Removed references to HPE

* Removed references to hce
Includes removal of code to hide/remove the 'hce' service previously
associated with a hcf applicaiton with a hce pipeline.
If application pipelines are included again it'll be a fresh implementation

* Remove old company name

* e2e fix

* Updated class name app --> console

* gate check

* gate check
* Rename module helion.framework to app.framework

* Remove references to 'helion'
- Three remaining instances, two in README and one in nginx/license.txt
- In some places I've swapped 'helion' for 'stratos' where we might want to use 'app' instead

* gate check

* Tweak readme

* Remove references to stackato

* Removed references to HPE

* Removed references to hce
Includes removal of code to hide/remove the 'hce' service previously
associated with a hcf applicaiton with a hce pipeline.
If application pipelines are included again it'll be a fresh implementation

* Remove old company name

* e2e fix

* Remove references to hcf (does not cover hcf cnsi_type)

* Undo endpoints.hcf --> endpoints.cf (object comes from response from backend)

* Fix failing e2e tests

* CI bump

* Fix failing e2e

* Merge Portal Proxy (#1059)

* update logging to use appropriate levels. remove logging that exposed sensitive info. remove extraneous debugging logs

* drop unneeded headers var

* update glide deps to include logrus

* update new log entries from rebase to use logger instead of log

* DRY up error messages

* prevent API from registering same cluster multiple times

* rename and return only bool for existing CNSI endpoint check function

* throw a regular Error instead of a Fatal if VCS Clients can't be parsed

* List VCS clients endpoint

* Using clientNotFound template in handleVCSAuth

* Use logger instead of log

* Refactor the use of inline markup to templates

* Copt templates to container; fix file paths

* fix logger call

* Update the template names for clarity

* Fixed logger statements

* Initial commit

Initial commit to get etcd stood up in a cluster

* Finalize initial version of the init script & Dockerfile

* Clean up and document init script

* Convert LONGGGG command to multiline

* Rename the Dockerfile

* Fix paths

* Rename folder

* Rename refs to etcd folder

* create PGStore mock

* update tests to use mocked db returned from setupHTTPTest()

* drop logging from mocks, make sure StoreSession.Options is initialized in mock

* add SessionStorer interface

* Expose pgsql EncryptToken function so we can use it in our tests

* use insertErr instead of err

* expand from 3-5 instances

* Remove ENV VAR based approach

* TEAMFOUR-541 Implement stolon for Postgres HA

This change adds stolon related container assets to the proxy project for the sake of Postgres HA.

- cut over to use stolon proxy instead of single user Postgres
- DRY up params in SDL
- remove ENV VARs from postflight Dockerfile
- DRY up ENV VARs in the postflight script
- rename the stratos user/pwd to stackato
- update the README
- tighten up connection string
- override the default stolon startup script with mechanics necessary for HCP.
- provide an initial cluster config file that directs stolon to elect a leader when multiple masters are in play.
- move the etcd initial cluster def into SDL
- add reconfig check
- move several env vars over to SDL

* TEAMFOUR-1052: Allow the API Host URL to be changed by the UI

* Remove debug info

* Fixed api prefix

* Address feedback from Chris

* TEAMFOUR-1044 - Added endpoint to validate HCF credentials

* drop sensitive DB config data from logs

* update vcs.go to send logs to flight recorder

* HSC-1040: Move versions api so that it does not require auth

* Support proxy for Noaa consumer

* HSC-1093: Fix JSON parse error

* add skip_ssl_validation to CNSI records

* use skip_ssl_validation flag to pick which http client to use for requests

* store VCS tokens in the db for reuse

* Refresh token on verifySession

* HSC-1097

* Set Session expiry time to 20 minutes
* Correctly enable the cleanup tick in pgstore

* Reordered time

* s/vcs_user_id/user_guid

* check skip_ssl_validation flag on HCE endpoints, remove unused param from initializeHttpClients

* Extend the expires_on of the session after verifySession is called

* Change distro from debian to ubuntu

* HSC-1097 - expose expiry time to clients

* HSC-1106: Changes to ensure no_proxy applies to the http URLs that are used

* Revert etcd containers to debian jessie

* Update the logger command usage

Update logger command to use:
- FLIGHT_RECORDER_HOST
- FLIGHT_RECORDER_PORT
- -u to overcome issue with the version of logger that ships with trusty
src: http://serverfault.com/questions/524480/ubuntu-12-04-logger-wont-write-to-remote-syslog

* Specify the full hostname

* Put this config file back

* Address review feedback

* Don't use shadow error when there is no parent error. Added missing SkipTLSVerification

* Align field [trivial]

* Removed unused code

* Don't log DB username password. Forward exit code but still popd

* Let's return 503 error when the db is not available

* HSC-1109 Add SkipSSL bool to each VCS_CLIENT entry

- added an optional bool to the vcs clients dta to allow the admin to indicate whether the Console should skipp SSL to a specific VCS endpoint.
- fixed a few lint errors

* HSC-1134 Secure our cookies

Secure out session cookies with the ‘HttpOnly’ and ‘Secure’ attributes.

* Also return 503 in admin middleware

* HSC-1141 Ensure DB password is set for both install & upgrade

The Stackato DB password is (currently) only getting set for install, not upgrade. This pulls that statement out of the IF clause and sets it always.

* Changed approach to set NO_PROXY to reduce risk

* Ensure all etcd host names are added to the NO_PROXY

* Tweak if statement & remove cruft

* Removed unused environment variable

* Do not forward the Connection header to HCF

* Add HCP CA to the OS CA certificate store (#124)

* Add HCP CA to the OS CA certificate store

* Added new line

* Added new line

* Extracted len(clientData) as variable [trivial]

* Use the correct global http client in all vcs requests

* Oops, pass the pointer to client, not the value

* Return on error or else panic!

* Initial changes to embed version in exe

- Remove use of CONSOLE_VERSION
- Add a new var to the interface for console version
- Pull version in within main.go
- Dockerfile change is WRONG and prob needs changing; don’t think we have access to env vars within Dockefile

* Finish up the version logic update

* Remove the use of the ‘Secure’ option for now

* Added a Jira to cover this

* HSC-1034 - Check VCS token is valid on OAuth (#125)

* Check VCS token is valid on OAuth

* Moved response.status read after error check to avoid panic

* Fixed HSC-1166

* HSC-1042 Log all stolon logs to FlightRecorder

* Revert back to the use of ENTRYPOINT

As Neil corrrectly pointed out, the behavior of CMD vs ENTRYPOINT is different. Given I’m not seeing the logs get sent to FlightRecorder, yet I can do so manually, the likely culprit is that the default stolon ENTRYPOINT is boing run and my CMD is being run afterwards. Oops. This change (hopefully) fixes that.

* Update user

* Fix incorrect (and missing) transport timeouts (#123)

* Correctly configure transport overall timeout. Set a connection timeout. Remove unused kill channel and superfluous timer

* Removed unused select blocks

* Reindent portal_config after merging master

* Work around certain browsers sending back an empty cookie after logout

* Renamed function to removeEmptyCookie

* Better fix using regex

* Also moved HttpOnly option into the sessionStore defaults instead of
in Save

* Remove redundant call to SetCookie as this is covered by clearSession

* Drop cookies from request in login

* Will separate secure cookie into another PR

* Secure our cookie to only be sent over HTTPS (#131)

* Detect error when the DB does not have an entry for a valid session cookie id (#133)

* Refactor to remove stolon, etcd and use postgres alone

* Enable migration of the database from stolon HA to single instance

- Update the postfllight job container to use postgres 9.4
- refactor/simplify the RUN statements to reduce layers in the db container
- Enable the database to be dumped from the stolon cluster and loaded on the single instance of postgres

* HSC-1250 Containers need to include Third Party license text files

* Typo

* Update LICENSE file location

* Fix for error logic to check for db and assume session issue otherwise

* Default to returning 401, only return 503 when we get dial type errors

* Trim whitespaces from VCS_CLIENTS param values (#135)

* 1017 refactor unit tests (#104)

* factor out SQL statements

* return errors instead of ok

* DRY up the queries, arguments, and expected rows

* er -> err [trivial]

* make sure verifySession() always returns HTTP Errors, fix panicky tests

* factor out SQL statements

* return errors instead of ok

* DRY up the queries, arguments, and expected rows

* fix up a few more tests

* update calls to initializeHTTPClients and pp.doRequest to match new function signatures

* Implement Goconvey (BDD) DSL (#140)

* factor out SQL statements

* DRY up the queries, arguments, and expected rows

* Initial effort with  the goconvey DSL

* fixups

* clean up these tests

* refactor multiple funcs into one big one

* Further refactor, DRY up these tests

* Edge cases, more DRYing things up (85% coverage)

* Need to call the correct method - I’m an idiot!

* Add goose db version tests

* Refactor datastore

* Refactor to dry up encrypt/decrypt

- Refactor to dry up encrypt/decrypt
- fix up lint errors

* Fix several annoying lint errors

* Further test development, slight refactoring of ReadKey metyhod name

* Skip unnecessary backup/restore to speed up upgrades

* HSC-1185 - detect SSL verification problems

* HSC-1276 - send regular WebSocket Ping messages to avoid proxies closing the connection if the app is quiet

* Send pings every 27s

Protect against very aggressive proxies by sending pings more frequently

* HSC-1276 - close the connection if we miss a pong

* Comment: ping -> pong

* No ;

* Bring docker registry, image name up to date (#137)

* Detect a wider range of SSL errors

* HSC-1292 - Faster deployment of Portal Proxy in dev environments (#145)

* HSC-1292 - Faster deployment of Portal Proxy in dev environments

* Optimised Goose file

* HSC-1310 - Removed Dockerfile.goose.base (#146)

This has migrated to stratos-deploy

* Migrate Console to use GitHub/BitBucket Personal Access Tokens

* Return empty array instead of JSON null in list calls when the list is empty

* Check token scopes and report to the UI

* On upgrade, automatically migrate VCS from connected Code Engines

* Update to go1.7. Tidied up Pre/Post flight dockerfiles. Made the world debian-jessie

* Removed reference to old git oauth flow templates

* Remove bad sudo

* Install missing lsb-release

* Pin to earlier Postgres image

* Fix volume name in middleware.go

* Fix volume name in migrate-vcs.go

* Wait for upgrade to complete before migrating VCSes

* typo

* Relay underlying message from internal method

* Allow deleting a VCS (#153)

* Allow deleting a VCS

* Fixed comment

* Detect that we failed to delete a VCS and return the correct status code (#154)

* When SSl errors occur, feed back detail to the caller

* More concise error msg

* Small update to README to cause new git tag for 4.1

* Update README to get new hash

* Support for HSM endpoints (#157)

* Support for HSM endpoints

* Remove commented out code as per Julein's review

* CF Firehose support (#160)

* Firehose support WIP

* Ensure each user gets the full Firehose stream even if they share credentials

* Refactor common code between app stream and firehose

* Reordered funcs

* Further polishing

* Tidy ups and tune down logging

* Refactor common code between firehose and app streams

* Renamed file to represent enhanced responsibilities

* Fix Portal Proxy tests and convert them to GoConvey (#162)

* Fixed version_ info and pgsql_vcs_token tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed passthrough & auth_tests tests

* Migrated OAuth requests tests to GoConvey

* Let's not parse strings a byte at a time

* Tests for token storage/retrieval (#163)

* Fixed version_ info and pgsql_vcs_token tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed passthrough & auth_tests tests

* Migrated OAuth requests tests to GoConvey

* Added tests for CNSI/UAA Token storage/retrieval

* Added for VCS Tokens

* Fixed typos

* Added additional tests to reach 80%+ coverage (#164)

* Fixed version_ info and pgsql_vcs_token tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed version_ info and pgsql_vcs_token tests

* Fixed passthrough tests

* Fixed passthrough & auth_tests tests

* Migrated OAuth requests tests to GoConvey

* Update README.md

* Added tests for CNSI/UAA Token storage/retrieval

* Added for VCS Tokens

* Fixed typos

* Added additional tests to reach 80%+ coverage

* Initial k8s work

* Updates to logging and configuration

* Fix for for more log statements

* Removed unsused HCP* config properties

* WIP SQLite support

* Added support for SQLite database backend

* Remove files not needed

* Update vendor folder

* Add support for deploying as a Cloud Foundry application

* Remove manifest file

* Addressed PR issues and fixed unit tests

* Fixes

* Add extra metadata to the stackatoinfo call for Cloud Foundry

* Rename stackatoInfo, fix verifySession response. Remove a couple of stackato references

* SQLite Fix: Ensure SQL Statements use the right param substituion char and order is always 1,2,3 etc

* Params MUST be in order - can't use indices with sqlite

* Add check to make sure at least 1 row gets updated

* Update README.md

* Omit cloud foundry metadata when not applicable

* Fixed unit test

* Add portal-proxy concourse Dockerfile (#173)

* Remove comment in test code

* Change go path default

* Remove HPE terms. Rename cookie

* Test commit

* Fix unit tests

Remove `cloud-foundry` property because
this is ommitted during marshalling if it empty

* Optimised Postflight Job (#174)

* Optimised Postflight Job

* Fix unit tests

Remove `cloud-foundry` property because
this is ommitted during marshalling if it empty

* Fix unit tests (#175)

Remove `cloud-foundry` property because
this is ommitted during marshalling if it empty

* Missed a couple

* Tidy up glide dependency management (#177)

* Cleaned up glide.yaml

* Update build script to run glide

* Updated glide files

* Add glide to concourse image for unit tests

* Updated glide.lock file

* Add openssl package to builder

* Downgrade sqlmock-go

* Add vendor to gitignore and downgrade sqlmock-go

* Componentise proxy (#179)

* Initial refactor

* WIP

* Get websocket/firehose working

* Moving stuff around to write build scripts

* Moved dockerfiles to be top level

* renamed components to src

* plugin load mechanism

* fixed imports

* plugin improvements

* Gulp build mechanism [WIP]

* Updated Gulp build files

* Fixed lint issues

* Fixed further lint issues

* Updated Portal Proxy builder image

* Updated load plugin mechanism

* Dedup vendor before building plugins/core

* Changes to interfaces

* Updated GeneralPlugin interface

* CloudFoundry Hosting plugin

* Core changes

* Moved portal proxy config definition

* minor fixes

* Final fixes to the CF Hosting plugin

* Moved code around to reflect stratos-ui structure

* Update build_portal_proxy.sh

* Delete `build.sh`

* remove core & misc changes

* build updates

* Update plugin names

* Update build_portal_proxy.sh

* Update portal-proxy unit tests

* Debugging concourse tests

* minor updates

* Rename `EndpointSpecification` to `EndpointPlugin`

* Renamed Dockerfile.dev

* renamed backend Dockerfile

* Fix lint issue

* Rename backend gulp tasks

* Renamed Dockerfiles

* updated gulpfile for funnsies

* remove hosting plugin

* Remove old references (#1052)

* Rename module helion.framework to app.framework

* Remove references to 'helion'
- Three remaining instances, two in README and one in nginx/license.txt
- In some places I've swapped 'helion' for 'stratos' where we might want to use 'app' instead

* gate check

* Tweak readme

* Remove references to stackato

* Removed references to HPE

* Removed references to hce
Includes removal of code to hide/remove the 'hce' service previously
associated with a hcf applicaiton with a hce pipeline.
If application pipelines are included again it'll be a fresh implementation

* Remove old company name

* e2e fix

* Updated class name app --> console

* gate check

* gate check

* CI bump
- Ensure that the delete space action is enabled for empty spaces on the
space detail page
- Ensure that spaces can be created
* Minor UX fixes
- Cancel/OK buttons on async modals are now aligned with modal content (for example see create org or space)
- Checkboxs are aligned a little better (for example see register endpoint 'skip sll' checkbox)

* CI bump
* Rename import paths in go files

* Configure path

* Enable docker-compose based deployment of merged UI/Proxy

* Clean native built node_modules after proxy compile

* moved Dockerfiles from root to

* Fix unit test gulp target and add CF deployment files

* updated gulp build files

* final updates

* Repurpose `test-backend` target to run backend tests

* Install both dev and prod dependencies
@richard-cox
Copy link
Copy Markdown
Contributor Author

@irfanhabib irfanhabib added suse and removed suse-test labels Jun 6, 2017
Copy link
Copy Markdown
Contributor

@nwmac nwmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nwmac nwmac merged commit 3b27832 into suse Jun 7, 2017
@nwmac nwmac deleted the add-space-e2e branch June 7, 2017 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants