mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-3236 feat: support requesting a configuration authentication (#1580)
This commit is contained in:
@@ -30,6 +30,7 @@ interface IServiceDescriptionLink extends IServiceDescriptionLinkOptions {
|
||||
|
||||
export interface RequestedProvider {
|
||||
providerId: string;
|
||||
configurationId?: string;
|
||||
}
|
||||
|
||||
@injectable()
|
||||
@@ -56,8 +57,8 @@ export class AuthProviderService {
|
||||
});
|
||||
}
|
||||
|
||||
async requireProvider(providerId: string): Promise<boolean> {
|
||||
const contexts = await this.requestAuthProvider.execute({ providerId });
|
||||
async requireProvider(providerId: string, configurationId?: string): Promise<boolean> {
|
||||
const contexts = await this.requestAuthProvider.execute({ providerId, configurationId });
|
||||
const provider = contexts.getContext(AuthProviderContext);
|
||||
|
||||
return provider.get();
|
||||
|
||||
@@ -32,8 +32,7 @@ export class AuthProvidersResource extends CachedMapResource<string, AuthProvide
|
||||
) {
|
||||
super();
|
||||
|
||||
this.preloadResource(serverConfigResource, () => {});
|
||||
this.serverConfigResource.outdateResource(this);
|
||||
this.sync(serverConfigResource, () => {}, () => CachedMapAllKey);
|
||||
|
||||
this.authConfigurationsResource.onItemUpdate.addHandler(this.updateConfigurations.bind(this));
|
||||
this.authConfigurationsResource.onItemDelete.addHandler(this.deleteConfigurations.bind(this));
|
||||
|
||||
@@ -231,7 +231,7 @@ export class AuthenticationService extends Bootstrap {
|
||||
}
|
||||
|
||||
if (!this.userInfoResource.hasToken(data.providerId)) {
|
||||
await this.auth(false, { providerId: data.providerId });
|
||||
await this.auth(false, { providerId: data.providerId, configurationId: data.configurationId });
|
||||
}
|
||||
|
||||
if (this.userInfoResource.hasToken(data.providerId)) {
|
||||
|
||||
@@ -15,7 +15,6 @@ import { useResource, useObservableRef } from '@cloudbeaver/core-blocks';
|
||||
import { useService } from '@cloudbeaver/core-di';
|
||||
import { NotificationService } from '@cloudbeaver/core-events';
|
||||
import { CachedMapAllKey } from '@cloudbeaver/core-sdk';
|
||||
import type { ILoadableState } from '@cloudbeaver/core-utils';
|
||||
|
||||
import { FEDERATED_AUTH } from './FEDERATED_AUTH';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user