@@ -29,6 +29,7 @@ export class ScmAuth implements ScmAuthApi {
|
||||
ProfileInfoApi &
|
||||
BackstageIdentityApi &
|
||||
SessionApi;
|
||||
bitbucket: OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi;
|
||||
}
|
||||
>;
|
||||
static forAuthApi(
|
||||
@@ -82,6 +83,12 @@ export const scmAuthApiRef: ApiRef<ScmAuthApi>;
|
||||
export interface ScmAuthTokenOptions extends AuthRequestOptions {
|
||||
additionalScope?: {
|
||||
repoWrite?: boolean;
|
||||
customScopes?: {
|
||||
github?: string[];
|
||||
azure?: string[];
|
||||
bitbucket?: string[];
|
||||
gitlab?: string[];
|
||||
};
|
||||
};
|
||||
url: string;
|
||||
}
|
||||
|
||||
@@ -164,6 +164,16 @@ export interface RepoUrlPickerUiOptions {
|
||||
allowedHosts?: string[];
|
||||
// (undocumented)
|
||||
allowedOwners?: string[];
|
||||
// (undocumented)
|
||||
requestUserCredentials?: {
|
||||
resultSecretsKey: string;
|
||||
additionalScopes?: {
|
||||
github?: string[];
|
||||
gitlab?: string[];
|
||||
bitbucket?: string[];
|
||||
azure?: string[];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// @public
|
||||
@@ -317,4 +327,9 @@ export const TextValuePicker: ({
|
||||
idSchema,
|
||||
placeholder,
|
||||
}: FieldProps<string>) => JSX.Element;
|
||||
|
||||
// @public
|
||||
export const useSecretsContext: () => {
|
||||
setSecret: (input: Record<string, string>) => void;
|
||||
};
|
||||
```
|
||||
|
||||
@@ -112,7 +112,7 @@ describe('RepoUrlPicker', () => {
|
||||
|
||||
describe('requestUserCredentials', () => {
|
||||
it('should call the scmAuthApi with the correct params', async () => {
|
||||
const { getByRole, getAllByRole } = await renderInTestApp(
|
||||
const { getAllByRole } = await renderInTestApp(
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
[scmIntegrationsApiRef, mockIntegrationsApi],
|
||||
|
||||
@@ -60,7 +60,7 @@ export const useSecretsContext = () => {
|
||||
);
|
||||
}
|
||||
|
||||
const { secrets, setSecrets } = value;
|
||||
const { setSecrets } = value;
|
||||
|
||||
const setSecret = useCallback(
|
||||
(input: Record<string, string>) => {
|
||||
|
||||
Reference in New Issue
Block a user