|
1 |
| -# v2.0.0 (Wed May 03 2023) |
| 1 | +# v2.0.0 (July 03, 2023) |
2 | 2 |
|
3 |
| -#### 🚀 Enhancement |
| 3 | +## Summary |
| 4 | +- 🚀 **Added:** Magic Connect developers can now use the Admin SDK to validate DID tokens. [#111](https://github.com/magiclabs/magic-admin-js/pull/111) ([@magic-ravi](https://github.com/magic-ravi)) |
| 5 | +- ⚠️ **Changed:** After creating the Magic instance, it is now necessary to call a new initialize method for Magic Connect developers that want to utilize the Admin SDK. [#111](https://github.com/magiclabs/magic-admin-js/pull/111) ([@magic-ravi](https://github.com/magic-ravi)) |
| 6 | +- 🛡️ **Security:** Additional validation of `aud` (client ID) is now being done during initialization of the SDK. [#111](https://github.com/magiclabs/magic-admin-js/pull/111) ([@magic-ravi](https://github.com/magic-ravi)) |
4 | 7 |
|
5 |
| -- Add Magic Connect Admin SDK support for Token Resource [#111](https://github.com/magiclabs/magic-admin-js/pull/111) ([@magic-ravi](https://github.com/magic-ravi)) |
6 |
| - - [Security Enhancement]: Validate `aud` using Magic client ID. |
7 |
| - - Add new `init` async method to create Magic instance and pull client ID from Magic servers if not provided. |
8 |
| - - Deprecate regular constructor. |
9 |
| - - Skip validation of attachment if 'none' is passed in `validate`. |
| 8 | +## Developer Notes |
10 | 9 |
|
11 |
| -#### Authors: 1 |
| 10 | +### 🚀 Added |
| 11 | + |
| 12 | +#### Admin SDK for MC |
| 13 | +Magic Connect developers can now use the Admin SDK to validate DID tokens. |
| 14 | + |
| 15 | +**Details** |
| 16 | +There is full support for all `TokenResource` SDK methods for MC. This is intended to be used with client side [`magic-js`](#) SDK which will now emit an `id-token-created` event with a DID token upon login via the [`connectWithUI`](#) method. |
| 17 | + |
| 18 | +This functionality is replicated on our other SDKs on Python and Ruby. |
| 19 | + |
| 20 | +### ⚠️ Changed |
| 21 | + |
| 22 | +#### Constructor initialization |
| 23 | + |
| 24 | +The existing constructor has been deprecated in place of a new async `initialize` method. |
| 25 | +The `initialize` method will pull clientId from Magic servers if one is not provided in the `options` parameter. |
| 26 | + |
| 27 | +**Previous Version** |
| 28 | +```javascript |
| 29 | +const magic = new Magic(secretKey); |
| 30 | +try { |
| 31 | + magic.token.validate(DIDT); |
| 32 | +} catch (e) { |
| 33 | + console.log(e); |
| 34 | +} |
| 35 | +try { |
| 36 | + await magic.users.getMetadataByToken(DIDT); |
| 37 | +} catch (e) { |
| 38 | + console.log(e); |
| 39 | +} |
| 40 | +``` |
| 41 | + |
| 42 | +**Current Version** |
| 43 | +```javascript |
| 44 | +const magic = await Magic.init(mcSecretKey); |
| 45 | +try { |
| 46 | + magic.token.validate(DIDT); |
| 47 | +} catch (e) { |
| 48 | + console.log(e); |
| 49 | +} |
| 50 | +try { |
| 51 | + await magic.users.getMetadataByToken(DIDT); |
| 52 | +} catch (e) { |
| 53 | + console.log(e); |
| 54 | +} |
| 55 | +``` |
| 56 | + |
| 57 | +#### Attachment Validation |
| 58 | + |
| 59 | +- Skip validation of attachment if 'none' is passed in `validate`. |
| 60 | + |
| 61 | +### 🛡️ Security |
| 62 | + |
| 63 | +#### Client ID Validation |
| 64 | + |
| 65 | +Additional validation of `aud` (client ID) is now being done during initialization of the SDK. This is for both Magic Connect and Magic Auth developers. |
| 66 | + |
| 67 | + |
| 68 | +### 🚨 Breaking |
| 69 | + |
| 70 | +None, all changes are fully backwards compatiable. |
| 71 | + |
| 72 | +### Authors: 1 |
12 | 73 |
|
13 | 74 | - Ravi Bhankharia ([@magic-ravi](https://github.com/magic-ravi))
|
14 | 75 |
|
|
0 commit comments