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

task.mdevals/scenario-1/

Azure SAS Configuration Manager

A utility module for managing Azure Shared Access Signature (SAS) credentials with rotation support for cloud storage operations.

Capabilities

SAS Credential Initialization

  • It creates a credential with a valid SAS token @test
  • It throws an error when initialized with an empty signature @test

SAS Token Access

  • It provides read access to the current signature @test
  • It returns the correct signature value after initialization @test

SAS Credential Rotation

  • It updates the credential with a new signature @test
  • It reflects the new signature value after rotation @test
  • It throws an error when rotating to an empty signature @test

Type Validation

  • It correctly identifies valid SAS credentials @test
  • It returns false for non-SAS credential objects @test

Implementation

@generates

API

/**
 * Creates and manages an Azure SAS credential with rotation capabilities
 */
export class SASManager {
  /**
   * Creates a new SAS manager with the provided signature
   * @param signature - The initial SAS token
   */
  constructor(signature: string);

  /**
   * Gets the current SAS credential
   * @returns The managed credential instance
   */
  getCredential(): unknown;

  /**
   * Gets the current signature value
   * @returns The current SAS token string
   */
  getSignature(): string;

  /**
   * Rotates to a new SAS signature
   * @param newSignature - The new SAS token
   */
  rotateSignature(newSignature: string): void;

  /**
   * Validates if an object is a valid SAS credential
   * @param credential - The object to validate
   * @returns True if the object is a valid SAS credential
   */
  static isValidCredential(credential: unknown): boolean;
}

Dependencies { .dependencies }

@azure/core-auth { .dependency }

Provides authentication primitives for Azure services.

Install with Tessl CLI

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

tile.json