forked from okta/okta-sdk-golang
/
model_password_credential_hash.go
423 lines (355 loc) · 13.5 KB
/
model_password_credential_hash.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
/*
Okta Admin Management
Allows customers to easily access the Okta Management APIs
Copyright 2018 - Present Okta, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
API version: 5.1.0
Contact: devex-public@okta.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package okta
import (
"encoding/json"
)
// PasswordCredentialHash Specifies a hashed password to import into Okta. This allows an existing password to be imported into Okta directly from some other store. Okta supports the BCRYPT, SHA-512, SHA-256, SHA-1, MD5, and PBKDF2 hash functions for password import. A hashed password may be specified in a Password object when creating or updating a user, but not for other operations. See [Create User with Imported Hashed Password](https://developer.okta.com/docs/reference/api/users/#create-user-with-imported-hashed-password) for information on using this object when creating a user. When updating a user with a hashed password, the user must be in the `STAGED` status.
type PasswordCredentialHash struct {
Algorithm *PasswordCredentialHashAlgorithm `json:"algorithm,omitempty"`
DigestAlgorithm *DigestAlgorithm `json:"digestAlgorithm,omitempty"`
// The number of iterations used when hashing passwords using PBKDF2. Must be >= 4096. Only required for PBKDF2 algorithm.
IterationCount *int32 `json:"iterationCount,omitempty"`
// Size of the derived key in bytes. Only required for PBKDF2 algorithm.
KeySize *int32 `json:"keySize,omitempty"`
// Only required for salted hashes. For BCRYPT, this specifies Radix-64 as the encoded salt used to generate the hash, which must be 22 characters long. For other salted hashes, this specifies the Base64-encoded salt used to generate the hash.
Salt *string `json:"salt,omitempty"`
// Specifies whether salt was pre- or postfixed to the password before hashing. Only required for salted algorithms.
SaltOrder *string `json:"saltOrder,omitempty"`
// For SHA-512, SHA-256, SHA-1, MD5, and PBKDF2, this is the actual base64-encoded hash of the password (and salt, if used). This is the Base64-encoded `value` of the SHA-512/SHA-256/SHA-1/MD5/PBKDF2 digest that was computed by either pre-fixing or post-fixing the `salt` to the `password`, depending on the `saltOrder`. If a `salt` was not used in the `source` system, then this should just be the Base64-encoded `value` of the password's SHA-512/SHA-256/SHA-1/MD5/PBKDF2 digest. For BCRYPT, this is the actual Radix-64 encoded hashed password.
Value *string `json:"value,omitempty"`
// Governs the strength of the hash and the time required to compute it. Only required for BCRYPT algorithm.
WorkFactor *int32 `json:"workFactor,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PasswordCredentialHash PasswordCredentialHash
// NewPasswordCredentialHash instantiates a new PasswordCredentialHash object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewPasswordCredentialHash() *PasswordCredentialHash {
this := PasswordCredentialHash{}
return &this
}
// NewPasswordCredentialHashWithDefaults instantiates a new PasswordCredentialHash object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewPasswordCredentialHashWithDefaults() *PasswordCredentialHash {
this := PasswordCredentialHash{}
return &this
}
// GetAlgorithm returns the Algorithm field value if set, zero value otherwise.
func (o *PasswordCredentialHash) GetAlgorithm() PasswordCredentialHashAlgorithm {
if o == nil || o.Algorithm == nil {
var ret PasswordCredentialHashAlgorithm
return ret
}
return *o.Algorithm
}
// GetAlgorithmOk returns a tuple with the Algorithm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PasswordCredentialHash) GetAlgorithmOk() (*PasswordCredentialHashAlgorithm, bool) {
if o == nil || o.Algorithm == nil {
return nil, false
}
return o.Algorithm, true
}
// HasAlgorithm returns a boolean if a field has been set.
func (o *PasswordCredentialHash) HasAlgorithm() bool {
if o != nil && o.Algorithm != nil {
return true
}
return false
}
// SetAlgorithm gets a reference to the given PasswordCredentialHashAlgorithm and assigns it to the Algorithm field.
func (o *PasswordCredentialHash) SetAlgorithm(v PasswordCredentialHashAlgorithm) {
o.Algorithm = &v
}
// GetDigestAlgorithm returns the DigestAlgorithm field value if set, zero value otherwise.
func (o *PasswordCredentialHash) GetDigestAlgorithm() DigestAlgorithm {
if o == nil || o.DigestAlgorithm == nil {
var ret DigestAlgorithm
return ret
}
return *o.DigestAlgorithm
}
// GetDigestAlgorithmOk returns a tuple with the DigestAlgorithm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PasswordCredentialHash) GetDigestAlgorithmOk() (*DigestAlgorithm, bool) {
if o == nil || o.DigestAlgorithm == nil {
return nil, false
}
return o.DigestAlgorithm, true
}
// HasDigestAlgorithm returns a boolean if a field has been set.
func (o *PasswordCredentialHash) HasDigestAlgorithm() bool {
if o != nil && o.DigestAlgorithm != nil {
return true
}
return false
}
// SetDigestAlgorithm gets a reference to the given DigestAlgorithm and assigns it to the DigestAlgorithm field.
func (o *PasswordCredentialHash) SetDigestAlgorithm(v DigestAlgorithm) {
o.DigestAlgorithm = &v
}
// GetIterationCount returns the IterationCount field value if set, zero value otherwise.
func (o *PasswordCredentialHash) GetIterationCount() int32 {
if o == nil || o.IterationCount == nil {
var ret int32
return ret
}
return *o.IterationCount
}
// GetIterationCountOk returns a tuple with the IterationCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PasswordCredentialHash) GetIterationCountOk() (*int32, bool) {
if o == nil || o.IterationCount == nil {
return nil, false
}
return o.IterationCount, true
}
// HasIterationCount returns a boolean if a field has been set.
func (o *PasswordCredentialHash) HasIterationCount() bool {
if o != nil && o.IterationCount != nil {
return true
}
return false
}
// SetIterationCount gets a reference to the given int32 and assigns it to the IterationCount field.
func (o *PasswordCredentialHash) SetIterationCount(v int32) {
o.IterationCount = &v
}
// GetKeySize returns the KeySize field value if set, zero value otherwise.
func (o *PasswordCredentialHash) GetKeySize() int32 {
if o == nil || o.KeySize == nil {
var ret int32
return ret
}
return *o.KeySize
}
// GetKeySizeOk returns a tuple with the KeySize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PasswordCredentialHash) GetKeySizeOk() (*int32, bool) {
if o == nil || o.KeySize == nil {
return nil, false
}
return o.KeySize, true
}
// HasKeySize returns a boolean if a field has been set.
func (o *PasswordCredentialHash) HasKeySize() bool {
if o != nil && o.KeySize != nil {
return true
}
return false
}
// SetKeySize gets a reference to the given int32 and assigns it to the KeySize field.
func (o *PasswordCredentialHash) SetKeySize(v int32) {
o.KeySize = &v
}
// GetSalt returns the Salt field value if set, zero value otherwise.
func (o *PasswordCredentialHash) GetSalt() string {
if o == nil || o.Salt == nil {
var ret string
return ret
}
return *o.Salt
}
// GetSaltOk returns a tuple with the Salt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PasswordCredentialHash) GetSaltOk() (*string, bool) {
if o == nil || o.Salt == nil {
return nil, false
}
return o.Salt, true
}
// HasSalt returns a boolean if a field has been set.
func (o *PasswordCredentialHash) HasSalt() bool {
if o != nil && o.Salt != nil {
return true
}
return false
}
// SetSalt gets a reference to the given string and assigns it to the Salt field.
func (o *PasswordCredentialHash) SetSalt(v string) {
o.Salt = &v
}
// GetSaltOrder returns the SaltOrder field value if set, zero value otherwise.
func (o *PasswordCredentialHash) GetSaltOrder() string {
if o == nil || o.SaltOrder == nil {
var ret string
return ret
}
return *o.SaltOrder
}
// GetSaltOrderOk returns a tuple with the SaltOrder field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PasswordCredentialHash) GetSaltOrderOk() (*string, bool) {
if o == nil || o.SaltOrder == nil {
return nil, false
}
return o.SaltOrder, true
}
// HasSaltOrder returns a boolean if a field has been set.
func (o *PasswordCredentialHash) HasSaltOrder() bool {
if o != nil && o.SaltOrder != nil {
return true
}
return false
}
// SetSaltOrder gets a reference to the given string and assigns it to the SaltOrder field.
func (o *PasswordCredentialHash) SetSaltOrder(v string) {
o.SaltOrder = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *PasswordCredentialHash) GetValue() string {
if o == nil || o.Value == nil {
var ret string
return ret
}
return *o.Value
}
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PasswordCredentialHash) GetValueOk() (*string, bool) {
if o == nil || o.Value == nil {
return nil, false
}
return o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *PasswordCredentialHash) HasValue() bool {
if o != nil && o.Value != nil {
return true
}
return false
}
// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *PasswordCredentialHash) SetValue(v string) {
o.Value = &v
}
// GetWorkFactor returns the WorkFactor field value if set, zero value otherwise.
func (o *PasswordCredentialHash) GetWorkFactor() int32 {
if o == nil || o.WorkFactor == nil {
var ret int32
return ret
}
return *o.WorkFactor
}
// GetWorkFactorOk returns a tuple with the WorkFactor field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PasswordCredentialHash) GetWorkFactorOk() (*int32, bool) {
if o == nil || o.WorkFactor == nil {
return nil, false
}
return o.WorkFactor, true
}
// HasWorkFactor returns a boolean if a field has been set.
func (o *PasswordCredentialHash) HasWorkFactor() bool {
if o != nil && o.WorkFactor != nil {
return true
}
return false
}
// SetWorkFactor gets a reference to the given int32 and assigns it to the WorkFactor field.
func (o *PasswordCredentialHash) SetWorkFactor(v int32) {
o.WorkFactor = &v
}
func (o PasswordCredentialHash) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Algorithm != nil {
toSerialize["algorithm"] = o.Algorithm
}
if o.DigestAlgorithm != nil {
toSerialize["digestAlgorithm"] = o.DigestAlgorithm
}
if o.IterationCount != nil {
toSerialize["iterationCount"] = o.IterationCount
}
if o.KeySize != nil {
toSerialize["keySize"] = o.KeySize
}
if o.Salt != nil {
toSerialize["salt"] = o.Salt
}
if o.SaltOrder != nil {
toSerialize["saltOrder"] = o.SaltOrder
}
if o.Value != nil {
toSerialize["value"] = o.Value
}
if o.WorkFactor != nil {
toSerialize["workFactor"] = o.WorkFactor
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return json.Marshal(toSerialize)
}
func (o *PasswordCredentialHash) UnmarshalJSON(bytes []byte) (err error) {
varPasswordCredentialHash := _PasswordCredentialHash{}
err = json.Unmarshal(bytes, &varPasswordCredentialHash)
if err == nil {
*o = PasswordCredentialHash(varPasswordCredentialHash)
} else {
return err
}
additionalProperties := make(map[string]interface{})
err = json.Unmarshal(bytes, &additionalProperties)
if err == nil {
delete(additionalProperties, "algorithm")
delete(additionalProperties, "digestAlgorithm")
delete(additionalProperties, "iterationCount")
delete(additionalProperties, "keySize")
delete(additionalProperties, "salt")
delete(additionalProperties, "saltOrder")
delete(additionalProperties, "value")
delete(additionalProperties, "workFactor")
o.AdditionalProperties = additionalProperties
} else {
return err
}
return err
}
type NullablePasswordCredentialHash struct {
value *PasswordCredentialHash
isSet bool
}
func (v NullablePasswordCredentialHash) Get() *PasswordCredentialHash {
return v.value
}
func (v *NullablePasswordCredentialHash) Set(val *PasswordCredentialHash) {
v.value = val
v.isSet = true
}
func (v NullablePasswordCredentialHash) IsSet() bool {
return v.isSet
}
func (v *NullablePasswordCredentialHash) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePasswordCredentialHash(val *PasswordCredentialHash) *NullablePasswordCredentialHash {
return &NullablePasswordCredentialHash{value: val, isSet: true}
}
func (v NullablePasswordCredentialHash) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePasswordCredentialHash) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}