@azure/functions-authentication-events 1.0.0-beta.2 → 1.0.0-beta.3

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.
Files changed (131) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +125 -117
  3. package/dist/browser/constants.d.ts +2 -0
  4. package/dist/browser/constants.d.ts.map +1 -0
  5. package/{dist-esm/src → dist/browser}/constants.js +1 -1
  6. package/{dist-esm/src → dist/browser}/constants.js.map +1 -1
  7. package/dist/browser/events.d.ts +87 -0
  8. package/dist/browser/events.d.ts.map +1 -0
  9. package/{dist-esm/src → dist/browser}/events.js +1 -1
  10. package/dist/browser/events.js.map +1 -0
  11. package/dist/browser/index.d.ts +5 -0
  12. package/dist/browser/index.d.ts.map +1 -0
  13. package/dist/browser/index.js +5 -0
  14. package/dist/browser/index.js.map +1 -0
  15. package/dist/browser/logger.d.ts +7 -0
  16. package/dist/browser/logger.d.ts.map +1 -0
  17. package/{dist-esm/src → dist/browser}/logger.js +1 -1
  18. package/{dist-esm/src → dist/browser}/logger.js.map +1 -1
  19. package/dist/browser/package.json +3 -0
  20. package/dist/browser/tokenIssuanceStart/actions.d.ts +17 -0
  21. package/dist/browser/tokenIssuanceStart/actions.d.ts.map +1 -0
  22. package/{dist-esm/src → dist/browser}/tokenIssuanceStart/actions.js +1 -1
  23. package/dist/browser/tokenIssuanceStart/actions.js.map +1 -0
  24. package/dist/browser/tokenIssuanceStart/context.d.ts +105 -0
  25. package/dist/browser/tokenIssuanceStart/context.d.ts.map +1 -0
  26. package/dist/browser/tokenIssuanceStart/context.js +4 -0
  27. package/dist/browser/tokenIssuanceStart/context.js.map +1 -0
  28. package/dist/browser/tokenIssuanceStart/index.d.ts +3 -0
  29. package/dist/browser/tokenIssuanceStart/index.d.ts.map +1 -0
  30. package/dist/browser/tokenIssuanceStart/index.js +4 -0
  31. package/{dist-esm/src → dist/browser}/tokenIssuanceStart/index.js.map +1 -1
  32. package/dist/commonjs/constants.d.ts +2 -0
  33. package/dist/commonjs/constants.d.ts.map +1 -0
  34. package/dist/commonjs/constants.js +7 -0
  35. package/dist/commonjs/constants.js.map +1 -0
  36. package/dist/commonjs/events.d.ts +87 -0
  37. package/dist/commonjs/events.d.ts.map +1 -0
  38. package/dist/commonjs/events.js +17 -0
  39. package/dist/commonjs/events.js.map +1 -0
  40. package/dist/commonjs/index.d.ts +5 -0
  41. package/dist/commonjs/index.d.ts.map +1 -0
  42. package/dist/commonjs/index.js +10 -0
  43. package/dist/commonjs/index.js.map +1 -0
  44. package/dist/commonjs/logger.d.ts +7 -0
  45. package/dist/commonjs/logger.d.ts.map +1 -0
  46. package/dist/commonjs/logger.js +13 -0
  47. package/dist/commonjs/logger.js.map +1 -0
  48. package/dist/commonjs/package.json +3 -0
  49. package/dist/commonjs/tokenIssuanceStart/actions.d.ts +17 -0
  50. package/dist/commonjs/tokenIssuanceStart/actions.d.ts.map +1 -0
  51. package/dist/commonjs/tokenIssuanceStart/actions.js +13 -0
  52. package/dist/commonjs/tokenIssuanceStart/actions.js.map +1 -0
  53. package/dist/commonjs/tokenIssuanceStart/context.d.ts +105 -0
  54. package/dist/commonjs/tokenIssuanceStart/context.d.ts.map +1 -0
  55. package/dist/commonjs/tokenIssuanceStart/context.js +5 -0
  56. package/dist/commonjs/tokenIssuanceStart/context.js.map +1 -0
  57. package/dist/commonjs/tokenIssuanceStart/index.d.ts +3 -0
  58. package/dist/commonjs/tokenIssuanceStart/index.d.ts.map +1 -0
  59. package/dist/commonjs/tokenIssuanceStart/index.js +8 -0
  60. package/dist/commonjs/tokenIssuanceStart/index.js.map +1 -0
  61. package/{types/latest → dist/commonjs}/tsdoc-metadata.json +11 -11
  62. package/dist/esm/constants.d.ts +2 -0
  63. package/dist/esm/constants.d.ts.map +1 -0
  64. package/dist/esm/constants.js +4 -0
  65. package/dist/esm/constants.js.map +1 -0
  66. package/dist/esm/events.d.ts +87 -0
  67. package/dist/esm/events.d.ts.map +1 -0
  68. package/dist/esm/events.js +14 -0
  69. package/dist/esm/events.js.map +1 -0
  70. package/dist/esm/index.d.ts +5 -0
  71. package/dist/esm/index.d.ts.map +1 -0
  72. package/dist/esm/index.js +5 -0
  73. package/dist/esm/index.js.map +1 -0
  74. package/dist/esm/logger.d.ts +7 -0
  75. package/dist/esm/logger.d.ts.map +1 -0
  76. package/dist/esm/logger.js +10 -0
  77. package/dist/esm/logger.js.map +1 -0
  78. package/dist/esm/package.json +3 -0
  79. package/dist/esm/tokenIssuanceStart/actions.d.ts +17 -0
  80. package/dist/esm/tokenIssuanceStart/actions.d.ts.map +1 -0
  81. package/dist/esm/tokenIssuanceStart/actions.js +10 -0
  82. package/dist/esm/tokenIssuanceStart/actions.js.map +1 -0
  83. package/dist/esm/tokenIssuanceStart/context.d.ts +105 -0
  84. package/dist/esm/tokenIssuanceStart/context.d.ts.map +1 -0
  85. package/dist/esm/tokenIssuanceStart/context.js +4 -0
  86. package/dist/esm/tokenIssuanceStart/context.js.map +1 -0
  87. package/dist/esm/tokenIssuanceStart/index.d.ts +3 -0
  88. package/dist/esm/tokenIssuanceStart/index.d.ts.map +1 -0
  89. package/dist/esm/tokenIssuanceStart/index.js +4 -0
  90. package/dist/esm/tokenIssuanceStart/index.js.map +1 -0
  91. package/dist/react-native/constants.d.ts +2 -0
  92. package/dist/react-native/constants.d.ts.map +1 -0
  93. package/dist/react-native/constants.js +4 -0
  94. package/dist/react-native/constants.js.map +1 -0
  95. package/dist/react-native/events.d.ts +87 -0
  96. package/dist/react-native/events.d.ts.map +1 -0
  97. package/dist/react-native/events.js +14 -0
  98. package/dist/react-native/events.js.map +1 -0
  99. package/dist/react-native/index.d.ts +5 -0
  100. package/dist/react-native/index.d.ts.map +1 -0
  101. package/dist/react-native/index.js +5 -0
  102. package/dist/react-native/index.js.map +1 -0
  103. package/dist/react-native/logger.d.ts +7 -0
  104. package/dist/react-native/logger.d.ts.map +1 -0
  105. package/dist/react-native/logger.js +10 -0
  106. package/dist/react-native/logger.js.map +1 -0
  107. package/dist/react-native/package.json +3 -0
  108. package/dist/react-native/tokenIssuanceStart/actions.d.ts +17 -0
  109. package/dist/react-native/tokenIssuanceStart/actions.d.ts.map +1 -0
  110. package/dist/react-native/tokenIssuanceStart/actions.js +10 -0
  111. package/dist/react-native/tokenIssuanceStart/actions.js.map +1 -0
  112. package/dist/react-native/tokenIssuanceStart/context.d.ts +105 -0
  113. package/dist/react-native/tokenIssuanceStart/context.d.ts.map +1 -0
  114. package/dist/react-native/tokenIssuanceStart/context.js +4 -0
  115. package/dist/react-native/tokenIssuanceStart/context.js.map +1 -0
  116. package/dist/react-native/tokenIssuanceStart/index.d.ts +3 -0
  117. package/dist/react-native/tokenIssuanceStart/index.d.ts.map +1 -0
  118. package/dist/react-native/tokenIssuanceStart/index.js +4 -0
  119. package/dist/react-native/tokenIssuanceStart/index.js.map +1 -0
  120. package/package.json +84 -79
  121. package/dist/index.js +0 -31
  122. package/dist/index.js.map +0 -1
  123. package/dist-esm/src/events.js.map +0 -1
  124. package/dist-esm/src/index.js +0 -5
  125. package/dist-esm/src/index.js.map +0 -1
  126. package/dist-esm/src/tokenIssuanceStart/actions.js.map +0 -1
  127. package/dist-esm/src/tokenIssuanceStart/context.js +0 -4
  128. package/dist-esm/src/tokenIssuanceStart/context.js.map +0 -1
  129. package/dist-esm/src/tokenIssuanceStart/index.js +0 -4
  130. package/types/3.1/functions-authentication-events.d.ts +0 -202
  131. package/types/latest/functions-authentication-events.d.ts +0 -224
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ Copyright (c) Microsoft Corporation.
2
2
 
3
- Copyright (c) 2020 Microsoft
3
+ MIT License
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -12,7 +12,7 @@ furnished to do so, subject to the following conditions:
12
12
  The above copyright notice and this permission notice shall be included in all
13
13
  copies or substantial portions of the Software.
14
14
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
package/README.md CHANGED
@@ -4,42 +4,42 @@ Authentication Event Trigger for Azure Functions handles all the backend process
4
4
 
5
5
  This project framework provides the following features:
6
6
 
7
- * Token validation for securing the API call
8
- * Object model, typing, and IDE intellisense
9
- * Inbound and outbound validation of the API request and response schemas
10
- * Versioning
11
- * No need for boilerplate code.
7
+ - Token validation for securing the API call
8
+ - Object model, typing, and IDE intellisense
9
+ - Inbound and outbound validation of the API request and response schemas
10
+ - Versioning
11
+ - No need for boilerplate code.
12
12
 
13
13
  ## Getting started
14
14
 
15
15
  ### Install the npm package
16
16
 
17
17
  ```console
18
- npm install @azure/functions-authentication-events
18
+ npm install @azure/functions-authentication-events
19
19
  ```
20
20
 
21
21
  ### Prerequisites
22
22
 
23
- * [Azure function tools](https://github.com/Azure/azure-functions-core-tools)
24
- * [Azure Function Core Tools](https://github.com/Azure/azure-functions-core-tools#installing)
25
- * If using Visual Studio Code the following extensions:
26
- * [ms-azuretools.vscode-azurefunctions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions)
27
- * [ms-dotnettools.csharp](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp)
23
+ - [Azure function tools](https://github.com/Azure/azure-functions-core-tools)
24
+ - [Azure Function Core Tools](https://github.com/Azure/azure-functions-core-tools#installing)
25
+ - If using Visual Studio Code the following extensions:
26
+ - [ms-azuretools.vscode-azurefunctions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions)
27
+ - [ms-dotnettools.csharp](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp)
28
28
 
29
29
  ### Authenticate the Client
30
30
 
31
- When Azure AD authentication events service calls your custom extension, it will send an `Authorization` header with a `Bearer {token}`. This token will represent a [service to service authentication](https://review.docs.microsoft.com/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow) in which:
31
+ When Azure AD authentication events service calls your custom extension, it will send an `Authorization` header with a `Bearer {token}`. This token will represent a [service to service authentication](https://review.learn.microsoft.com/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow) in which:
32
32
 
33
- * The '**resource**', also known as the **audience**, is the application that you register to represent your API. This is represented by the `aud` claim in the token.
34
- * The '**client**' is a Microsoft application that represents the Azure AD authentication events service. It has an `appId` value of `99045fe1-7639-4a75-9d4a-577b6ca3810f`. This is represented by:
35
- * The `azp` claim in the token if your application `accessTokenAcceptedVersion` property is set to `2`.
36
- * The `appid` claim in the token if your resource application's `accessTokenAcceptedVersion` property is set to `1` or `null`.
33
+ - The '**resource**', also known as the **audience**, is the application that you register to represent your API. This is represented by the `aud` claim in the token.
34
+ - The '**client**' is a Microsoft application that represents the Azure AD authentication events service. It has an `appId` value of `99045fe1-7639-4a75-9d4a-577b6ca3810f`. This is represented by:
35
+ - The `azp` claim in the token if your application `accessTokenAcceptedVersion` property is set to `2`.
36
+ - The `appid` claim in the token if your resource application's `accessTokenAcceptedVersion` property is set to `1` or `null`.
37
37
 
38
- There are three approaches to dealing with the token. You can customize the behavior using [application settings](https://docs.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings?tabs=portal#settings) as shown below or via the [local.settings.json](https://docs.microsoft.com/azure/azure-functions/functions-develop-local#local-settings-file) file in local environments.
38
+ There are three approaches to dealing with the token. You can customize the behavior using [application settings](https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings?tabs=portal#settings) as shown below or via the [local.settings.json](https://learn.microsoft.com/azure/azure-functions/functions-develop-local#local-settings-file) file in local environments.
39
39
 
40
40
  #### Validate tokens using Azure Functions Azure AD authentication integration
41
41
 
42
- When running your function in production, it is **highly recommended** to use the [Azure Functions Azure AD authentication integration](https://docs.microsoft.com/azure/app-service/configure-authentication-provider-aad#-option-2-use-an-existing-registration-created-separately) for validating incoming tokens.
42
+ When running your function in production, it is **highly recommended** to use the [Azure Functions Azure AD authentication integration](https://learn.microsoft.com/azure/app-service/configure-authentication-provider-aad#-option-2-use-an-existing-registration-created-separately) for validating incoming tokens.
43
43
 
44
44
  1. Go to the "Authentication" tab in your Function App
45
45
  2. Click on "Add identity provider"
@@ -47,29 +47,27 @@ When running your function in production, it is **highly recommended** to use th
47
47
  4. Select "Provide the details of an existing app registration"
48
48
  5. Enter the `Application ID` of the app that represents your API in Azure AD
49
49
 
50
- The issuer and allowed audience depends on the [`accessTokenAcceptedVersion`](https://review.docs.microsoft.com/azure/active-directory/develop/access-tokens) property of your application (can be found in the "Manifest" of the application).
50
+ The issuer and allowed audience depends on the [`accessTokenAcceptedVersion`](https://review.learn.microsoft.com/azure/active-directory/develop/access-tokens) property of your application (can be found in the "Manifest" of the application).
51
51
 
52
- If the `accessTokenAcceptedVersion` property is set to `2`:
53
- 6. Set the `Issuer URL to "https://login.microsoftonline.com/{tenantId}/v2.0"
52
+ If the `accessTokenAcceptedVersion` property is set to `2`: 6. Set the `Issuer URL to "https://login.microsoftonline.com/{tenantId}/v2.0"
54
53
  7. Set an 'Allowed Audience' to the Application ID (`appId`)
55
54
 
56
- If the `accessTokenAcceptedVersion` property is set to `1` or `null`:
57
- 6. Set the `Issuer URL to "https://sts.windows.net/{tenantId}/"
58
- 7. Set an 'Allowed Audience' to the Application ID URI (also known as`identifierUri`). It should be in the format of`api://{azureFunctionAppName}.azurewebsites.net/{resourceApiAppId}` or `api://{FunctionAppFullyQualifiedDomainName}/{resourceApiAppId}` if using a [custom domain name](https://docs.microsoft.com/azure/dns/dns-custom-domain#:~:text=Azure%20Function%20App%201%20Navigate%20to%20Function%20App,Custom%20domain%20text%20field%20and%20select%20Validate.%20).
55
+ If the `accessTokenAcceptedVersion` property is set to `1` or `null`: 6. Set the `Issuer URL to "https://sts.windows.net/{tenantId}/"
56
+ 7. Set an 'Allowed Audience' to the Application ID URI (also known as`identifierUri`). It should be in the format of`api://{azureFunctionAppName}.azurewebsites.net/{resourceApiAppId}`or`api://{FunctionAppFullyQualifiedDomainName}/{resourceApiAppId}` if using a [custom domain name](https://learn.microsoft.com/azure/dns/dns-custom-domain#:~:text=Azure%20Function%20App%201%20Navigate%20to%20Function%20App,Custom%20domain%20text%20field%20and%20select%20Validate.%20).
59
57
 
60
58
  By default, the Authentication event trigger will validate that Azure Function authentication integration is configured and it will check that the **client** in the token is set to `99045fe1-7639-4a75-9d4a-577b6ca3810f` (via the `azp` or `appid` claims in the token).
61
59
 
62
60
  If you want to test your API against some other client that is not Azure AD authentication events service, like using Postman, you can configure an _optional_ application setting:
63
61
 
64
- * **AuthenticationEvents__CustomCallerAppId** - the guid of your desired client. If not provided, `99045fe1-7639-4a75-9d4a-577b6ca3810f` is assumed.
62
+ - **AuthenticationEvents\_\_CustomCallerAppId** - the guid of your desired client. If not provided, `99045fe1-7639-4a75-9d4a-577b6ca3810f` is assumed.
65
63
 
66
64
  #### Have the trigger validate the token
67
65
 
68
66
  In local environments or environments that aren't hosted in the Azure Function service, the trigger can do the token validation. Set the following application settings:
69
67
 
70
- * **AuthenticationEvents__TenantId** - your tenant ID
71
- * **AuthenticationEvents__AudienceAppId** - the same value as "Allowed audience" in option 1.
72
- * **AuthenticationEvents__CustomCallerAppId** (_optional_) - the guid of your desired client. If not provided, `99045fe1-7639-4a75-9d4a-577b6ca3810f` is assumed.
68
+ - **AuthenticationEvents\_\_TenantId** - your tenant ID
69
+ - **AuthenticationEvents\_\_AudienceAppId** - the same value as "Allowed audience" in option 1.
70
+ - **AuthenticationEvents\_\_CustomCallerAppId** (_optional_) - the guid of your desired client. If not provided, `99045fe1-7639-4a75-9d4a-577b6ca3810f` is assumed.
73
71
 
74
72
  An example `local.settings.json` file:
75
73
 
@@ -90,20 +88,20 @@ An example `local.settings.json` file:
90
88
 
91
89
  If you would like to _not_ authenticate the token while in local development, set the following application setting:
92
90
 
93
- * **AuthenticationEvents__BypassTokenValidation** - value of `true` will make the trigger not check for a validation of the token.
91
+ - **AuthenticationEvents\_\_BypassTokenValidation** - value of `true` will make the trigger not check for a validation of the token.
94
92
 
95
93
  ### Quickstart
96
94
 
97
- * Visual Studio Code
98
- * Start Visual Studio Code
99
- * Run the terminal command `func init . --worker-runtime node` via the command palette
100
- * Run the terminal command `func new` via the command palette
101
- * Follow the project creation prompts
102
- * Run the terminal command `npm install @azure/functions-authentication-events` via the command palette
103
- * Run the terminal command `npm install` via the command palette
104
- * Run the terminal command `npm run-script build` via the command palette
105
- * For development purpose turn of token validation for testing:
106
- * Add the **AuthenticationEvents__BypassTokenValidation** application key to the "Values" section in the local.settings.json file and set it's value to **true**. If you do not have a local.settings.json file in your local environment, create one in the root of your Function App.
95
+ - Visual Studio Code
96
+ - Start Visual Studio Code
97
+ - Run the terminal command `func init . --worker-runtime node` via the command palette
98
+ - Run the terminal command `func new` via the command palette
99
+ - Follow the project creation prompts
100
+ - Run the terminal command `npm install @azure/functions-authentication-events` via the command palette
101
+ - Run the terminal command `npm install` via the command palette
102
+ - Run the terminal command `npm run-script build` via the command palette
103
+ - For development purpose turn of token validation for testing:
104
+ - Add the **AuthenticationEvents\_\_BypassTokenValidation** application key to the "Values" section in the local.settings.json file and set it's value to **true**. If you do not have a local.settings.json file in your local environment, create one in the root of your Function App.
107
105
 
108
106
  ```json
109
107
  {
@@ -116,7 +114,7 @@ If you would like to _not_ authenticate the token while in local development, se
116
114
  }
117
115
  ```
118
116
 
119
- * Once the project is loaded, you can run the sample code and you should see the Azure functions developer's application load your end point.
117
+ - Once the project is loaded, you can run the sample code and you should see the Azure functions developer's application load your end point.
120
118
 
121
119
  ## Key concepts
122
120
 
@@ -124,100 +122,109 @@ Key concepts of the Azure .NET SDK can be found [here](https://azure.github.io/a
124
122
 
125
123
  ## Documentation
126
124
 
127
- * One the function has been published, there's some good reading about logging and metrics that can be found [here](https://docs.microsoft.com/azure/azure-functions/functions-monitor-log-analytics?tabs=csharp)
125
+ - One the function has been published, there's some good reading about logging and metrics that can be found [here](https://learn.microsoft.com/azure/azure-functions/functions-monitor-log-analytics?tabs=csharp)
128
126
 
129
- * For API Documentation, please see the (Link TBD)
130
- * Once this moves to preview, we except no breaking changes and would be as simple as removing the the nuget source that points to the private preview.
127
+ - For API Documentation, please see the (Link TBD)
128
+ - Once this moves to preview, we except no breaking changes and would be as simple as removing the the nuget source that points to the private preview.
131
129
 
132
130
  ## Examples
133
131
 
134
132
  To Test Token Augmentation, please do the following.
135
133
 
136
- * Open the project that was created in the prior step. (QuickStart)
137
- * Run the Application. `func host start`
138
- * Once the Azure functions developer's application has started, copy the listening url that is displayed with the application starts up.
139
- * Note: All Authentication functions are listed, in the case we have one function listener registered called "**OnTokenIssuanceStart**"
140
- * Your function endpoint will then be a combination of the listening url and function, for example: "http://localhost:7071/runtime/webhooks/AuthenticationEvents?code=(YOUR_CODE)&function=OnTokenIssuanceStart"
141
- * Post the following payload using something like Postman or Fiddler.
142
- * Steps for using Postman can be found (Link TBD)
134
+ - Open the project that was created in the prior step. (QuickStart)
135
+ - Run the Application. `func host start`
136
+ - Once the Azure functions developer's application has started, copy the listening url that is displayed with the application starts up.
137
+ - Note: All Authentication functions are listed, in the case we have one function listener registered called "**OnTokenIssuanceStart**"
138
+ - Your function endpoint will then be a combination of the listening url and function, for example: "http://localhost:7071/runtime/webhooks/AuthenticationEvents?code=(YOUR_CODE)&function=OnTokenIssuanceStart"
139
+ - Post the following payload using something like Postman or Fiddler.
140
+ - Steps for using Postman can be found (Link TBD)
143
141
 
144
142
  ```json
145
143
  {
146
- "type": "microsoft.graph.authenticationEvent.tokenIssuanceStart",
147
- "source": "/tenants/00000001-0000-0ff1-ce00-000000000000/applications/ef9e995c-efdb-4e76-97a9-8cdfc6e06afc",
148
- "data": {
149
- "@odata.type": "microsoft.graph.onTokenIssuanceStartCalloutData",
150
- "tenantId": "00000001-0000-0ff1-ce00-000000000000",
151
- "authenticationEventListenerId": "f2390d57-9664-4dde-b625-f0115925e1e2",
152
- "customAuthenticationExtensionId": "9cc1c1ed-5f04-4fdf-85c0-94a7c6ea819c",
153
- "authenticationContext": {
154
- "correlationId": "f4bd1870-b774-4fa5-ba78-e08ac6be14c0",
155
- "client": {
156
- "ip": "127.0.0.1",
157
- "locale": "en-us",
158
- "market": "en-us"
159
- },
160
- "protocol": "OAUTH2.0",
161
- "clientServicePrincipal": {
162
- "id": "eedfddb9-304e-4d62-aa83-24700a0bcf0e",
163
- "appId": "ef9e995c-efdb-4e76-97a9-8cdfc6e06afc",
164
- "appDisplayName": "",
165
- "displayName": "Test application"
166
- },
167
- "resourceServicePrincipal": {
168
- "id": "eedfddb9-304e-4d62-aa83-24700a0bcf0e",
169
- "appId": "ef9e995c-efdb-4e76-97a9-8cdfc6e06afc",
170
- "appDisplayName": "",
171
- "displayName": "Test application"
172
- },
173
- "user": {
174
- "companyName": "Evo Sts Test",
175
- "country": "",
176
- "id": "69d24544-c420-4721-a4bf-106f2378d9f6",
177
- "mail": "testadmin@evostsoneboxtest.com",
178
- "onPremisesSamAccountName": "testadmin",
179
- "onPremisesSecurityIdentifier": "testadmin",
180
- "preferredDataLocation": "",
181
- "userPrincipalName": "testadmin@evostsoneboxtest.com"
182
- }
183
- }
144
+ "type": "microsoft.graph.authenticationEvent.tokenIssuanceStart",
145
+ "source": "/tenants/00000001-0000-0ff1-ce00-000000000000/applications/ef9e995c-efdb-4e76-97a9-8cdfc6e06afc",
146
+ "data": {
147
+ "@odata.type": "microsoft.graph.onTokenIssuanceStartCalloutData",
148
+ "tenantId": "00000001-0000-0ff1-ce00-000000000000",
149
+ "authenticationEventListenerId": "f2390d57-9664-4dde-b625-f0115925e1e2",
150
+ "customAuthenticationExtensionId": "9cc1c1ed-5f04-4fdf-85c0-94a7c6ea819c",
151
+ "authenticationContext": {
152
+ "correlationId": "f4bd1870-b774-4fa5-ba78-e08ac6be14c0",
153
+ "client": {
154
+ "ip": "127.0.0.1",
155
+ "locale": "en-us",
156
+ "market": "en-us"
157
+ },
158
+ "protocol": "OAUTH2.0",
159
+ "clientServicePrincipal": {
160
+ "id": "eedfddb9-304e-4d62-aa83-24700a0bcf0e",
161
+ "appId": "ef9e995c-efdb-4e76-97a9-8cdfc6e06afc",
162
+ "appDisplayName": "",
163
+ "displayName": "Test application"
164
+ },
165
+ "resourceServicePrincipal": {
166
+ "id": "eedfddb9-304e-4d62-aa83-24700a0bcf0e",
167
+ "appId": "ef9e995c-efdb-4e76-97a9-8cdfc6e06afc",
168
+ "appDisplayName": "",
169
+ "displayName": "Test application"
170
+ },
171
+ "user": {
172
+ "companyName": "Evo Sts Test",
173
+ "country": "",
174
+ "id": "69d24544-c420-4721-a4bf-106f2378d9f6",
175
+ "mail": "testadmin@evostsoneboxtest.com",
176
+ "onPremisesSamAccountName": "testadmin",
177
+ "onPremisesSecurityIdentifier": "testadmin",
178
+ "preferredDataLocation": "",
179
+ "userPrincipalName": "testadmin@evostsoneboxtest.com"
180
+ }
184
181
  }
182
+ }
185
183
  }
186
184
  ```
187
185
 
188
- * You should see this response:
186
+ - You should see this response:
189
187
 
190
188
  ```json
191
189
  {
192
- "data": {
193
- "@odata.type": "microsoft.graph.onTokenIssuanceStartResponseData",
194
- "actions": [
195
- {
196
- "@odata.type": "ProvideClaimsForToken",
197
- "claims": [
198
- {
199
- "DateOfBirth": "01/01/2000"
200
- },
201
- {
202
- "CustomRoles": [
203
- "Writer",
204
- "Editor"
205
- ]
206
- }
207
- ]
208
- }
190
+ "data": {
191
+ "@odata.type": "microsoft.graph.onTokenIssuanceStartResponseData",
192
+ "actions": [
193
+ {
194
+ "@odata.type": "ProvideClaimsForToken",
195
+ "claims": [
196
+ {
197
+ "DateOfBirth": "01/01/2000"
198
+ },
199
+ {
200
+ "CustomRoles": ["Writer", "Editor"]
201
+ }
209
202
  ]
210
- }
203
+ }
204
+ ]
205
+ }
211
206
  }
212
207
  ```
213
208
 
214
209
  ## Troubleshooting
215
210
 
216
- * Visual Studio Code
217
- * If running in Visual Studio Code, you get an error along the lines of the local Azure Storage Emulator is unavailable, you can start the emulator manually.! (Note: Azure Storage emulator is now deprecated and the suggested replacement is [Azurite](https://docs.microsoft.com/azure/storage/common/storage-use-azurite?tabs=visual-studio))
218
- * If using Visual Studio Code on Mac please use [Azurite](https://docs.microsoft.com/azure/storage/common/storage-use-azurite?tabs=visual-studio)
219
- * If you see the following error on Windows (it's a bug) when trying to run the created projected.
220
- * This can be resolved by executing this command in powershell `Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine` more info on this can be found [here](https://github.com/Azure/azure-functions-core-tools/issues/1821) and [here](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7)
211
+ - Visual Studio Code
212
+ - If running in Visual Studio Code, you get an error along the lines of the local Azure Storage Emulator is unavailable, you can start the emulator manually.! (Note: Azure Storage emulator is now deprecated and the suggested replacement is [Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite?tabs=visual-studio))
213
+ - If using Visual Studio Code on Mac please use [Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite?tabs=visual-studio)
214
+ - If you see the following error on Windows (it's a bug) when trying to run the created projected.
215
+ - This can be resolved by executing this command in powershell `Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine` more info on this can be found [here](https://github.com/Azure/azure-functions-core-tools/issues/1821) and [here](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7)
216
+
217
+ ### Logging
218
+
219
+ Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
220
+
221
+ ```ts snippet:SetLogLevel
222
+ import { setLogLevel } from "@azure/logger";
223
+
224
+ setLogLevel("info");
225
+ ```
226
+
227
+ For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
221
228
 
222
229
  ## Next steps
223
230
 
@@ -225,11 +232,11 @@ For more information on Azure SDK, please refer to [this website](https://azure.
225
232
 
226
233
  ## Publish
227
234
 
228
- * Follow the instruction here to create and publish your Azure Application. <https://docs.microsoft.com/azure/azure-functions/functions-develop-vs?tabs=in-process#publish-to-azure>
229
- * To determine your published posting endpoint, combine the azure function endpoint you created, route to the listener and listener code, the listen code can be found by navigating to your azure function application, selecting "App Keys" and copying the value of AuthenticationEvents_extension.
230
- * For example: "https://azureautheventstriggerdemo.azurewebsites.net/runtime/webhooks/AuthenticationEvents?code=(AuthenticationEvents_extension_key)&function=OnTokenIssuanceStart"
231
- * Make sure your production environment has the correct application settings for token authentication.
232
- * Once again you can test the published function by posting the above payload to the new endpoint.
235
+ - Follow the instruction here to create and publish your Azure Application. <https://learn.microsoft.com/azure/azure-functions/functions-develop-vs?tabs=in-process#publish-to-azure>
236
+ - To determine your published posting endpoint, combine the azure function endpoint you created, route to the listener and listener code, the listen code can be found by navigating to your azure function application, selecting "App Keys" and copying the value of AuthenticationEvents_extension.
237
+ - For example: "https://azureautheventstriggerdemo.azurewebsites.net/runtime/webhooks/AuthenticationEvents?code=(AuthenticationEvents_extension_key)&function=OnTokenIssuanceStart"
238
+ - Make sure your production environment has the correct application settings for token authentication.
239
+ - Once again you can test the published function by posting the above payload to the new endpoint.
233
240
 
234
241
  ## Contributing
235
242
 
@@ -252,6 +259,7 @@ more information see the [Code of Conduct FAQ][coc_faq] or contact
252
259
  <opencode@microsoft.com> with any additional questions or comments.
253
260
 
254
261
  <!-- LINKS -->
262
+
255
263
  [cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md
256
264
  [coc]: https://opensource.microsoft.com/codeofconduct/
257
265
  [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
@@ -0,0 +1,2 @@
1
+ export declare const SDK_VERSION: string;
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,EAAE,MAAuB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export const SDK_VERSION = "1.0.0-beta.1";
4
4
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"1.0.0-beta.1\";\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"1.0.0-beta.1\";\n"]}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Abstract base event interface to house common event request attributes.
3
+ */
4
+ export interface AuthenticationEventRequestCommon {
5
+ /** Related Type */
6
+ type: string;
7
+ /** The status of the current request, see RequestStatus. */
8
+ requestStatus: RequestStatus;
9
+ /** A user friendly message (containing errors), that the authentication event returns. */
10
+ statusMessage: string;
11
+ /** A dictionary of query string parameters */
12
+ queryParameters: Record<string, string>;
13
+ }
14
+ /**
15
+ * Event request interface extended the related response and event data (payload) objects.
16
+ */
17
+ export interface AuthenticationEventRequest<TResponse extends AuthenticationEventResponse, TData extends AuthenticationEventData> extends AuthenticationEventRequestCommon {
18
+ /** Related IEventResponse */
19
+ response: TResponse;
20
+ /** Related IEventData */
21
+ payload: TData;
22
+ }
23
+ /**
24
+ * Event request interface extended the related response and event data (payload) objects for cloud events.
25
+ */
26
+ export interface CloudEventRequest<TResponse extends AuthenticationEventResponse, TData extends AuthenticationEventData> extends AuthenticationEventRequest<TResponse, TData> {
27
+ /** Related Source */
28
+ source: string;
29
+ /** Related \@odata.type */
30
+ oDataType: string;
31
+ }
32
+ /**
33
+ * Event response interface that houses attributes returned from the authentication events trigger.
34
+ */
35
+ export interface AuthenticationEventResponse {
36
+ /** A template of the body of the expected response. */
37
+ body: string;
38
+ }
39
+ /**
40
+ * Event data interface pertaining to the expected payload, this interface houses the common attributes for data events.
41
+ */
42
+ export interface AuthenticationEventData {
43
+ /** Tenant the request is related to. */
44
+ tenantId: string;
45
+ /** Unique Id for the event. */
46
+ authenticationEventListenerId: string;
47
+ /** The unique internal Id of the registered custom extension. */
48
+ customAuthenticationExtensionId: string;
49
+ }
50
+ /**
51
+ * An interface that binds a response that has actions
52
+ */
53
+ export interface ActionableResponse<TEventAction extends AuthenticationEventAction> extends AuthenticationEventResponse {
54
+ /** Collections of actions pertaining to the event. */
55
+ actions: TEventAction[];
56
+ }
57
+ /**
58
+ * An interface for any responses that implement an cloud event payload and has actions on it.
59
+ */
60
+ export interface ActionableCloudEventResponse<TEventAction extends AuthenticationEventAction> extends ActionableResponse<TEventAction> {
61
+ /** Gets the Cloud Event \@odata.type. */
62
+ oDataType: string;
63
+ }
64
+ /**
65
+ * An interface representing an action for an event.
66
+ */
67
+ export interface AuthenticationEventAction {
68
+ /** Must be overridden, this will be the 'Name' of the action in the JSON. */
69
+ actionType: string;
70
+ }
71
+ /**
72
+ * The status of the request.
73
+ */
74
+ export type RequestStatus = "Failed" | "TokenInvalid" | "Successful";
75
+ /**
76
+ * Return the correctly formatted error
77
+ * */
78
+ export interface FailedRequest extends AuthenticationEventResponse {
79
+ error: string;
80
+ }
81
+ /**
82
+ * Helper function to create a files request
83
+ * @param error - string or exception
84
+ * @returns a valid FailedRequest object
85
+ */
86
+ export declare function createFailedRequest(error: unknown): FailedRequest;
87
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,aAAa,EAAE,aAAa,CAAC;IAC7B,0FAA0F;IAC1F,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B,CACzC,SAAS,SAAS,2BAA2B,EAC7C,KAAK,SAAS,uBAAuB,CACrC,SAAQ,gCAAgC;IACxC,6BAA6B;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,yBAAyB;IACzB,OAAO,EAAE,KAAK,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAChC,SAAS,SAAS,2BAA2B,EAC7C,KAAK,SAAS,uBAAuB,CACrC,SAAQ,0BAA0B,CAAC,SAAS,EAAE,KAAK,CAAC;IACpD,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,6BAA6B,EAAE,MAAM,CAAC;IACtC,iEAAiE;IACjE,+BAA+B,EAAE,MAAM,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,YAAY,SAAS,yBAAyB,CAChF,SAAQ,2BAA2B;IACnC,sDAAsD;IACtD,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B,CAAC,YAAY,SAAS,yBAAyB,CAC1F,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IACxC,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,cAAc,GAAG,YAAY,CAAC;AAErE;;KAEK;AACL,MAAM,WAAW,aAAc,SAAQ,2BAA2B;IAEhE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAKjE"}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  /**
4
4
  * Helper function to create a files request
5
5
  * @param error - string or exception
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAqGlC;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO;QACL,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAC9D,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Abstract base event interface to house common event request attributes.\n */\nexport interface AuthenticationEventRequestCommon {\n /** Related Type */\n type: string;\n /** The status of the current request, see RequestStatus. */\n requestStatus: RequestStatus;\n /** A user friendly message (containing errors), that the authentication event returns. */\n statusMessage: string;\n /** A dictionary of query string parameters */\n queryParameters: Record<string, string>;\n}\n\n/**\n * Event request interface extended the related response and event data (payload) objects.\n */\nexport interface AuthenticationEventRequest<\n TResponse extends AuthenticationEventResponse,\n TData extends AuthenticationEventData,\n> extends AuthenticationEventRequestCommon {\n /** Related IEventResponse */\n response: TResponse;\n /** Related IEventData */\n payload: TData;\n}\n\n/**\n * Event request interface extended the related response and event data (payload) objects for cloud events.\n */\nexport interface CloudEventRequest<\n TResponse extends AuthenticationEventResponse,\n TData extends AuthenticationEventData,\n> extends AuthenticationEventRequest<TResponse, TData> {\n /** Related Source */\n source: string;\n /** Related \\@odata.type */\n oDataType: string;\n}\n\n/**\n * Event response interface that houses attributes returned from the authentication events trigger.\n */\nexport interface AuthenticationEventResponse {\n /** A template of the body of the expected response. */\n body: string;\n}\n\n/**\n * Event data interface pertaining to the expected payload, this interface houses the common attributes for data events.\n */\nexport interface AuthenticationEventData {\n /** Tenant the request is related to. */\n tenantId: string;\n /** Unique Id for the event. */\n authenticationEventListenerId: string;\n /** The unique internal Id of the registered custom extension. */\n customAuthenticationExtensionId: string;\n}\n\n/**\n * An interface that binds a response that has actions\n */\nexport interface ActionableResponse<TEventAction extends AuthenticationEventAction>\n extends AuthenticationEventResponse {\n /** Collections of actions pertaining to the event. */\n actions: TEventAction[];\n}\n\n/**\n * An interface for any responses that implement an cloud event payload and has actions on it.\n */\nexport interface ActionableCloudEventResponse<TEventAction extends AuthenticationEventAction>\n extends ActionableResponse<TEventAction> {\n /** Gets the Cloud Event \\@odata.type. */\n oDataType: string;\n}\n\n/**\n * An interface representing an action for an event.\n */\nexport interface AuthenticationEventAction {\n /** Must be overridden, this will be the 'Name' of the action in the JSON. */\n actionType: string;\n}\n\n/**\n * The status of the request.\n */\nexport type RequestStatus = \"Failed\" | \"TokenInvalid\" | \"Successful\";\n\n/**\n * Return the correctly formatted error\n * */\nexport interface FailedRequest extends AuthenticationEventResponse {\n //* * The error that caused the request to fail. */\n error: string;\n}\n\n/**\n * Helper function to create a files request\n * @param error - string or exception\n * @returns a valid FailedRequest object\n */\nexport function createFailedRequest(error: unknown): FailedRequest {\n return {\n body: \"\",\n error: error instanceof Error ? error.message : String(error),\n };\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export { FailedRequest, ActionableResponse, AuthenticationEventAction, AuthenticationEventData, AuthenticationEventRequest, AuthenticationEventRequestCommon, AuthenticationEventResponse, RequestStatus, CloudEventRequest, createFailedRequest, ActionableCloudEventResponse, } from "./events.js";
2
+ export { AuthenticationEventContext, AuthenticationEventContextClient, AuthenticationEventContextServicePrincipal, AuthenticationEventContextUser, TokenIssuanceStartData, TokenIssuanceStartRequest, TokenIssuanceStartResponse, } from "./tokenIssuanceStart/context.js";
3
+ export { ProvideClaimsForToken, TokenClaim, createProvideClaimsForToken, } from "./tokenIssuanceStart/actions.js";
4
+ export { TokenIssuanceStartAction } from "./tokenIssuanceStart/context.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,0CAA0C,EAC1C,8BAA8B,EAC9B,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,2BAA2B,GAC5B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export { createFailedRequest, } from "./events.js";
4
+ export { createProvideClaimsForToken, } from "./tokenIssuanceStart/actions.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAUL,mBAAmB,GAEpB,MAAM,aAAa,CAAC;AAWrB,OAAO,EAGL,2BAA2B,GAC5B,MAAM,iCAAiC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n FailedRequest,\n ActionableResponse,\n AuthenticationEventAction,\n AuthenticationEventData,\n AuthenticationEventRequest,\n AuthenticationEventRequestCommon,\n AuthenticationEventResponse,\n RequestStatus,\n CloudEventRequest,\n createFailedRequest,\n ActionableCloudEventResponse,\n} from \"./events.js\";\n\nexport {\n AuthenticationEventContext,\n AuthenticationEventContextClient,\n AuthenticationEventContextServicePrincipal,\n AuthenticationEventContextUser,\n TokenIssuanceStartData,\n TokenIssuanceStartRequest,\n TokenIssuanceStartResponse,\n} from \"./tokenIssuanceStart/context.js\";\nexport {\n ProvideClaimsForToken,\n TokenClaim,\n createProvideClaimsForToken,\n} from \"./tokenIssuanceStart/actions.js\";\n\nexport { TokenIssuanceStartAction } from \"./tokenIssuanceStart/context.js\";\n"]}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The \@azure/logger configuration for this package.
3
+ *
4
+ * @internal
5
+ */
6
+ export declare const logger: import("@azure/logger").AzureLogger;
7
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,MAAM,qCAAwD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { createClientLogger } from "@azure/logger";
4
4
  /**
5
5
  * The \@azure/logger configuration for this package.
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,iCAAiC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The \\@azure/logger configuration for this package.\n *\n * @internal\n */\nexport const logger = createClientLogger(\"functions-authentication-events\");\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,iCAAiC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The \\@azure/logger configuration for this package.\n *\n * @internal\n */\nexport const logger = createClientLogger(\"functions-authentication-events\");\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,17 @@
1
+ import type { TokenIssuanceStartAction } from "./context.js";
2
+ /**
3
+ * An Interface for the Provide Claims for token action.
4
+ */
5
+ export interface ProvideClaimsForToken extends TokenIssuanceStartAction {
6
+ /** The 'Name' of the action in the JSON. */
7
+ actionType: "microsoft.graph.ProvideClaimsForToken";
8
+ /** Collection of claims to add to the token. */
9
+ claims: TokenClaim;
10
+ }
11
+ /** Helper function to create a provider claims for token */
12
+ export declare function createProvideClaimsForToken(claims: TokenClaim): ProvideClaimsForToken;
13
+ /**
14
+ * An type representing a claim.
15
+ */
16
+ export type TokenClaim = Record<string, string | string[]>;
17
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/tokenIssuanceStart/actions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,wBAAwB;IACrE,4CAA4C;IAC5C,UAAU,EAAE,uCAAuC,CAAC;IACpD,gDAAgD;IAChD,MAAM,EAAE,UAAU,CAAC;CAEpB;AAED,4DAA4D;AAC5D,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,UAAU,GAAG,qBAAqB,CAKrF;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  /** Helper function to create a provider claims for token */
4
4
  export function createProvideClaimsForToken(claims) {
5
5
  return {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/tokenIssuanceStart/actions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAelC,4DAA4D;AAC5D,MAAM,UAAU,2BAA2B,CAAC,MAAkB;IAC5D,OAAO;QACL,UAAU,EAAE,uCAAuC;QACnD,MAAM,EAAE,MAAM;KACf,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenIssuanceStartAction } from \"./context.js\";\n\n/**\n * An Interface for the Provide Claims for token action.\n */\nexport interface ProvideClaimsForToken extends TokenIssuanceStartAction {\n /** The 'Name' of the action in the JSON. */\n actionType: \"microsoft.graph.ProvideClaimsForToken\";\n /** Collection of claims to add to the token. */\n claims: TokenClaim;\n /** Helper constructor to easily add claims to the action. */\n}\n\n/** Helper function to create a provider claims for token */\nexport function createProvideClaimsForToken(claims: TokenClaim): ProvideClaimsForToken {\n return {\n actionType: \"microsoft.graph.ProvideClaimsForToken\",\n claims: claims,\n };\n}\n\n/**\n * An type representing a claim.\n */\nexport type TokenClaim = Record<string, string | string[]>;\n"]}