add manifest model for external auth provider

This commit is contained in:
Jacob Overgaard
2024-04-04 11:30:52 +02:00
parent abbf5f3aa7
commit 9ca24c3c22
2 changed files with 68 additions and 1 deletions

View File

@@ -0,0 +1,64 @@
import type { ManifestElement } from '@umbraco-cms/backoffice/extension-api';
import type { UUIInterfaceColor, UUIInterfaceLook } from '@umbraco-cms/backoffice/external/uui';
/**
* Represents an authentication provider that can be used to authenticate users.
* The provider needs to be registered in the API that the authorization request is sent to in order to be used.
*
* @see {forProviderName} for the provider name that this provider is for.
*/
export interface ManifestAuthProvider extends ManifestElement {
type: 'authProvider';
/**
* The provider name that this provider is for.
* @examples 'Umbraco.Github'
*/
forProviderName: string;
meta?: MetaAuthProvider;
}
export interface MetaAuthProvider {
/**
* The label of the provider that is shown to the user.
*/
label?: string;
/**
* The default view of the provider that is shown to the user.
* If no element is provided, then the button will be rendered as a @see {UUIButtonElement} using these options.
*/
defaultView: {
/**
* The icon of the provider that is shown to the user.
* @examples ['icon-cloud', 'icon-github', 'icon-google', 'icon-facebook', 'icon-twitter', 'icon-x', 'icon-microsoft']
* @default 'icon-cloud'
*/
icon?: string;
/**
* The color of the provider that is shown to the user.
* @default 'secondary'
*/
color?: UUIInterfaceLook;
/**
* The look of the provider that is shown to the user.
* @default 'default'
*/
look?: UUIInterfaceColor;
};
/**
* If true, the Umbraco backoffice login will be disabled.
* @default false
*/
denyLocalLogin?: boolean;
/**
* If true, the user will be redirected to the provider's login page immediately.
* @default false
*/
autoRedirect?: boolean;
}

View File

@@ -1,3 +1,4 @@
import type { ManifestAuthProvider } from './auth-provider.model.js';
import type { ManifestBlockEditorCustomView } from './block-editor-custom-view.model.js';
import type { ManifestCollection } from './collection.models.js';
import type { ManifestCollectionView } from './collection-view.model.js';
@@ -64,6 +65,7 @@ import type {
ManifestEntryPoint,
} from '@umbraco-cms/backoffice/extension-api';
export type * from './auth-provider.model.js';
export type * from './block-editor-custom-view.model.js';
export type * from './collection.models.js';
export type * from './collection-action.model.js';
@@ -131,12 +133,13 @@ export type ManifestWorkspaces = ManifestWorkspace | ManifestWorkspaceRoutableKi
export type ManifestWorkspaceViews = ManifestWorkspaceView | ManifestWorkspaceViewContentTypeDesignEditorKind;
export type ManifestTypes =
| ManifestAuthProvider
| ManifestBundle<ManifestTypes>
| ManifestCondition
| ManifestBlockEditorCustomView
| ManifestCollection
| ManifestCollectionView
| ManifestCollectionAction
| ManifestCondition
| ManifestDashboard
| ManifestDashboardCollection
| ManifestDynamicRootOrigin