Go to file
John Cowen 6ec6530e03
UI: [BUGFIX] Decode/encode urls (#5206)
In 858b05fc31 (diff-46ef88aa04507fb9b039344277531584)
we removed encoding values in pathnames as we thought they were
eventually being encoded by `ember`. It looks like this isn't the case.

Turns out sometimes they are encoded sometimes they aren't. It's complicated.
If at all possible refer to the PR https://github.com/hashicorp/consul/pull/5206.

It's related to the difference between `dynamic` routes and `wildcard` routes.

Partly related to this is a decision on whether we urlencode the slashes within service names or not. Whilst historically we haven't done this, we feel its a good time to change this behaviour, so we'll also be changing services to use dynamic routes instead of wildcard routes. So service links will then look like /ui/dc-1/services/application%2Fservice rather than /ui/dc-1/services/application/service

Here, we define our routes in a declarative format (for the moment at least JSON) outside of Router.map, and loop through this within Router.map to set all our routes using the standard this.route method. We essentially configure our Router from the outside. As this configuration is now done declaratively outside of Router.map we can also make this data available to href-to and paramsFor, allowing us to detect wildcard routes and therefore apply urlencoding/decoding.

Where I mention 'conditionally' below, this is detection is what is used for the decision.

We conditionally add url encoding to the `{{href-to}}` helper/addon. The
reasoning here is, if we are asking for a 'href/url' then whatever we
receive back should always be urlencoded. We've done this by reusing as much
code from the original `ember-href-to` addon as possible, after this
change every call to the `{{href-to}}` helper will be urlencoded.

As all links using `{{href-to}}` are now properly urlencoded. We also
need to decode them in the correct place 'on the other end', so..

We also override the default `Route.paramsFor` method to conditionally decode all
params before passing them to the `Route.model` hook.

Lastly (the revert), as we almost consistently use url params to
construct API calls, we make sure we re-encode any slugs that have been
passed in by the user/developer. The original API for the `createURL`
function was to allow you to pass values that didn't need encoding,
values that **did** need encoding, followed by query params (which again
require url encoding)

All in all this should make the entire ember app url encode/decode safe.
2019-01-23 13:46:59 +00:00
.circleci refresh cache key and fix comments 2019-01-03 22:57:40 -05:00
.github add codeowners for consul docs 2019-01-03 15:01:16 -05:00
acl New ACLs (#4791) 2018-10-19 12:04:07 -04:00
agent connect: Forward intention RPCs if this isn't the primary 2019-01-22 11:29:21 -08:00
api agent: display messages from serf in cli (#5236) 2019-01-22 21:08:50 +01:00
bench Gets benchmarks running again and does a rough pass for 0.7.1. 2016-11-29 13:02:26 -08:00
build-support Dont expect the freebsd/arm build 2018-10-19 14:50:51 -04:00
command agent: display messages from serf in cli (#5236) 2019-01-22 21:08:50 +01:00
connect connect: remove additional trust-domain validation (#4934) 2018-11-12 20:20:12 +00:00
demo demo: Added udp port forwarding 2018-05-30 13:56:56 +09:00
ipaddr New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
lib connect: tame thundering herd of CSRs on CA rotation (#5228) 2019-01-22 17:19:36 +00:00
logger Connect Envoy Command (#4735) 2018-10-10 16:55:34 +01:00
sentinel Renames stubs to be more consistent. 2017-11-29 18:36:52 -08:00
service_os Changes made : 2018-06-28 21:18:14 -04:00
snapshot snapshot: read meta.json correctly. (#5193) 2019-01-08 17:06:28 +01:00
terraform terraform: fix formatting of consul.tf (#4580) 2018-10-24 08:02:38 -07:00
test snapshot: read meta.json correctly. (#5193) 2019-01-08 17:06:28 +01:00
testrpc Bugfix: Use "%#v" when formatting structs (#4600) 2018-08-28 12:37:34 -04:00
testutil testutil: If testing.T is nil panic with error (#4725) 2018-10-26 12:13:40 -07:00
tlsutil agent: honor when ca is set but verify_outgoing is disabled (#4826) 2018-12-17 09:56:18 -08:00
types Removes remoteConsuls in favor of the new router. 2017-03-16 16:42:19 -07:00
ui update ffi to dodge CVE-2018-1000201 (#4670) 2018-09-14 11:22:48 +02:00
ui-v2 UI: [BUGFIX] Decode/encode urls (#5206) 2019-01-23 13:46:59 +00:00
vendor Revendor serf to pull in keyring list truncation changes. (#5251) 2019-01-22 16:07:04 -05:00
version Put the tree in v1.4.1 dev mode 2018-11-14 16:56:48 -08:00
watch Fix data race (#5029) 2019-01-08 11:43:14 -05:00
website website: update nokogiri (#5252) 2019-01-22 21:49:16 +01:00
.dockerignore Update the scripting 2018-06-14 21:42:47 -04:00
.gitattributes Initial commit 2013-11-04 14:15:27 -08:00
.gitignore merge feedback: fix typos; actually use deliverLatest added previously but not plumbed in 2018-10-10 16:55:34 +01:00
.travis.yml Bump Go version for CI and build to 1.11.1 (#4782) 2018-10-11 12:21:53 +01:00
CHANGELOG.md Update CHANGELOG.md 2019-01-22 21:17:39 +01:00
GNUmakefile CA Provider Plugins (#4751) 2019-01-07 12:48:44 -05:00
INTERNALS.md docs: correct link to top level agent package (#4750) 2018-10-04 09:15:55 -05:00
LICENSE Initial commit 2013-11-04 14:15:27 -08:00
NOTICE.md add copyright notice file 2018-07-09 10:58:26 -07:00
README.md Contribution guide (#4704) 2018-10-05 09:06:40 -07:00
Vagrantfile Adds a basic Linux Vagrant setup, stolen from Nomad. 2017-10-06 08:10:12 -07:00
main.go Added Side Effect import for Windows Service 2018-06-18 14:55:11 -04:00
main_test.go Adding basic CLI infrastructure 2013-12-19 11:22:08 -08:00

README.md

Consul Build Status Join the chat at https://gitter.im/hashicorp-consul/Lobby

Consul is a tool for service discovery and configuration. Consul is distributed, highly available, and extremely scalable.

Consul provides several key features:

  • Service Discovery - Consul makes it simple for services to register themselves and to discover other services via a DNS or HTTP interface. External services such as SaaS providers can be registered as well.

  • Health Checking - Health Checking enables Consul to quickly alert operators about any issues in a cluster. The integration with service discovery prevents routing traffic to unhealthy hosts and enables service level circuit breakers.

  • Key/Value Storage - A flexible key/value store enables storing dynamic configuration, feature flagging, coordination, leader election and more. The simple HTTP API makes it easy to use anywhere.

  • Multi-Datacenter - Consul is built to be datacenter aware, and can support any number of regions without complex configuration.

  • Service Segmentation - Consul Connect enables secure service-to-service communication with automatic TLS encryption and identity-based authorization.

Consul runs on Linux, Mac OS X, FreeBSD, Solaris, and Windows. A commercial version called Consul Enterprise is also available.

Please note: We take Consul's security and our users' trust very seriously. If you believe you have found a security issue in Consul, please responsibly disclose by contacting us at security@hashicorp.com.

Quick Start

An extensive quick start is viewable on the Consul website:

https://www.consul.io/intro/getting-started/install.html

Documentation

Full, comprehensive documentation is viewable on the Consul website:

https://www.consul.io/docs

Contributing

Thank you for your interest in contributing! Please refer to CONTRIBUTING.md for guidance.