mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 02:39:19 +08:00
feat: update APIAuthType enum to include display types for authentication options
This commit is contained in:
@@ -55,17 +55,10 @@ class EditAuthType extends ConsumerWidget {
|
|||||||
height: 8,
|
height: 8,
|
||||||
),
|
),
|
||||||
ADPopupMenu<APIAuthType>(
|
ADPopupMenu<APIAuthType>(
|
||||||
value: currentAuthType.name.capitalize(),
|
value: currentAuthType.displayType,
|
||||||
values: const [
|
values: APIAuthType.values
|
||||||
(APIAuthType.none, 'None'),
|
.map((type) => (type, type.displayType))
|
||||||
(APIAuthType.basic, 'Basic'),
|
.toList(),
|
||||||
(APIAuthType.apiKey, 'API Key'),
|
|
||||||
(APIAuthType.bearer, 'Bearer'),
|
|
||||||
(APIAuthType.jwt, 'JWT'),
|
|
||||||
(APIAuthType.digest, 'Digest'),
|
|
||||||
(APIAuthType.oauth1, 'OAuth 1.0'),
|
|
||||||
(APIAuthType.oauth2, 'OAuth 2.0'),
|
|
||||||
],
|
|
||||||
tooltip: "Select Authentication Type",
|
tooltip: "Select Authentication Type",
|
||||||
isOutlined: true,
|
isOutlined: true,
|
||||||
onChanged: readOnly
|
onChanged: readOnly
|
||||||
@@ -92,6 +85,7 @@ class EditAuthType extends ConsumerWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildAuthFields(
|
Widget _buildAuthFields(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
WidgetRef ref,
|
WidgetRef ref,
|
||||||
|
|||||||
@@ -9,7 +9,19 @@ enum APIType {
|
|||||||
final String abbr;
|
final String abbr;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum APIAuthType { none, basic, apiKey, bearer, jwt, digest, oauth1, oauth2 }
|
enum APIAuthType {
|
||||||
|
none("None"),
|
||||||
|
basic("Basic Auth"),
|
||||||
|
apiKey("API Key"),
|
||||||
|
bearer("Bearer Token"),
|
||||||
|
jwt("JWT Bearer"),
|
||||||
|
digest("Digest Auth"),
|
||||||
|
oauth1("OAuth 1.0"),
|
||||||
|
oauth2("OAuth 2.0");
|
||||||
|
|
||||||
|
const APIAuthType(this.displayType);
|
||||||
|
final String displayType;
|
||||||
|
}
|
||||||
|
|
||||||
enum HTTPVerb {
|
enum HTTPVerb {
|
||||||
get("GET"),
|
get("GET"),
|
||||||
|
|||||||
Reference in New Issue
Block a user