firebase / firebase/firebase-admin-node

FR: Add option for hash input order when importing users

Đang mở
#313 0 bình luận 0 reaction 1 người được giao Được @bojeil-google nhận Xem trên GitHub
api: auth type: feature request
Ngôn ngữ chính
TypeScript
Star
1.7k
Fork
419
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
16

Mô tả

#### Feature Request Description

Add a new `hash.inputOrder` option for the [`importUsers()`](https://firebase.google.com/docs/reference/admin/node/admin.auth.Auth#importUsers) auth method, inspired by the [`--hash-input-order` parameter of the Firebase CLI](https://firebase.google.com/docs/cli/auth).

It will accept a string value of `"SALT_FIRST"` or `"PASSWORD_FIRST"` and it will only apply to the `SHA512`, `SHA256`, `SHA1`, `MD5`, `HMAC_SHA512`, `HMAC_SHA256`, `HMAC_SHA1`, and `HMAC_MD5` algorithms.

#### Usage Example

```js
const importOptions = {
hash: {
algorithm: 'SHA256',
rounds: 80,
inputOrder: 'PASSWORD_FIRST', // or 'SALT_FIRST'
}
};

return admin.auth().importUsers(users, importOptions)
.then((results) => {
console.log('Users successfully imported!', results);
})
.catch((error) => {
console.log('Failed to import users:', error);
});
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.