KisaragiEffective/reinventory-manager

secretMachineIdを追加することで複数セッション張ることが可能(今聞いた)

Closed this issue · 0 comments

https://github.com/KisaragiEffective/neosvr-inventory-management/blob/c6594d0342c86bc12e953aad245719ed8f5f9c59/src/model.rs#L64-L74

ここのログイン処理にsecretMachineIdを追加することで複数セッション張ることが可能。

MachineIdの判断条件としては以下の通り:

  1. 22文字
  2. 数字・英文字(Lowercase)・記号(- _ のみ)各種0個以上で構成

なので、極端な場合これでもOK。

POST https://{{hostname}}/api/userSessions HTTP/1.1
content-type: {{contentType}}
TOTP: {{totp}}

{
    "ownerId": null,
    "username": null,
    "email": "{{email}}",
    "password": "{{password}}",
    "secretMachineId": "012345678901234567890",
    "rememberMe": false
}

公式の実装としては:

  1. UUIDの生成
  2. ByteArrayに変換
  3. Base64 URL Encodingに変換( RFC4648)
    3.1 Base64で実装した後、+ -> - | / -> _ | = -> ``(空文字)
  4. 全部小文字にする

といった具合です。