diff --git a/app/Protobuf/GPBMetadata/GoogleAuth.php b/app/Protobuf/GPBMetadata/GoogleAuth.php new file mode 100644 index 00000000..3e8e817b --- /dev/null +++ b/app/Protobuf/GPBMetadata/GoogleAuth.php @@ -0,0 +1,24 @@ +internalAddGeneratedFile(hex2bin( + "0af5050a10476f6f676c65417574682e70726f746f12176170702e50726f746f6275662e476f6f676c654175746822bf050a075061796c6f616412460a0e6f74705f706172616d657465727318012003280b322e2e6170702e50726f746f6275662e476f6f676c65417574682e5061796c6f61642e4f7470506172616d6574657273120f0a0776657273696f6e18022001280512120a0a62617463685f73697a6518032001280512130a0b62617463685f696e64657818042001280512100a0862617463685f69641805200128051a82020a0d4f7470506172616d6574657273120e0a0673656372657418012001280c120c0a046e616d65180220012809120e0a06697373756572180320012809123d0a09616c676f726974686d18042001280e322a2e6170702e50726f746f6275662e476f6f676c65417574682e5061796c6f61642e416c676f726974686d123b0a0664696769747318052001280e322b2e6170702e50726f746f6275662e476f6f676c65417574682e5061796c6f61642e4469676974436f756e7412360a047479706518062001280e32282e6170702e50726f746f6275662e476f6f676c65417574682e5061796c6f61642e4f747054797065120f0a07636f756e74657218072001280322790a09416c676f726974686d12190a15414c474f524954484d5f554e535045434946494544100012120a0e414c474f524954484d5f53484131100112140a10414c474f524954484d5f534841323536100212140a10414c474f524954484d5f534841353132100312110a0d414c474f524954484d5f4d4435100422550a0a4469676974436f756e74121b0a1744494749545f434f554e545f554e535045434946494544100012130a0f44494749545f434f554e545f534958100112150a1144494749545f434f554e545f4549474854100222490a074f74705479706512180a144f54505f545950455f554e535045434946494544100012110a0d4f54505f545950455f484f5450100112110a0d4f54505f545950455f544f54501002620670726f746f33" + ), true); + + static::$is_initialized = true; + } +} + diff --git a/app/Protobuf/GoogleAuth.proto b/app/Protobuf/GoogleAuth.proto new file mode 100644 index 00000000..c49d1675 --- /dev/null +++ b/app/Protobuf/GoogleAuth.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; + +package app.Protobuf.GoogleAuth; + +message Payload { + enum Algorithm { + ALGORITHM_UNSPECIFIED = 0; + ALGORITHM_SHA1 = 1; + ALGORITHM_SHA256 = 2; + ALGORITHM_SHA512 = 3; + ALGORITHM_MD5 = 4; + } + enum DigitCount { + DIGIT_COUNT_UNSPECIFIED = 0; + DIGIT_COUNT_SIX = 1; + DIGIT_COUNT_EIGHT = 2; + } + enum OtpType { + OTP_TYPE_UNSPECIFIED = 0; + OTP_TYPE_HOTP = 1; + OTP_TYPE_TOTP = 2; + } + message OtpParameters { + bytes secret = 1; + string name = 2; + string issuer = 3; + Algorithm algorithm = 4; + DigitCount digits = 5; + OtpType type = 6; + int64 counter = 7; + } + repeated OtpParameters otp_parameters = 1; + int32 version = 2; + int32 batch_size = 3; + int32 batch_index = 4; + int32 batch_id = 5; +} \ No newline at end of file diff --git a/app/Protobuf/GoogleAuth/Payload.php b/app/Protobuf/GoogleAuth/Payload.php new file mode 100644 index 00000000..73ed7588 --- /dev/null +++ b/app/Protobuf/GoogleAuth/Payload.php @@ -0,0 +1,166 @@ +app.Protobuf.GoogleAuth.Payload + */ +class Payload extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .app.Protobuf.GoogleAuth.Payload.OtpParameters otp_parameters = 1; + */ + private $otp_parameters; + /** + * Generated from protobuf field int32 version = 2; + */ + protected $version = 0; + /** + * Generated from protobuf field int32 batch_size = 3; + */ + protected $batch_size = 0; + /** + * Generated from protobuf field int32 batch_index = 4; + */ + protected $batch_index = 0; + /** + * Generated from protobuf field int32 batch_id = 5; + */ + protected $batch_id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \App\Protobuf\GoogleAuth\Payload\OtpParameters[]|\Google\Protobuf\Internal\RepeatedField $otp_parameters + * @type int $version + * @type int $batch_size + * @type int $batch_index + * @type int $batch_id + * } + */ + public function __construct($data = NULL) { + \App\Protobuf\GPBMetadata\GoogleAuth::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .app.Protobuf.GoogleAuth.Payload.OtpParameters otp_parameters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOtpParameters() + { + return $this->otp_parameters; + } + + /** + * Generated from protobuf field repeated .app.Protobuf.GoogleAuth.Payload.OtpParameters otp_parameters = 1; + * @param \App\Protobuf\GoogleAuth\Payload\OtpParameters[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOtpParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \App\Protobuf\GoogleAuth\Payload\OtpParameters::class); + $this->otp_parameters = $arr; + + return $this; + } + + /** + * Generated from protobuf field int32 version = 2; + * @return int + */ + public function getVersion() + { + return $this->version; + } + + /** + * Generated from protobuf field int32 version = 2; + * @param int $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkInt32($var); + $this->version = $var; + + return $this; + } + + /** + * Generated from protobuf field int32 batch_size = 3; + * @return int + */ + public function getBatchSize() + { + return $this->batch_size; + } + + /** + * Generated from protobuf field int32 batch_size = 3; + * @param int $var + * @return $this + */ + public function setBatchSize($var) + { + GPBUtil::checkInt32($var); + $this->batch_size = $var; + + return $this; + } + + /** + * Generated from protobuf field int32 batch_index = 4; + * @return int + */ + public function getBatchIndex() + { + return $this->batch_index; + } + + /** + * Generated from protobuf field int32 batch_index = 4; + * @param int $var + * @return $this + */ + public function setBatchIndex($var) + { + GPBUtil::checkInt32($var); + $this->batch_index = $var; + + return $this; + } + + /** + * Generated from protobuf field int32 batch_id = 5; + * @return int + */ + public function getBatchId() + { + return $this->batch_id; + } + + /** + * Generated from protobuf field int32 batch_id = 5; + * @param int $var + * @return $this + */ + public function setBatchId($var) + { + GPBUtil::checkInt32($var); + $this->batch_id = $var; + + return $this; + } + +} + diff --git a/app/Protobuf/GoogleAuth/Payload/Algorithm.php b/app/Protobuf/GoogleAuth/Payload/Algorithm.php new file mode 100644 index 00000000..29f42e02 --- /dev/null +++ b/app/Protobuf/GoogleAuth/Payload/Algorithm.php @@ -0,0 +1,66 @@ +app.Protobuf.GoogleAuth.Payload.Algorithm + */ +class Algorithm +{ + /** + * Generated from protobuf enum ALGORITHM_UNSPECIFIED = 0; + */ + const ALGORITHM_UNSPECIFIED = 0; + /** + * Generated from protobuf enum ALGORITHM_SHA1 = 1; + */ + const ALGORITHM_SHA1 = 1; + /** + * Generated from protobuf enum ALGORITHM_SHA256 = 2; + */ + const ALGORITHM_SHA256 = 2; + /** + * Generated from protobuf enum ALGORITHM_SHA512 = 3; + */ + const ALGORITHM_SHA512 = 3; + /** + * Generated from protobuf enum ALGORITHM_MD5 = 4; + */ + const ALGORITHM_MD5 = 4; + + private static $valueToName = [ + self::ALGORITHM_UNSPECIFIED => 'ALGORITHM_UNSPECIFIED', + self::ALGORITHM_SHA1 => 'ALGORITHM_SHA1', + self::ALGORITHM_SHA256 => 'ALGORITHM_SHA256', + self::ALGORITHM_SHA512 => 'ALGORITHM_SHA512', + self::ALGORITHM_MD5 => 'ALGORITHM_MD5', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Algorithm::class, \App\Protobuf\GoogleAuth\Payload_Algorithm::class); + diff --git a/app/Protobuf/GoogleAuth/Payload/DigitCount.php b/app/Protobuf/GoogleAuth/Payload/DigitCount.php new file mode 100644 index 00000000..7545fa66 --- /dev/null +++ b/app/Protobuf/GoogleAuth/Payload/DigitCount.php @@ -0,0 +1,56 @@ +app.Protobuf.GoogleAuth.Payload.DigitCount + */ +class DigitCount +{ + /** + * Generated from protobuf enum DIGIT_COUNT_UNSPECIFIED = 0; + */ + const DIGIT_COUNT_UNSPECIFIED = 0; + /** + * Generated from protobuf enum DIGIT_COUNT_SIX = 1; + */ + const DIGIT_COUNT_SIX = 1; + /** + * Generated from protobuf enum DIGIT_COUNT_EIGHT = 2; + */ + const DIGIT_COUNT_EIGHT = 2; + + private static $valueToName = [ + self::DIGIT_COUNT_UNSPECIFIED => 'DIGIT_COUNT_UNSPECIFIED', + self::DIGIT_COUNT_SIX => 'DIGIT_COUNT_SIX', + self::DIGIT_COUNT_EIGHT => 'DIGIT_COUNT_EIGHT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DigitCount::class, \App\Protobuf\GoogleAuth\Payload_DigitCount::class); + diff --git a/app/Protobuf/GoogleAuth/Payload/OtpParameters.php b/app/Protobuf/GoogleAuth/Payload/OtpParameters.php new file mode 100644 index 00000000..42aa40ce --- /dev/null +++ b/app/Protobuf/GoogleAuth/Payload/OtpParameters.php @@ -0,0 +1,223 @@ +app.Protobuf.GoogleAuth.Payload.OtpParameters + */ +class OtpParameters extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field bytes secret = 1; + */ + protected $secret = ''; + /** + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * Generated from protobuf field string issuer = 3; + */ + protected $issuer = ''; + /** + * Generated from protobuf field .app.Protobuf.GoogleAuth.Payload.Algorithm algorithm = 4; + */ + protected $algorithm = 0; + /** + * Generated from protobuf field .app.Protobuf.GoogleAuth.Payload.DigitCount digits = 5; + */ + protected $digits = 0; + /** + * Generated from protobuf field .app.Protobuf.GoogleAuth.Payload.OtpType type = 6; + */ + protected $type = 0; + /** + * Generated from protobuf field int64 counter = 7; + */ + protected $counter = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $secret + * @type string $name + * @type string $issuer + * @type int $algorithm + * @type int $digits + * @type int $type + * @type int|string $counter + * } + */ + public function __construct($data = NULL) { + \App\Protobuf\GPBMetadata\GoogleAuth::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field bytes secret = 1; + * @return string + */ + public function getSecret() + { + return $this->secret; + } + + /** + * Generated from protobuf field bytes secret = 1; + * @param string $var + * @return $this + */ + public function setSecret($var) + { + GPBUtil::checkString($var, False); + $this->secret = $var; + + return $this; + } + + /** + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field string issuer = 3; + * @return string + */ + public function getIssuer() + { + return $this->issuer; + } + + /** + * Generated from protobuf field string issuer = 3; + * @param string $var + * @return $this + */ + public function setIssuer($var) + { + GPBUtil::checkString($var, True); + $this->issuer = $var; + + return $this; + } + + /** + * Generated from protobuf field .app.Protobuf.GoogleAuth.Payload.Algorithm algorithm = 4; + * @return int + */ + public function getAlgorithm() + { + return $this->algorithm; + } + + /** + * Generated from protobuf field .app.Protobuf.GoogleAuth.Payload.Algorithm algorithm = 4; + * @param int $var + * @return $this + */ + public function setAlgorithm($var) + { + GPBUtil::checkEnum($var, \App\Protobuf\GoogleAuth\Payload_Algorithm::class); + $this->algorithm = $var; + + return $this; + } + + /** + * Generated from protobuf field .app.Protobuf.GoogleAuth.Payload.DigitCount digits = 5; + * @return int + */ + public function getDigits() + { + return $this->digits; + } + + /** + * Generated from protobuf field .app.Protobuf.GoogleAuth.Payload.DigitCount digits = 5; + * @param int $var + * @return $this + */ + public function setDigits($var) + { + GPBUtil::checkEnum($var, \App\Protobuf\GoogleAuth\Payload_DigitCount::class); + $this->digits = $var; + + return $this; + } + + /** + * Generated from protobuf field .app.Protobuf.GoogleAuth.Payload.OtpType type = 6; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Generated from protobuf field .app.Protobuf.GoogleAuth.Payload.OtpType type = 6; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \App\Protobuf\GoogleAuth\Payload_OtpType::class); + $this->type = $var; + + return $this; + } + + /** + * Generated from protobuf field int64 counter = 7; + * @return int|string + */ + public function getCounter() + { + return $this->counter; + } + + /** + * Generated from protobuf field int64 counter = 7; + * @param int|string $var + * @return $this + */ + public function setCounter($var) + { + GPBUtil::checkInt64($var); + $this->counter = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OtpParameters::class, \App\Protobuf\GoogleAuth\Payload_OtpParameters::class); + diff --git a/app/Protobuf/GoogleAuth/Payload/OtpType.php b/app/Protobuf/GoogleAuth/Payload/OtpType.php new file mode 100644 index 00000000..e434df9b --- /dev/null +++ b/app/Protobuf/GoogleAuth/Payload/OtpType.php @@ -0,0 +1,56 @@ +app.Protobuf.GoogleAuth.Payload.OtpType + */ +class OtpType +{ + /** + * Generated from protobuf enum OTP_TYPE_UNSPECIFIED = 0; + */ + const OTP_TYPE_UNSPECIFIED = 0; + /** + * Generated from protobuf enum OTP_TYPE_HOTP = 1; + */ + const OTP_TYPE_HOTP = 1; + /** + * Generated from protobuf enum OTP_TYPE_TOTP = 2; + */ + const OTP_TYPE_TOTP = 2; + + private static $valueToName = [ + self::OTP_TYPE_UNSPECIFIED => 'OTP_TYPE_UNSPECIFIED', + self::OTP_TYPE_HOTP => 'OTP_TYPE_HOTP', + self::OTP_TYPE_TOTP => 'OTP_TYPE_TOTP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OtpType::class, \App\Protobuf\GoogleAuth\Payload_OtpType::class); + diff --git a/app/Protobuf/GoogleAuth/Payload_Algorithm.php b/app/Protobuf/GoogleAuth/Payload_Algorithm.php new file mode 100644 index 00000000..b8c18bce --- /dev/null +++ b/app/Protobuf/GoogleAuth/Payload_Algorithm.php @@ -0,0 +1,16 @@ +