op_connect 0.1.1

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 (43) hide show
  1. checksums.yaml +7 -0
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +31 -0
  3. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  4. data/.github/workflows/coverage.yml +27 -0
  5. data/.github/workflows/publish.yml +42 -0
  6. data/.github/workflows/test.yml +27 -0
  7. data/.gitignore +11 -0
  8. data/CODE_OF_CONDUCT.md +84 -0
  9. data/Gemfile +16 -0
  10. data/Guardfile +23 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +322 -0
  13. data/Rakefile +12 -0
  14. data/bin/console +17 -0
  15. data/bin/setup +8 -0
  16. data/docker-compose.yml +20 -0
  17. data/lib/op_connect/api_request/actor.rb +15 -0
  18. data/lib/op_connect/api_request/resource.rb +14 -0
  19. data/lib/op_connect/api_request.rb +17 -0
  20. data/lib/op_connect/client/files.rb +20 -0
  21. data/lib/op_connect/client/items.rb +34 -0
  22. data/lib/op_connect/client/vaults.rb +15 -0
  23. data/lib/op_connect/client.rb +45 -0
  24. data/lib/op_connect/configurable.rb +45 -0
  25. data/lib/op_connect/connection.rb +103 -0
  26. data/lib/op_connect/default.rb +57 -0
  27. data/lib/op_connect/error.rb +60 -0
  28. data/lib/op_connect/item/field.rb +18 -0
  29. data/lib/op_connect/item/file.rb +16 -0
  30. data/lib/op_connect/item/generator_recipe.rb +12 -0
  31. data/lib/op_connect/item/section.rb +12 -0
  32. data/lib/op_connect/item/url.rb +14 -0
  33. data/lib/op_connect/item.rb +31 -0
  34. data/lib/op_connect/object.rb +21 -0
  35. data/lib/op_connect/response/raise_error.rb +16 -0
  36. data/lib/op_connect/response.rb +5 -0
  37. data/lib/op_connect/server_health/dependency.rb +13 -0
  38. data/lib/op_connect/server_health.rb +13 -0
  39. data/lib/op_connect/vault.rb +16 -0
  40. data/lib/op_connect/version.rb +5 -0
  41. data/lib/op_connect.rb +47 -0
  42. data/op_connect.gemspec +34 -0
  43. metadata +116 -0
data/lib/op_connect.rb ADDED
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "faraday"
4
+ require "faraday_middleware"
5
+
6
+ # Ruby toolkit for the 1Password Connect REST API.
7
+ #
8
+ module OpConnect
9
+ autoload :Client, "op_connect/client"
10
+ autoload :Configurable, "op_connect/configurable"
11
+ autoload :Connection, "op_connect/connection"
12
+ autoload :Default, "op_connect/default"
13
+ autoload :Object, "op_connect/object"
14
+ autoload :Response, "op_connect/response"
15
+
16
+ autoload :Error, "op_connect/error"
17
+ autoload :ClientError, "op_connect/error"
18
+ autoload :BadRequest, "op_connect/error"
19
+ autoload :Forbidden, "op_connect/error"
20
+ autoload :NotFound, "op_connect/error"
21
+ autoload :PayloadTooLarge, "op_connect/error"
22
+ autoload :Unauthorized, "op_connect/error"
23
+ autoload :ServerError, "op_connect/error"
24
+ autoload :InternalServerError, "op_connect/error"
25
+ autoload :ServiceUnavailable, "op_connect/error"
26
+
27
+ # Classes used to return a nicer object wrapping the response.
28
+ autoload :APIRequest, "op_connect/api_request"
29
+ autoload :Item, "op_connect/item"
30
+ autoload :ServerHealth, "op_connect/server_health"
31
+ autoload :Vault, "op_connect/vault"
32
+
33
+ class << self
34
+ include OpConnect::Configurable
35
+
36
+ # API client based on configured options {Configurable}
37
+ #
38
+ # @return [OpConnect::Client] API wrapper
39
+ #
40
+ def client
41
+ return @client if defined?(@client) && @client.same_options?(options)
42
+ @client = OpConnect::Client.new(options)
43
+ end
44
+ end
45
+ end
46
+
47
+ OpConnect.setup
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/op_connect/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "op_connect"
7
+ spec.version = OpConnect::VERSION
8
+ spec.authors = ["Andrew Porter"]
9
+ spec.email = ["partydrone@icloud.com"]
10
+
11
+ spec.summary = "A Ruby SDK for the 1Password Connect API."
12
+ spec.description = "A Ruby SDK for the 1Password Connect API. 1Password Connect API documentation can be found at https://support.1password.com/connect-api-reference/"
13
+ spec.homepage = "https://github.com/partydrone/connect-sdk-ruby"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.5.0"
16
+
17
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'https://mygemserver.com'"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/partydrone/connect-sdk-ruby"
21
+ spec.metadata["github_repo"] = "ssh://github.com/partydrone/connect-sdk-ruby"
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.add_dependency "faraday", "~> 1.8"
33
+ spec.add_dependency "faraday_middleware", "~> 1.2"
34
+ end
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: op_connect
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Porter
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-11-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.8'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday_middleware
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.2'
41
+ description: A Ruby SDK for the 1Password Connect API. 1Password Connect API documentation
42
+ can be found at https://support.1password.com/connect-api-reference/
43
+ email:
44
+ - partydrone@icloud.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
50
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
51
+ - ".github/workflows/coverage.yml"
52
+ - ".github/workflows/publish.yml"
53
+ - ".github/workflows/test.yml"
54
+ - ".gitignore"
55
+ - CODE_OF_CONDUCT.md
56
+ - Gemfile
57
+ - Guardfile
58
+ - LICENSE.txt
59
+ - README.md
60
+ - Rakefile
61
+ - bin/console
62
+ - bin/setup
63
+ - docker-compose.yml
64
+ - lib/op_connect.rb
65
+ - lib/op_connect/api_request.rb
66
+ - lib/op_connect/api_request/actor.rb
67
+ - lib/op_connect/api_request/resource.rb
68
+ - lib/op_connect/client.rb
69
+ - lib/op_connect/client/files.rb
70
+ - lib/op_connect/client/items.rb
71
+ - lib/op_connect/client/vaults.rb
72
+ - lib/op_connect/configurable.rb
73
+ - lib/op_connect/connection.rb
74
+ - lib/op_connect/default.rb
75
+ - lib/op_connect/error.rb
76
+ - lib/op_connect/item.rb
77
+ - lib/op_connect/item/field.rb
78
+ - lib/op_connect/item/file.rb
79
+ - lib/op_connect/item/generator_recipe.rb
80
+ - lib/op_connect/item/section.rb
81
+ - lib/op_connect/item/url.rb
82
+ - lib/op_connect/object.rb
83
+ - lib/op_connect/response.rb
84
+ - lib/op_connect/response/raise_error.rb
85
+ - lib/op_connect/server_health.rb
86
+ - lib/op_connect/server_health/dependency.rb
87
+ - lib/op_connect/vault.rb
88
+ - lib/op_connect/version.rb
89
+ - op_connect.gemspec
90
+ homepage: https://github.com/partydrone/connect-sdk-ruby
91
+ licenses:
92
+ - MIT
93
+ metadata:
94
+ homepage_uri: https://github.com/partydrone/connect-sdk-ruby
95
+ source_code_uri: https://github.com/partydrone/connect-sdk-ruby
96
+ github_repo: ssh://github.com/partydrone/connect-sdk-ruby
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: 2.5.0
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ requirements: []
112
+ rubygems_version: 3.2.22
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: A Ruby SDK for the 1Password Connect API.
116
+ test_files: []