|
15 | 15 | it 'returns the auth options alphabetically by default' do |
16 | 16 | params = NoAuthTrait::AuthParameters.new(operation_name: :operation_a) |
17 | 17 | auth_options = subject.resolve(params) |
18 | | - expected = %w[smithy.api#httpBasicAuth smithy.api#httpBearerAuth smithy.api#httpDigestAuth] |
| 18 | + expected = [ |
| 19 | + { scheme_id: 'smithy.api#httpBasicAuth' }, |
| 20 | + { scheme_id: 'smithy.api#httpBearerAuth' }, |
| 21 | + { scheme_id: 'smithy.api#httpDigestAuth' } |
| 22 | + ] |
19 | 23 | expect(auth_options).to eq(expected) |
20 | 24 | end |
21 | 25 |
|
22 | 26 | it 'returns the auth options for the operation with the auth trait' do |
23 | 27 | params = NoAuthTrait::AuthParameters.new(operation_name: :operation_b) |
24 | 28 | auth_options = subject.resolve(params) |
25 | | - expect(auth_options).to eq(['smithy.api#httpDigestAuth']) |
| 29 | + expect(auth_options).to eq([{ scheme_id: 'smithy.api#httpDigestAuth' }]) |
26 | 30 | end |
27 | 31 |
|
28 | 32 | it 'returns the auth options for the operation with the optionalAuth trait' do |
29 | 33 | params = NoAuthTrait::AuthParameters.new(operation_name: :operation_g) |
30 | 34 | auth_options = subject.resolve(params) |
31 | 35 | expect(auth_options).to eq( |
32 | | - %w[ |
33 | | - smithy.api#httpBasicAuth |
34 | | - smithy.api#httpBearerAuth |
35 | | - smithy.api#httpDigestAuth |
36 | | - smithy.api#noAuth |
| 36 | + [ |
| 37 | + { scheme_id: 'smithy.api#httpBasicAuth' }, |
| 38 | + { scheme_id: 'smithy.api#httpBearerAuth' }, |
| 39 | + { scheme_id: 'smithy.api#httpDigestAuth' }, |
| 40 | + { scheme_id: 'smithy.api#noAuth' } |
37 | 41 | ] |
38 | 42 | ) |
39 | 43 | end |
|
49 | 53 | it 'returns the auth options with the service auth trait' do |
50 | 54 | params = AuthTrait::AuthParameters.new(operation_name: :operation_c) |
51 | 55 | auth_options = subject.resolve(params) |
52 | | - expected = %w[smithy.api#httpBasicAuth smithy.api#httpDigestAuth] |
| 56 | + expected = [{ scheme_id: 'smithy.api#httpBasicAuth' }, { scheme_id: 'smithy.api#httpDigestAuth' }] |
53 | 57 | expect(auth_options).to eq(expected) |
54 | 58 | end |
55 | 59 |
|
56 | 60 | it 'returns the auth options for the operation overriding the service auth trait' do |
57 | 61 | params = AuthTrait::AuthParameters.new(operation_name: :operation_d) |
58 | 62 | auth_options = subject.resolve(params) |
59 | | - expect(auth_options).to eq(['smithy.api#httpBearerAuth']) |
| 63 | + expect(auth_options).to eq([{ scheme_id: 'smithy.api#httpBearerAuth' }]) |
60 | 64 | end |
61 | 65 |
|
62 | 66 | it 'returns a noAuth option when the auth trait is empty' do |
63 | 67 | params = AuthTrait::AuthParameters.new(operation_name: :operation_e) |
64 | 68 | auth_options = subject.resolve(params) |
65 | | - expect(auth_options).to eq(['smithy.api#noAuth']) |
| 69 | + expect(auth_options).to eq([{ scheme_id: 'smithy.api#noAuth' }]) |
66 | 70 | end |
67 | 71 |
|
68 | 72 | it 'returns the auth options for the operation with the optionalAuth trait' do |
69 | 73 | params = AuthTrait::AuthParameters.new(operation_name: :operation_f) |
70 | 74 | auth_options = subject.resolve(params) |
71 | | - expect(auth_options).to eq(%w[smithy.api#httpBasicAuth smithy.api#httpDigestAuth smithy.api#noAuth]) |
| 75 | + expect(auth_options).to eq( |
| 76 | + [ |
| 77 | + { scheme_id: 'smithy.api#httpBasicAuth' }, |
| 78 | + { scheme_id: 'smithy.api#httpDigestAuth' }, |
| 79 | + { scheme_id: 'smithy.api#noAuth' } |
| 80 | + ] |
| 81 | + ) |
72 | 82 | end |
73 | 83 | end |
74 | 84 | end |
|
82 | 92 | it 'returns the auth options for the operation with no auth traits' do |
83 | 93 | params = NoAuth::AuthParameters.new(operation_name: :operation_h) |
84 | 94 | auth_options = subject.resolve(params) |
85 | | - expect(auth_options).to eq(['smithy.api#noAuth']) |
| 95 | + expect(auth_options).to eq([{ scheme_id: 'smithy.api#noAuth' }]) |
86 | 96 | end |
87 | 97 |
|
88 | 98 | it 'returns the auth options for the operation with the optionalAuth trait' do |
89 | 99 | params = NoAuth::AuthParameters.new(operation_name: :operation_i) |
90 | 100 | auth_options = subject.resolve(params) |
91 | | - expect(auth_options).to eq(['smithy.api#noAuth']) |
| 101 | + expect(auth_options).to eq([{ scheme_id: 'smithy.api#noAuth' }]) |
92 | 102 | end |
93 | 103 | end |
94 | 104 | end |
|
0 commit comments