Provides low-level interfaces and helper methods for authentication in Azure SDK
Overall
score
97%
{
"context": "This criteria evaluates how effectively an engineer uses the @azure/core-auth package, specifically the TokenCredential interface and AccessToken structure, to implement a token caching service. The focus is on proper use of token retrieval, expiration handling, and scope management.",
"type": "weighted_checklist",
"checklist": [
{
"name": "TokenCredential usage",
"description": "Correctly uses the TokenCredential interface by calling the getToken() method to obtain tokens from the underlying credential.",
"max_score": 20
},
{
"name": "AccessToken structure",
"description": "Properly works with the AccessToken interface, accessing the token string, expiresOnTimestamp, and refreshAfterTimestamp properties to manage cached tokens.",
"max_score": 20
},
{
"name": "Token expiration",
"description": "Correctly implements token expiration logic by comparing current time with the expiresOnTimestamp property from AccessToken to determine if a token has expired.",
"max_score": 15
},
{
"name": "Proactive refresh",
"description": "Implements proactive token refresh by checking the refreshAfterTimestamp property from AccessToken and obtaining fresh tokens when the refresh threshold is exceeded but token hasn't expired.",
"max_score": 15
},
{
"name": "Scope handling",
"description": "Properly handles both single scope strings and arrays of scopes by passing them correctly to TokenCredential.getToken(), which accepts string | string[] parameter.",
"max_score": 10
},
{
"name": "Scope normalization",
"description": "Implements proper cache key generation by normalizing scopes (e.g., sorting and joining arrays) to ensure consistent cache lookups for the same set of scopes regardless of order.",
"max_score": 10
},
{
"name": "Null handling",
"description": "Correctly handles null return values from TokenCredential.getToken() by returning null and not caching failed token requests.",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-azure--core-authdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10