chore: update multiple git providers docs (#10017)

* chore: update multiple git providers docs

* Improve var name

* Fix fmt
This commit is contained in:
Kyle Carberry 2023-10-03 10:27:02 -05:00 committed by GitHub
parent eeab33b1c3
commit f16eb1331f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 37 additions and 37 deletions

View File

@ -42,7 +42,7 @@ const (
FeatureTemplateRBAC FeatureName = "template_rbac"
FeatureUserRoleManagement FeatureName = "user_role_management"
FeatureHighAvailability FeatureName = "high_availability"
FeatureMultipleGitAuth FeatureName = "multiple_git_auth"
FeatureMultipleExternalAuth FeatureName = "multiple_external_auth"
FeatureExternalProvisionerDaemons FeatureName = "external_provisioner_daemons"
FeatureAppearance FeatureName = "appearance"
FeatureAdvancedTemplateScheduling FeatureName = "advanced_template_scheduling"
@ -60,7 +60,7 @@ var FeatureNames = []FeatureName{
FeatureSCIM,
FeatureTemplateRBAC,
FeatureHighAvailability,
FeatureMultipleGitAuth,
FeatureMultipleExternalAuth,
FeatureExternalProvisionerDaemons,
FeatureAppearance,
FeatureAdvancedTemplateScheduling,
@ -89,7 +89,7 @@ func (n FeatureName) Humanize() string {
// This method may disappear at any time.
func (n FeatureName) AlwaysEnable() bool {
return map[FeatureName]bool{
FeatureMultipleGitAuth: true,
FeatureMultipleExternalAuth: true,
FeatureExternalProvisionerDaemons: true,
FeatureAppearance: true,
FeatureWorkspaceBatchActions: true,

View File

@ -111,7 +111,7 @@ Optionally, you can request custom scopes:
CODER_EXTERNAL_AUTH_0_SCOPES="repo:read repo:write write:gpg_key"
```
### Multiple git providers (enterprise)
### Multiple External Providers (enterprise)
Multiple providers are an Enterprise feature. [Learn more](../enterprise.md).

View File

@ -4,21 +4,21 @@ Coder is free to use and includes some features that are only accessible with a
paid license. [Contact Sales](https://coder.com/contact) for pricing or
[get a free trial](https://coder.com/trial).
| Category | Feature | Open Source | Enterprise |
| --------------- | ------------------------------------------------------------------------------------ | :---------: | :--------: |
| Support | Email, Phone, Prioritization | ❌ | ✅ |
| Scale | [High Availability](./admin/high-availability.md) | ❌ | ✅ |
| Scale | [Multiple Git Providers](./admin/git-providers.md#multiple-git-providers-enterprise) | ❌ | ✅ |
| Scale | [Isolated Terraform Runners](./admin/provisioners.md) | ❌ | ✅ |
| Scale | [Workspace Proxies](./admin/workspace-proxies.md) | ❌ | ✅ |
| Governance | [Audit Logging](./admin/audit-logs.md) | ❌ | ✅ |
| Governance | [Browser Only Connections](./networking/#browser-only-connections-enterprise) | ❌ | ✅ |
| Governance | [Groups & Template RBAC](./admin/rbac.md) | ❌ | ✅ |
| Cost Control | [Quotas](./admin/quotas.md) | ❌ | ✅ |
| Cost Control | [Max Workspace Autostop](./templates/#configure-max-workspace-autostop) | ❌ | ✅ |
| User Management | [Groups](./admin/groups.md) | ❌ | ✅ |
| User Management | [Group & role sync](./admin/auth.md#group-sync-enterprise) | ❌ | ✅ |
| User Management | [SCIM](./admin/auth.md#scim) | ❌ | ✅ |
| Category | Feature | Open Source | Enterprise |
| --------------- | --------------------------------------------------------------------------------------------------- | :---------: | :--------: |
| Support | Email, Phone, Prioritization | ❌ | ✅ |
| Scale | [High Availability](./admin/high-availability.md) | ❌ | ✅ |
| Scale | [Multiple External Auth Providers](./admin/external-auth.md#multiple-external-providers-enterprise) | ❌ | ✅ |
| Scale | [Isolated Terraform Runners](./admin/provisioners.md) | ❌ | ✅ |
| Scale | [Workspace Proxies](./admin/workspace-proxies.md) | ❌ | ✅ |
| Governance | [Audit Logging](./admin/audit-logs.md) | ❌ | ✅ |
| Governance | [Browser Only Connections](./networking/#browser-only-connections-enterprise) | ❌ | ✅ |
| Governance | [Groups & Template RBAC](./admin/rbac.md) | ❌ | ✅ |
| Cost Control | [Quotas](./admin/quotas.md) | ❌ | ✅ |
| Cost Control | [Max Workspace Autostop](./templates/#configure-max-workspace-autostop) | ❌ | ✅ |
| User Management | [Groups](./admin/groups.md) | ❌ | ✅ |
| User Management | [Group & role sync](./admin/auth.md#group-sync-enterprise) | ❌ | ✅ |
| User Management | [SCIM](./admin/auth.md#scim) | ❌ | ✅ |
## Adding your license key

View File

@ -465,7 +465,7 @@ func (api *API) updateEntitlements(ctx context.Context) error {
codersdk.FeatureBrowserOnly: api.BrowserOnly,
codersdk.FeatureSCIM: len(api.SCIMAPIKey) != 0,
codersdk.FeatureHighAvailability: api.DERPServerRelayAddress != "",
codersdk.FeatureMultipleGitAuth: len(api.ExternalAuthConfigs) > 1,
codersdk.FeatureMultipleExternalAuth: len(api.ExternalAuthConfigs) > 1,
codersdk.FeatureTemplateRBAC: api.RBAC,
codersdk.FeatureExternalTokenEncryption: len(api.ExternalTokenEncryption) > 0,
codersdk.FeatureExternalProvisionerDaemons: true,

View File

@ -23,7 +23,7 @@ func Entitlements(
db database.Store,
logger slog.Logger,
replicaCount int,
gitAuthCount int,
externalAuthCount int,
keys map[string]ed25519.PublicKey,
enablements map[codersdk.FeatureName]bool,
) (codersdk.Entitlements, error) {
@ -161,8 +161,8 @@ func Entitlements(
if featureName == codersdk.FeatureHighAvailability {
continue
}
// Multiple Git auth has it's own warnings based on the number configured!
if featureName == codersdk.FeatureMultipleGitAuth {
// External Auth Providers auth has it's own warnings based on the number configured!
if featureName == codersdk.FeatureMultipleExternalAuth {
continue
}
feature := entitlements.Features[featureName]
@ -200,23 +200,23 @@ func Entitlements(
}
}
if gitAuthCount > 1 {
feature := entitlements.Features[codersdk.FeatureMultipleGitAuth]
if externalAuthCount > 1 {
feature := entitlements.Features[codersdk.FeatureMultipleExternalAuth]
switch feature.Entitlement {
case codersdk.EntitlementNotEntitled:
if entitlements.HasLicense {
entitlements.Errors = append(entitlements.Errors,
"You have multiple Git authorizations configured but your license is limited at one.",
"You have multiple External Auth Providers configured but your license is limited at one.",
)
} else {
entitlements.Errors = append(entitlements.Errors,
"You have multiple Git authorizations configured but this is an Enterprise feature. Reduce to one.",
"You have multiple External Auth Providers configured but this is an Enterprise feature. Reduce to one.",
)
}
case codersdk.EntitlementGracePeriod:
entitlements.Warnings = append(entitlements.Warnings,
"You have multiple Git authorizations configured but your license is expired. Reduce to one.",
"You have multiple External Auth Providers configured but your license is expired. Reduce to one.",
)
}
}

View File

@ -248,7 +248,7 @@ func TestEntitlements(t *testing.T) {
if featureName == codersdk.FeatureHighAvailability {
continue
}
if featureName == codersdk.FeatureMultipleGitAuth {
if featureName == codersdk.FeatureMultipleExternalAuth {
continue
}
niceName := featureName.Humanize()
@ -484,7 +484,7 @@ func TestEntitlements(t *testing.T) {
require.NoError(t, err)
require.False(t, entitlements.HasLicense)
require.Len(t, entitlements.Errors, 1)
require.Equal(t, "You have multiple Git authorizations configured but this is an Enterprise feature. Reduce to one.", entitlements.Errors[0])
require.Equal(t, "You have multiple External Auth Providers configured but this is an Enterprise feature. Reduce to one.", entitlements.Errors[0])
})
t.Run("MultipleGitAuthNotEntitled", func(t *testing.T) {
@ -499,12 +499,12 @@ func TestEntitlements(t *testing.T) {
}),
})
entitlements, err := license.Entitlements(context.Background(), db, slog.Logger{}, 1, 2, coderdenttest.Keys, map[codersdk.FeatureName]bool{
codersdk.FeatureMultipleGitAuth: true,
codersdk.FeatureMultipleExternalAuth: true,
})
require.NoError(t, err)
require.True(t, entitlements.HasLicense)
require.Len(t, entitlements.Errors, 1)
require.Equal(t, "You have multiple Git authorizations configured but your license is limited at one.", entitlements.Errors[0])
require.Equal(t, "You have multiple External Auth Providers configured but your license is limited at one.", entitlements.Errors[0])
})
t.Run("MultipleGitAuthGrace", func(t *testing.T) {
@ -515,17 +515,17 @@ func TestEntitlements(t *testing.T) {
GraceAt: time.Now().Add(-time.Hour),
ExpiresAt: time.Now().Add(time.Hour),
Features: license.Features{
codersdk.FeatureMultipleGitAuth: 1,
codersdk.FeatureMultipleExternalAuth: 1,
},
}),
Exp: time.Now().Add(time.Hour),
})
entitlements, err := license.Entitlements(context.Background(), db, slog.Logger{}, 1, 2, coderdenttest.Keys, map[codersdk.FeatureName]bool{
codersdk.FeatureMultipleGitAuth: true,
codersdk.FeatureMultipleExternalAuth: true,
})
require.NoError(t, err)
require.True(t, entitlements.HasLicense)
require.Len(t, entitlements.Warnings, 1)
require.Equal(t, "You have multiple Git authorizations configured but your license is expired. Reduce to one.", entitlements.Warnings[0])
require.Equal(t, "You have multiple External Auth Providers configured but your license is expired. Reduce to one.", entitlements.Warnings[0])
})
}

View File

@ -1682,7 +1682,7 @@ export type FeatureName =
| "external_provisioner_daemons"
| "external_token_encryption"
| "high_availability"
| "multiple_git_auth"
| "multiple_external_auth"
| "scim"
| "template_autostop_requirement"
| "template_rbac"
@ -1698,7 +1698,7 @@ export const FeatureNames: FeatureName[] = [
"external_provisioner_daemons",
"external_token_encryption",
"high_availability",
"multiple_git_auth",
"multiple_external_auth",
"scim",
"template_autostop_requirement",
"template_rbac",