LCOV - code coverage report
Current view: top level - lib/src/auth - agattp_auth_basic.dart (source / functions) Coverage Total Hit
Test: agattp Lines: 100.0 % 4 4
Test Date: 2025-01-28 00:11:13 Functions: - 0 0

            Line data    Source code
       1              : import 'dart:convert';
       2              : import 'dart:io';
       3              : 
       4              : import 'package:agattp/src/auth/agattp_abstract_auth.dart';
       5              : 
       6              : /// Implementation of the Basic Auth authentication strategy
       7              : class AgattpAuthBasic implements AgattpAuthInterface {
       8              :   /// The Basic Auth username
       9              :   final String username;
      10              : 
      11              :   /// The Basic Auth password
      12              :   final String password;
      13              : 
      14            1 :   const AgattpAuthBasic({
      15              :     required this.username,
      16              :     required this.password,
      17              :   });
      18              : 
      19            1 :   @override
      20            1 :   Future<Map<String, String>> getAuthHeaders(_, __) async => <String, String>{
      21              :     // Simply encode the username and password in base64
      22              :     HttpHeaders.authorizationHeader:
      23            6 :         'Basic ${base64.encode(utf8.encode('$username:$password'))}',
      24              :   };
      25              : }
        

Generated by: LCOV version 2.0-1