microsoft / microsoft/kiota-php
Delegated Permission Cache Key
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 8
- Forks
- 10
- Avg merge
- 10h 16m
- Merged PRs (30d)
- 3
Description
The DelegatedPermissionTrait is missing the part of setting the cacheKey when the access token is null. According to the documentation, the cache key should be {tenantId}-{clientId} but is missing that part
Possible fix: Update the setCacheKey method with the proper fallback.
public function setCacheKey(?AccessToken $accessToken = null): void
{
if ($accessToken && $accessToken->getToken()) {
$uniqueIdentifier = hash("sha256", $accessToken->getToken());
$this->cacheKey = "{$this->getTenantId()}-{$this->getClientId()}-{$uniqueIdentifier}";
} else {
// If access is not provided fallback to default {tenantId}-{clientId}.
$this->cacheKey = "{$this->getTenantId()}-{$this->getClientId()}";
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate DelegatedPermissionTrait and its setCacheKey method. Compare the null-access-token behavior with the documented {tenantId}-{clientId} format, then verify that the cache key uses that fallback while retaining the token-based format when a token is present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authorization
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100