core-app-api: fix + deprecate saml and github session types
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/core-app-api': patch
|
||||
---
|
||||
|
||||
Fixed an issue where valid SAML and GitHub sessions would be considered invalid and not be stored.
|
||||
|
||||
Deprecated the `SamlSession` and `GithubSession` types.
|
||||
@@ -410,7 +410,7 @@ export class GithubAuth implements OAuthApi, SessionApi {
|
||||
signOut(): Promise<void>;
|
||||
}
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type GithubSession = {
|
||||
providerInfo: {
|
||||
accessToken: string;
|
||||
@@ -562,7 +562,7 @@ export class SamlAuth
|
||||
signOut(): Promise<void>;
|
||||
}
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type SamlSession = {
|
||||
userId: string;
|
||||
profile: ProfileInfo;
|
||||
|
||||
@@ -17,10 +17,13 @@
|
||||
import { ProfileInfo, BackstageIdentity } from '@backstage/core-plugin-api';
|
||||
import { z } from 'zod';
|
||||
|
||||
// TODO(Rugvip): Make GithubSession internal
|
||||
|
||||
/**
|
||||
* Session information for GitHub auth.
|
||||
*
|
||||
* @public
|
||||
* @deprecated This type is internal and will be removed
|
||||
*/
|
||||
export type GithubSession = {
|
||||
providerInfo: {
|
||||
@@ -29,6 +32,7 @@ export type GithubSession = {
|
||||
expiresAt?: Date;
|
||||
};
|
||||
profile: ProfileInfo;
|
||||
// TODO(Rugvip): This should be made optional once the type is no longer public
|
||||
backstageIdentity: BackstageIdentity;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
export { default as SamlAuth } from './SamlAuth';
|
||||
export type { SamlSession } from './types';
|
||||
export type { ExportedSamlSession as SamlSession } from './types';
|
||||
|
||||
@@ -21,15 +21,22 @@ import { z } from 'zod';
|
||||
* Session information for SAML auth.
|
||||
*
|
||||
* @public
|
||||
* @deprecated This type is internal and will be removed
|
||||
*/
|
||||
export type SamlSession = {
|
||||
export type ExportedSamlSession = {
|
||||
userId: string;
|
||||
profile: ProfileInfo;
|
||||
backstageIdentity: BackstageIdentity;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export type SamlSession = {
|
||||
profile: ProfileInfo;
|
||||
backstageIdentity: BackstageIdentity;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const samlSessionSchema: z.ZodSchema<SamlSession> = z.object({
|
||||
userId: z.string(),
|
||||
profile: z.object({
|
||||
email: z.string().optional(),
|
||||
displayName: z.string().optional(),
|
||||
|
||||
Reference in New Issue
Block a user