import { EntityId, IsoDatetime, Username, Email } from '../Foundations';
export declare type CreateApplicationResponse = {
    appId: EntityId;
    apiToken?: Jwt;
};
export declare type GenericSuccessMessage = {
    message: string;
};
export declare type CreateUserRegistrationResponse = {
    credential: UserCredentialInformation;
    user: UserRegistrationInformation;
};
export declare type CreateUserRegistrationChallengeResponse = {
    temporaryAuthenticationToken: Jwt;
    rp: RelyingParty;
    user: AuthenticationUserInformation;
    supportedCredentialKinds: SupportedCredentialKinds;
    otpUrl: string;
    challenge: string;
    authenticatorSelection: AuthenticatorSelection;
    attestation: AuthenticatorAttestationOptions;
    pubKeyCredParams: PubKeyCredParams[];
    excludeCredentials: AllowCredential[];
};
export declare type CreateUserLoginChallengeResponse = {
    supportedCredentialKinds: SupportedCredentials[];
    challenge: string;
    challengeIdentifier: Jwt;
    externalAuthenticationUrl: string;
    allowCredentials: AllowCredentials;
};
export declare type CreateUserLoginResponse = {
    token: Jwt;
};
export declare type CreateUserActionSignatureResponse = {
    userAction: string;
};
export declare type AccessTokenInfoWithPublicKey = {
    tokenId: EntityId;
    kind: AccessTokenKind;
    orgId: EntityId;
    permissions: string[];
    scopes: string[];
    name: string;
    linkedUserId: EntityId;
    publicKey: string;
    credId: string;
    creationDate: IsoDatetime;
    isActive: boolean;
};
export declare type UserInfo = {
    username: string;
    userId: EntityId;
    kind: UserAuthKind;
    credentialUuid: EntityId;
    orgId: EntityId;
    permissions?: string[];
    scopes?: string[];
    isActive: boolean;
    isServiceAccount: boolean;
    isRegistered: boolean;
};
export declare type UserAccessTokenInformation = {
    userInfo: UserInfo;
    accessTokens: AccessTokenInfoWithPublicKey[];
};
export declare type AppInfoWithPublicKey = {
    appId: EntityId;
    kind: ApplicationKind;
    credentialUuid: EntityId;
    orgId: EntityId;
    tokenHash?: string;
    permissions: string[];
    scopes: string[];
    expectedRpId: string;
    name: string;
    isActive: boolean;
    publicKey: string;
    credId: string;
    expectedOrigin: string;
};
export declare type CredentialInfo = {
    credentialId: string;
    credentialUuid: EntityId;
    dateCreated: IsoDatetime;
    isActive: boolean;
    kind: CredentialKind;
    name: string;
    publicKey?: string;
    relyingPartyId: string;
    origin: string;
};
export declare type CreateAvailableOrgListResponse = {
    /**
     * The ID of the organization.
     */
    orgId: EntityId;
    /**
     * The ID of an application that can be used to log into the given org.
     */
    appId: EntityId;
};
export declare type UserRegistrationBase = {
    temporaryAuthenticationToken: Jwt;
    rp: RelyingParty;
    user: AuthenticationUserInformation;
};
export declare type Fido2Options = {
    temporaryAuthenticationToken: Jwt;
    rp: RelyingParty;
    user: AuthenticationUserInformation;
    kind: CredentialKind.Fido2;
    challenge: string;
    excludeCredentials: ExcludeCredentials[];
    authenticatorSelection: AuthenticatorSelection;
    /**
     * Tells the authenticator that it needs to identify itself to the server, so that the server can verify the device is secure.
     *
     * none: Tells the authenticator that it does not need to provide an attestation document.
     *
     * indirect: Tells the authenticator, that it needs to provide attestation information, but it doesn't need to provide any identifying information about the device.
     *
     * direct: Tells the authenticator, that it needs to provide attestation information, including information to identify the device.
     *
     * enterprise: Tells the authenticator, that it should use enterprise certificates configured on the device for the credentials. For example, smart cards can be supported on Fido2 devices if an enterprise certificate is registered on the device.
     */
    attestation: AuthenticatorAttestationOptions;
    pubKeyCredParams: PubKeyCredParams[];
};
export declare type PublicKeyOptions = {
    temporaryAuthenticationToken: Jwt;
    rp: RelyingParty;
    user: AuthenticationUserInformation;
    kind: CredentialKind.Key;
    challenge: string;
    pubKeyCredParams: PubKeyCredParams[];
    attestation: AuthenticatorAttestationOptions;
};
export declare type AllowCredential = {
    /**
     * Must be 'public-key'
     */
    type: string;
    id: string;
    transports?: string;
};
export declare type RelyingParty = {
    id: string;
    name: string;
};
export declare type AuthenticationUserInformation = {
    id: EntityId;
    displayName: string;
    name: string;
};
export declare type PubKeyCredParams = {
    /**
     * Must be 'public-key'
     */
    type: string;
    alg: number;
};
export declare type AuthenticatorSelection = {
    /**
     * If not given, any authenticator type can be used.
     *
     * platform: Authenticator must be built into the system. For example, Windows Hello or Apple Touch ID use a TPM that are integrated into the system.
     *
     * cross-platform: Authenticator must be able to move between systems. For example, a yubikey is a USB device that can be plugged into any system.
     */
    authenticatorAttachment?: string;
    /**
     * discouraged: This tells the authenticator to not use resident keys.
     *
     * preferred: This tells the authenticator that resident keys should be used if available.
     *
     * required: This tells the authenticator that a resident key is required.
     */
    residentKey: AuthenticatorRequirementOptions;
    requireResidentKey: boolean;
    /**
     * Required: Tells the authenticator that the user needs to verify they are in possession of the authenticator device. This usually means the user is prompted for a pin, passcode, or to complete a biometric challenge.
     *
     * Preferred: Tells the authenticator that the user should be asked to verify they are in possession of the authenticator device. This usually means the user is prompted for a pin, passcode, or to complete a biometric challenge.
     * If the user has recently verified their possession the device may choose not to ask the user to verify again.
     *
     * Discouraged: Tells the authenticator that the user should not be prompted for possession. This is generally only used when WebAuthn is a second factor.
     */
    userVerification: AuthenticatorRequirementOptions;
};
export declare type ExcludeCredentials = {
    /**
     * Must be 'public-key'
     */
    type: string;
    id: string;
    transports: FidoCredentialsTransportKind;
};
export declare type UserCredentialInformation = {
    uuid: EntityId;
    kind: CredentialKind;
    name: string;
};
export declare type UserRegistrationInformation = {
    id: EntityId;
    username: string;
    orgId: EntityId;
};
export declare type AuthenticateUserPasswordInput = {
    kind: CredentialKind.Password;
    password: string;
};
export declare type AuthenticateUserFido2Input = {
    kind: CredentialKind.Fido2;
    credentialAssertion: Fido2CredentialAssertion;
};
export declare type Fido2CredentialAssertion = {
    credId: string;
    clientData: string;
    authenticatorData: string;
    signature: string;
    userHandle: string;
};
export declare type KeyCredentialAssertion = {
    credId: string;
    clientData: string;
    signature: string;
};
export declare type AuthenticateUserKeyInput = {
    kind: CredentialKind.Key;
    credentialAssertion: KeyCredentialAssertion;
};
export declare type CreateServerSideAppInput = {
    appName: string;
    scopes?: string[];
    permissions?: string[];
    kind: UserKind.Application;
    expectedRpId: string;
    expectedOrigin: string;
    appKind: ApplicationKind.ServerSideApplication;
    publicKey: string;
};
export declare type CreateApplicationAppInputBase = {
    appName: string;
    scopes?: string[];
    permissions?: string[];
    kind: UserKind.Application;
    expectedRpId: string;
    expectedOrigin: string;
};
export declare type CreateApplicationInputBase = {
    appName: string;
    scopes?: string[];
    permissions?: string[];
};
export declare type CreateClientSideAppInput = {
    appName: string;
    scopes?: string[];
    permissions?: string[];
    kind: UserKind.Application;
    expectedRpId: string;
    expectedOrigin: string;
    appKind: ApplicationKind.ClientSideApplication;
};
export declare type CreateServiceAccountInput = {
    appName: string;
    scopes?: string[];
    permissions?: string[];
    kind: UserKind.ServiceAccount;
    publicKey: string;
};
export declare type CreatePatInput = {
    appName: string;
    scopes?: string[];
    permissions?: string[];
    kind: UserKind.Pat;
    publicKey: string;
};
export declare type SupportedCredentialKinds = {
    firstFactor: CredentialKind[];
    secondFactor: CredentialKind[];
};
export declare type RegistrationConfirmationFido2 = {
    credentialKind: CredentialKind.Fido2;
    credentialInfo: CredentialAssertion;
};
export declare type RegistrationConfirmationKey = {
    credentialKind: CredentialKind.Key;
    credentialInfo: CredentialAssertion;
};
export declare type CredentialAssertion = {
    credId: string;
    clientData: string;
    attestationData: string;
};
export declare type RegistrationConfirmationPassword = {
    credentialKind: CredentialKind.Password;
    credentialInfo: PasswordCredentialInformation;
};
export declare type PasswordCredentialInformation = {
    password: string;
};
export declare type RegistrationConfirmationTotp = {
    credentialKind: CredentialKind.Totp;
    credentialInfo: TotpCredentialInformation;
};
export declare type TotpCredentialInformation = {
    otpCode: string;
};
export declare type AllowCredentials = {
    webauthn: AllowCredential[];
    key: AllowCredential[];
};
export declare type SupportedCredentials = {
    kind: CredentialKind;
    factor: CredentialFactor;
    requiresSecondFactor: boolean;
};
export declare type AuthenticateUserTotpInput = {
    kind: CredentialKind.Totp;
    otpCode: string;
};
export declare type CreateTotpCredentialResponse = {
    temporaryAuthenticationToken: Jwt;
    rp: RelyingParty;
    user: AuthenticationUserInformation;
    kind: CredentialKind.Totp;
    otpUrl: string;
};
export declare type CreatePasswordCredentialResponse = {
    temporaryAuthenticationToken: Jwt;
    rp: RelyingParty;
    user: AuthenticationUserInformation;
    kind: CredentialKind.Password;
};
export declare type CreateUserCredentialInputBase = {
    challengeIdentifier: Jwt;
    credentialName: string;
};
export declare type CreateUserCredentialTotpInput = {
    challengeIdentifier: Jwt;
    credentialName: string;
    credentialKind: CredentialKind.Totp;
    credentialInfo: TotpCredentialInformation;
};
export declare type CreateUserCredentialPasswordInput = {
    credentialKind: CredentialKind.Password;
    credentialInfo: PasswordCredentialInformation;
    challengeIdentifier: Jwt;
    credentialName: string;
};
export declare type CreateUserCredentialPublicKeyInput = {
    challengeIdentifier: Jwt;
    credentialName: string;
    credentialKind: CredentialKind.Key;
    credentialInfo: CredentialAssertion;
};
export declare type CreateUserCredentialFido2Input = {
    credentialKind: CredentialKind.Fido2;
    credentialInfo: CredentialAssertion;
    challengeIdentifier: Jwt;
    credentialName: string;
};
export declare type HttpRequestInformation = {
    method: string;
    scheme: string;
    authority: string;
    path: string;
};
export declare type LegacyAuthAttestation = {
    token: Jwt;
    decodedToken: DecodedJwt;
    authIdentity: AuthIdentity;
};
export declare type OrgEmployeeIdentity = {
    kind: AuthIdentityKind.OrgEmployeeIdentity;
    orgId: EntityId;
    employeeId: EntityId;
    username: Username;
    isOrgOwner: boolean;
    scope: string;
    permissions: string[];
};
export declare type OrgApiKeyIdentity = {
    kind: AuthIdentityKind.OrgApiKeyIdentity;
    orgId: EntityId;
    apiKeyId: EntityId;
    scope: string;
    permissions: string[];
};
export declare type DfnsStaffIdentity = {
    kind: AuthIdentityKind.DfnsStaffIdentity;
    username: Username;
    scope: string;
    permissions: string[];
};
export declare type DfnsServiceIdentity = {
    kind: AuthIdentityKind.DfnsServiceIdentity;
    serviceName: string;
};
export declare type SignedAuthAttestation = {
    authBlock: AuthBlock;
};
export declare type JwtHeader = {
    alg?: string;
    b64?: boolean;
    kid?: string;
    typ?: string;
};
export declare type DecodedJwt = {
    payload: JwtPayload;
    header: JwtHeader;
};
export declare type AuthBlock = {
    request: Jwt;
    auth: Jwt;
};
export declare type Jwt = string;
export declare type JwtPayload = Record<string, unknown>;
export declare type CreateUserActionSignatureChallengeInput = {
    /**
     * Human readable explanation of the activity, so that person can understand what is being signed.
     */
    userActionPayload: string;
    userActionHttpMethod: string;
    userActionHttpPath: string;
    userActionServerKind?: ServerKind;
};
export declare type CreateDelegatedUserLoginInput = {
    username: string;
};
export declare type ActivateApplicationInput = {
    appId: EntityId;
};
export declare type CreateUserInput = {
    email: string;
    kind: UserAuthKind;
    publicKey: string;
    scopes?: string[];
    permissions?: string[];
};
export declare type CreateUserRegistrationChallengeInput = {
    username: string;
    registrationCode: string;
    orgId: EntityId;
};
export declare type CreateUserRegistrationInput = {
    firstFactorCredential: RegistrationFirstFactor;
    secondFactorCredential?: RegistrationSecondFactor;
};
export declare type CreateUserLoginChallengeInput = {
    username: string;
    orgId: EntityId;
};
export declare type CreateUserLoginInput = {
    challengeIdentifier: Jwt;
    firstFactor: AuthenticateUserFirstFactor;
    secondFactor?: AuthenticateUserSecondFactor;
};
export declare type ActivateUserInput = {
    userId: EntityId;
};
export declare type CreateUserCredentialChallengeInput = {
    kind: CredentialKind;
};
export declare type ActivateCredentialInput = {
    credentialUuid: EntityId;
};
export declare type CreateSignedAuthAttestationInput = {
    body?: string;
    headers: Record<string, string>;
    isBase64Encoded: boolean;
    http: HttpRequestInformation;
};
export declare type CreateCodeLoginChallengeInput = {
    code: string;
};
export declare type CreateUserLoginFromCodeInput = {
    challengeIdentifier: Jwt;
};
export declare type CreateOrgOwnerInput = {
    email: Email;
    publicKey?: string;
    orgId: EntityId;
    authBlock: AuthBlock;
};
export declare type CreateAvailableOrgListInput = {
    /**
     * The username of the user that is logging into the system.
     */
    username: Username;
    /**
     * If specified, the API will return only the matching application for the given org ID. This would be used when the user has already given the org they want to log into, but the caller doesn't know the Auth V2 Application ID to use.
     */
    orgId?: EntityId;
    /**
     * A list of permission names that the caller will be using in their application.
     *
     * If the list is not empty, the API will attempt to find an Auth V2 Application that has the majority of the permissions provided.
     *
     * If the list is empty or not provided, the API will select the Auth V2 Application with the largest set of permissions.
     */
    permissions?: string[];
    /**
     * The origin (scheme, hostname, and port) of the server where the request is originating. For example: https://dashboard.dfns.io
     *
     * The API will only return orgs that have a Auth V2 Application with a matching origin.
     */
    origin: string;
};
export declare type CreateApplicationInput = CreateServerSideAppInput | CreateClientSideAppInput | CreateServiceAccountInput | CreatePatInput;
export declare type CreateUserCredentialInput = CreateUserCredentialTotpInput | CreateUserCredentialPasswordInput | CreateUserCredentialPublicKeyInput | CreateUserCredentialFido2Input;
export declare type CreateUserCredentialChallengeResponse = Fido2Options | PublicKeyOptions | CreateTotpCredentialResponse | CreatePasswordCredentialResponse;
export declare type CreateSignedAuthAttestationResponse = LegacyAuthAttestation | SignedAuthAttestation;
export declare type RegistrationFirstFactor = RegistrationConfirmationFido2 | RegistrationConfirmationKey | RegistrationConfirmationPassword;
export declare type RegistrationSecondFactor = RegistrationConfirmationFido2 | RegistrationConfirmationKey | RegistrationConfirmationTotp;
export declare type AuthenticateUserFirstFactor = AuthenticateUserPasswordInput | AuthenticateUserFido2Input | AuthenticateUserKeyInput;
export declare type AuthenticateUserSecondFactor = AuthenticateUserFido2Input | AuthenticateUserKeyInput | AuthenticateUserTotpInput;
export declare type AuthIdentity = OrgEmployeeIdentity | OrgApiKeyIdentity | DfnsStaffIdentity | DfnsServiceIdentity;
export declare enum CredentialKind {
    Fido2 = "Fido2",
    Key = "Key",
    Password = "Password",
    Totp = "Totp"
}
export declare enum UserKind {
    CustomerEmployee = "CustomerEmployee",
    DfnsStaff = "DfnsStaff",
    EndUser = "EndUser",
    Pat = "Pat",
    Application = "Application",
    ServiceAccount = "ServiceAccount"
}
export declare enum AuthenticatorRequirementOptions {
    required = "required",
    preferred = "preferred",
    discouraged = "discouraged"
}
export declare enum AuthenticatorAttestationOptions {
    none = "none",
    indirect = "indirect",
    direct = "direct",
    enterprise = "enterprise"
}
export declare enum ApplicationKind {
    ServerSideApplication = "ServerSideApplication",
    ClientSideApplication = "ClientSideApplication"
}
export declare enum FidoCredentialsTransportKind {
    usb = "usb",
    nfc = "nfc",
    ble = "ble",
    internal = "internal",
    hybrid = "hybrid"
}
export declare enum CredentialFactor {
    first = "first",
    second = "second",
    either = "either"
}
export declare enum ServerKind {
    Api = "Api",
    Staff = "Staff"
}
export declare enum AccessTokenKind {
    ServiceAccount = "ServiceAccount",
    Pat = "Pat"
}
export declare enum UserAuthKind {
    EndUser = "EndUser",
    CustomerEmployee = "CustomerEmployee",
    DfnsStaff = "DfnsStaff"
}
export declare enum AuthIdentityKind {
    DfnsStaffIdentity = "DfnsStaffIdentity",
    OrgEmployeeIdentity = "OrgEmployeeIdentity",
    OrgApiKeyIdentity = "OrgApiKeyIdentity",
    DfnsServiceIdentity = "DfnsServiceIdentity"
}
