diff --git a/.github/policies/msgraph-sdk-php-branch-protection.yml b/.github/policies/msgraph-sdk-php-branch-protection.yml index 4b38287bc84..9d88bc68a58 100644 --- a/.github/policies/msgraph-sdk-php-branch-protection.yml +++ b/.github/policies/msgraph-sdk-php-branch-protection.yml @@ -1,8 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -# File initially created using https://github.com/MIchaelMainer/policyservicetoolkit/blob/main/branch_protection_export.ps1. - name: msgraph-sdk-php-branch-protection description: Branch protection policy for the msgraph-sdk-php repository resource: repository diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7338af847d..01b648e2407 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,9 +40,9 @@ The recommended commit types used are: Adding a footer with the prefix **BREAKING CHANGE:** will cause an increment of the _major_ version. ## Pull requests -If you are making documentation changes, feel free to submit a pull request against the **main** branch. All other pull requests should be submitted against the **dev** branch or a specific feature branch. The master branch is intended to represent the code released in the most-recent composer package. +If you are making documentation changes, feel free to submit a pull request against the **main** branch. All other pull requests should be submitted against the **main** branch or a specific feature branch. The master branch is intended to represent the code released in the most-recent composer package. -When a new package is about to be released, changes in dev will be merged into master. The package will be generated from master. +When a new package is about to be released, changes in main. The package will be generated from main. Some things to note about this project: diff --git a/docs/Examples.md b/docs/Examples.md index 37e4e70710b..9ea825fb4af 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -105,10 +105,10 @@ how your application can retrieve access tokens from the SDK and pass already ac The SDK provides a mechanism to expose the access token and refresh token that it acquires to your application for use in future requests. This would prevent the SDK from making a new token request with each `GraphServiceClient` your application instantiates. It also allows your application to prevent its users from signing in with each request within a session. -By default, a `GraphServiceClient` instance caches access tokens in a built-in [`InMemoryAccessTokenCache`](https://github.com/microsoft/kiota-authentication-phpleague-php/blob/dev/src/Cache/InMemoryAccessTokenCache.php). The cache will be populated with a PHPLeague [`AccessToken`](https://github.com/thephpleague/oauth2-client/blob/master/src/Token/AccessToken.php) object which carries both the `access_token`, its expiry and a `refresh_token` if available. When the `GraphServiceClient` instance is re-used for a request with the same user/application, the in-memory cache is checked for a valid token otherwise a new token request is made. +By default, a `GraphServiceClient` instance caches access tokens in a built-in [`InMemoryAccessTokenCache`](https://github.com/microsoft/kiota-authentication-phpleague-php/blob/main/src/Cache/InMemoryAccessTokenCache.php). The cache will be populated with a PHPLeague [`AccessToken`](https://github.com/thephpleague/oauth2-client/blob/master/src/Token/AccessToken.php) object which carries both the `access_token`, its expiry and a `refresh_token` if available. When the `GraphServiceClient` instance is re-used for a request with the same user/application, the in-memory cache is checked for a valid token otherwise a new token request is made. However, to get the cached token that the SDK requests for a user/application you -can initialise an `InMemoryAccessTokenCache` or pass a custom implementation of the [`AccessTokenCache`](https://github.com/microsoft/kiota-authentication-phpleague-php/blob/dev/src/Cache/AccessTokenCache.php) interface and pass it as a parameter when initialising the `GraphServiceClient`. The two approaches are outlined below: +can initialise an `InMemoryAccessTokenCache` or pass a custom implementation of the [`AccessTokenCache`](https://github.com/microsoft/kiota-authentication-phpleague-php/blob/main/src/Cache/AccessTokenCache.php) interface and pass it as a parameter when initialising the `GraphServiceClient`. The two approaches are outlined below: ### Using an InMemoryAccessTokenCache instance @@ -146,7 +146,7 @@ $accessToken = $inMemoryCache->getTokenWithContext($tokenRequestContext); ### Using a custom AccessTokenCache implementation -A custom [`AccessTokenCache`](https://github.com/microsoft/kiota-authentication-phpleague-php/blob/dev/src/Cache/AccessTokenCache.php) interface implementation can also be provided. After the request, the SDK persists the token in the +A custom [`AccessTokenCache`](https://github.com/microsoft/kiota-authentication-phpleague-php/blob/main/src/Cache/AccessTokenCache.php) interface implementation can also be provided. After the request, the SDK persists the token in the custom cache via the `persistAccessToken()` method. By default, the SDK adds a unique cache key/identifier to a `TokenRequestContext` that uniquely identifies the tenant, client and user (if applicable). @@ -166,9 +166,9 @@ $accessToken = $customCache->getAccessToken($tokenRequestContext->getCacheKey()) ### Initializing a GraphServiceClient with an access token For applications that already have built-in mechanisms to fetch and refresh access tokens, the SDK supports passing these tokens to a `GraphServiceClient` by initializing -a client using an [`AccessTokenCache`](https://github.com/microsoft/kiota-authentication-phpleague-php/blob/dev/src/Cache/AccessTokenCache.php) interface implementation. +a client using an [`AccessTokenCache`](https://github.com/microsoft/kiota-authentication-phpleague-php/blob/main/src/Cache/AccessTokenCache.php) interface implementation. -The SDK provides a built-in implementation of this interface via an [`InMemoryAccessTokenCache`](https://github.com/microsoft/kiota-authentication-phpleague-php/blob/dev/src/Cache/InMemoryAccessTokenCache.php). +The SDK provides a built-in implementation of this interface via an [`InMemoryAccessTokenCache`](https://github.com/microsoft/kiota-authentication-phpleague-php/blob/main/src/Cache/InMemoryAccessTokenCache.php). This is also useful when re-using a previously retrieved access token for a signed-in user during a previous request. @@ -381,7 +381,7 @@ while ($pageIterator->hasNext()) { ## Use a Custom Response Handler / Get the raw HTTP response -Define a response handler that implements the [Response Handler interface](https://github.com/microsoft/kiota-abstractions-php/blob/dev/src/ResponseHandler.php) and pass it into the request using the request options. +Define a response handler that implements the [Response Handler interface](https://github.com/microsoft/kiota-abstractions-php/blob/main/src/ResponseHandler.php) and pass it into the request using the request options. The SDK provides a default asynchronous response handler which returns a promise that resolves to a raw HTTP response.