mirror of https://github.com/hashicorp/consul
commit
d032fb52a2
@ -0,0 +1,3 @@
|
||||
```release-note:improvement
|
||||
ci: Enable security scanning for CRT
|
||||
```
|
@ -0,0 +1,3 @@
|
||||
```release-note:deprecation
|
||||
acl: The `consul.acl.ResolveTokenToIdentity` metric is no longer reported. The values that were previous reported as part of this metric will now be part of the `consul.acl.ResolveToken` metric.
|
||||
```
|
@ -0,0 +1,3 @@
|
||||
```release-note:enhancement
|
||||
ui: Use @hashicorp/flight icons for all our icons.
|
||||
```
|
@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
ca: adjust validation of PrivateKeyType/Bits with the Vault provider, to remove the error when the cert is created manually in Vault.
|
||||
```
|
@ -1,14 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" = "purge" ]
|
||||
then
|
||||
userdel consul
|
||||
if [ -d "/run/systemd/system" ]; then
|
||||
systemctl --system daemon-reload >/dev/null || :
|
||||
fi
|
||||
|
||||
if [ "$1" == "upgrade" ] && [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
systemctl restart consul >/dev/null || true
|
||||
fi
|
||||
case "$1" in
|
||||
purge | 0)
|
||||
userdel consul
|
||||
;;
|
||||
|
||||
exit 0
|
||||
upgrade | [1-9]*)
|
||||
if [ -d "/run/systemd/system" ]; then
|
||||
systemctl try-restart consul.service >/dev/null || :
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
case "$1" in
|
||||
remove | 0)
|
||||
if [ -d "/run/systemd/system" ]; then
|
||||
systemctl --no-reload disable consul.service > /dev/null || :
|
||||
systemctl stop consul.service > /dev/null || :
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -0,0 +1,13 @@
|
||||
container {
|
||||
dependencies = true
|
||||
alpine_secdb = true
|
||||
secrets = true
|
||||
}
|
||||
|
||||
binary {
|
||||
secrets = true
|
||||
go_modules = false
|
||||
osv = true
|
||||
oss_index = true
|
||||
nvd = true
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_NAME="$(basename ${BASH_SOURCE[0]})"
|
||||
pushd $(dirname ${BASH_SOURCE[0]}) > /dev/null
|
||||
SCRIPT_DIR=$(pwd)
|
||||
pushd ../.. > /dev/null
|
||||
SOURCE_DIR=$(pwd)
|
||||
popd > /dev/null
|
||||
pushd ../functions > /dev/null
|
||||
FN_DIR=$(pwd)
|
||||
popd > /dev/null
|
||||
popd > /dev/null
|
||||
|
||||
source "${SCRIPT_DIR}/functions.sh"
|
||||
|
||||
function usage {
|
||||
cat <<-EOF
|
||||
Usage: ${SCRIPT_NAME} [<options ...>]
|
||||
|
||||
Description:
|
||||
This script will build the Consul binary on the local system.
|
||||
All the requisite tooling must be installed for this to be
|
||||
successful.
|
||||
|
||||
Options:
|
||||
|
||||
-s | --source DIR Path to source to build.
|
||||
Defaults to "${SOURCE_DIR}"
|
||||
|
||||
-o | --os OSES Space separated string of OS
|
||||
platforms to build.
|
||||
|
||||
-a | --arch ARCH Space separated string of
|
||||
architectures to build.
|
||||
|
||||
-h | --help Print this help text.
|
||||
EOF
|
||||
}
|
||||
|
||||
function err_usage {
|
||||
err "$1"
|
||||
err ""
|
||||
err "$(usage)"
|
||||
}
|
||||
|
||||
function main {
|
||||
declare sdir="${SOURCE_DIR}"
|
||||
declare build_os=""
|
||||
declare build_arch=""
|
||||
|
||||
|
||||
while test $# -gt 0
|
||||
do
|
||||
case "$1" in
|
||||
-h | --help )
|
||||
usage
|
||||
return 0
|
||||
;;
|
||||
-s | --source )
|
||||
if test -z "$2"
|
||||
then
|
||||
err_usage "ERROR: option -s/--source requires an argument"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! test -d "$2"
|
||||
then
|
||||
err_usage "ERROR: '$2' is not a directory and not suitable for the value of -s/--source"
|
||||
return 1
|
||||
fi
|
||||
|
||||
sdir="$2"
|
||||
shift 2
|
||||
;;
|
||||
-o | --os )
|
||||
if test -z "$2"
|
||||
then
|
||||
err_usage "ERROR: option -o/--os requires an argument"
|
||||
return 1
|
||||
fi
|
||||
|
||||
build_os="$2"
|
||||
shift 2
|
||||
;;
|
||||
-a | --arch )
|
||||
if test -z "$2"
|
||||
then
|
||||
err_usage "ERROR: option -a/--arch requires an argument"
|
||||
return 1
|
||||
fi
|
||||
|
||||
build_arch="$2"
|
||||
shift 2
|
||||
;;
|
||||
* )
|
||||
err_usage "ERROR: Unknown argument: '$1'"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
build_consul_local "${sdir}" "${build_os}" "${build_arch}" || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
main "$@"
|
||||
exit $?
|
@ -0,0 +1,42 @@
|
||||
# Adding a Changelog Entry
|
||||
|
||||
Any change that a Consul user might need to know about should have a changelog entry.
|
||||
|
||||
What doesn't need a changelog entry?
|
||||
- Docs changes
|
||||
- Typos fixes, unless they are in a public-facing API
|
||||
- Code changes we are certain no Consul users will need to know about
|
||||
|
||||
To include a [changelog entry](../.changelog) in a PR, commit a text file
|
||||
named `.changelog/<PR#>.txt`, where `<PR#>` is the number associated with the open
|
||||
PR in Github. The text file should describe the changes in the following format:
|
||||
|
||||
````
|
||||
```release-note:<change type>
|
||||
<code area>: <brief description of the improvement you made here>
|
||||
```
|
||||
````
|
||||
|
||||
Valid values for `<change type>` include:
|
||||
- `feature`: for the addition of a new feature
|
||||
- `improvement`: for an improvement (not a bug fix) to an existing feature
|
||||
- `bug`: for a bug fix
|
||||
- `security`: for any Common Vulnerabilities and Exposures (CVE) resolutions
|
||||
- `breaking-change`: for any change that is not fully backwards-compatible
|
||||
- `deprecation`: for functionality which is now marked for removal in a future release
|
||||
|
||||
`<code area>` is meant to categorize the functionality affected by the change.
|
||||
Some common values are:
|
||||
- `checks`: related to node or service health checks
|
||||
- `cli`: related to the command-line interface and its commands
|
||||
- `config`: related to configuration changes (e.g., adding a new config option)
|
||||
- `connect`: catch-all for the Connect subsystem that provides service mesh functionality
|
||||
if no more specific `<code area>` applies
|
||||
- `http`: related to the HTTP API interface and its endpoints
|
||||
- `dns`: related to DNS functionality
|
||||
- `ui`: any change related to the built-in Consul UI (`website/` folder)
|
||||
|
||||
Look in the [`.changelog/`](../.changelog) folder for examples of existing changelog entries.
|
||||
|
||||
If a PR deserves multiple changelog entries, just add multiple entries separated by a newline
|
||||
in the format described above to the `.changelog/<PR#>.txt` file.
|
@ -0,0 +1,19 @@
|
||||
# Forking the Consul Repo
|
||||
|
||||
Community members wishing to contribute code to Consul must fork the Consul project
|
||||
(`your-github-username/consul`). Branches pushed to that fork can then be submitted
|
||||
as pull requests to the upstream project (`hashicorp/consul`).
|
||||
|
||||
To locally clone the repo so that you can pull the latest from the upstream project
|
||||
(`hashicorp/consul`) and push changes to your own fork (`your-github-username/consul`):
|
||||
|
||||
1. [Create the forked repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo#forking-a-repository) (`your-github-username/consul`)
|
||||
2. Clone the `hashicorp/consul` repository and `cd` into the folder
|
||||
3. Make `hashicorp/consul` the `upstream` remote rather than `origin`:
|
||||
`git remote rename origin upstream`.
|
||||
4. Add your fork as the `origin` remote. For example:
|
||||
`git remote add origin https://github.com/myusername/consul`
|
||||
5. Checkout a feature branch: `git checkout -t -b new-feature`
|
||||
6. [Make changes](../../.github/CONTRIBUTING.md#modifying-the-code)
|
||||
7. Push changes to the fork when ready to [submit a PR](../../.github/CONTRIBUTING.md#submitting-a-pull-request):
|
||||
`git push -u origin new-feature`
|
@ -1,3 +1,31 @@
|
||||
.consul-external-source {
|
||||
@extend %pill-200, %frame-gray-600, %p1;
|
||||
}
|
||||
.consul-external-source.kubernetes::before {
|
||||
@extend %with-logo-kubernetes-color-icon, %as-pseudo;
|
||||
}
|
||||
.consul-external-source.terraform::before {
|
||||
@extend %with-logo-terraform-color-icon, %as-pseudo;
|
||||
}
|
||||
.consul-external-source.nomad::before {
|
||||
@extend %with-logo-nomad-color-icon, %as-pseudo;
|
||||
}
|
||||
.consul-external-source.consul::before,
|
||||
.consul-external-source.consul-api-gateway::before {
|
||||
@extend %with-logo-consul-color-icon, %as-pseudo;
|
||||
}
|
||||
.consul-external-source.vault::before {
|
||||
@extend %with-vault-100;
|
||||
}
|
||||
.consul-external-source.aws::before {
|
||||
@extend %with-aws-100;
|
||||
}
|
||||
.consul-external-source.leader::before {
|
||||
@extend %with-star-outline-mask, %as-pseudo;
|
||||
}
|
||||
.consul-external-source.jwt::before {
|
||||
@extend %with-logo-jwt-color-icon, %as-pseudo;
|
||||
}
|
||||
.consul-external-source.oidc::before {
|
||||
@extend %with-logo-oidc-color-icon, %as-pseudo;
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
.consul-intention-fieldsets {
|
||||
.value-allow > :last-child::before {
|
||||
@extend %with-arrow-right-mask, %as-pseudo;
|
||||
color: rgb(var(--tone-green-500));
|
||||
@extend %with-allow-500;
|
||||
}
|
||||
.value-deny > :last-child::before {
|
||||
@extend %with-deny-color-icon, %as-pseudo;
|
||||
@extend %with-deny-500;
|
||||
}
|
||||
.value- > :last-child::before {
|
||||
@extend %with-layers-mask, %as-pseudo;
|
||||
@extend %with-l7-500;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
import Helper from '@ember/component/helper';
|
||||
import { assert } from '@ember/debug';
|
||||
import { adoptStyles } from '@lit/reactive-element';
|
||||
|
||||
export default class AdoptStylesHelper extends Helper {
|
||||
/**
|
||||
* Adopt/apply given styles to a `ShadowRoot` using constructable styleSheets if supported
|
||||
*
|
||||
* @param {[ShadowRoot, CSSResultGroup]} params
|
||||
*/
|
||||
compute([$shadow, styles], hash) {
|
||||
assert(
|
||||
'adopt-styles can only be used to apply styles to ShadowDOM elements',
|
||||
$shadow instanceof ShadowRoot
|
||||
);
|
||||
adoptStyles($shadow, [styles]);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
# adopt-styles
|
||||
|
||||
Adopt/apply given styles to a `ShadowRoot` using constructable styleSheets if supported
|
||||
|
||||
```hbs preview-template
|
||||
<div
|
||||
{{attach-shadow (set this 'shadow')}}
|
||||
>
|
||||
{{#if this.shadow}}
|
||||
{{#in-element this.shadow}}
|
||||
{{adopt-styles this.shadow (css '
|
||||
:host {
|
||||
background-color: red;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
')}}
|
||||
{{/in-element}}
|
||||
{{/if}}
|
||||
</div>
|
||||
```
|
||||
|
||||
## Positional Arguments
|
||||
|
||||
| Argument | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `params` | `[ShadowRoot, CSSResultGroup]` | | |
|
||||
|
@ -0,0 +1,8 @@
|
||||
import Helper from '@ember/component/helper';
|
||||
import { css } from '@lit/reactive-element';
|
||||
|
||||
export default class ConsoleLogHelper extends Helper {
|
||||
compute([str], hash) {
|
||||
return css([str]);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
import { helper } from '@ember/component/helper';
|
||||
|
||||
/**
|
||||
* Conditionally maps styles to a string ready for typical DOM
|
||||
* usage (i.e. semi-colon delimited)
|
||||
*
|
||||
* @typedef {([string, (string | undefined), string] | [string, (string | undefined)])} styleInfo
|
||||
* @param {styleInfo[]} entries - An array of `styleInfo`s to map
|
||||
* @param {boolean} transform=true - whether to perform the build-time 'helper
|
||||
* to modifier' transpilation. Note a transpiler needs installing separately.
|
||||
*/
|
||||
const styleMap = (entries, transform = true) => {
|
||||
const str = entries.reduce((prev, [prop, value, unit = '']) => {
|
||||
if (value == null) {
|
||||
return prev;
|
||||
}
|
||||
return `${prev}${prop}:${value.toString()}${unit};`;
|
||||
}, '');
|
||||
return str.length > 0 ? str : undefined;
|
||||
};
|
||||
|
||||
export default helper(styleMap);
|
@ -0,0 +1,58 @@
|
||||
# style-map
|
||||
|
||||
`{{style-map}}` is used to easily add a list of styles, conditionally, and
|
||||
have them all formatted nicely to be printed in a DOM `style` attribute.
|
||||
|
||||
As well as an entry-like array you can also pass an additional `unit` property
|
||||
as the 3rd item in the array. This is to make it easier to do mathamatical
|
||||
calculations for units without having to use `(concat)`.
|
||||
|
||||
If any property has a value of `null` or `undefined`, that style property will
|
||||
not be included in the resulting string.
|
||||
|
||||
```hbs preview-template
|
||||
<figure>
|
||||
<figcaption>
|
||||
This div has the correct style added/omitted.
|
||||
</figcaption>
|
||||
<div
|
||||
style={{style-map
|
||||
(array 'outline' '1px solid red')
|
||||
(array 'width' '600px')
|
||||
(array 'height' 100 'px')
|
||||
(array 'padding' 1 'rem')
|
||||
(array 'background' null)
|
||||
}}
|
||||
>
|
||||
<code>
|
||||
style={{style-map
|
||||
(array 'outline' '1px solid red')
|
||||
(array 'width' '600px')
|
||||
(array 'height' 100 'px')
|
||||
(array 'padding' 1 'rem')
|
||||
(array 'background' null)
|
||||
}}
|
||||
</code>
|
||||
</div>
|
||||
</figure>
|
||||
```
|
||||
|
||||
## Positional Arguments
|
||||
|
||||
| Argument | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `entries` | `styleInfo[]` | | An array of `styleInfo`s to map |
|
||||
|
||||
## Named Arguments
|
||||
|
||||
| Argument | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `transform` | `boolean` | true | whether to perform the build-time 'helper to modifier' transpilation |
|
||||
|
||||
## Types
|
||||
|
||||
| Type | Default | Description |
|
||||
| --- | --- | --- |
|
||||
| `styleInfo` | `([string, (string \| undefined), string] \| [string, (string \| undefined)])` | |
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
import { setModifierManager, capabilities } from '@ember/modifier';
|
||||
|
||||
export default setModifierManager(
|
||||
() => ({
|
||||
capabilities: capabilities('3.13', { disableAutoTracking: true }),
|
||||
|
||||
createModifier() {},
|
||||
|
||||
installModifier(_state, element, { positional: [fn, ...args], named }) {
|
||||
let shadow;
|
||||
try {
|
||||
shadow = element.attachShadow({ mode: 'open' });
|
||||
} catch (e) {
|
||||
// shadow = false;
|
||||
console.error(e);
|
||||
}
|
||||
fn(shadow);
|
||||
},
|
||||
updateModifier() {},
|
||||
destroyModifier() {},
|
||||
}),
|
||||
class CustomElementModifier {}
|
||||
);
|
@ -0,0 +1,28 @@
|
||||
# attach-shadow
|
||||
|
||||
`{{attach-shadow (set this 'shadow')}}` attaches a `ShadowRoot` to the modified DOM element
|
||||
and pass a reference to that `ShadowRoot` to the setter function.
|
||||
|
||||
|
||||
Please note: This should be used as a utility modifier for when having access
|
||||
to the shadow DOM is handy, not really for building full blown shadow DOM
|
||||
based Web Components.
|
||||
|
||||
```hbs preview-template
|
||||
<div
|
||||
{{attach-shadow (set this 'shadow')}}
|
||||
>
|
||||
{{#if this.shadow}}
|
||||
{{#in-element this.shadow}}
|
||||
<slot name="name"></slot>
|
||||
{{/in-element}}
|
||||
{{/if}}
|
||||
<p slot="name">Hello from the shadows!</p>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Positional Arguments
|
||||
|
||||
| Argument | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `setter` | `function` | | Usually `set` or `mut` or similar |
|
@ -0,0 +1,45 @@
|
||||
import Modifier from 'ember-modifier';
|
||||
import { action } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class OnOutsideModifier extends Modifier {
|
||||
@service('dom') dom;
|
||||
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.doc = this.dom.document();
|
||||
}
|
||||
async connect(params, options) {
|
||||
await new Promise(resolve => setTimeout(resolve, 0));
|
||||
try {
|
||||
this.doc.addEventListener(params[0], this.listen);
|
||||
} catch (e) {
|
||||
// continue
|
||||
}
|
||||
}
|
||||
|
||||
@action
|
||||
listen(e) {
|
||||
if (this.dom.isOutside(this.element, e.target)) {
|
||||
const dispatch = typeof this.params[1] === 'function' ? this.params[1] : _ => {};
|
||||
dispatch.apply(this.element, [e]);
|
||||
}
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.doc.removeEventListener('click', this.listen);
|
||||
}
|
||||
|
||||
didReceiveArguments() {
|
||||
this.params = this.args.positional;
|
||||
this.options = this.args.named;
|
||||
}
|
||||
|
||||
didInstall() {
|
||||
this.connect(this.args.positional, this.args.named);
|
||||
}
|
||||
|
||||
willRemove() {
|
||||
this.disconnect();
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
# on-outside
|
||||
|
||||
`{{on-outside 'click' (fn @callback}}` works similarly to `{{on }}` but allows
|
||||
you to attach handlers that is specifically not the currently modified
|
||||
element.
|
||||
|
||||
```hbs preview-template
|
||||
<button
|
||||
{{on-outside 'click' (set this 'clicked' 'outside clicked')}}
|
||||
{{on 'click' (set this 'clicked' 'inside clicked')}}
|
||||
style="background: red;width: 100px;height: 100px;"
|
||||
>
|
||||
{{or this.clicked "click me or outside of me"}}
|
||||
</button>
|
||||
```
|
||||
|
||||
## Positional Arguments
|
||||
|
||||
| Argument | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `event` | `string` | | Name of the event to listen for |
|
||||
| `handler` | `function` | | Function to handle the event |
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,71 @@
|
||||
%with-vault-100 {
|
||||
@extend %with-vault-16-mask, %as-pseudo;
|
||||
color: rgb(var(--tone-vault-500));
|
||||
}
|
||||
%with-vault-300 {
|
||||
@extend %with-vault-16-mask, %as-pseudo;
|
||||
color: rgb(var(--tone-vault-500));
|
||||
}
|
||||
%with-aws-100,
|
||||
%with-aws-300 {
|
||||
@extend %aws-color-16-svg-prop;
|
||||
@extend %with-icon, %as-pseudo;
|
||||
|
||||
background-image: var(--theme-dark-none) var(--aws-color-16-svg);
|
||||
|
||||
-webkit-mask-image: var(--theme-light-none) var(--aws-color-16-svg);
|
||||
-webkit-mask-repeat: var(--theme-light-none) no-repeat;
|
||||
-webkit-mask-position: var(--theme-light-none) center;
|
||||
mask-image: var(--theme-light-none) var(--aws-color-16-svg);
|
||||
mask-repeat: var(--theme-light-none) no-repeat;
|
||||
mask-position: var(--theme-light-none) center;
|
||||
background-color: var(--theme-light-none) rgb(var(--white));
|
||||
}
|
||||
%with-allow-100,
|
||||
%with-aws-100,
|
||||
%with-deny-100,
|
||||
%with-l7-100,
|
||||
%with-vault-100 {
|
||||
width: 0.75rem; /* 12px */
|
||||
height: 0.75rem; /* 12px */
|
||||
}
|
||||
%with-allow-500,
|
||||
%with-deny-500,
|
||||
%with-l7-500 {
|
||||
width: 1.25rem; /* 20px */
|
||||
height: 1.25rem; /* 20px */
|
||||
}
|
||||
%with-allow-300,
|
||||
%with-allow-500 {
|
||||
color: rgb(var(--tone-green-500));
|
||||
}
|
||||
%with-deny-300,
|
||||
%with-deny-500 {
|
||||
color: rgb(var(--tone-red-500));
|
||||
}
|
||||
%with-allow-300,
|
||||
%with-allow-500,
|
||||
%with-deny-300,
|
||||
%with-deny-500,
|
||||
%with-l7-300,
|
||||
%with-l7-500 {
|
||||
@extend %as-pseudo;
|
||||
}
|
||||
%with-allow-300 {
|
||||
@extend %with-arrow-right-16-mask;
|
||||
}
|
||||
%with-allow-500 {
|
||||
@extend %with-arrow-right-24-mask;
|
||||
}
|
||||
%with-deny-300 {
|
||||
@extend %with-skip-16-mask;
|
||||
}
|
||||
%with-deny-500 {
|
||||
@extend %with-skip-24-mask;
|
||||
}
|
||||
%with-l7-300 {
|
||||
@extend %with-layers-16-mask;
|
||||
}
|
||||
%with-l7-500 {
|
||||
@extend %with-layers-24-mask;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue