Merge pull request #9155 from backstage/dependabot/npm_and_yarn/prettier-2.5.1

chore(deps-dev): bump prettier from 2.4.1 to 2.5.1
This commit is contained in:
Johan Haals
2022-01-25 10:57:36 +01:00
committed by GitHub
7 changed files with 111 additions and 103 deletions
@@ -205,45 +205,47 @@ export class BitbucketAuthProvider implements OAuthHandlers {
}
}
export const bitbucketUsernameSignInResolver: SignInResolver<BitbucketOAuthResult> =
async (info, ctx) => {
const { result } = info;
export const bitbucketUsernameSignInResolver: SignInResolver<
BitbucketOAuthResult
> = async (info, ctx) => {
const { result } = info;
if (!result.fullProfile.username) {
throw new Error('Bitbucket profile contained no Username');
}
if (!result.fullProfile.username) {
throw new Error('Bitbucket profile contained no Username');
}
const entity = await ctx.catalogIdentityClient.findUser({
annotations: {
'bitbucket.org/username': result.fullProfile.username,
},
});
const entity = await ctx.catalogIdentityClient.findUser({
annotations: {
'bitbucket.org/username': result.fullProfile.username,
},
});
const claims = getEntityClaims(entity);
const token = await ctx.tokenIssuer.issueToken({ claims });
const claims = getEntityClaims(entity);
const token = await ctx.tokenIssuer.issueToken({ claims });
return { id: entity.metadata.name, entity, token };
};
return { id: entity.metadata.name, entity, token };
};
export const bitbucketUserIdSignInResolver: SignInResolver<BitbucketOAuthResult> =
async (info, ctx) => {
const { result } = info;
export const bitbucketUserIdSignInResolver: SignInResolver<
BitbucketOAuthResult
> = async (info, ctx) => {
const { result } = info;
if (!result.fullProfile.id) {
throw new Error('Bitbucket profile contained no User ID');
}
if (!result.fullProfile.id) {
throw new Error('Bitbucket profile contained no User ID');
}
const entity = await ctx.catalogIdentityClient.findUser({
annotations: {
'bitbucket.org/user-id': result.fullProfile.id,
},
});
const entity = await ctx.catalogIdentityClient.findUser({
annotations: {
'bitbucket.org/user-id': result.fullProfile.id,
},
});
const claims = getEntityClaims(entity);
const token = await ctx.tokenIssuer.issueToken({ claims });
const claims = getEntityClaims(entity);
const token = await ctx.tokenIssuer.issueToken({ claims });
return { id: entity.metadata.name, entity, token };
};
return { id: entity.metadata.name, entity, token };
};
export type BitbucketProviderOptions = {
/**
@@ -184,21 +184,22 @@ export class GithubAuthProvider implements OAuthHandlers {
}
}
export const githubDefaultSignInResolver: SignInResolver<GithubOAuthResult> =
async (info, ctx) => {
const { fullProfile } = info.result;
export const githubDefaultSignInResolver: SignInResolver<
GithubOAuthResult
> = async (info, ctx) => {
const { fullProfile } = info.result;
const userId = fullProfile.username || fullProfile.id;
const userId = fullProfile.username || fullProfile.id;
const token = await ctx.tokenIssuer.issueToken({
claims: {
sub: `user:default/${userId}`,
ent: [`user:default/${userId}`],
},
});
const token = await ctx.tokenIssuer.issueToken({
claims: {
sub: `user:default/${userId}`,
ent: [`user:default/${userId}`],
},
});
return { id: userId, token };
};
return { id: userId, token };
};
export type GithubProviderOptions = {
/**
@@ -220,25 +220,26 @@ export const microsoftEmailSignInResolver: SignInResolver<OAuthResult> = async (
return { id: entity.metadata.name, entity, token };
};
export const microsoftDefaultSignInResolver: SignInResolver<OAuthResult> =
async (info, ctx) => {
const { profile } = info;
export const microsoftDefaultSignInResolver: SignInResolver<
OAuthResult
> = async (info, ctx) => {
const { profile } = info;
if (!profile.email) {
throw new Error('Profile contained no email');
}
if (!profile.email) {
throw new Error('Profile contained no email');
}
const userId = profile.email.split('@')[0];
const userId = profile.email.split('@')[0];
const token = await ctx.tokenIssuer.issueToken({
claims: {
sub: `user:default/${userId}`,
ent: [`user:default/${userId}`],
},
});
const token = await ctx.tokenIssuer.issueToken({
claims: {
sub: `user:default/${userId}`,
ent: [`user:default/${userId}`],
},
});
return { id: userId, token };
};
return { id: userId, token };
};
export type MicrosoftProviderOptions = {
/**
@@ -211,19 +211,20 @@ export class OidcAuthProvider implements OAuthHandlers {
}
}
export const oAuth2DefaultSignInResolver: SignInResolver<OidcAuthResult> =
async (info, ctx) => {
const { profile } = info;
export const oAuth2DefaultSignInResolver: SignInResolver<
OidcAuthResult
> = async (info, ctx) => {
const { profile } = info;
if (!profile.email) {
throw new Error('Profile contained no email');
}
const userId = profile.email.split('@')[0];
const token = await ctx.tokenIssuer.issueToken({
claims: { sub: userId, ent: [`user:default/${userId}`] },
});
return { id: userId, token };
};
if (!profile.email) {
throw new Error('Profile contained no email');
}
const userId = profile.email.split('@')[0];
const token = await ctx.tokenIssuer.issueToken({
claims: { sub: userId, ent: [`user:default/${userId}`] },
});
return { id: userId, token };
};
/**
* OIDC provider callback options. An auth handler and a sign in resolver
@@ -31,18 +31,19 @@ type CostInsightsPageLoadingProps = {
dispatchReset: (loadingActions: string[]) => void;
};
export const mapLoadingToProps: MapLoadingToProps<CostInsightsPageLoadingProps> =
({ state, actions, dispatch }) => ({
loadingActions: actions,
loadingGroups: state[DefaultLoadingAction.UserGroups],
loadingBillingDate: state[DefaultLoadingAction.LastCompleteBillingDate],
loadingInitial: state[DefaultLoadingAction.CostInsightsInitial],
dispatchInitial: (isLoading: boolean) =>
dispatch({ [DefaultLoadingAction.CostInsightsInitial]: isLoading }),
dispatchInsights: (isLoading: boolean) =>
dispatch({ [DefaultLoadingAction.CostInsightsPage]: isLoading }),
dispatchNone: (loadingActions: string[]) =>
dispatch(getResetState(loadingActions)),
dispatchReset: (loadingActions: string[]) =>
dispatch(getResetStateWithoutInitial(loadingActions)),
});
export const mapLoadingToProps: MapLoadingToProps<
CostInsightsPageLoadingProps
> = ({ state, actions, dispatch }) => ({
loadingActions: actions,
loadingGroups: state[DefaultLoadingAction.UserGroups],
loadingBillingDate: state[DefaultLoadingAction.LastCompleteBillingDate],
loadingInitial: state[DefaultLoadingAction.CostInsightsInitial],
dispatchInitial: (isLoading: boolean) =>
dispatch({ [DefaultLoadingAction.CostInsightsInitial]: isLoading }),
dispatchInsights: (isLoading: boolean) =>
dispatch({ [DefaultLoadingAction.CostInsightsPage]: isLoading }),
dispatchNone: (loadingActions: string[]) =>
dispatch(getResetState(loadingActions)),
dispatchReset: (loadingActions: string[]) =>
dispatch(getResetStateWithoutInitial(loadingActions)),
});
@@ -28,20 +28,22 @@ type CostInsightsTabsLoadingProps = {
dispatchReset: (loadingActions: string[]) => void;
};
export const mapFiltersToProps: MapFiltersToProps<CostInsightsTabsFilterProps> =
({ pageFilters, setPageFilters }) => ({
...pageFilters,
setGroup: (group: Group) =>
setPageFilters({
...pageFilters,
group: group.id,
project: null,
}),
});
export const mapFiltersToProps: MapFiltersToProps<
CostInsightsTabsFilterProps
> = ({ pageFilters, setPageFilters }) => ({
...pageFilters,
setGroup: (group: Group) =>
setPageFilters({
...pageFilters,
group: group.id,
project: null,
}),
});
export const mapLoadingToProps: MapLoadingToProps<CostInsightsTabsLoadingProps> =
({ actions, dispatch }) => ({
loadingActions: actions,
dispatchReset: (loadingActions: string[]) =>
dispatch(getResetStateWithoutInitial(loadingActions)),
});
export const mapLoadingToProps: MapLoadingToProps<
CostInsightsTabsLoadingProps
> = ({ actions, dispatch }) => ({
loadingActions: actions,
dispatchReset: (loadingActions: string[]) =>
dispatch(getResetStateWithoutInitial(loadingActions)),
});
+3 -3
View File
@@ -19793,9 +19793,9 @@ prettier@^1.19.1:
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
prettier@^2.2.1:
version "2.4.1"
resolved "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c"
integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==
version "2.5.1"
resolved "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a"
integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==
pretty-bytes@^5.3.0, pretty-bytes@^5.6.0:
version "5.6.0"