mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 11:27:50 +08:00
feat: refactor authentication handling to use new ApiAuthModel and update related components
This commit is contained in:
@@ -12,11 +12,9 @@ _$RequestModelImpl _$$RequestModelImplFromJson(Map json) => _$RequestModelImpl(
|
||||
APIType.rest,
|
||||
name: json['name'] as String? ?? "",
|
||||
description: json['description'] as String? ?? "",
|
||||
authType: $enumDecodeNullable(_$APIAuthTypeEnumMap, json['authType']) ??
|
||||
APIAuthType.none,
|
||||
authData: json['authData'] == null
|
||||
? null
|
||||
: APIAuthModel.fromJson(
|
||||
? const ApiAuthModel(type: APIAuthType.none)
|
||||
: ApiAuthModel.fromJson(
|
||||
Map<String, dynamic>.from(json['authData'] as Map)),
|
||||
requestTabIndex: json['requestTabIndex'] ?? 0,
|
||||
httpRequestModel: json['httpRequestModel'] == null
|
||||
@@ -43,7 +41,6 @@ Map<String, dynamic> _$$RequestModelImplToJson(_$RequestModelImpl instance) =>
|
||||
'apiType': _$APITypeEnumMap[instance.apiType]!,
|
||||
'name': instance.name,
|
||||
'description': instance.description,
|
||||
'authType': _$APIAuthTypeEnumMap[instance.authType]!,
|
||||
'authData': instance.authData?.toJson(),
|
||||
'httpRequestModel': instance.httpRequestModel?.toJson(),
|
||||
'responseStatus': instance.responseStatus,
|
||||
@@ -57,14 +54,3 @@ const _$APITypeEnumMap = {
|
||||
APIType.rest: 'rest',
|
||||
APIType.graphql: 'graphql',
|
||||
};
|
||||
|
||||
const _$APIAuthTypeEnumMap = {
|
||||
APIAuthType.none: 'none',
|
||||
APIAuthType.basic: 'basic',
|
||||
APIAuthType.apiKey: 'apiKey',
|
||||
APIAuthType.bearerToken: 'bearerToken',
|
||||
APIAuthType.jwtBearer: 'jwtBearer',
|
||||
APIAuthType.digest: 'digest',
|
||||
APIAuthType.oauth1: 'oauth1',
|
||||
APIAuthType.oauth2: 'oauth2',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user