CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-azure--core-auth

Provides low-level interfaces and helper methods for authentication in Azure SDK

Overall
score

97%

Overview
Eval results
Files

rubric.jsonevals/scenario-4/

{
  "context": "This criteria evaluates how well the engineer uses @azure/core-auth's token expiration tracking capabilities to implement a token cache manager. The focus is on correctly using the AccessToken interface's expiresOnTimestamp and refreshAfterTimestamp fields to manage token lifecycle and caching logic.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "AccessToken interface usage",
      "description": "Uses the AccessToken interface from @azure/core-auth with token, expiresOnTimestamp, and optional refreshAfterTimestamp properties",
      "max_score": 15
    },
    {
      "name": "TokenCredential interface usage",
      "description": "Uses the TokenCredential interface from @azure/core-auth with getToken() method that returns Promise<AccessToken | null>",
      "max_score": 10
    },
    {
      "name": "Expiration checking",
      "description": "Correctly compares Date.now() with expiresOnTimestamp to determine if a cached token has expired (current time >= expiresOnTimestamp means expired)",
      "max_score": 20
    },
    {
      "name": "Proactive refresh logic",
      "description": "Correctly checks refreshAfterTimestamp when present and fetches a fresh token when current time >= refreshAfterTimestamp, even if the token hasn't expired",
      "max_score": 25
    },
    {
      "name": "Cache hit optimization",
      "description": "Returns cached token without calling credential.getToken() when the token is valid (current time < expiresOnTimestamp and either no refreshAfterTimestamp or current time < refreshAfterTimestamp)",
      "max_score": 15
    },
    {
      "name": "Scope-based caching",
      "description": "Implements separate caching for different scopes, treating single string scope and array of scopes correctly by using a normalized cache key",
      "max_score": 10
    },
    {
      "name": "Token retrieval",
      "description": "Calls credential.getToken() to fetch new tokens when cache misses or tokens need refresh, passing the scopes parameter correctly",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-azure--core-auth

tile.json