liblynx-api 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1721e67204106823f15655d3e4ac2a35ae71c23f0b716d3ff54bb321c1313e09
4
- data.tar.gz: 53947628a0695b4430227af5883cbb7aea44497a96d89fd2bdb763292de3deca
3
+ metadata.gz: ba21c208b05e9e4924e74c00ba2e6b82885d1d260092bc9a6a5410ef48726c51
4
+ data.tar.gz: fe1ee8f9e390861a23b575144153515edbf39d6ee878ec8eb98c4c8fd5c1d207
5
5
  SHA512:
6
- metadata.gz: 067ec4853a37ff4ee77aae4297f6a5f64605c9da7087cba6556f7792514eb6a984f18b003d1b7527ecb2a20b05753cd89de467eefe0ea3588a2d1d0933947366
7
- data.tar.gz: b7b0eb7b424d4edc954a1a1c5f61ff141d1e827e01617c17e85d9c2e773ee2282bd0e265ab37da75294d5f8090a1212cf751d6e13b1990832a17c6da5593bb3f
6
+ metadata.gz: 10f20997e5868b79fad06852ec21083b70169cce1f25b1c9f5c4857bcb4debf739d739c94b7f71c19e62ba4cb6ee5c7c495c70b3d29fe29d01aa9410ad5c069d
7
+ data.tar.gz: 4f0f4cab62b3a82b6c99e256ec517ba8b064e7ecbd02d333898111a3c7c6984d87f9a88743700182a39913fa34116d9fceed780552f278dfd6fcd241e86576c5
@@ -4,4 +4,5 @@ deploy:
4
4
  secure: OxGYvmusVgh8GzIkRMTUXmTF/xNUs6W5pbVivRzCv1zlPmlFncbmd52WAytq7A5SioI07SYaaeF3Y9/AaEhh0vBteFcmWg32mMGt6FIAaOGyTi8s42mfp9RFZqcPZKb+DM/qr9pFPgUgFogJC7SIEEGhp07SOyrvK928A19H3XLOQbXTm11Pmf1+wBCuxOs84I74UflZw+qCRDfxGWheycna0fIEfev5tGeW/thotYKi2z5l4qNmqysnlW6zO380ORvschrWu+vSgTKELjo9d6AhK3dRBCC1c5VgVs0PaoLEpKRDtbBUuD8UmbKGTI/wgjEnwcj3S3FUoUGIBBis1WCX9TpQ7iSrWDAg1vQ3iKedWRJ65blt10kgwH5nRfk9JdmENviAGDNYwIGkKfMGRDZnq07gWUBSHx2kIKcvrFyovoHGJ8Zfk5b65YMB0JQw6sVx9kV4flstrJ4kgVMPOIy6U+RbSroSvJ2iOHsXxH1zTk4YtZrmow57jlQV4iUKOxkUIBdFKYCT9ucVOhfzfDoay4q4qY1Q/Ohf5GSJphNa7uwhjwnOkjiwvFTyfUiU6FD8NjIwlJ84dy3DrOmJBfj1Tj5/Z/hgH/lp/309T1rsY0fv5ebbktRg+L82mh0LK/bsFcVwskrOI7+WX6a4gmqBEZ4kdTNrYvU2R+VRuTY=
5
5
  gem: liblynx-api
6
6
  on:
7
+ tags: true
7
8
  repo: dsablic/liblynx-api
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- liblynx-api (1.0.1)
4
+ liblynx-api (1.1.0)
5
5
  heroics
6
6
  moneta
7
7
 
@@ -10,7 +10,7 @@ GEM
10
10
  specs:
11
11
  diff-lcs (1.3)
12
12
  erubis (2.7.0)
13
- excon (0.60.0)
13
+ excon (0.62.0)
14
14
  heroics (0.0.24)
15
15
  erubis (~> 2.0)
16
16
  excon
data/api.md CHANGED
@@ -217,11 +217,21 @@ List existing accounts.
217
217
  GET /api/accounts
218
218
  ```
219
219
 
220
+ #### Optional Parameters
221
+
222
+ | Name | Type | Description | Example |
223
+ | ------- | ------- | ------- | ------- |
224
+ | **page** | *integer* | page number | `42` |
225
+ | **perpage** | *integer* | page size | `42` |
226
+
220
227
 
221
228
  #### Curl Example
222
229
 
223
230
  ```bash
224
231
  $ curl -n https://connect.liblynx.com/api/accounts
232
+ -G \
233
+ -d perpage=42 \
234
+ -d page=42
225
235
  ```
226
236
 
227
237
 
@@ -509,6 +519,69 @@ HTTP/1.1 200 OK
509
519
  ```
510
520
 
511
521
 
522
+ ## <a name="resource-idp">idp</a>
523
+
524
+ Stability: `production`
525
+
526
+
527
+
528
+ ### Attributes
529
+
530
+ | Name | Type | Description | Example |
531
+ | ------- | ------- | ------- | ------- |
532
+ | **entity_id** | *string* | shibboleth entity id | `"example"` |
533
+ | **logo_small_size** | *string* | logo size (WxH) | `"example"` |
534
+ | **logo_small_url** | *string* | logo url | `"example"` |
535
+ | **name** | *string* | name of the institution | `"example"` |
536
+
537
+ ### <a name="link-GET-idp-/api/idps">idp List</a>
538
+
539
+ List shibboleth idps.
540
+
541
+ ```
542
+ GET /api/idps
543
+ ```
544
+
545
+ #### Optional Parameters
546
+
547
+ | Name | Type | Description | Example |
548
+ | ------- | ------- | ------- | ------- |
549
+ | **page** | *integer* | page number | `42` |
550
+ | **perpage** | *integer* | page size | `42` |
551
+ | **q** | *string* | query string | `"example"` |
552
+
553
+
554
+ #### Curl Example
555
+
556
+ ```bash
557
+ $ curl -n https://connect.liblynx.com/api/idps
558
+ -G \
559
+ -d q=example \
560
+ -d perpage=42 \
561
+ -d page=42
562
+ ```
563
+
564
+
565
+ #### Response Example
566
+
567
+ ```
568
+ HTTP/1.1 200 OK
569
+ ```
570
+
571
+ ```json
572
+ {
573
+ "idps": [
574
+ {
575
+ "name": "example",
576
+ "entity_id": "example",
577
+ "logo_small_url": "example",
578
+ "logo_small_size": "example"
579
+ }
580
+ ]
581
+ }
582
+ ```
583
+
584
+
512
585
  ## <a name="resource-samlidp">Samlidp</a>
513
586
 
514
587
  Stability: `production`
@@ -83,7 +83,7 @@ module LibLynxAPI
83
83
 
84
84
  # Get the default options.
85
85
  def self.default_options
86
- default_headers = {"Accept"=>"application/json", "User-Agent"=>"liblynx-api/1.0.0"}
86
+ default_headers = {"Accept"=>"application/json", "User-Agent"=>"liblynx-api/1.1.0"}
87
87
  {
88
88
  default_headers: default_headers,
89
89
  url: "https://connect.liblynx.com"
@@ -112,6 +112,13 @@ module LibLynxAPI
112
112
  @identification_resource ||= Identification.new(@client)
113
113
  end
114
114
 
115
+ #
116
+ #
117
+ # @return [Idp]
118
+ def idp
119
+ @idp_resource ||= Idp.new(@client)
120
+ end
121
+
115
122
  #
116
123
  #
117
124
  # @return [Samlidp]
@@ -157,8 +164,10 @@ module LibLynxAPI
157
164
  end
158
165
 
159
166
  # List existing accounts.
160
- def list()
161
- @client.account.list()
167
+ #
168
+ # @param body: the object to pass as the request payload
169
+ def list(body = {})
170
+ @client.account.list(body)
162
171
  end
163
172
 
164
173
  # Update an existing account.
@@ -191,6 +200,20 @@ module LibLynxAPI
191
200
  end
192
201
  end
193
202
 
203
+ #
204
+ class Idp
205
+ def initialize(client)
206
+ @client = client
207
+ end
208
+
209
+ # List shibboleth idps.
210
+ #
211
+ # @param body: the object to pass as the request payload
212
+ def list(body = {})
213
+ @client.idp.list(body)
214
+ end
215
+ end
216
+
194
217
  #
195
218
  class Samlidp
196
219
  def initialize(client)
@@ -499,6 +522,25 @@ module LibLynxAPI
499
522
  "href": "/api/accounts",
500
523
  "method": "GET",
501
524
  "rel": "instances",
525
+ "schema": {
526
+ "type": [
527
+ "object"
528
+ ],
529
+ "properties": {
530
+ "perpage": {
531
+ "type": [
532
+ "integer"
533
+ ],
534
+ "description": "page size"
535
+ },
536
+ "page": {
537
+ "type": [
538
+ "integer"
539
+ ],
540
+ "description": "page number"
541
+ }
542
+ }
543
+ },
502
544
  "targetSchema": {
503
545
  "properties": {
504
546
  "accounts": {
@@ -929,6 +971,122 @@ module LibLynxAPI
929
971
  }
930
972
  }
931
973
  },
974
+ "idp": {
975
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
976
+ "title": "idp",
977
+ "description": "",
978
+ "stability": "production",
979
+ "strictProperties": true,
980
+ "type": [
981
+ "object"
982
+ ],
983
+ "definitions": {
984
+ "name": {
985
+ "description": "name of the institution",
986
+ "readOnly": true,
987
+ "type": [
988
+ "string"
989
+ ]
990
+ },
991
+ "entity_id": {
992
+ "description": "shibboleth entity id",
993
+ "readOnly": true,
994
+ "type": [
995
+ "string"
996
+ ]
997
+ },
998
+ "logo_small_url": {
999
+ "description": "logo url",
1000
+ "readOnly": true,
1001
+ "type": [
1002
+ "string"
1003
+ ]
1004
+ },
1005
+ "logo_small_size": {
1006
+ "description": "logo size (WxH)",
1007
+ "readOnly": true,
1008
+ "type": [
1009
+ "string"
1010
+ ]
1011
+ },
1012
+ "identity": {
1013
+ "$ref": "#/definitions/idp/definitions/entity_id"
1014
+ }
1015
+ },
1016
+ "links": [
1017
+ {
1018
+ "description": "List shibboleth idps.",
1019
+ "href": "/api/idps",
1020
+ "method": "GET",
1021
+ "rel": "instances",
1022
+ "title": "List",
1023
+ "schema": {
1024
+ "type": [
1025
+ "object"
1026
+ ],
1027
+ "properties": {
1028
+ "q": {
1029
+ "type": [
1030
+ "string"
1031
+ ],
1032
+ "description": "query string"
1033
+ },
1034
+ "perpage": {
1035
+ "type": [
1036
+ "integer"
1037
+ ],
1038
+ "description": "page size"
1039
+ },
1040
+ "page": {
1041
+ "type": [
1042
+ "integer"
1043
+ ],
1044
+ "description": "page number"
1045
+ }
1046
+ }
1047
+ },
1048
+ "targetSchema": {
1049
+ "properties": {
1050
+ "idps": {
1051
+ "items": {
1052
+ "properties": {
1053
+ "name": {
1054
+ "$ref": "#/definitions/idp/definitions/name"
1055
+ },
1056
+ "entity_id": {
1057
+ "$ref": "#/definitions/idp/definitions/entity_id"
1058
+ },
1059
+ "logo_small_url": {
1060
+ "$ref": "#/definitions/idp/definitions/logo_small_url"
1061
+ },
1062
+ "logo_small_size": {
1063
+ "$ref": "#/definitions/idp/definitions/logo_small_size"
1064
+ }
1065
+ }
1066
+ },
1067
+ "type": [
1068
+ "array"
1069
+ ]
1070
+ }
1071
+ }
1072
+ }
1073
+ }
1074
+ ],
1075
+ "properties": {
1076
+ "name": {
1077
+ "$ref": "#/definitions/idp/definitions/name"
1078
+ },
1079
+ "entity_id": {
1080
+ "$ref": "#/definitions/idp/definitions/entity_id"
1081
+ },
1082
+ "logo_small_url": {
1083
+ "$ref": "#/definitions/idp/definitions/logo_small_url"
1084
+ },
1085
+ "logo_small_size": {
1086
+ "$ref": "#/definitions/idp/definitions/logo_small_size"
1087
+ }
1088
+ }
1089
+ },
932
1090
  "samlidp": {
933
1091
  "$schema": "http://json-schema.org/draft-04/hyper-schema",
934
1092
  "title": "Samlidp",
@@ -1144,6 +1302,9 @@ module LibLynxAPI
1144
1302
  "identification": {
1145
1303
  "$ref": "#/definitions/identification"
1146
1304
  },
1305
+ "idp": {
1306
+ "$ref": "#/definitions/idp"
1307
+ },
1147
1308
  "samlidp": {
1148
1309
  "$ref": "#/definitions/samlidp"
1149
1310
  },
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LibLynxAPI
4
- VERSION = '1.0.1'
4
+ VERSION = '1.1.0'
5
5
  end
@@ -253,6 +253,25 @@
253
253
  "href": "/api/accounts",
254
254
  "method": "GET",
255
255
  "rel": "instances",
256
+ "schema": {
257
+ "type": [
258
+ "object"
259
+ ],
260
+ "properties": {
261
+ "perpage": {
262
+ "type": [
263
+ "integer"
264
+ ],
265
+ "description": "page size"
266
+ },
267
+ "page": {
268
+ "type": [
269
+ "integer"
270
+ ],
271
+ "description": "page number"
272
+ }
273
+ }
274
+ },
256
275
  "targetSchema": {
257
276
  "properties": {
258
277
  "accounts": {
@@ -683,6 +702,122 @@
683
702
  }
684
703
  }
685
704
  },
705
+ "idp": {
706
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
707
+ "title": "idp",
708
+ "description": "",
709
+ "stability": "production",
710
+ "strictProperties": true,
711
+ "type": [
712
+ "object"
713
+ ],
714
+ "definitions": {
715
+ "name": {
716
+ "description": "name of the institution",
717
+ "readOnly": true,
718
+ "type": [
719
+ "string"
720
+ ]
721
+ },
722
+ "entity_id": {
723
+ "description": "shibboleth entity id",
724
+ "readOnly": true,
725
+ "type": [
726
+ "string"
727
+ ]
728
+ },
729
+ "logo_small_url": {
730
+ "description": "logo url",
731
+ "readOnly": true,
732
+ "type": [
733
+ "string"
734
+ ]
735
+ },
736
+ "logo_small_size": {
737
+ "description": "logo size (WxH)",
738
+ "readOnly": true,
739
+ "type": [
740
+ "string"
741
+ ]
742
+ },
743
+ "identity": {
744
+ "$ref": "#/definitions/idp/definitions/entity_id"
745
+ }
746
+ },
747
+ "links": [
748
+ {
749
+ "description": "List shibboleth idps.",
750
+ "href": "/api/idps",
751
+ "method": "GET",
752
+ "rel": "instances",
753
+ "title": "List",
754
+ "schema": {
755
+ "type": [
756
+ "object"
757
+ ],
758
+ "properties": {
759
+ "q": {
760
+ "type": [
761
+ "string"
762
+ ],
763
+ "description": "query string"
764
+ },
765
+ "perpage": {
766
+ "type": [
767
+ "integer"
768
+ ],
769
+ "description": "page size"
770
+ },
771
+ "page": {
772
+ "type": [
773
+ "integer"
774
+ ],
775
+ "description": "page number"
776
+ }
777
+ }
778
+ },
779
+ "targetSchema": {
780
+ "properties": {
781
+ "idps": {
782
+ "items": {
783
+ "properties": {
784
+ "name": {
785
+ "$ref": "#/definitions/idp/definitions/name"
786
+ },
787
+ "entity_id": {
788
+ "$ref": "#/definitions/idp/definitions/entity_id"
789
+ },
790
+ "logo_small_url": {
791
+ "$ref": "#/definitions/idp/definitions/logo_small_url"
792
+ },
793
+ "logo_small_size": {
794
+ "$ref": "#/definitions/idp/definitions/logo_small_size"
795
+ }
796
+ }
797
+ },
798
+ "type": [
799
+ "array"
800
+ ]
801
+ }
802
+ }
803
+ }
804
+ }
805
+ ],
806
+ "properties": {
807
+ "name": {
808
+ "$ref": "#/definitions/idp/definitions/name"
809
+ },
810
+ "entity_id": {
811
+ "$ref": "#/definitions/idp/definitions/entity_id"
812
+ },
813
+ "logo_small_url": {
814
+ "$ref": "#/definitions/idp/definitions/logo_small_url"
815
+ },
816
+ "logo_small_size": {
817
+ "$ref": "#/definitions/idp/definitions/logo_small_size"
818
+ }
819
+ }
820
+ },
686
821
  "samlidp": {
687
822
  "$schema": "http://json-schema.org/draft-04/hyper-schema",
688
823
  "title": "Samlidp",
@@ -898,6 +1033,9 @@
898
1033
  "identification": {
899
1034
  "$ref": "#/definitions/identification"
900
1035
  },
1036
+ "idp": {
1037
+ "$ref": "#/definitions/idp"
1038
+ },
901
1039
  "samlidp": {
902
1040
  "$ref": "#/definitions/samlidp"
903
1041
  },
@@ -246,6 +246,19 @@
246
246
  "href": "/api/accounts",
247
247
  "method": "GET",
248
248
  "rel": "instances",
249
+ "schema": {
250
+ "type": "object",
251
+ "properties": {
252
+ "perpage": {
253
+ "type": "integer",
254
+ "description": "page size"
255
+ },
256
+ "page": {
257
+ "type": "integer",
258
+ "description": "page number"
259
+ }
260
+ }
261
+ },
249
262
  "targetSchema": {
250
263
  "properties": {
251
264
  "accounts": {
@@ -0,0 +1,109 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/hyper-schema",
3
+ "title": "idp",
4
+ "description": "",
5
+ "stability": "production",
6
+ "strictProperties": true,
7
+ "type": [
8
+ "object"
9
+ ],
10
+ "definitions": {
11
+ "name": {
12
+ "description": "name of the institution",
13
+ "readOnly": true,
14
+ "type": [
15
+ "string"
16
+ ]
17
+ },
18
+ "entity_id": {
19
+ "description": "shibboleth entity id",
20
+ "readOnly": true,
21
+ "type": [
22
+ "string"
23
+ ]
24
+ },
25
+ "logo_small_url": {
26
+ "description": "logo url",
27
+ "readOnly": true,
28
+ "type": [
29
+ "string"
30
+ ]
31
+ },
32
+ "logo_small_size": {
33
+ "description": "logo size (WxH)",
34
+ "readOnly": true,
35
+ "type": [
36
+ "string"
37
+ ]
38
+ },
39
+ "identity": {
40
+ "$ref": "/schemata/idp#/definitions/entity_id"
41
+ }
42
+ },
43
+ "links": [
44
+ {
45
+ "description": "List shibboleth idps.",
46
+ "href": "/api/idps",
47
+ "method": "GET",
48
+ "rel": "instances",
49
+ "title": "List",
50
+ "schema": {
51
+ "type": "object",
52
+ "properties": {
53
+ "q": {
54
+ "type": "string",
55
+ "description": "query string"
56
+ },
57
+ "perpage": {
58
+ "type": "integer",
59
+ "description": "page size"
60
+ },
61
+ "page": {
62
+ "type": "integer",
63
+ "description": "page number"
64
+ }
65
+ }
66
+ },
67
+ "targetSchema": {
68
+ "properties": {
69
+ "idps": {
70
+ "items": {
71
+ "properties": {
72
+ "name": {
73
+ "$ref": "/schemata/idp#/definitions/name"
74
+ },
75
+ "entity_id": {
76
+ "$ref": "/schemata/idp#/definitions/entity_id"
77
+ },
78
+ "logo_small_url": {
79
+ "$ref": "/schemata/idp#/definitions/logo_small_url"
80
+ },
81
+ "logo_small_size": {
82
+ "$ref": "/schemata/idp#/definitions/logo_small_size"
83
+ }
84
+ }
85
+ },
86
+ "type": [
87
+ "array"
88
+ ]
89
+ }
90
+ }
91
+ }
92
+ }
93
+ ],
94
+ "properties": {
95
+ "name": {
96
+ "$ref": "/schemata/idp#/definitions/name"
97
+ },
98
+ "entity_id": {
99
+ "$ref": "/schemata/idp#/definitions/entity_id"
100
+ },
101
+ "logo_small_url": {
102
+ "$ref": "/schemata/idp#/definitions/logo_small_url"
103
+ },
104
+ "logo_small_size": {
105
+ "$ref": "/schemata/idp#/definitions/logo_small_size"
106
+ }
107
+ },
108
+ "id": "schemata/idp"
109
+ }
@@ -23,7 +23,16 @@ describe 'The generated liblynx api client' do
23
23
  }
24
24
  end
25
25
 
26
- it 'can get list the accounts' do
26
+ it 'can list the idps' do
27
+ expect(@client.idp.list).to match(hash_including('idps'))
28
+ end
29
+
30
+ it 'can list the idps using the query filter' do
31
+ expect(@client.idp.list(q: 'of denver')['idps'])
32
+ .to include(include('name' => 'University of Denver'))
33
+ end
34
+
35
+ it 'can list the accounts' do
27
36
  expect(@client.account.list).to match(hash_including('accounts'))
28
37
  end
29
38
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liblynx-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Sablic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-19 00:00:00.000000000 Z
11
+ date: 2018-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -132,6 +132,7 @@ files:
132
132
  - schema.json
133
133
  - schemata/account.json
134
134
  - schemata/identification.json
135
+ - schemata/idps.json
135
136
  - schemata/samlidps.json
136
137
  - schemata/token.json
137
138
  - spec/client_spec.rb
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
156
  version: '0'
156
157
  requirements: []
157
158
  rubyforge_project:
158
- rubygems_version: 2.7.6
159
+ rubygems_version: 2.7.7
159
160
  signing_key:
160
161
  specification_version: 4
161
162
  summary: Ruby client for the LibLynx API