001/*
002 * Copyright 2026 Revetware LLC.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package com.revetsec.totp;
018
019import javax.annotation.concurrent.Immutable;
020
021/** Fixed, redacted application-visible reasons for rejected TOTP operations.
022 * @since 1.0.0 */
023@Immutable
024public enum TotpRejectionReason {
025    /** The input, binding or requested transition was not accepted. */
026    REJECTED,
027    /** The submitted code was invalid, expired or already consumed. */
028    INVALID_CODE,
029    /** No active factor exists for this account. */
030    NOT_ENROLLED,
031    /** Initial enrollment cannot replace an active factor. */
032    ALREADY_ENROLLED,
033    /** The pending enrollment was absent or expired. */
034    ENROLLMENT_NOT_FOUND,
035    /** A pending enrollment already exists or its generation changed. */
036    ENROLLMENT_CONFLICT,
037    /** The approved factor generation is no longer current. */
038    FACTOR_MISMATCH,
039    /** The approved recovery batch is no longer current. */
040    RECOVERY_BATCH_MISMATCH,
041    /** The server-owned operation or browser binding did not match. */
042    BINDING_MISMATCH
043}