Skip to content

BLACK4585/2FAuth-Dart-API-Client

Repository files navigation

openapi

This is the definition (following OpenAPI 3.1 specification) of the REST API of 2FAuth, a web app to manage your Two-Factor Authentication (2FA) accounts and generate their security passwords.

The API is available once you installed 2FAuth on your server.

This Dart package is automatically generated by the OpenAPI Generator project:

  • API version: 1.3.0
  • Generator version: 7.4.0
  • Build package: org.openapitools.codegen.languages.DartClientCodegen For more information, please visit https://github.com/Bubka

Requirements

Dart 2.12 or later

Installation & Usage

Github

If this Dart package is published to Github, add the following dependency to your pubspec.yaml

dependencies:
  openapi:
    git: https://github.com/BLACK4585/2FAuth-Dart-API-Client.git

Local

To use the package in your local drive, add the following dependency to your pubspec.yaml

dependencies:
  openapi:
    path: /path/to/openapi

This package is used for the 2FAuth mobile app by me.

Tests

TODO

Getting Started

Please follow the installation procedure and then run the following:

import 'package:openapi/api.dart';

// TODO Configure HTTP Bearer authorization: Bearer-Auth
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('Bearer-Auth').setAccessToken(yourTokenGeneratorFunction);

final api_instance = GroupsApi();
final id = 1; // int | The ID of the resource

try {
    api_instance.deleteGroupsId(id);
} catch (e) {
    print('Exception when calling GroupsApi->deleteGroupsId: $e\n');
}

Documentation for API Endpoints

All URIs are relative to https://demo.2fauth.app

Class Method HTTP request Description
GroupsApi deleteGroupsId DELETE /api/v1/groups/{id} Delete group
GroupsApi getGroups GET /api/v1/groups Get all groups
GroupsApi getGroupsId GET /api/v1/groups/{id} Find group by ID
GroupsApi getGroupsIdTwofaccounts GET /api/v1/groups/{id}/twofaccounts Get all 2FA accounts of a group
GroupsApi postGroups POST /api/v1/groups Create Group
GroupsApi postGroupsIdAssign POST /api/v1/groups/{id}/assign Add 2FA accounts to a group
GroupsApi putGroupsId PUT /api/v1/groups/{id} Update group
IconsApi deleteIconsFilename DELETE /api/v1/icons/{filename} Delete an icon
IconsApi postIcons POST /api/v1/icons Upload an icon
OneTimePasswordApi getTwofaccountsIdOtp GET /api/v1/twofaccounts/{id}/otp Get a One-Time password
OneTimePasswordApi postTwofaccountsOtp POST /api/v1/twofaccounts/otp Get a One-Time password
QrcodeApi getTwofaccountsIdQrcode GET /api/v1/twofaccounts/{id}/qrcode Encode a 2FA account in a QR code
QrcodeApi postQrcodeDecode POST /api/v1/qrcode/decode Decode a QR code
SettingsApi deleteSettingsName DELETE /api/v1/settings/{name} Delete custom setting
SettingsApi getSettings GET /api/v1/settings Get all settings
SettingsApi getSettingsName GET /api/v1/settings/{name} Find setting by name
SettingsApi postSettings POST /api/v1/settings Create custom setting
SettingsApi putSettingsName PUT /api/v1/settings/{name} Update setting
TwofaccountsApi deleteTwofaccounts DELETE /api/v1/twofaccounts Mass delete 2FA accounts
TwofaccountsApi deleteTwofaccountsId DELETE /api/v1/twofaccounts/{id} Delete 2FA account
TwofaccountsApi getGroupsIdTwofaccounts GET /api/v1/groups/{id}/twofaccounts Get all 2FA accounts of a group
TwofaccountsApi getTwofaccounts GET /api/v1/twofaccounts Get all 2FA accounts
TwofaccountsApi getTwofaccountsExport GET /api/v1/twofaccounts/export Export 2FA accounts
TwofaccountsApi getTwofaccountsId GET /api/v1/twofaccounts/{id} Find 2FA account by ID
TwofaccountsApi patchTwofaccountsWithdraw PATCH /api/v1/twofaccounts/withdraw Withdraw accounts from groups
TwofaccountsApi postTwofaccounts POST /api/v1/twofaccounts Create 2FA account
TwofaccountsApi postTwofaccountsMigration POST /api/v1/twofaccounts/migration Convert a migration resource
TwofaccountsApi postTwofaccountsPreview POST /api/v1/twofaccounts/preview Preview 2FA account
TwofaccountsApi postTwofaccountsReorder POST /api/v1/twofaccounts/reorder Save order of the 2FA accounts collection
TwofaccountsApi putTwofaccountsId PUT /api/v1/twofaccounts/{id} Update 2FA account
UserApi getUser GET /api/v1/user Get user
UserApi getUserName GET /api/v1/user/name Get user name
UserPreferenceApi getUserPreferences GET /api/v1/user/preferences Get all user preferences
UserPreferenceApi getUserPreferencesName GET /api/v1/user/preferences/{name} Find user preference by name
UserPreferenceApi putUserPreferencesName PUT /api/v1/user/preferences/{name} Update user preference
UsersApi deleteUsersId DELETE /api/v1/users/{id} Delete user
UsersApi deleteUsersIdCredentials DELETE /api/v1/users/{id}/credentials Revoke user's webauthn credentials
UsersApi deleteUsersIdPats DELETE /api/v1/users/{id}/pats Revoke user's personal access tokens
UsersApi getUsers GET /api/v1/users Get all registered users
UsersApi getUsersId GET /api/v1/users/{id} Find user by ID
UsersApi patchUsersIdPasswordReset PATCH /api/v1/users/{id}/password/reset Reset user password
UsersApi patchUsersIdPromote PATCH /api/v1/users/{id}/promote Promote user as administrator
UsersApi postUsers POST /api/v1/users Create user

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

Bearer-Auth

  • Type: HTTP Bearer authentication

Contact

This Dart package is generated by OpenAPI Generator project team (https://openapi-generator.tech) and maintained by BLACK. Please reach out to me if you have any questions or issues with this package.

The original author of the Product and API is Bubka, you can contact him here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published