mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-03-07 02:35:57 +00:00
userdb: Use protocol buffers instead of our custom format
Protocol buffers are a more portable, practical and safe format for the user database.
This commit is contained in:
28
internal/userdb/userdb.proto
Normal file
28
internal/userdb/userdb.proto
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package userdb;
|
||||
|
||||
message ProtoDB {
|
||||
map<string, Password> users = 1;
|
||||
}
|
||||
|
||||
message Password {
|
||||
oneof scheme {
|
||||
Scrypt scrypt = 2;
|
||||
Plain plain = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message Scrypt {
|
||||
uint64 logN = 1;
|
||||
int32 r = 2;
|
||||
int32 p = 3;
|
||||
int32 keyLen = 4;
|
||||
bytes salt = 5;
|
||||
bytes encrypted = 6;
|
||||
}
|
||||
|
||||
message Plain {
|
||||
bytes password = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user