Commit dfc1e49
authored
[Identity] DeviceCodeCredential constructor unification (Azure#14443)
DeviceCodeCredential stopped having required parameters a while ago, when we started completing the values for tenant ID and client ID by default. However, even though our guidelines establish that we should group all of the optional parameters in option bags, the signature of this constructor never changed.
As part of my recent Identity changes, I've made it so the DeviceCodeCredential constructor could also accept only receiving the optional parameters. The intention there was to not do a breaking change initially, but since we're targeting a major version release, having this constructor overload feels unnecessary.
This PR makes it so DeviceCodeCredential only accepts an options bag as the first parameter, without overloads.
While doing these changes, I was able to spot a bug I introduced in my recent changes (currently on master, but not released) by which clientId and tenantId were not properly passed through if sent only through the options bag. While this is fixed by this PR too, that fix caused the recordings not to match, as some of the recordings were using the default values for clientId and tenantId instead of the ones passed through. I've fixed the tests to match what the recordings represented, which essentially allows us to test that the default values for tenantId and clientId can work, meaning that now I'm treating the device code tests as if sometimes used the default parameters.
Fixes: Azure#144201 parent cd3557a commit dfc1e49
File tree
5 files changed
+26
-52
lines changed- sdk/identity/identity
- review
- src/credentials
- test
- internal
- node
- public/node
5 files changed
+26
-52
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
| |||
Lines changed: 3 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 10 | + | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
| |||
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 34 | | |
47 | 35 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 36 | + | |
67 | 37 | | |
68 | 38 | | |
69 | 39 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 40 | + | |
73 | 41 | | |
74 | 42 | | |
75 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
Lines changed: 4 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
80 | | - | |
81 | | - | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
117 | | - | |
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
| |||
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
159 | | - | |
160 | | - | |
161 | 158 | | |
162 | 159 | | |
163 | 160 | | |
| |||
169 | 166 | | |
170 | 167 | | |
171 | 168 | | |
172 | | - | |
173 | | - | |
174 | 169 | | |
175 | 170 | | |
176 | 171 | | |
| |||
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| |||
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
64 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
| |||
87 | 97 | | |
88 | 98 | | |
89 | 99 | | |
90 | | - | |
91 | | - | |
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
| |||
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
117 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
118 | 129 | | |
119 | 130 | | |
120 | 131 | | |
| |||
0 commit comments