fix(docs): Fixed various letter casing and script errors

Signed-off-by: Łukasz Jernaś <lukasz.jernas@allegro.com>
This commit is contained in:
Łukasz Jernaś
2024-09-05 17:10:40 +02:00
parent 5b43f7f78f
commit 326faeddae
22 changed files with 39 additions and 31 deletions
@@ -197,7 +197,7 @@ When declaring a service factory you may also want to make the export the buildi
```ts
export class DefaultFooService {
static create(options: { transform: (foo: string) => string }) {
return new DefaultFooService(options.transform ?? (foo) => foo);
return new DefaultFooService(options.transform ?? ((foo) => foo);
}
private constructor(private readonly transform: (foo: string) => string) {}
@@ -431,7 +431,7 @@ catalog:
/* highlight-add-end */
```
#### Github
#### GitHub
For `GithubDiscoveryProcessor`, `GithubMultiOrgReaderProcessor` and `GithubOrgReaderProcessor`, first migrate to the equivalent Entity Provider.
@@ -445,7 +445,7 @@ backend.add(import('@backstage/plugin-catalog-backend-module-github/alpha'));
```
If you were providing a `schedule` in code, this now needs to be set via configuration.
All other Github configuration in `app-config.yaml` remains the same.
All other GitHub configuration in `app-config.yaml` remains the same.
```yaml title="app-config.yaml"
catalog:
+3 -2
View File
@@ -73,7 +73,8 @@ router.get('/makes-calls', async (req, res) => {
onBehalfOf: await httpAuth.credentials(req),
targetPluginId: 'catalog',
});
// make a call using the token
});
// make a call using the token
```
This ensures that the original caller and their associated permissions are
@@ -106,7 +107,7 @@ objects. For example checking what type of principal (caller type - e.g. user or
service) they represent. For example:
```ts
if (auth.isPrincipal(credentials, 'user)) {
if (auth.isPrincipal(credentials, 'user')) {
// In here, the TypeScript type of the credentials object has been properly
// narrowed to `BackstageCredentials<BackstageUserPrincipal>` so you can
// access its specific properties such as `credentials.principal.userEntityRef`.
@@ -47,6 +47,7 @@ can do so like this:
router.get('/some-request', async (req, res) => {
const credentials = await httpAuth.credentials(req, { allow: ['user'] });
// Do something with the credentials here
});
```
The second argument is optional, but in this example we specified that we only
@@ -47,6 +47,7 @@ additional information about that principal.
router.get('/some-request', async (req, res) => {
const credentials = await httpAuth.credentials(req, { allow: ['user'] });
const info = await userInfo.getUserInfo(credentials);
});
```
The `userInfo` service only deals with credentials that contain user principals,
@@ -61,6 +62,8 @@ router.get('/some-request', async (req, res) => {
if (auth.isPrincipal(credentials, 'user')) {
const info = await userInfo.getUserInfo(credentials);
// ...
}
});
```
The user info contains data that was extracted during sign-in for the given