microsoft_graph_core 0.1.0 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +2 -1
- data/lib/microsoft_graph_core/authentication/oauth_access_token_provider.rb +22 -0
- data/lib/microsoft_graph_core/authentication/oauth_authentication_provider.rb +11 -0
- data/lib/microsoft_graph_core/version_information.rb +1 -1
- data/lib/microsoft_graph_core.rb +2 -0
- data/microsoft_graph_core.gemspec +4 -4
- metadata +34 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c675efe3e600fe5e3167f22f83d4a383ad19d9ff8ea78e539f30768326a9b291
|
4
|
+
data.tar.gz: 9ad15ec7cc22a1d1a0c2f3c2b19c0ef75d28d75dd25eb3baf80f36b48df8b763
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de2d57a9c323a67393ee5d62cd57321bc25dcb40d0b5176ab2cd8b9e78bf40f7f8284000336809f9b3fc5ceb8bc5b48091477addfe39d57f879d795a87d28e81
|
7
|
+
data.tar.gz: b38cb8444c4a30eb51de10af1aba7d3adf56e3abdac05143b3d7c418fe7b4b2f50a290ac7e6ab265b3b63f2313e62cbec596c4e842726a8ffba895b715c64fb2
|
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
11
11
|
|
12
12
|
### Changed
|
13
13
|
|
14
|
+
## [0.2.0] - 2023-01-09
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
- Added authentication providers with default values for Microsoft Graph.
|
19
|
+
|
14
20
|
## [0.1.0] - 2023-01-09
|
15
21
|
|
16
22
|
### Added
|
data/README.md
CHANGED
@@ -30,10 +30,11 @@ For an example of how to get an authentication provider, see [choose a Microsoft
|
|
30
30
|
|
31
31
|
```Ruby
|
32
32
|
require "microsoft_kiota_authentication_oauth"
|
33
|
+
require "microsoft_graph_core"
|
33
34
|
|
34
35
|
context = MicrosoftKiotaAuthenticationOauth::ClientCredentialContext.new("<the tenant id from your app registration>", "<the client id from your app registration>", "<the client secret from your app registration>")
|
35
36
|
|
36
|
-
authentication_provider =
|
37
|
+
authentication_provider = MicrosoftGraphCore::Authentication::OAuthAuthenticationProvider.new(context, nil, ["Files.Read"])
|
37
38
|
```
|
38
39
|
|
39
40
|
### 2.3 Get a Graph Service Client and Adapter object
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'microsoft_kiota_authentication_oauth'
|
2
|
+
module MicrosoftGraphCore
|
3
|
+
module Authentication
|
4
|
+
# Wrapper around the kiota access token provider with the Microsoft Graph defaults set up.
|
5
|
+
class OAuthAccessTokenProvider < MicrosoftKiotaAuthenticationOAuth::OAuthAccessTokenProvider
|
6
|
+
|
7
|
+
# This is the initializer for OAuthAccessTokenProvider.
|
8
|
+
# :params
|
9
|
+
# token_request_context: a instance of one of our token request context or a custom implementation
|
10
|
+
# allowed_hosts: an array of strings, where each string is an allowed host, default is an array of Microsoft Graph hosts
|
11
|
+
# scopes: an array of strings, where each string is a scope, default is empty array
|
12
|
+
def initialize(token_request_context, allowed_hosts = [], scopes = [])
|
13
|
+
if allowed_hosts.nil? || allowed_hosts.empty?
|
14
|
+
allowed_hosts = ['graph.microsoft.com', 'graph.microsoft.us', 'dod-graph.microsoft.us',
|
15
|
+
'graph.microsoft.de', 'microsoftgraph.chinacloudapi.cn',
|
16
|
+
'canary.graph.microsoft.com']
|
17
|
+
end
|
18
|
+
super(token_request_context, allowed_hosts, scopes)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'microsoft_kiota_abstractions'
|
2
|
+
require_relative 'oauth_access_token_provider'
|
3
|
+
module MicrosoftGraphCore
|
4
|
+
module Authentication
|
5
|
+
class OAuthAuthenticationProvider < MicrosoftKiotaAbstractions::BaseBearerTokenAuthenticationProvider
|
6
|
+
def initialize(token_request_context, allowed_hosts, scopes)
|
7
|
+
super(MicrosoftGraphCore::Authentication::OAuthAccessTokenProvider.new(token_request_context, allowed_hosts, scopes))
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/microsoft_graph_core.rb
CHANGED
@@ -4,6 +4,8 @@ require_relative 'microsoft_graph_core/graph_client_factory'
|
|
4
4
|
require_relative 'microsoft_graph_core/graph_client_options'
|
5
5
|
require_relative 'microsoft_graph_core/graph_request_adapter_base'
|
6
6
|
require_relative 'microsoft_graph_core/middleware/telemetry_handler'
|
7
|
+
require_relative 'microsoft_graph_core/authentication/oauth_access_token_provider'
|
8
|
+
require_relative 'microsoft_graph_core/authentication/oauth_authentication_provider'
|
7
9
|
|
8
10
|
module MicrosoftGraphCore
|
9
11
|
|
@@ -31,10 +31,10 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
|
34
|
-
spec.add_runtime_dependency 'microsoft_kiota_abstractions', '~> 0.
|
35
|
-
spec.add_runtime_dependency 'microsoft_kiota_faraday', '
|
36
|
-
spec.add_runtime_dependency 'microsoft_kiota_serialization_json', '~> 0.
|
37
|
-
spec.add_runtime_dependency 'microsoft_kiota_authentication_oauth', '
|
34
|
+
spec.add_runtime_dependency 'microsoft_kiota_abstractions', '~> 0.13.0', '>= 0.13.0'
|
35
|
+
spec.add_runtime_dependency 'microsoft_kiota_faraday', '>= 0.10', '< 0.12'
|
36
|
+
spec.add_runtime_dependency 'microsoft_kiota_serialization_json', '~> 0.8.0'
|
37
|
+
spec.add_runtime_dependency 'microsoft_kiota_authentication_oauth', '>= 0.7', '< 0.8'
|
38
38
|
spec.add_development_dependency 'rake', '~> 13.0'
|
39
39
|
spec.add_development_dependency "rspec", "~> 3.0"
|
40
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: microsoft_graph_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: microsoft_kiota_abstractions
|
@@ -16,56 +16,74 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.13.0
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.13.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
29
|
+
version: 0.13.0
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.13.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: microsoft_kiota_faraday
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.10
|
39
|
+
version: '0.10'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0.12'
|
34
43
|
type: :runtime
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
38
|
-
- - "
|
47
|
+
- - ">="
|
39
48
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.10
|
49
|
+
version: '0.10'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0.12'
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: microsoft_kiota_serialization_json
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
44
56
|
requirements:
|
45
57
|
- - "~>"
|
46
58
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
59
|
+
version: 0.8.0
|
48
60
|
type: :runtime
|
49
61
|
prerelease: false
|
50
62
|
version_requirements: !ruby/object:Gem::Requirement
|
51
63
|
requirements:
|
52
64
|
- - "~>"
|
53
65
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
66
|
+
version: 0.8.0
|
55
67
|
- !ruby/object:Gem::Dependency
|
56
68
|
name: microsoft_kiota_authentication_oauth
|
57
69
|
requirement: !ruby/object:Gem::Requirement
|
58
70
|
requirements:
|
59
|
-
- - "
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0.7'
|
74
|
+
- - "<"
|
60
75
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
76
|
+
version: '0.8'
|
62
77
|
type: :runtime
|
63
78
|
prerelease: false
|
64
79
|
version_requirements: !ruby/object:Gem::Requirement
|
65
80
|
requirements:
|
66
|
-
- - "
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0.7'
|
84
|
+
- - "<"
|
67
85
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
86
|
+
version: '0.8'
|
69
87
|
- !ruby/object:Gem::Dependency
|
70
88
|
name: rake
|
71
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,6 +138,8 @@ files:
|
|
120
138
|
- SECURITY.md
|
121
139
|
- THIRD PARTY NOTICES
|
122
140
|
- lib/microsoft_graph_core.rb
|
141
|
+
- lib/microsoft_graph_core/authentication/oauth_access_token_provider.rb
|
142
|
+
- lib/microsoft_graph_core/authentication/oauth_authentication_provider.rb
|
123
143
|
- lib/microsoft_graph_core/graph_client_factory.rb
|
124
144
|
- lib/microsoft_graph_core/graph_client_options.rb
|
125
145
|
- lib/microsoft_graph_core/graph_request_adapter_base.rb
|