code42 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. data/.gitignore +1 -0
  2. data/README.md +82 -64
  3. data/Rakefile +5 -0
  4. data/code42.gemspec +6 -6
  5. data/lib/code42/api/computer.rb +22 -0
  6. data/lib/code42/api/org.rb +60 -0
  7. data/lib/code42/api/role.rb +24 -0
  8. data/lib/code42/api/token.rb +32 -0
  9. data/lib/code42/api/user.rb +72 -0
  10. data/lib/code42/client.rb +7 -178
  11. data/lib/code42/user.rb +8 -0
  12. data/lib/code42/version.rb +1 -1
  13. data/spec/cassettes/Code42_Client/_create_org/returns_created_org.yml +8 -8
  14. data/spec/cassettes/Code42_Client/_create_user/returns_created_user.yml +6 -6
  15. data/spec/cassettes/Code42_Client/_create_user/when_sending_an_invalid_email/raises_an_exception.yml +2 -2
  16. data/spec/cassettes/Code42_Client/_find_org_by_name/returns_the_org_with_the_specified_name.yml +12 -58
  17. data/spec/cassettes/Code42_Client/_get_token/returns_valid_tokens.yml +5 -5
  18. data/spec/cassettes/Code42_Client/_get_token/when_providing_invalid_credentials/should_raise_an_exception.yml +2 -2
  19. data/spec/cassettes/Code42_Client/_org/when_ID_is_not_passed/returns_my_org.yml +11 -11
  20. data/spec/cassettes/Code42_Client/_org/when_ID_is_passed_in/returns_a_specific_org.yml +11 -11
  21. data/spec/cassettes/Code42_Client/_ping/returns_a_ping.yml +5 -5
  22. data/spec/cassettes/Code42_Client/_user/when_ID_is_not_passed/returns_my_user.yml +10 -10
  23. data/spec/cassettes/Code42_Client/_user/when_ID_is_passed_in/returns_a_specific_user.yml +10 -10
  24. data/spec/cassettes/Code42_Client/_user/when_blocked/returns_the_blocked_status.yml +84 -0
  25. data/spec/cassettes/Code42_Client/_user/when_unblocked/returns_the_blocked_status.yml +113 -0
  26. data/spec/cassettes/Code42_Client/_user_roles/returns_an_enumerable.yml +7 -7
  27. data/spec/cassettes/Code42_Client/_validate_token/returns_a_valid_response.yml +10 -10
  28. data/spec/{crashplan → code42}/client_spec.rb +26 -5
  29. data/spec/{crashplan → code42}/connection_spec.rb +0 -0
  30. data/spec/{crashplan → code42}/org_spec.rb +0 -0
  31. data/spec/{crashplan → code42}/ping_spec.rb +0 -0
  32. data/spec/{crashplan → code42}/resource_spec.rb +0 -0
  33. data/spec/{crashplan → code42}/role_spec.rb +0 -0
  34. data/spec/{crashplan → code42}/settings_spec.rb +0 -0
  35. data/spec/{crashplan → code42}/token_spec.rb +0 -0
  36. data/spec/{crashplan → code42}/user_spec.rb +0 -0
  37. metadata +49 -66
  38. data/spec/cassettes/Crashplan_Client/_create_org/returns_created_org.yml +0 -47
  39. data/spec/cassettes/Crashplan_Client/_create_user/returns_created_user.yml +0 -44
  40. data/spec/cassettes/Crashplan_Client/_create_user/when_sending_an_invalid_email/raises_an_exception.yml +0 -37
  41. data/spec/cassettes/Crashplan_Client/_find_org_by_name/returns_the_org_with_the_specified_name.yml +0 -55
  42. data/spec/cassettes/Crashplan_Client/_get_token/returns_valid_tokens.yml +0 -38
  43. data/spec/cassettes/Crashplan_Client/_get_token/when_providing_invalid_credentials/should_raise_an_exception.yml +0 -37
  44. data/spec/cassettes/Crashplan_Client/_org/when_ID_is_not_passed/returns_my_org.yml +0 -54
  45. data/spec/cassettes/Crashplan_Client/_org/when_ID_is_passed_in/returns_a_specific_org.yml +0 -54
  46. data/spec/cassettes/Crashplan_Client/_ping/returns_a_ping.yml +0 -48
  47. data/spec/cassettes/Crashplan_Client/_user/when_ID_is_not_passed/returns_my_user.yml +0 -99
  48. data/spec/cassettes/Crashplan_Client/_user/when_ID_is_passed_in/returns_a_specific_user.yml +0 -53
  49. data/spec/cassettes/Crashplan_Client/_user_roles/returns_an_enumerable.yml +0 -50
  50. data/spec/cassettes/Crashplan_Client/_validate_token/returns_a_valid_response.yml +0 -128
@@ -1,53 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: http://admin:admin@localhost:7280/api/user/2
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept-Encoding:
11
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
- Accept:
13
- - ! '*/*'
14
- User-Agent:
15
- - Ruby
16
- response:
17
- status:
18
- code: 200
19
- message: !binary |-
20
- T0s=
21
- headers:
22
- !binary "Q2FjaGUtQ29udHJvbA==":
23
- - !binary |-
24
- bm8tc3RvcmU=
25
- !binary "UHJhZ21h":
26
- - !binary |-
27
- bm8tY2FjaGU=
28
- !binary "Q29udGVudC1UeXBl":
29
- - !binary |-
30
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
31
- !binary "Q29udGVudC1FbmNvZGluZw==":
32
- - !binary |-
33
- Z3ppcA==
34
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
35
- - !binary |-
36
- Y2h1bmtlZA==
37
- !binary "U2VydmVy":
38
- - !binary |-
39
- SmV0dHkoNy42LjMudjIwMTIwNDE2KQ==
40
- body:
41
- encoding: ASCII-8BIT
42
- string: !binary |-
43
- H4sIAAAAAAAAAIWSXW+CMBSG7/0VpNdiypcu3LnBFpJNDcK1OUJZmrXUlWJi
44
- jP997awRncnu2ue87/lqjyPHQZwoqEEBih3HOWqimaKcdAr4TkPkYy9wceD6
45
- uPBmMY7iKJiE05mrTxij8dmxAwm80/LjSYOToeg+a98RmdWa+OMrKKkhCEf1
46
- 09T3ahxNYRuE1SWv7kL1Ji+aV4ruCRpYW+DERMz5wgkHyjRse8Ysaqjs1OKs
47
- HWAGj+h3LxRk7fNBEVPV9SwX8vOmdX23nSfp67x8LzYv5bpYfqT5Zpm/bbIE
48
- XYW2CkpIAz1TlwicB4odJXti2ZaJ6ouYvA2wjgyHWknBxa2atnuq/qh1xeKw
49
- +62YLoo0X+XZOr3fW9bN29TuamiuJAFFRZuAIg8eP4yDaBKGd4/PRU0bWv1v
50
- jAJrNH9kdPoBpMgiQ4ACAAA=
51
- http_version:
52
- recorded_at: Wed, 20 Mar 2013 22:05:53 GMT
53
- recorded_with: VCR 2.4.0
@@ -1,50 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: http://admin:admin@localhost:7280/api/userRole/my
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept-Encoding:
11
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
- Accept:
13
- - ! '*/*'
14
- User-Agent:
15
- - Ruby
16
- response:
17
- status:
18
- code: 200
19
- message: !binary |-
20
- T0s=
21
- headers:
22
- !binary "Q2FjaGUtQ29udHJvbA==":
23
- - !binary |-
24
- bm8tc3RvcmU=
25
- !binary "UHJhZ21h":
26
- - !binary |-
27
- bm8tY2FjaGU=
28
- !binary "Q29udGVudC1UeXBl":
29
- - !binary |-
30
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
31
- !binary "Q29udGVudC1FbmNvZGluZw==":
32
- - !binary |-
33
- Z3ppcA==
34
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
35
- - !binary |-
36
- Y2h1bmtlZA==
37
- !binary "U2VydmVy":
38
- - !binary |-
39
- SmV0dHkoNy42LjMudjIwMTIwNDE2KQ==
40
- body:
41
- encoding: ASCII-8BIT
42
- string: !binary |-
43
- H4sIAAAAAAAAAF3PP2/CMBAF8J1PYXmOozunIZW3SiwMZYEFIYZTcpUsMEGO
44
- maJ8d87lb7v+5Ht+b5wppQMn6iiRdkqpUUQs+cBDonAW1BawMmANNBtsHDQO
45
- m9JaobkD0MXt4kyRwiDPx0lgyqrvqbtnbOyPvOyEsHjBigLnb9bb9dfie7l6
46
- JB779sD5cYoXvlsbmZLvTwtKfKsGcwMfBqWadRVIoRIADNRv1ULf+R/f/jvM
47
- m9BUuMHa1ejgs/ylP5s4Bj8McpaH7cY3yBnUBX/S0z7v3c+mK6NIym1NAQAA
48
- http_version:
49
- recorded_at: Thu, 07 Feb 2013 23:07:17 GMT
50
- recorded_with: VCR 2.4.0
@@ -1,128 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: http://admin:admin@localhost:7280/api/authToken/06zavyo44u0bv00dpqvrba2mkh-0a3xef19j13kr0xgtehwba1b3w
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept-Encoding:
11
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
- Accept:
13
- - ! '*/*'
14
- User-Agent:
15
- - Ruby
16
- response:
17
- status:
18
- code: 200
19
- message: !binary |-
20
- T0s=
21
- headers:
22
- !binary "Q2FjaGUtQ29udHJvbA==":
23
- - !binary |-
24
- bm8tc3RvcmU=
25
- !binary "UHJhZ21h":
26
- - !binary |-
27
- bm8tY2FjaGU=
28
- !binary "Q29udGVudC1UeXBl":
29
- - !binary |-
30
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
31
- !binary "Q29udGVudC1FbmNvZGluZw==":
32
- - !binary |-
33
- Z3ppcA==
34
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
35
- - !binary |-
36
- Y2h1bmtlZA==
37
- !binary "U2VydmVy":
38
- - !binary |-
39
- SmV0dHkoNy42LjMudjIwMTIwNDE2KQ==
40
- body:
41
- encoding: ASCII-8BIT
42
- string: !binary |-
43
- H4sIAAAAAAAAAC3MQQqAIBAF0H2nGGadMRoleI4uMKCBoCApbcS7N1G7z+P/
44
- 3ycAzKGx58boAKCLiLWYQ22ciyAa0qsio8ge2jqyTttl06Rod0Q4f4vCF+cq
45
- 9T4Exqv4v3a8OUUv6eRUw5jGA3x6xw54AAAA
46
- http_version:
47
- recorded_at: Thu, 07 Feb 2013 23:07:17 GMT
48
- - request:
49
- method: post
50
- uri: http://admin:admin@localhost:7280/api/authToken
51
- body:
52
- encoding: UTF-8
53
- string: ! '{"appCode":"CPP"}'
54
- headers:
55
- Content-Type:
56
- - application/json
57
- Accept:
58
- - ! '*/*'
59
- User-Agent:
60
- - Ruby
61
- response:
62
- status:
63
- code: 200
64
- message: OK
65
- headers:
66
- Cache-Control:
67
- - no-store
68
- Pragma:
69
- - no-cache
70
- Content-Type:
71
- - application/json; charset=utf-8
72
- Transfer-Encoding:
73
- - chunked
74
- Server:
75
- - Jetty(7.6.3.v20120416)
76
- body:
77
- encoding: US-ASCII
78
- string: ! "{\n \"metadata\": {\n \"timestamp\": \"2013-02-07T17:08:45.162-06:00\",\n
79
- \ \"params\": {}\n },\n \"data\": [\n \"108j8jdtxxjqp0ra106aa3092j\",\n
80
- \ \"09z8kiq7f273c0jilp86a0fiks\"\n ]\n}"
81
- http_version:
82
- recorded_at: Thu, 07 Feb 2013 23:08:45 GMT
83
- - request:
84
- method: get
85
- uri: http://admin:admin@localhost:7280/api/authToken/108j8jdtxxjqp0ra106aa3092j-09z8kiq7f273c0jilp86a0fiks
86
- body:
87
- encoding: US-ASCII
88
- string: ''
89
- headers:
90
- Accept-Encoding:
91
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
92
- Accept:
93
- - ! '*/*'
94
- User-Agent:
95
- - Ruby
96
- response:
97
- status:
98
- code: 200
99
- message: !binary |-
100
- T0s=
101
- headers:
102
- !binary "Q2FjaGUtQ29udHJvbA==":
103
- - !binary |-
104
- bm8tc3RvcmU=
105
- !binary "UHJhZ21h":
106
- - !binary |-
107
- bm8tY2FjaGU=
108
- !binary "Q29udGVudC1UeXBl":
109
- - !binary |-
110
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
111
- !binary "Q29udGVudC1FbmNvZGluZw==":
112
- - !binary |-
113
- Z3ppcA==
114
- !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
115
- - !binary |-
116
- Y2h1bmtlZA==
117
- !binary "U2VydmVy":
118
- - !binary |-
119
- SmV0dHkoNy42LjMudjIwMTIwNDE2KQ==
120
- body:
121
- encoding: ASCII-8BIT
122
- string: !binary |-
123
- H4sIAAAAAAAAAF3NPQ7DIAyG4T2nQJ5DZdIfIs7RC1jCA1IdRUC6IO4eo3bK
124
- +sjv5zYZA8KVIlWCYIxpKmo1CZdKsivCgu5ucbHo384HXMPjeXN+tfgKiDD/
125
- ip0ySdHz1hX6ULiufumTokLNB/+zo3DeSHj8oShpg1FP/QSeOIqYmgAAAA==
126
- http_version:
127
- recorded_at: Thu, 07 Feb 2013 23:08:45 GMT
128
- recorded_with: VCR 2.4.0