1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-18 13:48:58 +02:00

Docusaurusv2 (#864)

feat: Upgraded to Docusaurus v2

closes: #771
This commit is contained in:
Christopher Kolstad 2021-06-04 11:17:15 +02:00 committed by GitHub
parent 4e55cd52cd
commit 406f0554cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
235 changed files with 18924 additions and 8900 deletions

View File

@ -7,3 +7,4 @@ website/i18n/*.js
website/translated_docs
website/core
website/pages
websitev2

View File

@ -18,7 +18,7 @@ jobs:
git config --global user.email "${GH_EMAIL}"
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
# Stage the file, commit and push
cd website && npm install && GIT_USER="ivarconr" npm run publish-gh-pages
cd websitev2 && yarn && GIT_USER="ivarconr" yarn deploy
env:
GH_NAME: 'ivarconr'
GH_EMAIL: 'ivarconr@gmail.com'

View File

@ -1,32 +0,0 @@
---
id: index
title: API Documentation
---
## Client API
This describes the API provided to unleash-clients.
Since v4.0.0 all operations require an [API token](token.md) with `Client` level access.
With versions earlier than v4.0.0 and `insecure` authentication no authentication is required.
- [Feature Toggles API](client/feature-toggles-api.md)
- [Register API](client/register-api.md)
- [Metrics API](client/metrics-api.md)
## Admin API (internal)
The internal API used by the Admin UI (unleash-frontend). Since v4.0.0 all operations require an [API token](token.md) with `Admin` level access:
With versions earlier than v4.0.0 and `insecure` authentication Basic Auth (with curl `-u myemail@test.com:`) is enough
- [Feature Toggles API](admin/feature-toggles-api.md)
- [Strategies API](admin/strategies-api.md)
- [Events API](admin/events-api.md)
- [Metrics API](admin/metrics-api.md)
- [Tags API](admin/tags-api.md)
## System API's
- [Internal Backstage API](internal-backstage-api.md)

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -1,3 +0,0 @@
Please see <a href="/docs/user_guide/client-sdk.md">/docs/user_guide/client_sdk</a>
<meta http-equiv="refresh" content="0; URL=/docs/user_guide/client-sdk.md">

View File

@ -1,7 +0,0 @@
<script>
window.location = '/docs/user_guide';
</script>
Please see <a href="/docs/user_guide">/docs/user_guide</a>
<meta http-equiv="refresh" content="0; URL=//docs/user_guide">

View File

@ -1,3 +0,0 @@
Please see <a href="/docs/advanced/feature-toggle-variants.md">/docs/advanced/feature-toggle-variants</a>
<meta http-equiv="refresh" content="0; URL=/docs/advanced/feature-toggle-variants.md">

View File

@ -1,12 +0,0 @@
---
id: client_sdk
title: Client SDK
---
<script>
window.location = '/docs/sdks';
</script>
Please see <a href="/docs/sdks">/docs/sdks</a>
<meta http-equiv="refresh" content="0; URL=//docs/sdks">

View File

@ -1,12 +0,0 @@
---
id: connect_sdk
title: Connect your SDK
---
<script>
window.location = '/docs/sdks';
</script>
Please see <a href="/docs/sdks">/docs/sdks</a>
<meta http-equiv="refresh" content="0; URL=//docs/sdks">

View File

@ -74,6 +74,7 @@
"src/binver-dev.js",
"dist",
"snapshots",
"coverage"
"coverage",
"websitev2"
]
}

View File

@ -1,86 +0,0 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const React = require('react');
class Footer extends React.Component {
docUrl(doc, language) {
const baseUrl = this.props.config.baseUrl;
return `${baseUrl}docs/${language ? `${language}/` : ''}${doc}`;
}
pageUrl(doc, language) {
const baseUrl = this.props.config.baseUrl;
return baseUrl + (language ? `${language}/` : '') + doc;
}
render() {
return (
<footer className="nav-footer" id="footer">
<section className="sitemap">
<a href={this.props.config.baseUrl} className="nav-home">
{this.props.config.footerIcon && (
<img
src={this.props.config.baseUrl + this.props.config.footerIcon}
alt={this.props.config.title}
width="66"
height="58"
/>
)}
</a>
<div>
<h5>Docs</h5>
<a href={this.docUrl('user_guide/index.html')}>
Getting Started
</a>
<a href={this.docUrl('api/client/features.html')}>
API Reference
</a>
</div>
<div>
<h5>Community</h5>
<a href={this.pageUrl('users.html')}>
User Showcase
</a>
<a
href="https://join.slack.com/t/unleash-community/shared_invite/enQtNjUxMjU2MDc0MTAxLTJjYmViYjkwYmE0ODVlNmY1YjcwZGRmZWU5MTU1YTQ1Nzg5ZWQ2YzBlY2U1MjlmZDg5ZDRmZTMzNmQ5YmEyOGE"
target="_blank"
rel="noreferrer noopener">
Slack community
</a>
<a
href="https://www.getunleash.io">
getunleash.io
</a>
<a
href="https://twitter.com/Unleash_hosted"
target="_blank"
rel="noreferrer noopener">
Twitter
</a>
</div>
<div>
<h5>More</h5>
<a href="https://github.com/Unleash/unleash">GitHub</a>
<a
className="github-button"
href={this.props.config.repoUrl}
data-icon="octicon-star"
data-count-href="/unleash/unleash/stargazers"
data-show-count="true"
data-count-aria-label="# stargazers on GitHub"
aria-label="Star this project on GitHub">
Star
</a>
</div>
</section>
</footer>
);
}
}
module.exports = Footer;

View File

@ -1,272 +0,0 @@
{
"_comment": "This file is auto-generated by write-translations.js",
"localized-strings": {
"next": "Next",
"previous": "Previous",
"tagline": "The enterprise ready feature toggle service",
"docs": {
"activation_strategy": {
"title": "Activation Strategies"
},
"addons/index": {
"title": "Addons Introduction"
},
"addons/datadog": {
"title": "Datadog"
},
"addons/slack": {
"title": "Slack"
},
"addons/teams": {
"title": "Microsoft Teams"
},
"addons/webhook": {
"title": "Webhook"
},
"advanced/api_access": {
"title": "API Access"
},
"advanced/archived_toggles": {
"title": "Archived toggles"
},
"advanced/audit_log": {
"title": "The audit log"
},
"advanced/custom_activation_strategy": {
"title": "Custom Activation Strategy"
},
"advanced/enterprise-authentication": {
"title": "Authentication (Single-Sign-On)"
},
"advanced/feature_toggle_types": {
"title": "Feature Toggle Types"
},
"advanced/toggle_variants": {
"title": "Feature Toggle Variants"
},
"advanced/strategy_constraints": {
"title": "Strategy Constraints"
},
"advanced/tags": {
"title": "Tagging Features"
},
"api/admin/addons": {
"title": "/api/admin/addons"
},
"api/admin/context": {
"title": "/api/admin/context"
},
"api/admin/events": {
"title": "/api/admin/events"
},
"api/admin/features": {
"title": "/api/admin/features"
},
"api/admin/features-archive": {
"title": "/api/admin/archive"
},
"api/admin/feature-types": {
"title": "/api/admin/feature-types"
},
"api/admin/metrics": {
"title": "/api/admin/metrics"
},
"api/admin/projects": {
"title": "/api/admin/projects"
},
"api/admin/state": {
"title": "/api/admin/state"
},
"api/admin/strategies": {
"title": "/api/admin/strategies"
},
"api/admin/tags": {
"title": "/api/admin/tags"
},
"api/admin/user-admin": {
"title": "/api/admin/user-admin"
},
"api/basic-auth": {
"title": "Basic Auth"
},
"api/client/features": {
"title": "/api/client/features"
},
"api/client/metrics": {
"title": "/api/client/metrics"
},
"api/client/register": {
"title": "/api/client/register"
},
"api/index": {
"title": "API Documentation"
},
"api/internal/health": {
"title": "/health"
},
"api/internal/internal": {
"title": "/internal-backstage/prometheus"
},
"api/open_api": {
"title": "Open API Specification"
},
"client_sdk": {
"title": "client_sdk"
},
"client-specification": {
"title": "Client Specification"
},
"contributing/developer-guide": {
"title": "contributing/developer-guide"
},
"deploy/configuring_unleash_v3": {
"title": "Configuring Unleash"
},
"deploy/configuring_unleash": {
"title": "Configuring Unleash"
},
"deploy/database_backup": {
"title": "Database Backup"
},
"deploy/database-setup": {
"title": "Database Setup"
},
"deploy/email": {
"title": "Email service"
},
"deploy/getting_started": {
"title": "Getting Started"
},
"deploy/google_auth_v3": {
"title": "Google Auth Hook"
},
"deploy/google_auth": {
"title": "Google Auth Hook"
},
"deploy/import_export": {
"title": "Import & Export"
},
"deploy/migration_guide": {
"title": "Migration Guide"
},
"deploy/securing-unleash-v3": {
"title": "Securing Unleash v3"
},
"deploy/securing_unleash": {
"title": "Securing Unleash"
},
"guides/feature_updates_to_slack": {
"title": "Feature Updates To slack"
},
"index": {
"title": "index"
},
"integrations/integrations": {
"title": "Integrations and plugins"
},
"sdks/community": {
"title": "Community SDKs..."
},
"sdks/dot_net_sdk": {
"title": ".net SDK"
},
"sdks/go_sdk": {
"title": "GO SDK"
},
"sdks/index": {
"title": "Introduction"
},
"sdks/java_sdk": {
"title": "Java SDK"
},
"sdks/node_sdk": {
"title": "Node SDK"
},
"sdks/proxy-javascript": {
"title": "JavaScript Proxy SDK"
},
"sdks/python_sdk": {
"title": "Python SDK"
},
"sdks/ruby_sdk": {
"title": "Ruby SDK"
},
"sdks/unleash-proxy": {
"title": "The Unleash Proxy"
},
"toggle_variants": {
"title": "toggle_variants"
},
"unleash_context": {
"title": "Unleash Context"
},
"user_guide/activation_strategy": {
"title": "Activation Strategies"
},
"user_guide/client_sdk": {
"title": "Client SDK"
},
"user_guide/connect_sdk": {
"title": "Connect your SDK"
},
"user_guide/control_rollout": {
"title": "Control rollout"
},
"user_guide/create_feature_toggle": {
"title": "Create a feature toggle"
},
"user_guide/index": {
"title": "Introduction"
},
"user_guide/native_apps": {
"title": "Working with native apps"
},
"user_guide/projects": {
"title": "Projects"
},
"user_guide/rbac": {
"title": "Role-based Access control"
},
"user_guide/technical_debt": {
"title": "Technical Debt"
},
"user_guide/api-token": {
"title": "API Tokens"
},
"user_guide/unleash_context": {
"title": "Unleash Context"
},
"user_guide/user-management": {
"title": "User Management"
},
"user_guide/v4-whats-new": {
"title": "What's new in v4?"
}
},
"links": {
"Documentation": "Documentation",
"Deploy and manage": "Deploy and manage",
"Integrations": "Integrations",
"API": "API",
"Enterprise": "Enterprise",
"Help": "Help"
},
"categories": {
"Getting started": "Getting started",
"Unleash SDKs": "Unleash SDKs",
"Addons framework": "Addons framework",
"Advanced": "Advanced",
"Client": "Client",
"Admin": "Admin",
"Status": "Status",
"Specification": "Specification",
"Deploy & configure": "Deploy & configure",
"Integrations": "Integrations"
}
},
"pages-strings": {
"Help Translate|recruit community translators for your project": "Help Translate",
"Edit this Doc|recruitment message asking to edit the doc source": "Edit",
"Translate this Doc|recruitment message asking to translate the docs": "Translate"
}
}

View File

@ -1,26 +0,0 @@
{
"scripts": {
"examples": "docusaurus-examples",
"start": "docusaurus-start",
"build": "docusaurus-build",
"publish-gh-pages": "docusaurus-publish",
"write-translations": "docusaurus-write-translations",
"version": "docusaurus-version",
"rename-version": "docusaurus-rename-version"
},
"devDependencies": {
"docusaurus": "^1.14.7"
},
"resolutions": {
"immer": "^8.0.4",
"minimist": "^1.2.5",
"kind-of": "6.0.3",
"highlight.js": "^10.4.1",
"is-svg": "^4.2.2",
"postcss": "^8.2.10"
},
"license": "Apache-2.0",
"dependencies": {
"highlight.js": "^10.4.1"
}
}

View File

@ -1,58 +0,0 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const React = require('react');
const CompLibrary = require('../../core/CompLibrary.js');
const Container = CompLibrary.Container;
const GridBlock = CompLibrary.GridBlock;
const siteConfig = require(`${process.cwd()}/siteConfig.js`);
function docUrl(doc, language) {
return `${siteConfig.baseUrl}docs/${language ? `${language}/` : ''}${doc}`;
}
class Help extends React.Component {
render() {
const language = this.props.language || '';
const supportLinks = [
{
content: `Learn more using the [documentation on this site.](${docUrl(
'user_guide/connect_sdk',
language,
)})`,
title: 'Browse Docs',
},
{
content: 'Ask questions about the documentation and project in our [Slack community](https://join.slack.com/t/unleash-community/shared_invite/enQtNjUxMjU2MDc0MTAxLTJjYmViYjkwYmE0ODVlNmY1YjcwZGRmZWU5MTU1YTQ1Nzg5ZWQ2YzBlY2U1MjlmZDg5ZDRmZTMzNmQ5YmEyOGE)',
title: 'Join the community',
},
{
content: "Don't have time or resources to host Unleash yourself? Don't worry [Unleash-hosted.com](https://www.unleash-hosted.com) allows you to start using Unleash today!",
title: 'Unleash as a Service',
},
];
return (
<div className="docMainWrapper wrapper">
<Container className="mainContainer documentContainer postContainer">
<div className="post">
<header className="postHeader">
<h1>Need help?</h1>
</header>
<p>This project is maintained by a dedicated group of people.</p>
<GridBlock contents={supportLinks} layout="threeColumn" />
</div>
</Container>
</div>
);
}
}
module.exports = Help;

View File

@ -1,307 +0,0 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const React = require('react');
const CompLibrary = require('../../core/CompLibrary.js');
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
const Container = CompLibrary.Container;
const GridBlock = CompLibrary.GridBlock;
const siteConfig = require(`${process.cwd()}/siteConfig.js`);
function imgUrl(img) {
return `${siteConfig.baseUrl}img/${img}`;
}
function docUrl(doc, language) {
return `${siteConfig.baseUrl}docs/${language ? `${language}/` : ''}${doc}`;
}
function pageUrl(page, language) {
return siteConfig.baseUrl + (language ? `${language}/` : '') + page;
}
const Button = ({className = '', href, target, children}) => (
<div className="pluginWrapper buttonWrapper">
<a className={["button", className].join(' ')} href={href} target={target}>
{children}
</a>
</div>
);
Button.defaultProps = {
target: '_self',
};
const SplashContainer = props => (
<div className="homeContainer">
<div className="homeSplashFade">
<div className="wrapper homeWrapper">{props.children}</div>
</div>
</div>
);
const Logo = props => (
<div className="projectLogo">
<img src={props.img_src} alt="Project Logo" />
</div>
);
const LogoSvg = ({style}) => (
<svg style={style} viewBox="0 0 200 60" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(280.822 -299.303)">
<text
style={{
lineHeight: "0%",
InkscapeFontSpecification: "'Ubuntu, Medium'",
textAlign: "start",
}}
fontFamily="Ubuntu"
x="-227.697"
y="343.108"
>
<tspan
style={{
lineHeight: "100%",
InkscapeFontSpecification: "'Ubuntu, Medium'",
textAlign: "start",
}}
fontSize="37.5"
x="-227.697"
y="343.108"
>
Unleash
</tspan>
</text>
<rect
height="22.483"
width="40.186"
fill="#0b1700"
rx="9.74"
x="-272.312"
y="318.151"
/>
<rect
height="12.604"
width="14.489"
fill="#fff"
rx="4.135"
x="-251.511"
y="323.352"
/>
</g>
</svg>
);
const ProjectTitle = () => (
<h2 className="projectTitle">
<img src={imgUrl('Logo_DarkBlue_Transparent_Horizontal.png')} alt="Unleash" width="400" />
<small>{siteConfig.tagline}</small>
</h2>
);
const PromoSection = props => (
<div className="section promoSection">
<div className="promoRow">
<div className="pluginRowBlock">{props.children}</div>
</div>
</div>
);
class HomeSplash extends React.Component {
render() {
const language = this.props.language || '';
return (
<SplashContainer>
<div className="inner">
<Survey />
<ProjectTitle />
<a
className="github-button"
href={siteConfig.repoUrl}
data-size="large"
data-count-href="/unleash/unleash/stargazers"
data-show-count="true"
data-count-aria-label="# stargazers on GitHub"
aria-label="Star this project on GitHub">
Star
</a>
<FeatureCallout />
<PromoSection>
<Button className="primary" href={docUrl('deploy/getting_started', language)}>Getting Started</Button>
<Button href="#try">Try It Out</Button>
<Button href={siteConfig.repoUrl}>GitHub</Button>
</PromoSection>
</div>
</SplashContainer>
);
}
}
const Block = props => (
<Container
padding={['bottom', 'top']}
id={props.id}
background={props.background}>
<GridBlock align="left" contents={props.children} layout={props.layout} />
</Container>
);
const FeatureCallout = () => (
<div className="productShowcaseSection" style={{textAlign: 'center'}}>
<p>
Unleash is a feature toggle system, that gives you a great overview of all feature toggles across
all your applications and services. It comes with official client implementations for Java, Node.js, Go, Ruby, Python and .Net.
</p>
<p>
The main motivation for doing feature toggling is to decouple the process for deploying code to production
and releasing new features. This helps reducing risk, and allow us to easily manage which features to enable
</p>
</div>
);
const Survey = () => (
<div className="productShowcaseSection">
<p className="alert alert-warning">
Support us in making Unleash even better by participating in this&nbsp;
<a href="https://docs.google.com/forms/d/e/1FAIpQLSeCM5RUG-r8x4iynYNAlge_RCI77NDg61t28rixV3BBgVra0w/viewform" target="_blank">
Unleash Open-Source survey.
</a>&nbsp;
By participating you will also have the chance to win a $25 Amazon gift card.
</p>
</div>
);
const SASSOffering = () => (
<div className="productShowcaseSection">
<p className="alert alert-primary">
Unleash also comes in a enterprise edition with additional features and a hosted option. <br />
Check out&nbsp;
<a href="https://www.unleash-hosted.com/pricing">unleash-hosted.com</a>
</p>
</div>
);
const UnleashClient = () => (
<Container padding={['bottom', 'top']} id="unleash-client" background={'light'}>
<h2>Client SDK</h2>
<p>
Unleash has official SDK for Java, Node.js, Go, Ruby, Python and .Net. And we will be happy to add implementations in other languages written by you! These libraries make it very easy to use Unleash in your application.
</p>
<div className="gridBlock">
<div className="blockElement twoByGridBlock">
<div className="blockContent">
<h3>Official client SDKs:</h3>
<ul>
<li><MarkdownBlock>[unleash/unleash-client-java](https://github.com/unleash/unleash-client-java)</MarkdownBlock></li>
<li><MarkdownBlock>[unleash/unleash-client-node](https://github.com/unleash/unleash-client-node)</MarkdownBlock></li>
<li><MarkdownBlock>[unleash/unleash-client-go](https://github.com/unleash/unleash-client-go)</MarkdownBlock></li>
<li><MarkdownBlock>[unleash/unleash-client-ruby](https://github.com/unleash/unleash-client-ruby)</MarkdownBlock></li>
<li><MarkdownBlock>[unleash/unleash-client-python](https://github.com/Unleash/unleash-client-python)</MarkdownBlock></li>
<li><MarkdownBlock>[unleash/unleash-client-core](https://github.com/Unleash/unleash-client-core) (.Net Core)</MarkdownBlock></li>
</ul>
</div>
</div>
<div className="blockElement twoByGridBlock">
<div className="blockContent">
<h3>Clients written by awesome enthusiasts:</h3>
<ul>
<li><MarkdownBlock>[cognitedata/unleash-client-rust](https://github.com/cognitedata/unleash-client-rust) (Rust)</MarkdownBlock></li>
<li><MarkdownBlock>[uekoetter.dev/unleash-client-dart](https://pub.dev/packages/unleash) (Dart)</MarkdownBlock></li>
<li><MarkdownBlock>[silvercar/unleash-client-kotlin](https://github.com/silvercar/unleash-client-kotlin) (Kotlin)</MarkdownBlock></li>
<li><MarkdownBlock>[minds/unleash-client-php](https://gitlab.com/minds/unleash-client-php) (PHP)</MarkdownBlock></li>
<li><MarkdownBlock>[afontaine/unleash_ex](https://gitlab.com/afontaine/unleash_ex) (Elixir)</MarkdownBlock></li>
<li><MarkdownBlock>[mikefrancis/laravel-unleash](https://github.com/mikefrancis/laravel-unleash) (Laravel - PHP)</MarkdownBlock></li>
<li><MarkdownBlock>[AppsFlyer/clojure-unleash](https://github.com/AppsFlyer/unleash-client-clojure) (Clojure)</MarkdownBlock></li>
<li><MarkdownBlock>[pmb0/nestjs-unleash](https://github.com/pmb0/nestjs-unleash) (NestJS - Node.js)</MarkdownBlock></li>
</ul>
</div>
</div>
</div>
</Container>
);
const TryOut = () => (
<Block id="try">
{[
{
content: 'We have deployed a demo version of [Unleash on Heroku](https://unleash.herokuapp.com). '+
'Here you can play with the Unleash UI, define some feature toggles and get a feel of how to use Unleash. <br /><br />'+
'It is even possible to use one of the Unleash client SDKs and test it out Unleash your application. '+
'To do this, you should connect one of the clients using the hosted API URL: https://unleash.herokuapp.com/api/.',
image: imgUrl('dashboard_new.png'),
imageAlign: 'left',
align: 'left',
title: 'Try Unleash',
},
]}
</Block>
);
const ActivationStrategies = () => (
<Block background="dark">
{[
{
content: 'It\'s great to have a system for turning stuff on and off. Sometimes, however, we want more granular control, and we want to decide who the toggle should be enabled for. This is where activation strategies come into the picture. Activation strategies take arbitrary config and allow us to enable a toggle in various ways.',
image: imgUrl('logo-inverted.png'),
imageAlign: 'right',
title: 'Activation strategies',
},
]}
</Block>
);
const Showcase = props => {
if ((siteConfig.users || []).length === 0) {
return null;
}
const showcase = siteConfig.users.filter(user => user.pinned).map(user => (
<a href={user.infoLink} key={user.infoLink}>
<img src={user.image} alt={user.caption} title={user.caption} />
</a>
));
return (
<div className="productShowcaseSection paddingBottom">
<h2>Who is Using Unleash?</h2>
<p>Unleash is used by</p>
<div className="logos">{showcase}</div>
<div className="more-users">
<a className="button" href={pageUrl('users.html', props.language)}>
More {siteConfig.title} Users
</a>
</div>
</div>
);
};
class Index extends React.Component {
render() {
const language = this.props.language || '';
return (
<div>
<HomeSplash language={language} config={this.props.config} />
<div className="mainContainer" style={{ paddingTop: 0 }}>
<UnleashClient />
<TryOut />
<ActivationStrategies />
<Showcase language={language} />
</div>
</div>
);
}
}
module.exports = Index;

View File

@ -1,49 +0,0 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const React = require('react');
const CompLibrary = require('../../core/CompLibrary.js');
const Container = CompLibrary.Container;
const siteConfig = require(`${process.cwd()}/siteConfig.js`);
class Users extends React.Component {
render() {
if ((siteConfig.users || []).length === 0) {
return null;
}
const editUrl = `${siteConfig.repoUrl}/edit/master/website/siteConfig.js`;
const showcase = siteConfig.users.map(user => (
<a href={user.infoLink} key={user.infoLink}>
<img src={user.image} alt={user.caption} title={user.caption} />
</a>
));
return (
<div className="mainContainer">
<Container padding={['bottom', 'top']}>
<div className="showcaseSection">
<div className="prose">
<h1>Who is Using This?</h1>
<p>This project is used by many folks</p>
</div>
<div className="logos">{showcase}</div>
<p>Are you using this project?</p>
<a href={editUrl} className="button">
Add your company
</a>
</div>
</Container>
</div>
);
}
}
module.exports = Users;

View File

@ -1,85 +0,0 @@
{
"documentation": {
"Getting started": [
"user_guide/index",
"user_guide/v4-whats-new",
"user_guide/create_feature_toggle",
"user_guide/activation_strategy",
"user_guide/control_rollout",
"user_guide/projects",
"user_guide/unleash_context",
"user_guide/user-management",
"user_guide/rbac",
"user_guide/api-token",
"user_guide/technical_debt"
],
"Unleash SDKs": [
"sdks/index",
"sdks/java_sdk",
"sdks/node_sdk",
"sdks/dot_net_sdk",
"sdks/go_sdk",
"sdks/python_sdk",
"sdks/ruby_sdk",
"sdks/unleash-proxy",
"sdks/proxy-javascript",
"sdks/community"
],
"Addons framework": [
"addons/index",
"addons/webhook",
"addons/slack",
"addons/teams",
"addons/datadog"
],
"Advanced": [
"advanced/strategy_constraints",
"advanced/custom_activation_strategy",
"advanced/feature_toggle_types",
"advanced/toggle_variants",
"advanced/archived_toggles",
"advanced/audit_log",
"advanced/api_access",
"advanced/tags",
"advanced/enterprise-authentication"
]
},
"api": {
"Client": [
"api/client/features",
"api/client/register",
"api/client/metrics"
],
"Admin": [
"api/admin/features",
"api/admin/features-archive",
"api/admin/strategies",
"api/admin/metrics",
"api/admin/events",
"api/admin/state",
"api/admin/feature-types",
"api/admin/addons",
"api/admin/context",
"api/admin/projects",
"api/admin/user-admin"
],
"Status": ["api/internal/internal", "api/internal/health"],
"Specification": ["api/open_api"]
},
"Deploy and manage": {
"Deploy & configure": [
"deploy/getting_started",
"deploy/configuring_unleash",
"deploy/securing_unleash",
"deploy/email",
"deploy/google_auth",
"deploy/database-setup",
"deploy/database_backup",
"deploy/migration_guide",
"deploy/import_export"
]
},
"Integrations": {
"Integrations": ["integrations/integrations"]
}
}

View File

@ -1,146 +0,0 @@
'use strict';
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// See https://docusaurus.io/docs/site-config for all the possible
// site configuration options.
// List of projects/orgs using your project for the users page.
const users = [
{
caption: 'FINN.no',
// You will need to prepend the image path with your baseUrl
// if it is not '/', like: '/test-site/img/docusaurus.svg'.
image: '/img/finn.jpg',
infoLink: 'https://www.finn.no',
pinned: true,
},
{
caption: 'NAV.no',
// You will need to prepend the image path with your baseUrl
// if it is not '/', like: '/test-site/img/docusaurus.svg'.
image: '/img/nav.jpg',
infoLink: 'https://www.nav.no',
pinned: true,
},
{
caption: 'Unleash Hosted',
image: '/img/unleash-hosted.svg',
infoLink: 'https://www.unleash-hosted.com',
pinned: true,
},
{
caption: 'Budgets',
image: '/img/budgets.png',
infoLink: 'https://budgets.money',
pinned: true,
},
{
caption: 'Otovo',
image: '/img/otovo.png',
infoLink: 'https://www.otovo.com',
pinned: true,
},
{
caption: 'Amedia',
image: '/img/amedia-logo.png',
infoLink: 'https://www.amedia.no/',
pinned: true,
},
];
const siteConfig = {
title: '', // Title for your website.
tagline: 'The enterprise ready feature toggle service',
url: 'https://docs.getunleash.io', // Your website URL
baseUrl: '/', // Base URL for your project */
// For github.io type URLs, you would set the url and baseUrl like:
// url: 'https://facebook.github.io',
// baseUrl: '/test-site/',
// Used for publishing and more
projectName: 'unleash.github.io',
organizationName: 'Unleash',
// For top-level user or org sites, the organization is still the same.
// e.g., for the https://JoelMarcey.github.io site, it would be set like...
// organizationName: 'JoelMarcey'
// For no header links in the top nav bar -> headerLinks: [],
headerLinks: [
{ doc: 'user_guide/index', label: 'Documentation' },
{ doc: 'deploy/getting_started', label: 'Deploy and manage' },
{ doc: 'integrations/integrations', label: 'Integrations' },
{ doc: 'api/client/features', label: 'API' },
{ href: 'https://www.unleash-hosted.com/pricing', label: 'Enterprise' },
{ page: 'help', label: 'Help' },
// {blog: true, label: 'Blog'},
],
// If you have users set above, you add it here:
users,
/* path to images for header/footer */
headerIcon: 'img/Logo_White_Transparent_Horizontal.png',
footerIcon: 'img/Logo_White_Transparent_Horizontal.png',
favicon: 'img/favicon/favicon.ico',
/* Colors for website */
colors: {
primaryColor: '#39535b',
secondaryColor: '#817AFE',
},
/* Custom fonts for website */
/*
fonts: {
myFont: [
"Times New Roman",
"Serif"
],
myOtherFont: [
"-apple-system",
"system-ui"
]
},
*/
// This copyright info is used in /core/Footer.js and blog RSS/Atom feeds.
copyright: `Copyright © ${new Date().getFullYear()}`,
highlight: {
// Highlight.js theme to use for syntax highlighting in code blocks.
theme: 'default',
},
// Add custom scripts here that would be placed in <script> tags.
scripts: ['https://buttons.github.io/buttons.js'],
// On page navigation for the current documentation page.
onPageNav: 'separate',
// No .html extensions for paths.
cleanUrl: true,
// Open Graph and Twitter card images.
ogImage: 'img/unleash_logo.png',
twitterImage: 'img/unleash_logo.png',
// Show documentation's last contributor's name.
// enableUpdateBy: true,
// Show documentation's last update time.
// enableUpdateTime: true,
// You may provide arbitrary config keys to be used as needed by your
// template. For example, if you need your repo's URL...
repoUrl: 'https://github.com/unleash/unleash',
gaTrackingId: 'UA-134882379-1',
gaGtag: true,
};
module.exports = siteConfig;

View File

@ -1,82 +0,0 @@
/* your custom css */
@media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
}
@media only screen and (min-width: 1024px) {
}
@media only screen and (max-width: 1023px) {
}
@media only screen and (min-width: 1400px) {
}
@media only screen and (min-width: 1500px) {
}
a {
color: #0000ee;
}
h2.projectTitle {
color: black;
}
.blockImage img {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.sassOffering {
background-color: #d2e6d6;
color: #21612e;
border-radius: 10px;
border: 1px solid #21612e;
}
.alert {
position: relative;
padding: 0.75rem 1.25rem;
margin-bottom: 1rem;
border: 1px solid transparent;
border-radius: 0.25rem;
}
.alert-success {
color: #155724;
background-color: #d4edda;
border-color: #c3e6cb;
}
.alert-primary {
color: #004085;
background-color: #cce5ff;
border-color: #b8daff;
}
.alert-dark {
color: #1b1e21;
background-color: #d6d8d9;
border-color: #c6c8ca;
}
.alert-light {
color: #818182;
background-color: #fefefe;
border-color: #fdfdfe;
}
.alert-warning {
color: #856404;
background-color: #fff3cd;
border-color: #ffeeba;
}
.button.primary {
background: #817afe;
color: #fff;
}
.productShowcaseSection p {
max-width: 700px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

File diff suppressed because it is too large Load Diff

20
websitev2/.gitignore vendored Normal file
View File

@ -0,0 +1,20 @@
# Dependencies
/node_modules
# Production
/build
# Generated files
.docusaurus
.cache-loader
# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

33
websitev2/README.md Normal file
View File

@ -0,0 +1,33 @@
# Website
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
## Installation
```console
yarn install
```
## Local Development
```console
yarn start
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
## Build
```console
yarn build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
## Deployment
```console
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

View File

@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};

View File

@ -9,11 +9,11 @@ The definition of an activation strategy lives in the Unleash API and can be cre
Unleash comes with a few common activation strategies. Some of them require the client to provide the [unleash-context](./unleash-context.md), which gives the necessary context for Unleash.
## default
## default {#default}
It is the simplest activation strategy and basically means "active for everyone".
## userWithId
## userWithId {#userwithid}
Active for users with a `userId` defined in the `userIds` list. Typically I want to enable a new feature only for myself in production before I enable it for everyone else. To achieve this, we can use the “UserWithIdStrategy”. This strategy allows you to specify a list of user IDs that you want to expose the new feature for. (A user id may, of course, be an email if that is more appropriate in your system.)
@ -21,7 +21,7 @@ Active for users with a `userId` defined in the `userIds` list. Typically I want
- userIds - _List of user IDs you want the feature toggle to be enabled for_
## flexibleRollout
## flexibleRollout {#flexiblerollout}
A flexible rollout strategy which combines all gradual rollout strategies in to a single strategy (and will in time replace them). This strategy have different options for how you want to handle the stickiness, and have sane default mode.
@ -35,17 +35,17 @@ A flexible rollout strategy which combines all gradual rollout strategies in to
- **groupId** is used to ensure that different toggles will **hash differently** for the same user. The groupId defaults to _feature toggle name_, but the use can override it to _correlate rollout_ of multiple feature toggles.
- **rollout** The percentage (0-100) you want to enable the feature toggle for.
### Customize stickiness (beta)
### Customize stickiness (beta) {#customize-stickiness-beta}
By enabling the stickiness option on a custom context field you can use it together with the flexible rollout strategy. This will guarantee a consistent behavior for specific values of this context field. PS! support for this feature currently being supported by the following SDKs:
- [unleash-client-node](https://github.com/Unleash/unleash-client-node) (from v3.6.0)
## gradualRolloutUserId
## gradualRolloutUserId {#gradualrolloutuserid}
The `gradualRolloutUserId` strategy gradually activates a feature toggle for logged-in users. Stickiness is based on the user ID. The strategy guarantees that the same user gets the same experience every time across devices. It also assures that a user which is among the first 10% will also be among the first 20% of the users. That way, we ensure the users get the same experience, even if we gradually increase the number of users exposed to a particular feature. To achieve this, we hash the user ID and normalize the hash value to a number between 1 and 100 with a simple modulo operator.
![hash_and_normalise](assets/hash_and_normalise.png)
![hash_and_normalise](/img/hash_and_normalise.png)
Starting from v3.x all clients should use the 32-bit [MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash) algorithm to normalize values. ([issue 247](https://github.com/Unleash/unleash/issues/247))
@ -54,7 +54,7 @@ Starting from v3.x all clients should use the 32-bit [MurmurHash3](https://en.wi
- percentage - _The percentage (0-100) you want to enable the feature toggle for._
- groupId - _Used to define an activation group, which allows you to correlate rollout across feature toggles._
## gradualRolloutSessionId
## gradualRolloutSessionId {#gradualrolloutsessionid}
Similar to `gradualRolloutUserId` strategy, this strategy gradually activates a feature toggle, with the exception being that the stickiness is based on the session IDs. This makes it possible to target all users (not just logged-in users), guaranteeing that a user will get the same experience within a session.
@ -63,7 +63,7 @@ Similar to `gradualRolloutUserId` strategy, this strategy gradually activates a
- percentage - _The percentage (0-100) you want to enable the feature toggle for._
- groupId - _Used to define an activation group, which allows you to correlate rollout across feature toggles._
## gradualRolloutRandom
## gradualRolloutRandom {#gradualrolloutrandom}
The `gradualRolloutRandom` strategy randomly activates a feature toggle and has no stickiness. We have found this rollout strategy very useful in some scenarios, especially when we enable a feature which is not visible to the user. It is also the strategy we use to sample metrics and error reports.
@ -71,7 +71,7 @@ The `gradualRolloutRandom` strategy randomly activates a feature toggle and has
- percentage - _The percentage (0-100) you want to enable the feature toggle for._
## remoteAddress
## remoteAddress {#remoteaddress}
The remote address strategy activates a feature toggle for remote addresses defined in the IP list. We occasionally use this strategy to enable a feature only for IPs in our office network.
@ -79,7 +79,7 @@ The remote address strategy activates a feature toggle for remote addresses defi
- IPs - _List of IPs to enable the feature for._
## applicationHostname
## applicationHostname {#applicationhostname}
The application hostname strategy activates a feature toggle for client instances with a hostName in the `hostNames` list.

View File

@ -16,6 +16,6 @@ Currently Unleash support the following Addons out of the box:
In future releases we plan to support community built addons.
### Notes
### Notes {#notes}
When updating or creating a new addon configuration it can take up to one minute before Unleash picks up the new config on all instances due to caching.

View File

@ -9,9 +9,9 @@ The Datadog addon allows Unleash to post Updates to Datadog when a feature toggl
The Datadog addon will perform a single retry if the HTTP POST against the Datadog Webhook URL fails (either a 50x or network error). Duplicate events may happen, and you should never assume events always comes in order.
## Configuration
## Configuration {#configuration}
#### Events
#### Events {#events}
You can choose to trigger updates for the following events (we might add more event types in the future):
@ -22,7 +22,7 @@ You can choose to trigger updates for the following events (we might add more ev
- feature-stale-on
- feature-stale-off
#### Parameters
#### Parameters {#parameters}
Unleash Datadog addon takes the following parameters.
@ -33,6 +33,6 @@ Unleash Datadog addon takes the following parameters.
- US1-FED: https://app.ddog-gov.com/api/v1/events
- **DD API KEY** - This is a required property.
#### Tags
#### Tags {#tags}
Datadog's incoming webhooks are app specific. You will be able to create multiple addons to support messaging on different apps.

View File

@ -9,9 +9,9 @@ The Slack addon allows Unleash to post Updates when a feature toggle is updated.
The Slack addon will perform a single retry if the HTTP POST against the Slack Webhook URL fails (either a 50x or network error). Duplicate events may happen,m and you should never assume events always comes in order.
## Configuration
## Configuration {#configuration}
#### Events
#### Events {#events}
You can choose to trigger updates for the following events (we might add more event types in the future):
@ -22,7 +22,7 @@ You can choose to trigger updates for the following events (we might add more ev
- feature-stale-on
- feature-stale-off
#### Parameters
#### Parameters {#parameters}
Unleash Slack addon takes the following parameters.
@ -31,10 +31,10 @@ Unleash Slack addon takes the following parameters.
- **Emoji Icon** - Used to override the emoji icon used to post the update to a Slack channel.
- Default channel - Where to post the message if the feature toggles has not overridden the channel via the slack tags.
#### Tags
#### Tags {#tags}
The Slack addon also defined the Tag type "slack". You may use this tag to override which Slack channel Unleash should post updates to for this feature toggle.
![Slack Tags](../assets/slack_addon_tags.png)
![Slack Tags](/img/slack_addon_tags.png)
In the picture you can see we have defined two slack tags for the "new-payment-system" toggle. In this example Unleash will post updates to the **#notifications** and **#random** channel.

View File

@ -9,9 +9,9 @@ The MicrosoftTeams addon allows Unleash to post Updates when a feature toggle is
The Microsoft Teams addon will perform a single retry if the HTTP POST against the Microsoft Teams Webhook URL fails (either a 50x or network error). Duplicate events may happen, and you should never assume events always comes in order.
## Configuration
## Configuration {#configuration}
#### Events
#### Events {#events}
You can choose to trigger updates for the following events (we might add more event types in the future):
@ -22,12 +22,12 @@ You can choose to trigger updates for the following events (we might add more ev
- feature-stale-on
- feature-stale-off
#### Parameters
#### Parameters {#parameters}
Unleash Microsoft Teams addon takes the following parameters.
- **Microsoft Teams Webhook URL** - This is the only required property.
#### Tags
#### Tags {#tags}
Microsoft teams's incoming webhooks are channel specific. You will be able to create multiple addons to support messaging on multiple channels.

View File

@ -9,9 +9,9 @@ The Webhook Addon introduces a generic way to post messages from Unleash to thir
The webhook will perform a single retry if the HTTP POST call fails (either a 50x or network error). Duplicate events may happen,m and you should never assume events always comes in order.
## Configuration
## Configuration {#configuration}
#### Events
#### Events {#events}
You can choose to trigger updates for the following events (we might add more event types in the future):
@ -24,7 +24,7 @@ You can choose to trigger updates for the following events (we might add more ev
(we will add more events in the future!)
#### Parameters
#### Parameters {#parameters}
Unleash Webhook addon takes the following parameters.
@ -32,7 +32,7 @@ Unleash Webhook addon takes the following parameters.
**Content-Type** Used to set the content-type header used when unleash performs an HTTP POST to the defined endpoint.
**Body template** Used to override the body template used by Unleash when performing the HTTP POST. You may format you message using a [Mustache template](https://mustache.github.io). You will have the [Unleash event format](/docs/api/admin/events) available in the rendering context.
**Body template** Used to override the body template used by Unleash when performing the HTTP POST. You may format you message using a [Mustache template](https://mustache.github.io). You will have the [Unleash event format](/api/admin/events) available in the rendering context.
Example:
@ -45,4 +45,4 @@ Example:
}
```
If you don't specify anything Unleash will use the [Unleash event format](/docs/api/admin/events).
If you don't specify anything Unleash will use the [Unleash event format](/api/admin/events).

View File

@ -5,7 +5,7 @@ title: API Access
It is possible to integrate directly with the Admin API. In this guide we will explain all the steps to set it up.
## Step 1: Create API token
## Step 1: Create API token {#step-1-create-api-token}
Please refer to [Create token](../user_guide/api-token) on how to create an API token. You'll need a token with `Admin` level access for this to work.
@ -13,7 +13,7 @@ Please note that it may take up to 60 seconds for the new key to propagate to al
> If you need an API token to use in a client SDK you should create a "client token" as these have less access.
## Step 2: Use Admin API
## Step 2: Use Admin API {#step-2-use-admin-api}
Now that you have an access token with admin privileges we can use that to perform changes in our Unleash-hosted instance.
@ -26,8 +26,8 @@ https://app.unleash-hosted.com/demo/api/admin/features/Demo/toggle/on
**Great success!** We have now enabled the feature toggle. We can also verify that it was actually changed by the API user by navigating to the history (audit log) for this feature toggle.
![Create token](../assets/api_access_history.png)
![Create token](/img/api_access_history.png)
## API overview
## API overview {#api-overview}
You can find the full documentation on everything the Unleash API supports in the [Unleash API documentation](../api/admin/features).

View File

@ -3,17 +3,14 @@ id: archived_toggles
title: Archived toggles
---
In unleash you may choose to "archive" a feature toggle when it is not needed anymore. You do this by clicking the "Archive" button on the feature toggle details view. By archiving a feature toggle it will not be available to Client SDKs anymore.
In unleash you may choose to "archive" a feature toggle when it is not needed anymore. You do this by clicking the "Archive" button on the feature toggle details view. By archiving a feature toggle it will not be available to Client SDKs anymore.
![Archive Toggle](../assets/archive-toggle.png 'Archiving a Feature Toggle').
![Archive Toggle](/img/archive-toggle.png 'Archiving a Feature Toggle').
You will not be able to "fully delete a feature toggle". The reason for this is to avoid old toggles suddenly "waking up again". This could, in worst case, re-activate old functionality in code where the use of the feature toggle has not been cleaned up yet.
You will not be able to "fully delete a feature toggle". The reason for this is to avoid old toggles suddenly "waking up again". This could, in worst case, re-activate old functionality in code where the use of the feature toggle has not been cleaned up yet.
## Reviving a feature toggle
## Reviving a feature toggle {#reviving-a-feature-toggle}
If you want to re-use a feature toggle which has been archived you may revive in from the archive. You do that by clicking the "revive icon". Please not that revived toggles will be "disabled" when they are active again.
![Revive Toggle](../assets/archive-toggle-revive.png 'Reviving a Feature Toggle').
![Revive Toggle](/img/archive-toggle-revive.png 'Reviving a Feature Toggle').

View File

@ -5,14 +5,14 @@ title: The audit log
When something is not working as expected it is important to be able to track what changed when, and who performed the change.
## Audit log per feature toggle
## Audit log per feature toggle {#audit-log-per-feature-toggle}
Unleash comes with a audit log, available on a feature toggle level. You access the audit log via the “history” tab in the feature toggle view.
![Audit log](../assets/unleash-toggle-history.png)
![Audit log](/img/unleash-toggle-history.png)
## Global Audit Log
## Global Audit Log {#global-audit-log}
Unleash also keeps an audit log across all toggles and activation strategies, tracking all changes. You access the global audit log via the “Event history”, which you can find in the drawer menu.
Unleash also keeps an audit log across all toggles and activation strategies, tracking all changes. You access the global audit log via the “Event history”, which you can find in the drawer menu.
![Global audit log](../assets/global_audit_log.png)
![Global audit log](/img/global_audit_log.png)

View File

@ -5,27 +5,27 @@ title: Custom Activation Strategy
Even though Unleash comes with a few powerful [activation strategies](activation-strategies.md) there might be scenarios where you would like to extend Unleash with your own custom strategies.
### Example: TimeStamp Strategy
### Example: TimeStamp Strategy {#example-timestamp-strategy}
In this example we want to define an activation strategy offers a scheduled release of a feature toggle. This means that we want the feature toggle to be activated after a given date and time.
#### Define custom strategy
#### Define custom strategy {#define-custom-strategy}
First we need to "define" our new strategy. To add a new "Strategy", open the Strategies tab from the sidebar.
![timestamp_create_strategy](../assets/timestamp_create_strategy.png)
![timestamp_create_strategy](/img/timestamp_create_strategy.png)
We name our strategy `TimeStamp` and add one required parameter of type string, which we call `enableAfter`.
#### Use custom strategy
#### Use custom strategy {#use-custom-strategy}
After we have created the strategy definition, we can now decide to use that activation strategy for our feature toggle.
![timestamp_use_strategy](../assets/timestamp_use_strategy.png)
![timestamp_use_strategy](/img/timestamp_use_strategy.png)
In the example we want to use our custom strategy for the feature toggle named `demo.TimeStampRollout`.
#### Client implementation
#### Client implementation {#client-implementation}
All official client SDK's for Unleash provides abstractions for you to implement support for custom strategies.

View File

@ -5,26 +5,26 @@ title: Authentication (Single-Sign-On)
> This guide only applies to customers on the Enterprise subscription. Check out the [Unleash subscription plans](https://www.getunleash.io/plans) for details.
## Introduction
## Introduction {#introduction}
In this guide we will do a deep dive on the Single-Sign-On (SSO) integrations. Unleash Enterprise supports SAML 2.0, OpenID Connect and Google Authentication. In addition, Unleash Enterprise also supports username/password authentication out of the box, as you get with all the other versions of Unleash.
## Step 1: Sign-in
## Step 1: Sign-in {#step-1-sign-in}
In order to configure SSO Authentication you will need to log in to the Unleash instance with a user that have "Admin" role. If you are self-hosting Unleash then a default user will be automatically created the first time you start unleash:
- username: `admin`
- password: `unleash4all` (or `admin` if you started with Unleash v3).
## Step 2: Configure Authentication provider
## Step 2: Configure Authentication provider {#step-2-configure-authentication-provider}
Unleash enterprise supports multiple authentication providers, and we provide in depth guides for each of them. To find them navigate to "Admin" => "Authentication" section.
![admin-authentication](../assets/admin-authentication.png)
![admin-authentication](/img/admin-authentication.png)
## Step 3a: SAML 2.0
## Step 3a: SAML 2.0 {#step-3a-saml-20}
### Okta with SAML 2.0
### Okta with SAML 2.0 {#okta-with-saml-20}
If you are using Okta as your Authentication provider you start by signing in to your Okta account.
@ -32,17 +32,17 @@ If you are using Okta as your Authentication provider you start by signing in to
Navigate to “Admin/Applications” and click the “Add Apps” button.
![Okta: Add Apps](../assets/okta_add_application-768x345.png)
![Okta: Add Apps](/img/okta_add_application-768x345.png)
Then click “Create Application” and choose a new “SAML 2.0” application and click create
![Okta: Create Application](../assets/okta_create_new_application-768x467.png)
![Okta: Create Application](/img/okta_create_new_application-768x467.png)
**Step 2: Configure SAML**
Unleash expect email to be sent from the SSO provider so make sure Name ID format is set to email. Also you must give the IDP Initiated SSO URL Name, we have chosen to call it “unleash-enterprise”. This gives us the Sign-on URL we will need in our Unleash configuration later.
![Okta: Configure SAML](../assets/okta_configure_saml2.0-768x832.png)
![Okta: Configure SAML](/img/okta_configure_saml2.0-768x832.png)
> ### Important!
>
@ -54,7 +54,7 @@ Unleash expect email to be sent from the SSO provider so make sure Name ID forma
Click the “view Setup Instructions” to get the necessary configuration required for Unleash.
![Okta: Setup Instructions](../assets/okta_setup-instructions-768x731.png)
![Okta: Setup Instructions](/img/okta_setup-instructions-768x731.png)
**Step 4: Configure SAML 2.0 Authentication provider in Unleash**
@ -62,13 +62,13 @@ Open Unleash Admin Dashboard and navigate to Admin -> Authentication -> SAML. Fi
You may also choose to “auto create users”. This will make Unleash automatically create new users on the fly first time they sign-in to Unleash with the given SSO provider. You may also limit the auto-creation to certain email domains, shown in the example below.
![Unleash: SAML 2.0](../assets/saml-2.0-unleash.png)
![Unleash: SAML 2.0](/img/saml-2.0-unleash.png)
**Success!**
That should be it. Please note that you also must assign users to the application defined in Okta to actually be able to log-in to Unleash.
### Keycloak with SAML 2.0
### Keycloak with SAML 2.0 {#keycloak-with-saml-20}
**Step 1: Add client in Keycloak**
@ -78,17 +78,17 @@ Open to the Keycloak dashboard and navigate to “Clients” and click “Add Cl
https://<unleash.hostname.com>/auth/saml/callback
```
![Keycloak: Add client](../assets/keykloak_step1-768x347.png)
![Keycloak: Add client](/img/keykloak_step1-768x347.png)
**Step 2: Change “Name ID format to “email”** Unleash expect email to be sent from the SSO provider so make sure Name ID format is set to email, see a). also you must give the IDP Initiated SSO URL Name, we have chosen to call it “unleash”, see 2). This gives us the Sign-on URL we will need in our Unleash configuration later.
![Keycloak: step 2](../assets/keykloak_step2b-768x242.png)
![Keycloak: step 2](/img/keykloak_step2b-768x242.png)
**Step 3: Copy the Keycloak Entity ID an Signing key**
Navigate to “Realm Settings” and open the “SAML 2.0 Identity Provider Metadata”. You will need copy the entityID (a) and the X509Certificate (B). These will be required when configuring SAML 2.0 in Unleash.
![Keycloak: step 3](../assets/keykloak_step3-768x235.png)
![Keycloak: step 3](/img/keykloak_step3-768x235.png)
**Step 4: Configure SAML 2.0 Authentication provider in Unleash**
@ -100,11 +100,11 @@ Open Unleash Admin Dashboard and navigate to Admin -> Authentication. Fill in th
You may also choose to “auto create users”. This will make Unleash automatically create new users on the fly first time they sign-in to Unleash with the given SSO provider. You may also limit the auto-creation to certain email domains, shown in the example below.
![Keycloak: step 4](../assets/keykloak_step4-768x644.png)
![Keycloak: step 4](/img/keykloak_step4-768x644.png)
## Step 3b: OpenID Connect
## Step 3b: OpenID Connect {#step-3b-openid-connect}
### Okta with OpenID Connect
### Okta with OpenID Connect {#okta-with-openid-connect}
If you are using Okta as your Authentication provider you start by signing in to your Okta account.
@ -112,11 +112,11 @@ If you are using Okta as your Authentication provider you start by signing in to
Navigate to “Admin/Applications” and click the “Add Apps” button.
![Okta: Add Apps](../assets/okta_add_application-768x345.png)
![Okta: Add Apps](/img/okta_add_application-768x345.png)
Then click “Create Application” and choose a new “OIDC - OpenID Connect” application, and choose application type "Web Application" and click create.
![Okta: Create Apps](../assets/okta-oidc-create.png)
![Okta: Create Apps](/img/okta-oidc-create.png)
**Step 2: Configure Application Integration**
@ -124,19 +124,19 @@ Give you application a name. And set the Sign-in redirect URI to:
`https://[unleash.hostname.some]/auth/oidc/callback`
![Okta: Configure OpenID Connect](../assets/okta-oidc-configure.png)
![Okta: Configure OpenID Connect](/img/okta-oidc-configure.png)
Save your new application and your will ge the required details you need to configure the Unleash side of things:
![Okta: Configure OpenID Connect](../assets/okta-oidc-details.png)
![Okta: Configure OpenID Connect](/img/okta-oidc-details.png)
**Step 3: Configure OpenID Connect provider in Unleash**
Navigate to Unleash and insert the details (Discover URL, Client Id and Client Secret) in to Unleash.
![Unleash: Configure OpenID Connect](../assets/oidc-unleash.png)
![Unleash: Configure OpenID Connect](/img/oidc-unleash.png)
## Step 3c: Google Authentication
## Step 3c: Google Authentication {#step-3c-google-authentication}
**Step 1: Setup Google OAuth 2.0 Credentials** Go to https://console.developers.google.com/apis/credentials
@ -147,7 +147,7 @@ Navigate to Unleash and insert the details (Discover URL, Client Id and Client S
You will then get a Client ID and a Client Secret that you will need in the next step.
![Google OAuth: Secret](../assets/sso-google-secret.png)
![Google OAuth: Secret](/img/sso-google-secret.png)
**Step 2: Configure Unleash**
@ -161,10 +161,10 @@ If you want to allow everyone to access Unleash, and have Unleash auto-create us
Remember to click “Save” to store your settings.
![Google OAuth: Secret](../assets/google_auth_settings.png)
![Google OAuth: Secret](/img/google_auth_settings.png)
## Step 4: Verify
## Step 4: Verify {#step-4-verify}
Logout of Unleash and sign back in again. You should now be presented with the “SSO Authentication Option”. Click the button and follow the sign-in flow. If all goes well you should be successfully signed in to Unleash. If something is not working you can still sign-in with username and password.
![Verify SSO](../assets/sign-in.png)
![Verify SSO](/img/sign-in.png)

View File

@ -17,7 +17,7 @@ Feature toggle types currently supported by Unleash:
- **Kill switch** - Used to gracefully degrade system functionality. _(permanent)_
- **Permission** - Used to change the features or product experience that certain users receive. _(permanent)_
### Deprecate a feature toggle
### Deprecate a feature toggle {#deprecate-a-feature-toggle}
Feature toggles can now also be marked as `stale` (deprecated). This allows us to clearly signal that we should stop using the feature toggle in our applications.

View File

@ -9,9 +9,9 @@ Do you want to facilitate more advanced experimentations? Do you want to use Unl
You can now extend feature toggles with multiple variants. This feature enables you to extend a feature toggle to divide your traffic among a set of variants.
![toggle_variants](assets/variants.png 'Feature Toggle Variants')
![toggle_variants](/img/variants.png 'Feature Toggle Variants')
#### How does it work?
#### How does it work? {#how-does-it-work}
Unleash will first use activation strategies to decide whether a feature toggle is considered enabled or disabled for the current user.
@ -39,7 +39,7 @@ Variant variant = unleash.getVariant("toggle.name", unleashContext);
System.out.println(variant.getName());
```
#### Client SDK Support
#### Client SDK Support {#client-sdk-support}
To make use of toggle variants, you need to use a compatible client. Client SDK with variant support:

View File

@ -9,19 +9,19 @@ title: Strategy Constraints
Strategy constraints allow you to set pre-conditions on activation strategies that needs to be satisfied for the activation strategies to take effect.
## Constrain on a specific environment
## Constrain on a specific environment {#constrain-on-a-specific-environment}
The most common use case for strategy constraints is that you want an activation strategy to only take effect in a specific environment. For example, you could enable the feature for everyone in development, while you only expose the new feature to a few percent of users in production.
![Strategy constraints](../assets/strategy-constraints.png)
![Strategy constraints](/img/strategy-constraints.png)
## Constrain on custom context fields
## Constrain on custom context fields {#constrain-on-custom-context-fields}
It is also possible to constrain an activation strategy configuration on custom context fields. A common use case is a multi-tenant service where you want to control roll-out on a tenant identifier. This allows you to decide which customer should get access to your new feature.
![Custom constraints](../assets/custom-constraints.png)
![Custom constraints](/img/custom-constraints.png)
## Define your own custom fields
## Define your own custom fields {#define-your-own-custom-fields}
> Starting with Unleash-enterprise version 3.2.28 customers can define their custom context fields via the user interface.
@ -34,19 +34,20 @@ You can also define your own custom context fields that you can use together wit
Combining strategy constraints with the “flexibleRollout” allows you to do a gradual roll-out to a specific segment of your user base.
### Step 1: Navigate to “Context Fields“
### Step 1: Navigate to “Context Fields“ {#step-1-navigate-to-context-fields}
Locate “context fields in the menu
![Context fields](../assets/context-fields.png)
![Context fields](/img/context-fields.png)
### Step 2: Define new context field
### Step 2: Define new context field {#step-2-define-new-context-field}
Next you can define your new context field. The minimum requirement is to give it a unique *name*. In addition, you can give it a description and define the legal values.
Next you can define your new context field. The minimum requirement is to give it a unique _name_. In addition, you can give it a description and define the legal values.
![New context fields](../assets/new_context_field.png)
![New context fields](/img/new_context_field.png)
#### What is “legal values”?
#### What is “legal values”? {#what-is-legal-values}
Legal values defines all possible values for the context field. this will be used in Unleash Admin UI to guide users when working with context fields to make sure they only use legal values.
![New context fields](../assets/constraints_legal_values.png)
![New context fields](/img/constraints_legal_values.png)

View File

@ -7,17 +7,17 @@ title: Tagging Features
Do you want to filter your features to avoid having to see all features belonging to other teams than your own? Do you want to write a plugin that only gets notified about changes to features that your plugin knows how to handle?
### Say hello to Typed tags
### Say hello to Typed tags {#say-hello-to-typed-tags}
Unleash supports tagging features with an arbitrary number of tags. This eases filtering the list of tags to only those features that are tagged with the tag you're interested in.
#### How does it work?
#### How does it work? {#how-does-it-work}
Unleash will allow users to tag any feature with any number of tags. When viewing a feature, the UI will/may display all tags connected to that feature.
When adding a new tag, a dropdown will show you which type of tag you're about to add. Our first type; `simple` are meant to be used for filtering features. Show only features that have a tag of `MyTeam`.
#### Tag types
#### Tag types {#tag-types}
Types can be anything, and their purpose is to add some semantics to the tag itself.

View File

@ -5,7 +5,7 @@ title: /api/admin/addons
> In order to access the admin API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create an ADMIN token](../../user_guide/api-token) and add an Authorization header using the token.
### List addons and providers
### List addons and providers {#list-addons-and-providers}
`GET https://unleash.host.com/api/admin/addons`
@ -102,7 +102,7 @@ Returns a list of _configured addons_ and available _addon providers_.
}
```
### Create a new addon configuration
### Create a new addon configuration {#create-a-new-addon-configuration}
`POST https://unleash.host.com/api/addons`
@ -122,11 +122,11 @@ Creates an addon configuration for an addon provider.
}
```
### Notes
### Notes {#notes}
- `provider` must be a valid addon provider
### Update new addon configuration
### Update new addon configuration {#update-new-addon-configuration}
`POST https://unleash.host.com/api/addons/:id`
@ -146,11 +146,11 @@ Updates an addon configuration.
}
```
### Notes
### Notes {#notes-1}
- `provider` can not be changed.
### Delete an addon configuration
### Delete an addon configuration {#delete-an-addon-configuration}
`DELETE https://unleash.host.com/api/admin/addons/:id`

View File

@ -5,7 +5,7 @@ title: /api/admin/context
> The context feature is only available as part of Unleash Enterprise. In order to access the API programmatically you need to make sure you [obtain a API token](../../user_guide/api-token) with admin permissions.
### List context fields defined in Unleash
### List context fields defined in Unleash {#list-context-fields-defined-in-unleash}
`GET https://unleash.host.com/api/admin/context`
@ -48,7 +48,7 @@ Returns a list of context fields defined in Unleash.
]
```
### Create a new context field
### Create a new context field {#create-a-new-context-field}
`POST https://unleash.host.com/api/admin/context`
@ -65,7 +65,7 @@ Creates a new context field.
}
```
### Update a context field
### Update a context field {#update-a-context-field}
`PUT https://unleash.host.com/api/context/:name`
@ -82,7 +82,7 @@ Updates a new context field
}
```
### Delete a context field
### Delete a context field {#delete-a-context-field}
`DELETE https://unleash.host.com/api/admin/context/:name`

View File

@ -5,7 +5,7 @@ title: /api/admin/features
> In order to access the admin API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create an ADMIN token](../../user_guide/api-token) and add an Authorization header using the token.
### Fetching Feature Toggles
### Fetching Feature Toggles {#fetching-feature-toggles}
`GET: http://unleash.host.com/api/admin/features`
@ -73,7 +73,7 @@ This endpoint is the one all admin ui should use to fetch all available feature
}
```
#### Filter feature toggles
#### Filter feature toggles {#filter-feature-toggles}
Supports three params for now
@ -93,7 +93,7 @@ To filter for any feature belonging to project `myproject` use
Response format is the same as `api/admin/features`
### Fetch specific feature toggle
### Fetch specific feature toggle {#fetch-specific-feature-toggle}
`GET: http://unleash.host.com/api/admin/features/:featureName`
@ -117,7 +117,7 @@ Used to fetch details about a specific featureToggle. This is mostly provded to
}
```
### Create a new Feature Toggle
### Create a new Feature Toggle {#create-a-new-feature-toggle}
`POST: http://unleash.host.com/api/admin/features/`
@ -148,7 +148,7 @@ Used by the admin-dashboard to create a new feature toggles.
Returns 200-response if the feature toggle was created successfully.
### Update a Feature Toggle
### Update a Feature Toggle {#update-a-feature-toggle}
`PUT: http://unleash.host.com/api/admin/features/:toggleName`
@ -175,7 +175,7 @@ Used by the admin dashboard to update a feature toggles. The name has to match a
Returns 200-response if the feature toggle was updated successfully.
### Tag a Feature Toggle
### Tag a Feature Toggle {#tag-a-feature-toggle}
`POST https://unleash.host.com/api/admin/features/:featureName/tags`
@ -201,7 +201,7 @@ If the tuple (type, value) does not already exist, it will be added to the list
- Returns _404-NOT-FOUND_ if the `type` was not found
### Remove a tag from a Feature Toggle
### Remove a tag from a Feature Toggle {#remove-a-tag-from-a-feature-toggle}
`DELETE https://unleash.host.com/api/admin/features/:featureName/tags/:type/:value`
@ -216,13 +216,13 @@ Removes the specified tag from the `(type, value)` tuple from the Feature Toggle
- Returns 404 if the tag does not exist
- Returns 500 if the database could not be reached
### Archive a Feature Toggle
### Archive a Feature Toggle {#archive-a-feature-toggle}
`DELETE: http://unleash.host.com/api/admin/features/:toggleName`
Used to archive a feature toggle. A feature toggle can never be totally be deleted, but can be archived. This is a design decision to make sure that a old feature toggle suddenly reappears becuase someone else re-using the same name.
### Enable a Feature Toggle
### Enable a Feature Toggle {#enable-a-feature-toggle}
`POST: http://unleash.host.com/api/admin/features/:featureName/toggle/on`
@ -251,7 +251,7 @@ None
}
```
### Disable a Feature Toggle
### Disable a Feature Toggle {#disable-a-feature-toggle}
`POST: http://unleash.host.com/api/admin/features/:featureName/toggle/off`
@ -281,7 +281,7 @@ None
}
```
### Mark a Feature Toggle as "stale"
### Mark a Feature Toggle as "stale" {#mark-a-feature-toggle-as-stale}
`POST: http://unleash.host.com/api/admin/features/:featureName/stale/on`
@ -311,7 +311,7 @@ None
}
```
### Mark a Feature Toggle as "active"
### Mark a Feature Toggle as "active" {#mark-a-feature-toggle-as-active}
`POST: http://unleash.host.com/api/admin/features/:featureName/stale/off`

View File

@ -5,7 +5,7 @@ title: /api/admin/archive
> In order to access the admin API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create an ADMIN token](../../user_guide/api-token) and add an Authorization header using the token.
### Fetch archived toggles
### Fetch archived toggles {#fetch-archived-toggles}
`GET http://unleash.host.com/api/admin/archive/features`
@ -38,7 +38,7 @@ Used to fetch list of archived feature toggles
}
```
### Revive feature toggle
### Revive feature toggle {#revive-feature-toggle}
`POST http://unleash.host.com/api/admin/archive/revive`

View File

@ -7,7 +7,7 @@ title: /api/admin/metrics
# This document describes the metrics endpoint for admin ui
### Seen-toggles
### Seen-toggles {#seen-toggles}
`GET http://unleash.host.com/api/admin/seen-toggles`
@ -36,7 +36,7 @@ This enpoints returns a list of applications and what toogles unleash has seen f
- **seenToggles** - array of toggles names seen by unleash-server for this application
- **metricsCount** - number of metrics counted across all toggles for this application.
### Feature-Toggles metrics
### Feature-Toggles metrics {#feature-toggles-metrics}
`GET http://unleash.host.com/api/admin/metrics/feature-toggles`
@ -82,7 +82,7 @@ This endpoint gives _last minute_ and _last hour_ metrics for all active toggles
- **lastHour** - Hour projection collected metrics for all feature toggles.
- **lastMinute** - Minute projection collected metrics for all feature toggles.
### Applications
### Applications {#applications}
`GET http://unleash.host.com/api/admin/applications`
@ -111,13 +111,13 @@ This endpoint returns a list of known applications (seen the last two days) and
}
```
#### Query Params
#### Query Params {#query-params}
You can also specify the query param: _strategyName_, which will return all applications implementing the given strategy.
`GET http://unleash.host.com/api/admin/applications?strategyName=someStrategyName`
### Application Details
### Application Details {#application-details}
`GET http://unleash.host.com/api/admin/applications/:appName`
@ -150,7 +150,7 @@ This endpoint gives insight into details about a client application, such as ins
}
```
### Seen applications
### Seen applications {#seen-applications}
`GET http://unleash.host.com/api/admin/seen-apps`

View File

@ -5,7 +5,7 @@ title: /api/admin/projects
> The context feature is only available as part of Unleash Enterprise. In order to access the API programmatically you need to make sure you [obtain an API token](../../user_guide/api-token) with admin permissions.
### List projects in Unleash
### List projects in Unleash {#list-projects-in-unleash}
`GET https://unleash.host.com/api/admin/projects`
@ -39,7 +39,7 @@ Returns a list of projects in Unleash.
}
```
### Create a new project
### Create a new project {#create-a-new-project}
`POST https://unleash.host.com/api/admin/projects`
@ -55,7 +55,7 @@ Creates a new project.
}
```
### Update a projects field
### Update a projects field {#update-a-projects-field}
`PUT https://unleash.host.com/api/projects/:id`
@ -71,7 +71,7 @@ Updates a project with id=`id`.
}
```
### Delete a projects field
### Delete a projects field {#delete-a-projects-field}
`DELETE https://unleash.host.com/api/admin/projects/:id`

View File

@ -5,7 +5,7 @@ title: /api/admin/state
> In order to access the admin API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create an ADMIN token](../../user_guide/api-token) and add an Authorization header using the token.
### Export Feature Toggles & Strategies
### Export Feature Toggles & Strategies {#export-feature-toggles--strategies}
`GET: http://unleash.host.com/api/admin/state/export`
@ -58,7 +58,7 @@ strategies:
required: true
```
### Import Feature Toggles & Strategies
### Import Feature Toggles & Strategies {#import-feature-toggles--strategies}
`POST: http://unleash.host.com/api/admin/state/import`

View File

@ -5,7 +5,7 @@ title: /api/admin/strategies
> In order to access the admin API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create an ADMIN token](../../user_guide/api-token) and add an Authorization header using the token.
### Fetch Strategies
### Fetch Strategies {#fetch-strategies}
`GET: http://unleash.host.com/api/admin/strategies`
@ -56,7 +56,7 @@ Used to fetch all defined strategies and their defined parameters.
}
```
### Create strategy
### Create strategy {#create-strategy}
`POST: http://unleash.host.com/api/admin/strategies`
@ -85,7 +85,7 @@ Used to fetch all defined strategies and their defined parameters.
Used to create a new Strategy. Name is required and must be unique. It is also required to have a parameters array, but it can be empty.
### Update strategy
### Update strategy {#update-strategy}
`PUT: http://unleash.host.com/api/admin/strategies/:name`
@ -114,22 +114,22 @@ Used to create a new Strategy. Name is required and must be unique. It is also r
Used to update a Strategy definition. Name can't be changed. **PS! I can be dangerous to change an implemented strategy as the implementation also might need to be changed**
### Deprecate strategy
### Deprecate strategy {#deprecate-strategy}
`POST: https://unleash.host.com/api/admin/strategies/:name/deprecate`
Used to deprecate a strategy definition. This will set the deprecated flag to true. If the strategy is already deprecated, this will be a noop.
#### Errors
#### Errors {#errors}
_404 NOT FOUND_ - if `:name` does not exist
### Reactivate strategy
### Reactivate strategy {#reactivate-strategy}
`POST: https://unleash.host.com/api/admin/strategies/:name/reactivate`
Used to reactivate a deprecated strategy definition. This will set the deprecated flag back to false. If the strategy is not deprecated this is a noop and will still return 200.
#### Errors
#### Errors {#errors-1}
_404 NOT FOUND_ - if `:name` does not exist

View File

@ -5,7 +5,7 @@ title: /api/admin/tags
> In order to access the admin API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create an ADMIN token](../../user_guide/api-token) and add an Authorization header using the token.
### Create a new tag
### Create a new tag {#create-a-new-tag}
`POST https://unleash.host.com/api/admin/tags`
@ -20,11 +20,11 @@ Creates a new tag without connecting it to any other object, can be helpful to b
}
```
### Notes
### Notes {#notes}
- `type` must exist in tag-types
### List tags
### List tags {#list-tags}
`GET https://unleash.host.com/api/admin/tags`
@ -56,7 +56,7 @@ This endpoint is the one all admin UIs should use to fetch all available tags fr
}
```
### List tags by type
### List tags by type {#list-tags-by-type}
`GET: https://unleash.host.com/api/admin/tags/:type`
@ -84,19 +84,19 @@ Lists all tags of `:type`. If none exist, returns the empty list
}
```
### Get a single tag
### Get a single tag {#get-a-single-tag}
`GET https://unleash.host.com/api/admin/tags/:type/:value`
Gets the tag defined by the `type, value` tuple
### Delete a tag
### Delete a tag {#delete-a-tag}
`DELETE https://unleash.host.com/api/admin/tags/:type/:value`
Deletes the tag defined by the `type, value` tuple; all features tagged with this tag will lose the tag.
### Fetching Tag types
### Fetching Tag types {#fetching-tag-types}
`GET: https://unleash.host.com/api/admin/tag-types`
@ -117,7 +117,7 @@ Used to fetch all types the server knows about. This endpoint is the one all adm
}
```
### Get a single tag type
### Get a single tag type {#get-a-single-tag-type}
`GET: https://unleash.host.com/api/admin/tag-types/simple`
@ -137,7 +137,7 @@ Used to fetch details about a specific tag-type. This is mostly provided to make
}
```
### Create a new tag type
### Create a new tag type {#create-a-new-tag-type}
`POST: https://unleash.host.com/api/admin/tag-types`
@ -159,7 +159,7 @@ Used to register a new tag type. This endpoint should be used to inform the serv
Returns 201-CREATED if the tag type was created successfully
### Update tag type
### Update tag type {#update-tag-type}
`PUT: https://unleash.host.com/api/admin/tag-types/:typeName`
@ -172,7 +172,7 @@ Returns 201-CREATED if the tag type was created successfully
}
```
### Deleting a tag type
### Deleting a tag type {#deleting-a-tag-type}
`DELETE: https://unleash.host.com/api/admin/tag-types/:typeName`

View File

@ -5,7 +5,7 @@ title: /api/admin/user-admin
> In order to access the admin API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create an ADMIN token](../../user_guide/api-token) and add an Authorization header using the token.
### List all users
### List all users {#list-all-users}
`GET https://unleash.host.com/api/admin/user-admin`
@ -65,7 +65,7 @@ Will return all users and all available root roles for the Unleash instance.
}
```
### Search for users
### Search for users {#search-for-users}
You can also search for users via the search API. It will preform a simple search based on name and email matching the given query. Requires minimum 2 characters.
@ -88,7 +88,7 @@ You can also search for users via the search API. It will preform a simple searc
]
```
### Add a new user
### Add a new user {#add-a-new-user}
`POST https://unleash.host.com/api/admin/user-admin`
@ -108,7 +108,7 @@ Creates a new use with the given root role.
- `rootRole` can either be the role id or the unique name of the role (e.g: `Editor`).
#### Return values:
#### Return values: {#return-values}
`201: Created`
@ -148,7 +148,7 @@ Creates a new use with the given root role.
]
```
### Update a user
### Update a user {#update-a-user}
`POST https://unleash.host.com/api/admin/user-admin/:userId`
@ -169,7 +169,7 @@ Updates use with new fields
- `userId` is required as a url path parameter.
- All fields are optional. Only provided fields are updated.
### Delete a user
### Delete a user {#delete-a-user}
`DELETE https://unleash.host.com/api/admin/user-admin/:userId`
@ -180,7 +180,7 @@ Possible return values:
- `200: OK` - user was deleted
- `404: NOT FOUND` - No user with the provided `userId` was found
### Change password for a user
### Change password for a user {#change-password-for-a-user}
`POST https://unleash.host.com/api/admin/user-admin/:userId/change-password`
@ -197,7 +197,7 @@ Return values:
- `200 OK`: Password was changed.
- `400 Bad Request`: Password was not changed. Unleash requires a strong password. Please see in the response body on how to improve the password.
### Validate password for a user
### Validate password for a user {#validate-password-for-a-user}
You can use this endpoint to validate the strength of a given password.

View File

@ -5,13 +5,12 @@ title: Basic Auth
# Basic auth
When using the `insecure` authentication method, identifying using basic auth against the API is enough.
Since the `insecure` method doesn't require a password, it is enough to define the username when making HTTP requests.
When using the `insecure` authentication method, identifying using basic auth against the API is enough. Since the `insecure` method doesn't require a password, it is enough to define the username when making HTTP requests.
### With curl
### With curl {#with-curl}
Add the `-u myemail@test.com` flag to your curl command.
### With wget
### With wget {#with-wget}
Add the `--user=myemail@test.com` flag to your wget command.

View File

@ -3,9 +3,9 @@ id: features
title: /api/client/features
---
> In order to access the client API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create a CLIENT token](../../user_guide/api-token) and add an Authorization header using the token.
> In order to access the client API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create a CLIENT token](/user_guide/api-token) and add an Authorization header using the token.
### Fetching Feature Toggles
### Fetching Feature Toggles {#fetching-feature-toggles}
`GET: http://unleash.host.com/api/client/features`
@ -68,7 +68,7 @@ This endpoint should never return anything besides a valid _20X or 304-response_
}
```
#### Filter feature toggles
#### Filter feature toggles {#filter-feature-toggles}
Supports three params for now
@ -88,7 +88,7 @@ To filter for any feature belonging to project `myproject` use
Response format is the same as `api/client/features`
### Get specific feature toggle
### Get specific feature toggle {#get-specific-feature-toggle}
`GET: http://unleash.host.com/api/client/features/:featureName`
@ -113,11 +113,11 @@ Used to fetch details about a specific feature toggle. This is mainly provided t
}
```
### Strategy Constraints
### Strategy Constraints {#strategy-constraints}
> This is a unleash-enterprise feature
Strategy definitions may also contain a `constraints` property. Strategy constraints is a feature in Unleash which work on context fields, which is defined as part of the [Unleash Context](../../unleash-context). The purpose is to define a set of rules where all needs to be satisfied in order for the activation strategy to . A [high level description](https://www.unleash-hosted.com/articles/strategy-constraints) of it is available online.
Strategy definitions may also contain a `constraints` property. Strategy constraints is a feature in Unleash which work on context fields, which is defined as part of the [Unleash Context](/unleash_context). The purpose is to define a set of rules where all needs to be satisfied in order for the activation strategy to . A [high level description](https://www.unleash-hosted.com/articles/strategy-constraints) of it is available online.
**Example response:**
@ -158,9 +158,9 @@ In the example `environment` needs to be `production` AND `userId` must be eithe
- **IN** - constraint is satisfied if one of the values in the list matches the value for this context field in the context.
- **NOT_IN** - constraint is satisfied if NONE of the values is the list matches the value for this field in the context.
### Variants
### Variants {#variants}
All feature toggles can also take an array of variants. You can read more about [feature toggle variants](../../feature-toggle-variants).
All feature toggles can also take an array of variants. You can read more about [feature toggle variants](/advanced/toggle_variants).
```json
{

View File

@ -5,7 +5,7 @@ title: /api/client/metrics
> In order to access the client API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create a CLIENT token](../../user_guide/api-token) and add an Authorization header using the token.
### Send metrics
### Send metrics {#send-metrics}
`POST: http://unleash.host.com/api/client/metrics`

View File

@ -5,7 +5,7 @@ title: /api/client/register
> In order to access the client API endpoints you need to identify yourself. Unless you're using the `none` authentication method, you'll need to [create a CLIENT token](../../user_guide/api-token) and add an Authorization header using the token.
### Client registration
### Client registration {#client-registration}
`POST: http://unleash.host.com/api/client/register`

View File

@ -0,0 +1,33 @@
---
id: index
title: API Documentation
slug: /api
---
## Client API {#client-api}
This describes the API provided to unleash-clients.
Since v4.0.0 all operations require an [API token](/user_guide/api-token) with `Client` level access.
With versions earlier than v4.0.0 and `insecure` authentication no authentication is required.
- [Feature Toggles API](/api/client/features)
- [Register API](/api/client/register)
- [Metrics API](/api/client/metrics)
## Admin API (internal) {#admin-api-internal}
The internal API used by the Admin UI (unleash-frontend). Since v4.0.0 all operations require an [API token](/user_guide/api-token) with `Admin` level access:
With versions earlier than v4.0.0 and `insecure` authentication Basic Auth (with curl `-u myemail@test.com:`) is enough
- [Feature Toggles API](/api/admin/features)
- [Strategies API](/api/admin/strategies)
- [Events API](/api/admin/events)
- [Metrics API](/api/admin/metrics)
- [Tags API](/api/admin/tags)
## System API's {#system-apis}
- [Internal Backstage API](/api/internal/internal)

View File

@ -11,7 +11,7 @@ Unleash uses prometheus internally to collect metrics. These are available on th
[Read more about Prometheus](https://prometheus.io/)
## Annotations
## Annotations {#annotations}
Unleash will automatically count all updates for all toggles under the metric name `feature_toggle_update_total`, and the toggle name is will be set as a label value. This information can be used to create annotations in grafana for everytime a feature toggle is changed.

View File

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 665 B

View File

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 628 B

File diff suppressed because it is too large Load Diff

View File

@ -11,15 +11,11 @@
},
"host": "localhost:4242",
"basePath": "/api",
"schemes": [
"http"
],
"schemes": ["http"],
"paths": {
"/admin/archive/features": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
@ -38,9 +34,7 @@
"description": "Feature Toggle not found"
}
},
"tags": [
"Archive"
],
"tags": ["Archive"],
"description": "Archived feature toggles are those that have been previously deleted",
"operationId": "fetchArchivedToggles",
"summary": "List all the archived feature toggles on the Unleash server"
@ -66,9 +60,7 @@
"description": "Feature Toggle not found"
}
},
"tags": [
"Archive"
],
"tags": ["Archive"],
"description": "The Feature Toggle had been previously deleted",
"operationId": "reviveFeatureToggle",
"summary": "Un-archive a Feature Toggle"
@ -76,9 +68,7 @@
},
"/admin/events": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
@ -94,9 +84,7 @@
}
}
},
"tags": [
"Events"
],
"tags": ["Events"],
"description": "Returns one of the six event types:\n- feature-created\n- feature-updated\n- feature-archived\n- feature-revived\n- strategy-created\n- strategy-deleted",
"operationId": "get-admin-events",
"summary": "Fetch all changes in the Unleash system"
@ -104,9 +92,7 @@
},
"/admin/feature-types": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
@ -122,9 +108,7 @@
}
}
},
"tags": [
"Feature types"
],
"tags": ["Feature types"],
"description": "- release\n- experiment\n- ops\n- killswitch\n- permission",
"operationId": "get-admin-feature-types",
"summary": "Fetch the list of Unleash feature types"
@ -132,9 +116,7 @@
},
"/admin/features": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
@ -150,9 +132,7 @@
}
}
},
"tags": [
"Feature toggles"
],
"tags": ["Feature toggles"],
"externalDocs": {
"description": "Activation strategies",
"url": "https://unleash.github.io/docs/activation_strategy"
@ -162,12 +142,8 @@
"summary": "Fetches all feature toggles from the Unleash server."
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
{
"in": "body",
@ -192,9 +168,7 @@
}
}
},
"tags": [
"Feature toggles"
],
"tags": ["Feature toggles"],
"description": "Create a new Feature Toggle",
"operationId": "createFeatureToggle",
"summary": "Create a Feature Toggle"
@ -202,9 +176,7 @@
},
"/admin/features/{featureName}": {
"delete": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
@ -229,18 +201,13 @@
"description": "Feature Toggle not found"
}
},
"tags": [
"Feature toggles",
"Archive"
],
"tags": ["Feature toggles", "Archive"],
"description": "Feature toggles can only be archived - they cannot be deleted.\n\nIf an old Feature Toggle *re-appears*, this is because someone else has created a new one with the same name.\n",
"operationId": "archiveFeatureToggle",
"summary": "Archive a Feature Toggle."
},
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
@ -265,9 +232,7 @@
}
}
},
"tags": [
"Feature toggles"
],
"tags": ["Feature toggles"],
"externalDocs": {
"description": "Activation strategies",
"url": "https://unleash.github.io/docs/activation_strategy"
@ -277,12 +242,8 @@
"summary": "Fetches a specific Feature Toggle from the Unleash server."
},
"put": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
@ -321,9 +282,7 @@
"description": "Feature Toggle not found"
}
},
"tags": [
"Feature toggles"
],
"tags": ["Feature toggles"],
"description": "Update a Feature Toggle.",
"operationId": "featureName",
"summary": "Update a Feature Toggle"
@ -331,9 +290,7 @@
},
"/admin/features/{featureName}/stale/off": {
"post": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
@ -361,9 +318,7 @@
"description": "Feature Toggle not found"
}
},
"tags": [
"Feature toggles"
],
"tags": ["Feature toggles"],
"externalDocs": {
"description": "Feature Toggle types",
"url": "https://unleash.github.io/docs/feature_toggle_types"
@ -375,9 +330,7 @@
},
"/admin/features/{featureName}/stale/on": {
"post": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
@ -405,9 +358,7 @@
"description": "Feature Toggle not found"
}
},
"tags": [
"Feature toggles"
],
"tags": ["Feature toggles"],
"externalDocs": {
"description": "Feature Toggle types",
"url": "https://unleash.github.io/docs/feature_toggle_types"
@ -419,9 +370,7 @@
},
"/admin/features/{featureName}/toggle/off": {
"post": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
@ -449,9 +398,7 @@
"description": "Feature Toggle not found"
}
},
"tags": [
"Feature toggles"
],
"tags": ["Feature toggles"],
"description": "**featureName** must match an existing Feature Toggle.",
"operationId": "disableFeatureToggle",
"summary": "Disable a Feature Toggle."
@ -459,9 +406,7 @@
},
"/admin/features/{featureName}/toggle/on": {
"post": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
@ -489,9 +434,7 @@
"description": "Feature Toggle not found"
}
},
"tags": [
"Feature toggles"
],
"tags": ["Feature toggles"],
"description": "**featureName** must match an existing Feature Toggle.",
"operationId": "enableFeatureToggle",
"summary": "Enable a Feature Toggle."
@ -499,9 +442,7 @@
},
"/admin/metrics/applications": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
@ -517,9 +458,7 @@
}
}
},
"tags": [
"Metrics"
],
"tags": ["Metrics"],
"description": "Also has a link for more details.",
"operationId": "getApplications",
"summary": "A list of known applications ('seen' by Unleash in the last two days)"
@ -527,9 +466,7 @@
},
"/admin/metrics/applications/{appName}": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing application name.",
@ -557,9 +494,7 @@
"description": "Application name not found"
}
},
"tags": [
"Metrics"
],
"tags": ["Metrics"],
"description": "Details include things such as instances, strategies implemented and seen feature toggles.",
"operationId": "getApplicationDetails",
"summary": "Details about a client application."
@ -567,9 +502,7 @@
},
"/admin/metrics/feature-toggles": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
@ -585,9 +518,7 @@
}
}
},
"tags": [
"Metrics"
],
"tags": ["Metrics"],
"description": "- **Yes** is the number of times a given feature toggle was enabled in a client applucation\n- **No** is the number of times it was disabled.",
"operationId": "featureToggles",
"summary": "Gives 'last minute' and 'last hour' metrics for all active feature toggles (based on what was reported by the client applications)."
@ -595,9 +526,7 @@
},
"/admin/metrics/seen-apps": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
@ -613,9 +542,7 @@
}
}
},
"tags": [
"Metrics"
],
"tags": ["Metrics"],
"description": "(per Feature Toggle)",
"operationId": "seenApps",
"summary": "Details about seen applications"
@ -623,9 +550,7 @@
},
"/admin/metrics/seen-toggles": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
@ -635,9 +560,7 @@
}
}
},
"tags": [
"Metrics"
],
"tags": ["Metrics"],
"description": "It is only guaranteed that feature toggles reported by client applications within the last hour will be returned. However, in most cases, earlier reported feature toggles will also be returned.",
"operationId": "seenToggles",
"summary": "Returns a list of applications and the feature toggles that Unleash has 'seen' for each application."
@ -645,16 +568,11 @@
},
"/admin/state/export": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [
{
"description": "Choose export format, either json or yaml. json is the default\n",
"enum": [
"json",
"yaml"
],
"enum": ["json", "yaml"],
"in": "query",
"name": "format",
"type": "string",
@ -696,9 +614,7 @@
}
}
},
"tags": [
"Import and export"
],
"tags": ["Import and export"],
"externalDocs": {
"description": "Import and export",
"url": "https://unleash.github.io/docs/import_export"
@ -710,13 +626,8 @@
},
"/admin/state/import": {
"post": {
"consumes": [
"multipart/form-data",
"application/json"
],
"produces": [
"application/json"
],
"consumes": ["multipart/form-data", "application/json"],
"produces": ["application/json"],
"parameters": [
{
"default": "false",
@ -754,9 +665,7 @@
"description": "No import data provided."
}
},
"tags": [
"Import and export"
],
"tags": ["Import and export"],
"externalDocs": {
"description": "Import and export",
"url": "https://unleash.github.io/docs/import_export"
@ -768,9 +677,7 @@
},
"/admin/strategies": {
"get": {
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
@ -786,20 +693,14 @@
}
}
},
"tags": [
"Strategies"
],
"tags": ["Strategies"],
"description": "Fetch all strategies and their parameters.",
"operationId": "getStrategies",
"summary": "Fetch all strategies and their parameters."
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
{
"in": "body",
@ -830,9 +731,7 @@
}
}
},
"tags": [
"Strategies"
],
"tags": ["Strategies"],
"description": "Create Strategy",
"operationId": "createStrategy",
"summary": "Create Strategy"
@ -840,12 +739,8 @@
},
"/admin/strategies/{strategyName}": {
"put": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Strategy name.",
@ -878,9 +773,7 @@
"description": "Strategy not updated due to errors in query and/or request body (such as **name** and **strategyName** not matching)."
}
},
"tags": [
"Strategies"
],
"tags": ["Strategies"],
"description": "Use to update a Strategy definition.\n\n**name** and **strategyName** must match and must also match an existing Strategy name.\n\n**Caution: It can be dangerous to change a Strategy (as the implementation also might need to be changed).**\n",
"operationId": "updateStrategy",
"summary": "Update Strategy"
@ -917,11 +810,7 @@
"type": "string"
}
},
"required": [
"type",
"path",
"message"
],
"required": ["type", "path", "message"],
"type": "object"
},
"409": {
@ -935,9 +824,7 @@
"type": "string"
}
},
"required": [
"message"
]
"required": ["message"]
},
"minItems": 1,
"type": "array",
@ -953,11 +840,7 @@
"type": "string"
}
},
"required": [
"isJoi",
"name",
"details"
],
"required": ["isJoi", "name", "details"],
"title": "Error",
"type": "object"
},
@ -989,12 +872,7 @@
"properties": {
"kind": {
"description": "The kind of change:\n- **N** - a newly-added property or element\n- **D** - a property or element was deleted\n- **E** - a property or element was edited\n- **A** - a change occurred within an array",
"enum": [
"N",
"D",
"E",
"A"
],
"enum": ["N", "D", "E", "A"],
"example": "E",
"type": "string"
},
@ -1005,9 +883,7 @@
},
"path": {
"items": {
"required": [
"pathItem"
]
"required": ["pathItem"]
},
"properties": {
"pathItem": {
@ -1024,11 +900,7 @@
"type": "boolean"
}
},
"required": [
"kind",
"lhs",
"rhs"
]
"required": ["kind", "lhs", "rhs"]
},
"type": "array"
},
@ -1054,12 +926,7 @@
}
},
"minItems": 1,
"required": [
"id",
"type",
"createdBy",
"createdAt"
],
"required": ["id", "type", "createdBy", "createdAt"],
"type": "array",
"uniqueItems": true
},
@ -1141,12 +1008,7 @@
"$ref": "#/definitions/strategySchema"
}
},
"required": [
"application",
"instances",
"strategies",
"seenToggles"
],
"required": ["application", "instances", "strategies", "seenToggles"],
"title": "Successful response",
"type": "object"
},
@ -1162,11 +1024,7 @@
"$ref": "#/definitions/versionSchema"
}
},
"required": [
"version",
"features",
"strategies"
],
"required": ["version", "features", "strategies"],
"title": "Successful response",
"type": "object"
},
@ -1175,10 +1033,7 @@
"items": {
"properties": {
"appName": {
"enum": [
"lastHour",
"lastMinute"
],
"enum": ["lastHour", "lastMinute"],
"example": "lastHour",
"minLength": 1,
"type": "string"
@ -1189,24 +1044,15 @@
"type": "number"
},
"yesno": {
"enum": [
"yes",
"no"
],
"enum": ["yes", "no"],
"type": "string"
}
},
"required": [
"yesno",
"metricsCount"
],
"required": ["yesno", "metricsCount"],
"type": "object"
}
},
"required": [
"appName",
"seenToggles"
],
"required": ["appName", "seenToggles"],
"title": "Feature Toggle metrics",
"type": "object"
},
@ -1258,12 +1104,7 @@
"type": "string"
}
},
"required": [
"id",
"name",
"description",
"lifetimeDays"
]
"required": ["id", "name", "description", "lifetimeDays"]
},
"minItems": 1,
"type": "array",
@ -1273,10 +1114,7 @@
"$ref": "#/definitions/versionSchema"
}
},
"required": [
"version",
"types"
],
"required": ["version", "types"],
"title": "Successful response",
"type": "object"
},
@ -1297,11 +1135,7 @@
"type": "array"
}
},
"required": [
"appName",
"seenToggles",
"metricsCount"
],
"required": ["appName", "seenToggles", "metricsCount"],
"title": "Feature Toggle information",
"type": "object"
},
@ -1319,10 +1153,7 @@
"$ref": "#/definitions/versionSchema"
}
},
"required": [
"version",
"strategies"
],
"required": ["version", "strategies"],
"title": "Successful response",
"type": "object"
},
@ -1369,21 +1200,14 @@
"type": "string"
}
},
"required": [
"appName",
"createdAt",
"updatedAt",
"strategies"
]
"required": ["appName", "createdAt", "updatedAt", "strategies"]
},
"minItems": 1,
"type": "array",
"uniqueItems": true
}
},
"required": [
"applications"
],
"required": ["applications"],
"title": "Application details",
"type": "object"
},
@ -1419,12 +1243,7 @@
"type": "string"
}
},
"required": [
"name",
"type",
"description",
"required"
]
"required": ["name", "type", "description", "required"]
},
"minItems": 1,
"type": "array",
@ -1441,11 +1260,7 @@
"type": "string"
}
},
"required": [
"name",
"description",
"parameters"
],
"required": ["name", "description", "parameters"],
"title": "Strategy",
"type": "object"
},
@ -1508,15 +1323,9 @@
},
"default": "release",
"description": "'One of the five Unleash Feature Toggle types.\n\n**type** is optional. If not defined, it defaults to *release*'",
"enum": [
"release",
"experiment",
"ops",
"killswitch",
"permission"
],
"enum": ["release", "experiment", "ops", "killswitch", "permission"],
"example": "release",
"minLength": 1,
"minLength": 1,
"title": "Types of Feature Toggle",
"type": "string"
},
@ -1548,10 +1357,7 @@
"type": "string"
}
},
"required": [
"name",
"type"
],
"required": ["name", "type"],
"type": "object"
}
},
@ -1597,10 +1403,7 @@
"type": "number"
}
},
"required": [
"name",
"weight"
]
"required": ["name", "weight"]
},
"type": "array"
},

View File

@ -7,7 +7,7 @@ title: Client Specification
This document attempts to guide developers in implementing an Unleash Client SDK.
## System Overview
## System Overview {#system-overview}
Unleash is composed of three parts:
@ -15,11 +15,11 @@ Unleash is composed of three parts:
- **Unleash UI** - The dashboard used to manage feature toggles, define new strategies, look at metrics, etc.
- **Unleash SDK** - Used by clients to check if a feature is enabled or disabled. The SDK also collects metrics and sends them to the Unleash API. Activation Strategies are also implemented in the SDK. Unleash currently provides official SDKs for Java and Node.js
![system_overview](https://raw.githubusercontent.com/Unleash/unleash/master/docs/assets/unleash-diagram.png 'System Overview')
![system_overview](/img/unleash-diagram.png 'System Overview')
To be super fast, the client SDK caches all feature toggles and their current configuration in memory. The activation strategies are also implemented in the SDK. This makes it really fast to check if a toggle is on or off because it is just a simple function operating on local state, without the need to poll data from the database.
## The Basics
## The Basics {#the-basics}
All client implementations should strive to have a consistent and straightforward user API. It should be a simple method, called isEnabled, to check if a feature toggle is enabled or not. The method should return a `boolean` value, true or false.
@ -36,7 +36,7 @@ boolean value = unleash.isEnabled("unknownFeatureToggle", false);
//value==false because default value was used.
```
### Implementation of isEnabled
### Implementation of isEnabled {#implementation-of-isenabled}
A feature toggle is defined as:
@ -90,28 +90,28 @@ function isEnabled(name, unleashContext = {}, defaultValue = false) {
}
```
## Activation Strategies
## Activation Strategies {#activation-strategies}
Activation strategies are defined and configured in the unleash-service. It is up to the client to provide the actual implementation of each activation strategy.
Unleash also ships with a few built-in strategies, and expects client SDK's to implement these. Read more about these [activation strategies](activation-strategies.md). For the built-in strategies to work as expected the client should also allow the user to define an [unleash-context](unleash-context.md). The context should be possible to pass in as part of the `isEnabled` call.
### Extension points
### Extension points {#extension-points}
Client implementation should also provide a defined interface to make it easier for the user to implement their own activation strategies, and register those in the Unleash client.
## Fetching feature toggles (polling)
## Fetching feature toggles (polling) {#fetching-feature-toggles-polling}
The client implementation should fetch toggles in the background as regular polling. In a thread-based environment, such as Java, this needs to be done in a separate thread. The default poll interval should be **15 seconds**, and it should also be configurable.
## Client registration
## Client registration {#client-registration}
On start-up, the clients should register with the Unleash server. The registration request must include the required fields specified in the [API documentation](api/client/register-api.md).
## Metrics
## Metrics {#metrics}
Clients are expected to send metrics back to Unleash API at regular intervals. The metrics are a list of used toggles and how many times they evaluated to yes or no in at the time of requesting the metrics. Read more about how to send metrics in the [Metrics API](api/client/metrics-api.md) documentation.
## Backup Feature Toggles
## Backup Feature Toggles {#backup-feature-toggles}
The SDK also persists the latest known state to a local file on the instance where the client is running. It will store a local copy every time the client receives changes from the API. Having a local backup of the latest known state minimises the consequences of clients not being able to talk to the Unleash API on startup. This is necessary due to network unreliability.

View File

@ -1,4 +1,4 @@
## Introduction
## Introduction {#introduction}
Before developing on this project you will need two things:
@ -9,13 +9,13 @@ Before developing on this project you will need two things:
npm run start:dev
```
## PostgreSQL
## PostgreSQL {#postgresql}
To run and develop unleash, you need to have PostgreSQL database (PostgreSQL v10.x or newer) locally.
> Unleash currently also work with PostgreSQL v9.5+, but this might change in a future feature release, and we have stopped running automatic integration tests below PostgreSQL v10.
### Create a local unleash databases in postgres
### Create a local unleash databases in postgres {#create-a-local-unleash-databases-in-postgres}
```bash
$ psql postgres <<SQL
@ -38,11 +38,11 @@ export DATABASE_URL=postgres://unleash_user:passord@localhost:5432/unleash
export TEST_DATABASE_URL=postgres://unleash_user:passord@localhost:5432/unleash_test
```
## PostgreSQL with docker
## PostgreSQL with docker {#postgresql-with-docker}
If you don't want to install PostgreSQL locally, you can spin up an Docker instance. We have created a script to ease this process: `scripts/docker-postgres.sh`
## Start the application
## Start the application {#start-the-application}
In order to start the application you will need Node.js v14.x or newer installed locally.
@ -63,11 +63,11 @@ http://localhost:4242/api/
npm test
```
## Database changes
## Database changes {#database-changes}
We use database migrations to track database changes.
### Making a schema change
### Making a schema change {#making-a-schema-change}
To run migrations, you will set the environment variable for DATABASE_URL
@ -110,7 +110,7 @@ Test your migrations:
> npm run db-migrate -- down
```
## Publishing / Releasing new packages
## Publishing / Releasing new packages {#publishing--releasing-new-packages}
Please run `npm run nsp` and `npm run test` checks before publishing.

View File

@ -33,17 +33,17 @@ unleash.start(unleashOptions);
**Available Unleash options include:**
- **db** - The database configuration object taking the following properties:
- _user_ - the database username (`DATABASE_USERNAME`)
- _password_ - the database password (`DATABASE_PASSWORD`)
- _host_ - the database hostname (`DATABASE_HOST`)
- _port_ - the database port defaults to 5432 (`DATABASE_PORT`)
- _database_ - the database name to be used (`DATABASE_NAME`)
- _ssl_ - an object describing ssl options, see https://node-postgres.com/features/ssl (`DATABASE_SSL`, as a stringified json object)
- _version_ - the postgres database version. Used to connect a non-standard database. Defaults to `undefined`, which let the underlying adapter to detect the version automatically. (`DATABASE_VERSION`)
- _pool_ - an object describing pool options, see https://knexjs.org/#Installation-pooling. We support the following three fields:
- _min_ - minimum connections in connections pool (defaults to 0) (`DATABASE_POOL_MIN`)
- _max_ - maximum connections in connections pool (defaults to 4) (`DATABASE_POOL_MAX`)
- _idleTimeoutMillis_ - time in milliseconds a connection must be idle before being marked as a candidate for eviction (defaults to 30000) (`DATABASE_POOL_IDLE_TIMEOUT_MS`)
- _user_ - the database username (`DATABASE_USERNAME`)
- _password_ - the database password (`DATABASE_PASSWORD`)
- _host_ - the database hostname (`DATABASE_HOST`)
- _port_ - the database port defaults to 5432 (`DATABASE_PORT`)
- _database_ - the database name to be used (`DATABASE_NAME`)
- _ssl_ - an object describing ssl options, see https://node-postgres.com/features/ssl (`DATABASE_SSL`, as a stringified json object)
- _version_ - the postgres database version. Used to connect a non-standard database. Defaults to `undefined`, which let the underlying adapter to detect the version automatically. (`DATABASE_VERSION`)
- _pool_ - an object describing pool options, see https://knexjs.org/#Installation-pooling. We support the following three fields:
- _min_ - minimum connections in connections pool (defaults to 0) (`DATABASE_POOL_MIN`)
- _max_ - maximum connections in connections pool (defaults to 4) (`DATABASE_POOL_MAX`)
- _idleTimeoutMillis_ - time in milliseconds a connection must be idle before being marked as a candidate for eviction (defaults to 30000) (`DATABASE_POOL_IDLE_TIMEOUT_MS`)
- **databaseUrl** - (_deprecated_) the postgres database url to connect to. Only used if _db_ object is not specified, and overrides the _db_ object and any environment variables that change parts of it (like `DATABASE_SSL`). Should include username/password. This value may also be set via the `DATABASE_URL` environment variable. Alternatively, if you would like to read the database url from a file, you may set the `DATABASE_URL_FILE` environment variable with the full file path. The contents of the file must be the database url exactly.
- **databaseSchema** - the postgres database schema to use. Defaults to 'public'. (`DATABASE_SCHEMA`)
- **port** - which port the unleash-server should bind to. If port is omitted or is 0, the operating system will assign an arbitrary unused port. Will be ignored if pipe is specified. This value may also be set via the `HTTP_PORT` environment variable
@ -54,20 +54,20 @@ unleash.start(unleashOptions);
- **preHook** (function) - this is a hook if you need to provide any middlewares to express before `unleash` adds any. Express app instance is injected as first argument.
- **preRouterHook** (function) - use this to register custom express middlewares before the `unleash` specific routers are added. This is typically how you would register custom middlewares to handle authentication.
- **adminAuthentication** (string) - use this when implementing custom admin authentication [securing-unleash](./securing-unleash.md). Possible values are:
- `none` - will disable authentication altogether
- `unsecure` - (default) will use simple cookie based authentication. UI will require the user to specify an email in order to use unleash.
- `custom` - use this when you implement your own custom authentication logic.
- `none` - will disable authentication altogether
- `unsecure` - (default) will use simple cookie based authentication. UI will require the user to specify an email in order to use unleash.
- `custom` - use this when you implement your own custom authentication logic.
- **ui** (object) - Set of UI specific overrides. You may set the following keys: `headerBackground`, `environment`, `slogan`.
- **getLogger** (function) - Used to register a [custom log provider](#how-do-i-configure-the-log-output).
- **eventHook** (`function(event, data)`) - If provided, this function will be invoked whenever a feature is mutated. The possible values for `event` are `'feature-created'`, `'feature-updated'`, `'feature-archived'`, `'feature-revived'`. The `data` argument contains information about the mutation. Its fields are `type` (string) - the event type (same as `event`); `createdBy` (string) - the user who performed the mutation; `data` - the contents of the change. The contents in `data` differs based on the event type; For `'feature-archived'` and `'feature-revived'`, the only field will be `name` - the name of the feature. For `'feature-created'` and `'feature-updated'` the data follows a schema defined in the code [here](https://github.com/Unleash/unleash/blob/master/lib/routes/admin-api/feature-schema.js#L38-L59). See an [api here](/docs/api/admin/events).
- **eventHook** (`function(event, data)`) - If provided, this function will be invoked whenever a feature is mutated. The possible values for `event` are `'feature-created'`, `'feature-updated'`, `'feature-archived'`, `'feature-revived'`. The `data` argument contains information about the mutation. Its fields are `type` (string) - the event type (same as `event`); `createdBy` (string) - the user who performed the mutation; `data` - the contents of the change. The contents in `data` differs based on the event type; For `'feature-archived'` and `'feature-revived'`, the only field will be `name` - the name of the feature. For `'feature-created'` and `'feature-updated'` the data follows a schema defined in the code [here](https://github.com/Unleash/unleash/blob/master/lib/routes/admin-api/feature-schema.js#L38-L59). See an [api here](/api/admin/events).
- **baseUriPath** (string) - use to register a base path for all routes on the application. For example `/my/unleash/base` (note the starting /). Defaults to `/`. Can also be configured through the environment variable `BASE_URI_PATH`.
- **unleashUrl** (string) - Used to specify the official URL this instance of Unleash can be accessed at for an end user. Can also be configured through the environment variable `UNLEASH_URL`.
- **secureHeaders** (boolean) - use this to enable security headers (HSTS, CSP, etc) when serving Unleash from HTTPS. Can also be configured through the environment variable `SECURE_HEADERS`.
- **checkVersion** - the checkVersion object deciding where to check for latest version
- `url` - The url to check version (Defaults to `https://version.unleash.run`) - Overridable with (`UNLEASH_VERSION_URL`)
- `enable` - Whether version checking is enabled (defaults to true) - Overridable with (`CHECK_VERSION`) (if anything other than `true`, does not check)
- `url` - The url to check version (Defaults to `https://version.unleash.run`) - Overridable with (`UNLEASH_VERSION_URL`)
- `enable` - Whether version checking is enabled (defaults to true) - Overridable with (`CHECK_VERSION`) (if anything other than `true`, does not check)
### Disabling Auto-Start
### Disabling Auto-Start {#disabling-auto-start}
If you're using Unleash as part of a larger express app, you can disable the automatic server start by calling `server.create`. It takes the same options as `server.start`, but will not begin listening for connections.
@ -86,11 +86,11 @@ unleash
});
```
## Securing Unleash
## Securing Unleash {#securing-unleash}
You can integrate Unleash with your authentication provider (OAuth 2.0). Read more about [securing unleash](./securing-unleash.md).
## How do I configure the log output?
## How do I configure the log output? {#how-do-i-configure-the-log-output}
By default, `unleash` uses [log4js](https://github.com/nomiddlename/log4js-node) to log important information. It is possible to swap out the logger provider (only when using Unleash programmatically). You do this by providing an implementation of the **getLogger** function as This enables filtering of log levels and easy redirection of output streams.
@ -108,7 +108,7 @@ function getLogger(name) {
The logger interface with its `debug`, `info`, `warn` and `error` methods expects format string support as seen in `debug` or the JavaScript `console` object. Many commonly used logging implementations cover this API, e.g., bunyan, pino or winston.
## Database pooling connection timeouts
## Database pooling connection timeouts {#database-pooling-connection-timeouts}
- Please be aware of the default values of connection pool about idle session handling.
- If you have a network component which closes idle sessions on tcp layer, please ensure, that the connection pool idleTimeoutMillis setting is lower than the timespan as the network component will close the idle connection.

View File

@ -7,7 +7,7 @@ title: Configuring Unleash
# Must configure
## Database details
## Database details {#database-details}
In order for Unleash server to work, you must setup database connection details.
@ -24,7 +24,7 @@ In order for Unleash server to work, you must setup database connection details.
# Nice to configure
### Unleash URL
### Unleash URL {#unleash-url}
- Configured with `UNLEASH_URL` ** Should be set to the public discoverable URL of your instance, so if your instance is accessed by your users at `https://unleash.mysite.com` use that. ** If you're deploying this to a subpath, include the subpath in this. So `https://mysite.com/unleash` will also be correct.
- Used to create
@ -32,7 +32,7 @@ In order for Unleash server to work, you must setup database connection details.
- Welcome link for new users
- Links in events for our Slack, Microsoft Teams and Datadog addons
### Email server details
### Email server details {#email-server-details}
Used to send reset-password mails and welcome mails when onboarding new users. <br /> **NOTE** - If this is not configured, you will not be able to allow your users to reset their own passwords.
@ -102,7 +102,7 @@ unleash.start(unleashOptions);
- **ui** (object) - Set of UI specific overrides. You may set the following keys: `headerBackground`, `environment`, `slogan`.
- **getLogger** (function) - Used to register a [custom log provider](#how-do-i-configure-the-log-output).
- **logLevel** (`debug` | `info` | `warn` | `error` | `fatal`) - The lowest level to log at, also configurable using environment variable `LOG_LEVEL`.
- **eventHook** (`function(event, data)`) - If provided, this function will be invoked whenever a feature is mutated. The possible values for `event` are `'feature-created'`, `'feature-updated'`, `'feature-archived'`, `'feature-revived'`. The `data` argument contains information about the mutation. Its fields are `type` (string) - the event type (same as `event`); `createdBy` (string) - the user who performed the mutation; `data` - the contents of the change. The contents in `data` differs based on the event type; For `'feature-archived'` and `'feature-revived'`, the only field will be `name` - the name of the feature. For `'feature-created'` and `'feature-updated'` the data follows a schema defined in the code [here](https://github.com/Unleash/unleash/blob/master/src/lib/services/feature-schema.js#L65). See an [api here](/docs/api/admin/events).
- **eventHook** (`function(event, data)`) - If provided, this function will be invoked whenever a feature is mutated. The possible values for `event` are `'feature-created'`, `'feature-updated'`, `'feature-archived'`, `'feature-revived'`. The `data` argument contains information about the mutation. Its fields are `type` (string) - the event type (same as `event`); `createdBy` (string) - the user who performed the mutation; `data` - the contents of the change. The contents in `data` differs based on the event type; For `'feature-archived'` and `'feature-revived'`, the only field will be `name` - the name of the feature. For `'feature-created'` and `'feature-updated'` the data follows a schema defined in the code [here](https://github.com/Unleash/unleash/blob/master/src/lib/services/feature-schema.js#L65). See an [api here](/api/admin/events).
- **secureHeaders** (boolean) - use this to enable security headers (HSTS, CSP, etc) when serving Unleash from HTTPS. Can also be configured through the environment variable `SECURE_HEADERS`.
- **versionCheck** - the object deciding where to check for latest version
- `url` - The url to check version (Defaults to `https://version.unleash.run`) - Overridable with (`UNLEASH_VERSION_URL`)
@ -115,7 +115,7 @@ unleash.start(unleashOptions);
- `smtpuser` - Username for your SMTP server
- `smtppass` - Password for your SMTP server
### Disabling Auto-Start
### Disabling Auto-Start {#disabling-auto-start}
If you're using Unleash as part of a larger express app, you can disable the automatic server start by calling `server.create`. It takes the same options as `server.start`, but will not begin listening for connections.
@ -134,11 +134,11 @@ unleash
});
```
## Securing Unleash
## Securing Unleash {#securing-unleash}
You can integrate Unleash with your authentication provider (OAuth 2.0). Read more about [securing unleash](./securing-unleash.md).
## How do I configure the log output?
## How do I configure the log output? {#how-do-i-configure-the-log-output}
By default, `unleash` uses [log4js](https://github.com/nomiddlename/log4js-node) to log important information. It is possible to swap out the logger provider (only when using Unleash programmatically). You do this by providing an implementation of the **getLogger** function as This enables filtering of log levels and easy redirection of output streams.
@ -156,7 +156,7 @@ function getLogger(name) {
The logger interface with its `debug`, `info`, `warn` and `error` methods expects format string support as seen in `debug` or the JavaScript `console` object. Many commonly used logging implementations cover this API, e.g., bunyan, pino or winston.
## Database pooling connection timeouts
## Database pooling connection timeouts {#database-pooling-connection-timeouts}
- Please be aware of the default values of connection pool about idle session handling.
- If you have a network component which closes idle sessions on tcp layer, please ensure, that the connection pool idleTimeoutMillis setting is lower than the timespan as the network component will close the idle connection.

View File

@ -11,11 +11,11 @@ If the service is not configured you'll see a log line every time you add a new
[2021-05-07T12:59:04.572] [WARN] routes/user-controller.ts - email was not sent to the user because email configuration is lacking
```
## Configuring
## Configuring {#configuring}
Depending on your deploy case there are different ways of configuring this service. Full documentation of all configuration possibilities is available [here](./configuring-unleash.md)
### Docker
### Docker {#docker}
With docker, we configure the mail service via environment variables.
@ -30,7 +30,7 @@ Environment variables:
- EMAIL_PASSWORD - the password for your SMTP user
- EMAIL_SENDER - which address should reset-password mails and welcome mails be sent from - defaults to `noreply@unleash-hosted.com` which is probably not what you want.
### Node
### Node {#node}
With node, we can configure this when calling Unleash's start method.

View File

@ -5,7 +5,7 @@ title: Getting Started
> This section only applies if you plan to self-host Unleash. If you are looking for our hosted solution you should head over to [www.getunleash.io](https://www.getunleash.io/plans)
## Requirements
## Requirements {#requirements}
You will need:
@ -13,7 +13,7 @@ You will need:
- [PostgreSQL](https://www.postgresql.org/download/) (version 10 or later)
- [Create an unleash user and database](./database-setup).
## Start Unleash server
## Start Unleash server {#start-unleash-server}
Whichever option you choose to start Unleash, you must specify a database URI (it can be set in the environment variable DATABASE_URL). If your database server is not set up to support SSL you'll also need to set the environment variable `DATABASE_SSL` to `false`
@ -32,7 +32,7 @@ To run multiple replicas of Unleash simply point all instances to the same datab
- username: `admin`
- password: `unleash4all`
### Option one - use Docker
### Option one - use Docker {#option-one---use-docker}
**Useful links:**
@ -60,13 +60,13 @@ docker run -p 4242:4242 \
--network unleash unleashorg/unleash-server
```
#### Docker-compose
#### Docker-compose {#docker-compose}
1. Clone the [unleash-docker](https://github.com/Unleash/unleash-docker) repository.
2. Run `docker-compose build` in repository root folder.
3. Run `docker-compose up` in repository root folder.
### Option two - from Node.js
### Option two - from Node.js {#option-two---from-nodejs}
1. Create a new folder/directory on your development computer.
2. From a terminal/bash shell, install the dependencies:
@ -107,11 +107,11 @@ docker run -p 4242:4242 \
node server.js
```
## Create an api token for your client
## Create an api token for your client {#create-an-api-token-for-your-client}
- [API Token creation](../user_guide/api-token)
## Test your server and create a sample API call
## Test your server and create a sample API call {#test-your-server-and-create-a-sample-api-call}
Once the Unleash server has started, go to [localhost:4242](http://localhost:4242) in your browser. If you see an empty list of feature toggles, try creating one with [curl](https://curl.se/) from a terminal/bash shell:
@ -131,7 +131,7 @@ curl --location -H "Authorization: <apitoken from previous step>" --request POST
}'\
```
## Version check
## Version check {#version-check}
- Unleash checks that it uses the latest version by making a call to https://version.unleash.run.
- This is a cloud function storing instance id to our database for statistics.

View File

@ -17,7 +17,7 @@ unleash.start(options).then(unleash => {
});
```
### Creating a web application client ID
### Creating a web application client ID {#creating-a-web-application-client-id}
1. Go to the credentials section in the [Google Cloud Platform Console](https://console.cloud.google.com/apis/credentials?_ga=2.77615956.-1991581217.1542834301).
@ -39,7 +39,7 @@ http://localhost:4242/api/auth/callback
8. Copy the **CLIENT ID** and **CLIENT SECRET** and save them for later use.
### Add dependencies
### Add dependencies {#add-dependencies}
Add two dependencies [`@passport-next/passport`](https://www.npmjs.com/package/@passport-next/passport) and [`@passport-next/passport-google-oauth2`](https://www.npmjs.com/package/@passport-next/passport-google-oauth2) inside `index.js` file
@ -50,7 +50,7 @@ const GoogleOAuth2Strategy = require('@passport-next/passport-google-oauth2')
.Strategy;
```
### Configure the Google strategy for use by Passport.js
### Configure the Google strategy for use by Passport.js {#configure-the-google-strategy-for-use-by-passportjs}
OAuth 2-based strategies require a `verify` function which receives the credential (`accessToken`) for accessing the Google API on the user's behalf, along with the user's profile. The function must invoke `cb` with a user object, which will be set at `req.user` in route handlers after authentication.
@ -98,7 +98,7 @@ unleash.start(options).then(instance => {
});
```
### In `googleAdminAuth` function
### In `googleAdminAuth` function {#in-googleadminauth-function}
Configure `passport` package.
@ -170,7 +170,7 @@ function googleAdminAuth(app) {
}
```
### The complete code
### The complete code {#the-complete-code}
The `index.js` server file.

View File

@ -7,7 +7,7 @@ title: Google Auth Hook
This part of the tutorial shows how to create a sign-in flow for users and integrate with Unleash server project. The implementation assumes that I am working in `localhost` with `4242` port.
**If you are still using Unleash v3 you need to follow the [google-auth-hook-v3](./google-auth-hook-v3)**
**If you are still using Unleash v3 you need to follow the [google-auth-hook-v3](/deploy/google_auth_v3)**
This is a simple `index.js` server file.
@ -19,7 +19,7 @@ unleash.start(options).then(unleash => {
});
```
### Creating a web application client ID
### Creating a web application client ID {#creating-a-web-application-client-id}
1. Go to the credentials section in the [Google Cloud Platform Console](https://console.cloud.google.com/apis/credentials?_ga=2.77615956.-1991581217.1542834301).
@ -41,7 +41,7 @@ http://localhost:4242/api/auth/callback
8. Copy the **CLIENT ID** and **CLIENT SECRET** and save them for later use.
### Add dependencies
### Add dependencies {#add-dependencies}
Add two dependencies [`@passport-next/passport`](https://www.npmjs.com/package/@passport-next/passport) and [`@passport-next/passport-google-oauth2`](https://www.npmjs.com/package/@passport-next/passport-google-oauth2) inside `index.js` file
@ -74,7 +74,7 @@ unleash.start(options).then(instance => {
});
```
### In `googleAdminAuth` function: Configure the Google strategy for use by Passport.js
### In `googleAdminAuth` function: Configure the Google strategy for use by Passport.js {#in-googleadminauth-function-configure-the-google-strategy-for-use-by-passportjs}
OAuth 2-based strategies require a `verify` function which receives the credential (`accessToken`) for accessing the Google API on the user's behalf, along with the user's profile. The function must invoke `cb` with a user object, which will be set at `req.user` in route handlers after authentication.
@ -106,7 +106,7 @@ function googleAdminAuth(app, config, services) {
}
```
### In `googleAdminAuth` function
### In `googleAdminAuth` function {#in-googleadminauth-function}
Configure `passport` package.
@ -179,7 +179,7 @@ function googleAdminAuth(app, config, services) {
}
```
### The complete code
### The complete code {#the-complete-code}
> You can also find the complete [source code for this guide](https://github.com/Unleash/unleash-examples/tree/main/v4/securing-google-auth) in the unleash-examples project.

View File

@ -11,9 +11,9 @@ All import mechanisms support a `drop` parameter which will clean the database b
> You should be careful when using `drop` parameter in production environments, as it will clean current state.
## Runtime import & export
## Runtime import & export {#runtime-import--export}
### State Service
### State Service {#state-service}
Unleash returns a StateService when started, you can use this to import and export data at any time.
@ -34,7 +34,7 @@ If you want the database to be cleaned before import (all strategies and feature
It is also possible to not override exiting feature toggles (and strategies) by using the `keepExisting` parameter.
### API Export
### API Export {#api-export}
The api endpoint `/api/admin/state/export` will export feature-toggles and strategies as json by default.\
You can customize the export with query parameters:
@ -62,7 +62,7 @@ curl -X GET -H "Content-Type: application/json" \
http://unleash.herokuapp.com/api/admin/state/export?&featureToggles=1&strategies=0 > export.json
```
### API Import
### API Import {#api-import}
You can import feature-toggles and strategies by POSTing to the `/api/admin/state/import` endpoint (keep in mind this will require authentication).\
You can either send the data as JSON in the POST-body or send a `file` parameter with `multipart/form-data` (YAML files are also accepted here).
@ -96,9 +96,9 @@ curl -X POST -H "Content-Type: application/json" \
\*) Remember to set correct token for Authorization.
## Startup import
## Startup import {#startup-import}
### Import files via config parameter
### Import files via config parameter {#import-files-via-config-parameter}
You can import a json or yaml file via the configuration option `importFile`.

View File

@ -5,23 +5,23 @@ title: Migration Guide
Generally, the intention is that `unleash-server` should always provide support for clients one major version lower than the current one. This should make it possible to upgrade `unleash` gradually.
## Upgrading from v3.x to v4.x
## Upgrading from v3.x to v4.x {#upgrading-from-v3x-to-v4x}
Before you upgrade we strongly recommend that you take a full [database backup](/database_backup), to make sure you can downgrade to version 3.
Before you upgrade we strongly recommend that you take a full [database backup](/deploy/database_backup), to make sure you can downgrade to version 3.
You can also read the highlights of **[what's new in v4](../user_guide/v4-whats-new)**.
You can also read the highlights of **[what's new in v4](/user_guide/v4-whats-new)**.
### 1. All API calls now requires token.
### 1. All API calls now requires token. {#1-all-api-calls-now-requires-token}
If you are upgrading from Unleash Open-Source v3 client SDKs did not need to use an API token in order to connect to Unleash-server. Starting from v4 we have back-ported the API token handling for Enterprise in to the Open-Source version. This means that all client SDKs now need to use a client token in order to connect to Unleash.
Read more in the [API token documentation](../user_guide/api-token).
### 2. Configuring Unleash
### 2. Configuring Unleash {#2-configuring-unleash}
We have done a lot of changes to the options you can pass in to Unleash. If you are manually configuring Unleash you should have a look on the updated [configuring Unleash documentation](./configuring_unleash)
### 3. Role-based Access Control (RBAC)
### 3. Role-based Access Control (RBAC) {#3-role-based-access-control-rbac}
We have implemented RBAC in Unleash v4. This has totally changed the permission system in Unleash.
@ -45,19 +45,19 @@ req.session.user = user;
- [Read more about Securing Unleash v4](./securing_unleash)
- [Read more about RBAC](../user_guide/rbac)
### 4. Legacy v2 routes removed
### 4. Legacy v2 routes removed {#4-legacy-v2-routes-removed}
Only relevant if you use the `enableLegacyRoutes` option.
In v2 you could query feature toggles on `/api/features`. This was deprecated in v4 and we introduced two different endpoints (`/api/admin/features` and `/api/client/features`) to be able to optimize performance and security. In v3 you could still enable the legacy routes via the `enableLegacyRoutes` option. This was removed in v4.
### 5. Unleash CLI has been removed
### 5. Unleash CLI has been removed {#5-unleash-cli-has-been-removed}
Unleash no longer ships with a binary that allows you to start Unleash directly from the command line. From v4 you need to either use Unleash via docker or programmatically.
Read more in our [getting started documentation](./getting_started)
## Upgrading from v2.x to v3.x
## Upgrading from v2.x to v3.x {#upgrading-from-v2x-to-v3x}
The notable change introduced in Unleash v3.x is a strict separation of API paths for client requests and admin requests. This makes it easier to implement different authentication mechanisms for the admin UI and all unleash-clients. You can read more about [securing unleash](https://github.com/Unleash/unleash/blob/master/docs/securing-unleash.md).
@ -65,21 +65,21 @@ The recommended approach is to first upgrade the `unleash-server` to v3 (which s
After upgrading all your clients, you should consider turning off legacy routes, used by v2 clients. Read more about this option in the [Getting started guide](https://github.com/Unleash/unleash/blob/master/docs/getting-started.md#2-or-programmatically).
## Upgrading from v1.0 to v2.0
## Upgrading from v1.0 to v2.0 {#upgrading-from-v10-to-v20}
### Caveat 1: Not used db-migrate to migrate the Unleash database?
### Caveat 1: Not used db-migrate to migrate the Unleash database? {#caveat-1-not-used-db-migrate-to-migrate-the-unleash-database}
In FINN we used liquibase, for internal reasons, to migrate our database.
Because unleash from version 2.0 migrates the database internally, with db-migrate, you need to make sure that all previous migrations for version 1 exist, so that Unleash does not try to create already existing tables.
#### How to check?
#### How to check? {#how-to-check}
If you don't have a "migrations" table with _7 unique migrations_ you are affected by this.
#### How to fix?
#### How to fix? {#how-to-fix}
Before starting unleash version 2 you have to run the SQL located under `scripts/fix-migrations-version-1.sql`
### Caveat 2: databaseUrl (not database*Uri*)
### Caveat 2: databaseUrl (not database*Uri*) {#caveat-2-databaseurl-not-databaseuri}
Using Unleash as a library and injecting your own config? Then you should know that we changed the `databaseUri` config param name to **databaseUrl**. This is to make sure the param is aligned with the environment variable `DATABASE_URL` and avoid multiple names for the same config param.

View File

@ -7,11 +7,11 @@ title: Securing Unleash v3
The Unleash API is split into two different paths: `/api/client` and `/api/admin`. This makes it easy to have different authentication strategy for the admin interface and the client-api used by the applications integrating with Unleash.
## General settings
## General settings {#general-settings}
Unleash uses an encrypted cookie to maintain a user session. This allows users to be logged in across multiple instances of Unleash. To protect this cookie, Unleash will automatically generate a secure token the first time you start Unleash.
## Securing the Admin API
## Securing the Admin API {#securing-the-admin-api}
To secure the Admin API, you have to tell Unleash that you are using a custom admin authentication and implement your authentication logic as a preHook.
@ -49,7 +49,7 @@ Examples of custom authentication hooks:
We also have a version of Unleash deployed on Heroku which uses Google OAuth 2.0: https://secure-unleash.herokuapp.com
## Securing the Client API
## Securing the Client API {#securing-the-client-api}
A common way to support client access is to use pre-shared secrets. This can be solved by having clients send a shared key in an HTTP header with every client request to the Unleash API. All official Unleash clients should support this.

View File

@ -9,7 +9,7 @@ title: Securing Unleash
Unleash Open-Source v4 comes with username/password authentication out of the box. In addition Unleash v4 also comes with API token support, to make it easy to handle access tokens for Client SDKs and programmatic asses to the Unleash APIs.
### Implementing Custom Authentication
### Implementing Custom Authentication {#implementing-custom-authentication}
If you do not wish to use the built-in

View File

@ -3,7 +3,7 @@ id: feature_updates_to_slack
title: Feature Updates To slack
---
## Create a custom Slack WebHook url:
## Create a custom Slack WebHook url: {#create-a-custom-slack-webhook-url}
1. Go to [https://slack.com/apps/manage/custom-integrations](https://slack.com/apps/manage/custom-integrations)
1. Click Incoming WebHooks
@ -11,7 +11,7 @@ title: Feature Updates To slack
1. This is Slack's help page on how to do this: https://api.slack.com/custom-integrations/incoming-webhooks
- Choose a channel, follow the wizard, get the custom URL.
## Send data to Slack using an event hook function
## Send data to Slack using an event hook function {#send-data-to-slack-using-an-event-hook-function}
Using the `eventHook` option, create a function that will send the data you'd like into Slack when mutation events happen.
@ -24,9 +24,7 @@ function onEventHook(event, eventData) {
let text = '';
const unleashUrl = 'http://your.unleash.host.com';
const feature = `<${unleashUrl}/#/features/strategies/${data.name}|${
data.name
}>`;
const feature = `<${unleashUrl}/#/features/strategies/${data.name}|${data.name}>`;
switch (event) {
case 'feature-created':

View File

@ -20,7 +20,7 @@ Community developed Client SDKs we already now about:
- [pmb0/nestjs-unleash](https://github.com/pmb0/nestjs-unleash) (NestJS - Node.js)
- _...your implementation for your favorite language._
### Implement your own SDK?
### Implement your own SDK? {#implement-your-own-sdk}
If none of the above SDKs fits your need there is always the option of developing your own SDK. To guide the implementation we have a few resources available:

View File

@ -7,7 +7,7 @@ In this guide we explain how to use feature toggles in a .NET application using
> You will need your `API URL` and your `API token` in order to connect the Client SDK to you Unleash instance. You can find this information in the “Admin” section Unleash management UI. [Read more](../user_guide/api-token)
## Step 1: Install client SDK
## Step 1: Install client SDK {#step-1-install-client-sdk}
First we must add Unleash Client SDK as a dependency to your project. Below is an example of how you would add it via the .Net cli. Please see [NuGet](https://www.nuget.org/packages/Unleash.Client/) for other alternatives.
@ -15,7 +15,7 @@ First we must add Unleash Client SDK as a dependency to your project. Below is a
dotnet add package unleash.client
```
## Step 2: Create a new Unleash Instance
## Step 2: Create a new Unleash Instance {#step-2-create-a-new-unleash-instance}
Next we must initialize a new instance of the Unleash Client.
@ -38,7 +38,7 @@ In your app you typically just want one instance of Unleash, and inject that whe
You should change the URL and the Authorization header (API token) with the correct values for your instance, which you may locate under “Instance admin” in the menu.
## Step 3: Use the feature toggle
## Step 3: Use the feature toggle {#step-3-use-the-feature-toggle}
Now that we have initialized the client SDK we can start using feature toggles defined in Unleash in our application. To achieve this we have the “isEnabled” method available, which will allow us to check the value of a feature toggle. This method will return true or false based on whether the feature should be enabled or disabled for the current request.
@ -57,7 +57,7 @@ Pleas note the client SDK will synchronize with the Unleash-hosted API on initia
Read more about the [Unleash architecture](https://www.unleash-hosted.com/articles/our-unique-architecture) to learn how it works in more details
## Step 4: Provide Unleash Context
## Step 4: Provide Unleash Context {#step-4-provide-unleash-context}
It is the client SDK that computes whether a feature toggle should be considered enabled or disabled for specific use request. This is the job of the activation strategies, which are implemented in the client SDK.

View File

@ -5,7 +5,7 @@ title: GO SDK
> You will need your `API URL` and your `API token` in order to connect the Client SDK to you Unleash instance. You can find this information in the “Admin” section Unleash management UI. [Read more](../user_guide/api-token)
### 1. Install unleash-client-go
### 1. Install unleash-client-go {#1-install-unleash-client-go}
To install the latest version of the client use:
@ -19,7 +19,7 @@ If you are still using Unleash Server v2.x.x, then you should use:
go get github.com/Unleash/unleash-client-go
```
### 2. Initialize unleash
### 2. Initialize unleash {#2-initialize-unleash}
The easiest way to get started with Unleash is to initialize it early in your application code:
@ -38,7 +38,7 @@ func init() {
}
```
### 3. Use unleash
### 3. Use unleash {#3-use-unleash}
After you have initialized the unleash-client you can easily check if a feature toggle is enabled or not.
@ -46,13 +46,13 @@ After you have initialized the unleash-client you can easily check if a feature
unleash.IsEnabled("app.ToggleX")
```
### 4. Stop unleash
### 4. Stop unleash {#4-stop-unleash}
To shut down the client (turn off the polling) you can simply call the destroy-method. This is typically not required.
unleash.Close()
### Built in activation strategies
### Built in activation strategies {#built-in-activation-strategies}
The Go client comes with implementations for the built-in activation strategies provided by unleash.
@ -65,9 +65,9 @@ The Go client comes with implementations for the built-in activation strategies
- RemoteAddressStrategy
- ApplicationHostnameStrategy
Read more about the strategies in [activation-strategy.md]().
Read more about the strategies in [activation-strategy.md](/activation_strategy).
### Unleash context
### Unleash context {#unleash-context}
In order to use some of the common activation strategies you must provide a [unleash-context](https://github.com/Unleash/unleash/blob/master/docs/unleash-context.md). This client SDK allows you to send in the unleash context as part of the `isEnabled` call:

Some files were not shown because too many files have changed in this diff Show More