@backstage/plugin-catalog-backend-module-msgraph 0.4.0-next.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,132 @@
1
1
  # @backstage/plugin-catalog-backend-module-msgraph
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b1995df9f3: Adjust references in deprecation warnings to point to stable URL/document.
8
+ - Updated dependencies
9
+ - @backstage/backend-tasks@0.3.4
10
+ - @backstage/plugin-catalog-backend@1.3.1
11
+
12
+ ## 0.4.1-next.0
13
+
14
+ ### Patch Changes
15
+
16
+ - b1995df9f3: Adjust references in deprecation warnings to point to stable URL/document.
17
+ - Updated dependencies
18
+ - @backstage/backend-tasks@0.3.4-next.0
19
+ - @backstage/plugin-catalog-backend@1.3.1-next.0
20
+
21
+ ## 0.4.0
22
+
23
+ ### Minor Changes
24
+
25
+ - a145672f0f: Align `msgraph` plugin's entity provider config with other providers. **Deprecated** entity processor as well as previous config.
26
+
27
+ You will see warning at the log output until you migrate to the new setup.
28
+ All deprecated parts will be removed eventually after giving some time to migrate.
29
+
30
+ Please find information on how to migrate your current setup to the new one below.
31
+
32
+ **Migration Guide:**
33
+
34
+ There were two different way on how to use the msgraph plugin: processor or provider.
35
+
36
+ Previous registration for the processor:
37
+
38
+ ```typescript
39
+ // packages/backend/src/plugins/catalog.ts
40
+ builder.addProcessor(
41
+ MicrosoftGraphOrgReaderProcessor.fromConfig(env.config, {
42
+ logger: env.logger,
43
+ // [...]
44
+ }),
45
+ );
46
+ ```
47
+
48
+ Previous registration when using the provider:
49
+
50
+ ```typescript
51
+ // packages/backend/src/plugins/catalog.ts
52
+ builder.addEntityProvider(
53
+ MicrosoftGraphOrgEntityProvider.fromConfig(env.config, {
54
+ id: 'https://graph.microsoft.com/v1.0',
55
+ target: 'https://graph.microsoft.com/v1.0',
56
+ logger: env.logger,
57
+ schedule: env.scheduler.createScheduledTaskRunner({
58
+ frequency: { minutes: 30 },
59
+ timeout: { minutes: 3 },
60
+ }),
61
+ // [...]
62
+ }),
63
+ );
64
+ ```
65
+
66
+ Previous configuration as used for both:
67
+
68
+ ```yaml
69
+ # app-config.yaml
70
+ catalog:
71
+ processors:
72
+ microsoftGraphOrg:
73
+ providers:
74
+ - target: https://graph.microsoft.com/v1.0
75
+ # [...]
76
+ ```
77
+
78
+ **Replacement:**
79
+
80
+ Please check https://github.com/backstage/backstage/blob/master/plugins/catalog-backend-module-msgraph/README.md for the complete documentation of all configuration options (config as well as registration of the provider).
81
+
82
+ ```yaml
83
+ # app-config.yaml
84
+ catalog:
85
+ providers:
86
+ microsoftGraphOrg:
87
+ # In case you used the deprecated configuration with the entity provider
88
+ # using the value of `target` will keep the same location key for all
89
+ providerId: # some stable ID which will be used as part of the location key for all ingested data
90
+ target: https://graph.microsoft.com/v1.0
91
+ # [...]
92
+ ```
93
+
94
+ ```typescript
95
+ // packages/backend/src/plugins/catalog.ts
96
+ builder.addEntityProvider(
97
+ MicrosoftGraphOrgEntityProvider.fromConfig(env.config, {
98
+ logger: env.logger,
99
+ schedule: env.scheduler.createScheduledTaskRunner({
100
+ frequency: { minutes: 30 },
101
+ timeout: { minutes: 3 },
102
+ }),
103
+ // [...]
104
+ }),
105
+ );
106
+ ```
107
+
108
+ In case you've used multiple entity providers before
109
+ **and** you had different transformers for each of them
110
+ you can provide these directly at the one `fromConfig` call
111
+ by passing a Record with the provider ID as key.
112
+
113
+ - b8ebecd100: Microsoft Graph plugin can supports many more options for authenticating with the Microsoft Graph API.
114
+ Previously only ClientId/ClientSecret was supported, but now all the authentication options of `DefaultAzureCredential` from `@azure/identity` are supported.
115
+ Including Managed Identity, Client Certificate, Azure CLI and VS Code.
116
+
117
+ If `clientId` and `clientSecret` are specified in configuration, the plugin behaves the same way as before.
118
+ If these fields are omitted, the plugin uses `DefaultAzureCredential` to automatically determine the best authentication method.
119
+ This is particularly useful for local development environments - the default configuration will try to use existing credentials from Visual Studio Code, Azure CLI and Azure PowerShell, without the user needing to configure any credentials in app-config.yaml
120
+
121
+ ### Patch Changes
122
+
123
+ - a70869e775: Updated dependency `msw` to `^0.43.0`.
124
+ - 8006d0f9bf: Updated dependency `msw` to `^0.44.0`.
125
+ - Updated dependencies
126
+ - @backstage/plugin-catalog-backend@1.3.0
127
+ - @backstage/catalog-model@1.1.0
128
+ - @backstage/backend-tasks@0.3.3
129
+
3
130
  ## 0.4.0-next.2
4
131
 
5
132
  ### Patch Changes
package/README.md CHANGED
@@ -6,13 +6,18 @@ This provider is useful if you want to import users and groups from Azure Active
6
6
 
7
7
  ## Getting Started
8
8
 
9
- 1. Create or use an existing App registration in the [Microsoft Azure Portal](https://portal.azure.com/).
10
- The App registration requires at least the API permissions `Group.Read.All`,
11
- `GroupMember.Read.All`, `User.Read` and `User.Read.All` for Microsoft Graph
12
- (if you still run into errors about insufficient privileges, add
13
- `Team.ReadBasic.All` and `TeamMember.Read.All` too).
9
+ 1. Choose your authentication method - all methods supported by [DefaultAzureCredential](https://docs.microsoft.com/en-us/javascript/api/overview/azure/identity-readme?view=azure-node-latest#defaultazurecredential)
14
10
 
15
- 2. Configure the entity provider:
11
+ - For local dev, use Azure CLI, Azure PowerShell or Visual Studio Code for authentication
12
+ - If your infrastructure supports Managed Identity, use that
13
+ - Otherwise use an App Registration
14
+
15
+ 1. If using Managed Identity or App Registration for authentication, grant the following application permissions (not delegated)
16
+
17
+ - `GroupMember.Read.All`
18
+ - `User.Read.All`
19
+
20
+ 1. Configure the entity provider:
16
21
 
17
22
  ```yaml
18
23
  # app-config.yaml
@@ -24,11 +29,13 @@ catalog:
24
29
  authority: https://login.microsoftonline.com
25
30
  # If you don't know you tenantId, you can use Microsoft Graph Explorer
26
31
  # to query it
27
- tenantId: ${MICROSOFT_GRAPH_TENANT_ID}
32
+ tenantId: ${AZURE_TENANT_ID}
33
+ # Optional ClientId and ClientSecret if you don't want to use `DefaultAzureCredential`
34
+ # for authentication
28
35
  # Client Id and Secret can be created under Certificates & secrets in
29
36
  # the App registration in the Microsoft Azure Portal.
30
- clientId: ${MICROSOFT_GRAPH_CLIENT_ID}
31
- clientSecret: ${MICROSOFT_GRAPH_CLIENT_SECRET_TOKEN}
37
+ clientId: ${AZURE_CLIENT_ID}
38
+ clientSecret: ${AZURE_CLIENT_SECRET}
32
39
  # Optional mode for querying which defaults to "basic".
33
40
  # By default, the Microsoft Graph API only provides the basic feature set
34
41
  # for querying. Certain features are limited to advanced querying capabilities.
@@ -108,8 +115,9 @@ yarn add --cwd packages/backend @backstage/plugin-catalog-backend-module-msgraph
108
115
  + MicrosoftGraphOrgEntityProvider.fromConfig(env.config, {
109
116
  + logger: env.logger,
110
117
  + schedule: env.scheduler.createScheduledTaskRunner({
111
- + frequency: { minutes: 5 },
112
- + timeout: { minutes: 3 },
118
+ + frequency: { hours: 1 },
119
+ + timeout: { minutes: 50 },
120
+ + initialDelay: { seconds: 15}
113
121
  + }),
114
122
  + }),
115
123
  + );
package/config.d.ts CHANGED
@@ -50,13 +50,13 @@ export interface Config {
50
50
  /**
51
51
  * The OAuth client ID to use for authenticating requests.
52
52
  */
53
- clientId: string;
53
+ clientId?: string;
54
54
  /**
55
55
  * The OAuth client secret to use for authenticating requests.
56
56
  *
57
57
  * @visibility secret
58
58
  */
59
- clientSecret: string;
59
+ clientSecret?: string;
60
60
 
61
61
  // TODO: Consider not making these config options and pass them in the
62
62
  // constructor instead. They are probably not environment specific, so
@@ -130,13 +130,13 @@ export interface Config {
130
130
  /**
131
131
  * The OAuth client ID to use for authenticating requests.
132
132
  */
133
- clientId: string;
133
+ clientId?: string;
134
134
  /**
135
135
  * The OAuth client secret to use for authenticating requests.
136
136
  *
137
137
  * @visibility secret
138
138
  */
139
- clientSecret: string;
139
+ clientSecret?: string;
140
140
 
141
141
  user?: {
142
142
  /**