microsoft_graph_core 0.1.0 → 0.3.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/.github/workflows/auto-merge-dependabot.yml +32 -0
- data/.github/workflows/projectsbot.yml +1 -1
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/ruby.yml +2 -2
- data/CHANGELOG.md +12 -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 +5 -5
- metadata +39 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc9a6dd0e83e2b73a46e8761c5a9865f5e99ef7ce8e931ddd08ed03f6e1b110b
|
4
|
+
data.tar.gz: 4cbb63f80ad7a5ea9728a1c7a519611e475d7ea5227ab8f9284e3373fbea403a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6925575a3678cf9c8b11458d60a0d14b4d854ba0eda61c6af444088e6db31faec798c3dd67e5b6a71b1293572c2006a3fb04924ee4abb28b4fdbc532fa6519e0
|
7
|
+
data.tar.gz: d16c7a343307197c92e0fd95efbab984ef717baff2dff9d1cbc401259ce97c2727b15f52183ed25ddf09cb52b13b245659bbeb31608918e837930e807befccde
|
@@ -0,0 +1,32 @@
|
|
1
|
+
name: Auto-merge dependabot updates
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches: [ main ]
|
6
|
+
|
7
|
+
permissions:
|
8
|
+
pull-requests: write
|
9
|
+
contents: write
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
|
13
|
+
dependabot-merge:
|
14
|
+
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
|
17
|
+
if: ${{ github.actor == 'dependabot[bot]' }}
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- name: Dependabot metadata
|
21
|
+
id: metadata
|
22
|
+
uses: dependabot/fetch-metadata@v1.3.6
|
23
|
+
with:
|
24
|
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
25
|
+
|
26
|
+
- name: Enable auto-merge for Dependabot PRs
|
27
|
+
# Only if version bump is not a major version change
|
28
|
+
if: ${{steps.metadata.outputs.update-type != 'version-update:semver-major'}}
|
29
|
+
run: gh pr merge --auto --merge "$PR_URL"
|
30
|
+
env:
|
31
|
+
PR_URL: ${{github.event.pull_request.html_url}}
|
32
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
@@ -10,7 +10,7 @@ jobs:
|
|
10
10
|
steps:
|
11
11
|
- name: Generate token
|
12
12
|
id: generate_token
|
13
|
-
uses: tibdex/github-app-token@
|
13
|
+
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
14
14
|
with:
|
15
15
|
app_id: ${{ secrets.GRAPHBOT_APP_ID }}
|
16
16
|
private_key: ${{ secrets.GRAPHBOT_APP_PEM }}
|
data/.github/workflows/ruby.yml
CHANGED
@@ -12,7 +12,7 @@ jobs:
|
|
12
12
|
fail-fast: false
|
13
13
|
matrix:
|
14
14
|
os: [ubuntu-latest, macos-latest]
|
15
|
-
ruby-version: ['
|
15
|
+
ruby-version: ['3.0', '3.1', '3.2', head, jruby, jruby-head, truffleruby, truffleruby-head]
|
16
16
|
runs-on: ${{ matrix.os }}
|
17
17
|
steps:
|
18
18
|
- uses: actions/checkout@v3
|
@@ -25,7 +25,7 @@ jobs:
|
|
25
25
|
- name: Run tests
|
26
26
|
run: bundle exec rake
|
27
27
|
- name: Upload artifacts for ruby version 3 and ubuntu
|
28
|
-
if: ${{ matrix.os == 'ubuntu-latest' && matrix.ruby-version == '3.
|
28
|
+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.ruby-version == '3.2'}}
|
29
29
|
uses: actions/upload-artifact@v3
|
30
30
|
with:
|
31
31
|
name: drop
|
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
11
11
|
|
12
12
|
### Changed
|
13
13
|
|
14
|
+
## [0.3.0] - 2023-03-28
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
- Upgraded kiota dependencies
|
19
|
+
|
20
|
+
## [0.2.0] - 2023-01-09
|
21
|
+
|
22
|
+
### Added
|
23
|
+
|
24
|
+
- Added authentication providers with default values for Microsoft Graph.
|
25
|
+
|
14
26
|
## [0.1.0] - 2023-01-09
|
15
27
|
|
16
28
|
### 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
|
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
'source_code_uri' => 'https://github.com/microsoftgraph/msgraph-sdk-ruby-core',
|
21
21
|
'github_repo' => 'ssh://github.com/microsoftgraph/msgraph-sdk-ruby-core'
|
22
22
|
}
|
23
|
-
spec.required_ruby_version = '>=
|
23
|
+
spec.required_ruby_version = '>= 3.0.0'
|
24
24
|
|
25
25
|
# Specify which files should be added to the gem when it is released.
|
26
26
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -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', '
|
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.15'
|
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,71 +1,89 @@
|
|
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.3.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-
|
11
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: microsoft_kiota_abstractions
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.13'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
22
|
+
version: '0.15'
|
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'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.15'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: microsoft_kiota_faraday
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.10'
|
40
|
+
- - "<"
|
32
41
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
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
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0.10'
|
50
|
+
- - "<"
|
39
51
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
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
|
+
- - ">="
|
60
72
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
73
|
+
version: '0.7'
|
74
|
+
- - "<"
|
75
|
+
- !ruby/object:Gem::Version
|
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
|
@@ -103,6 +121,7 @@ extra_rdoc_files: []
|
|
103
121
|
files:
|
104
122
|
- ".github/CODEOWNERS"
|
105
123
|
- ".github/dependabot.yml"
|
124
|
+
- ".github/workflows/auto-merge-dependabot.yml"
|
106
125
|
- ".github/workflows/code-ql.yml"
|
107
126
|
- ".github/workflows/conflicting-pr-label.yml"
|
108
127
|
- ".github/workflows/projectsbot.yml"
|
@@ -120,6 +139,8 @@ files:
|
|
120
139
|
- SECURITY.md
|
121
140
|
- THIRD PARTY NOTICES
|
122
141
|
- lib/microsoft_graph_core.rb
|
142
|
+
- lib/microsoft_graph_core/authentication/oauth_access_token_provider.rb
|
143
|
+
- lib/microsoft_graph_core/authentication/oauth_authentication_provider.rb
|
123
144
|
- lib/microsoft_graph_core/graph_client_factory.rb
|
124
145
|
- lib/microsoft_graph_core/graph_client_options.rb
|
125
146
|
- lib/microsoft_graph_core/graph_request_adapter_base.rb
|
@@ -143,14 +164,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
164
|
requirements:
|
144
165
|
- - ">="
|
145
166
|
- !ruby/object:Gem::Version
|
146
|
-
version:
|
167
|
+
version: 3.0.0
|
147
168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
169
|
requirements:
|
149
170
|
- - ">="
|
150
171
|
- !ruby/object:Gem::Version
|
151
172
|
version: '0'
|
152
173
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
174
|
+
rubygems_version: 3.4.6
|
154
175
|
signing_key:
|
155
176
|
specification_version: 4
|
156
177
|
summary: Ruby SDK for Microsoft Graph
|