lex-microsoft_teams 0.6.2 → 0.6.4
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 +11 -0
- data/CLAUDE.md +3 -2
- data/lib/legion/extensions/microsoft_teams/actors/auth_validator.rb +9 -1
- data/lib/legion/extensions/microsoft_teams/actors/incremental_sync.rb +7 -3
- data/lib/legion/extensions/microsoft_teams/actors/profile_ingest.rb +8 -4
- data/lib/legion/extensions/microsoft_teams/runners/profile_ingest.rb +1 -0
- data/lib/legion/extensions/microsoft_teams/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6fccc37def8926f79ed1626030932012a3ac6875ee711b577c7ccd027a1158b4
|
|
4
|
+
data.tar.gz: 251f6d348cc76c15d226090375f121bac73c5e1b0de95bd70ea9bc975a4e93a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b326a71937fd36b9c98385b41d21f9600ce9ab9b28e7f91261e85b3bb117af6a84365c47d86152f67b34260f8068c1d1d8891abe82925e204f89380f2080e4e
|
|
7
|
+
data.tar.gz: 4ba5d4507933666d677e8d53bf1100556d88ad7abc7617b6b20b854419a2951f4de569abcb3faea4052d0c3bbe0d8eba6b4c96f85ad36125d1bc412ed8573f89
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.4] - 2026-03-22
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `auto_authenticate` setting (`settings[:microsoft_teams][:auth][:delegated][:auto_authenticate]`, default `false`) — when true, triggers browser OAuth popup on boot even for first-time users with no prior token
|
|
7
|
+
|
|
8
|
+
## [0.6.3] - 2026-03-22
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Add `extend self` to `Runners::ProfileIngest` so methods are callable at module level by framework actor dispatch
|
|
12
|
+
- Add token guard to `IncrementalSync` and `ProfileIngest` actors to skip execution when no valid delegated token exists
|
|
13
|
+
|
|
3
14
|
## [0.6.1] - 2026-03-21
|
|
4
15
|
|
|
5
16
|
### Fixed
|
data/CLAUDE.md
CHANGED
|
@@ -10,7 +10,7 @@ Legion Extension that connects LegionIO to Microsoft Teams via Graph API and Bot
|
|
|
10
10
|
|
|
11
11
|
**GitHub**: https://github.com/LegionIO/lex-microsoft_teams
|
|
12
12
|
**License**: MIT
|
|
13
|
-
**Version**: 0.6.
|
|
13
|
+
**Version**: 0.6.4
|
|
14
14
|
|
|
15
15
|
## Architecture
|
|
16
16
|
|
|
@@ -156,6 +156,7 @@ microsoft_teams:
|
|
|
156
156
|
client_id: "..."
|
|
157
157
|
client_secret: "vault://secret/teams/client_secret"
|
|
158
158
|
delegated:
|
|
159
|
+
auto_authenticate: false # when true, opens browser OAuth on boot even for first-time users
|
|
159
160
|
refresh_interval: 900 # seconds (TokenRefresher interval)
|
|
160
161
|
bot:
|
|
161
162
|
bot_id: "28:your-bot-id"
|
|
@@ -251,7 +252,7 @@ Optional framework dependencies (guarded with `defined?`, not in gemspec):
|
|
|
251
252
|
|
|
252
253
|
```bash
|
|
253
254
|
bundle install
|
|
254
|
-
bundle exec rspec #
|
|
255
|
+
bundle exec rspec # 292 specs across 39 spec files (as of v0.6.0)
|
|
255
256
|
bundle exec rubocop # Clean
|
|
256
257
|
```
|
|
257
258
|
|
|
@@ -30,12 +30,15 @@ module Legion
|
|
|
30
30
|
token = token_cache.cached_delegated_token
|
|
31
31
|
if token
|
|
32
32
|
log_info('Teams delegated auth restored')
|
|
33
|
-
elsif token_cache.previously_authenticated?
|
|
33
|
+
elsif token_cache.previously_authenticated? || auto_authenticate?
|
|
34
34
|
attempt_browser_reauth(token_cache)
|
|
35
35
|
end
|
|
36
36
|
elsif token_cache.previously_authenticated?
|
|
37
37
|
log_warn('Token file found but could not load, attempting re-authentication')
|
|
38
38
|
attempt_browser_reauth(token_cache)
|
|
39
|
+
elsif auto_authenticate?
|
|
40
|
+
log_info('auto_authenticate enabled, opening browser for initial authentication...')
|
|
41
|
+
attempt_browser_reauth(token_cache)
|
|
39
42
|
else
|
|
40
43
|
log_debug('No Teams delegated auth configured, skipping')
|
|
41
44
|
end
|
|
@@ -77,6 +80,11 @@ module Legion
|
|
|
77
80
|
false
|
|
78
81
|
end
|
|
79
82
|
|
|
83
|
+
def auto_authenticate?
|
|
84
|
+
settings = teams_auth_settings
|
|
85
|
+
settings.dig(:delegated, :auto_authenticate) == true
|
|
86
|
+
end
|
|
87
|
+
|
|
80
88
|
def teams_auth_settings
|
|
81
89
|
return {} unless defined?(Legion::Settings)
|
|
82
90
|
|
|
@@ -28,19 +28,23 @@ module Legion
|
|
|
28
28
|
false
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
def
|
|
31
|
+
def manual
|
|
32
32
|
token = resolve_token
|
|
33
|
+
return unless token
|
|
34
|
+
|
|
33
35
|
settings = begin
|
|
34
36
|
Legion::Settings[:microsoft_teams] || {}
|
|
35
37
|
rescue StandardError
|
|
36
38
|
{}
|
|
37
39
|
end
|
|
38
40
|
ingest = settings[:ingest] || {}
|
|
39
|
-
|
|
41
|
+
runner_class.incremental_sync(
|
|
40
42
|
token: token,
|
|
41
43
|
top_people: ingest.fetch(:top_people, 10),
|
|
42
44
|
message_depth: ingest.fetch(:message_depth, 50)
|
|
43
|
-
|
|
45
|
+
)
|
|
46
|
+
rescue StandardError => e
|
|
47
|
+
Legion::Logging.error("IncrementalSync: #{e.message}") if defined?(Legion::Logging)
|
|
44
48
|
end
|
|
45
49
|
|
|
46
50
|
private
|
|
@@ -22,19 +22,23 @@ module Legion
|
|
|
22
22
|
false
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def
|
|
25
|
+
def manual
|
|
26
26
|
token = resolve_token
|
|
27
|
+
return unless token
|
|
28
|
+
|
|
27
29
|
settings = begin
|
|
28
|
-
Legion::Settings[:microsoft_teams]
|
|
30
|
+
Legion::Settings[:microsoft_teams] || {}
|
|
29
31
|
rescue StandardError
|
|
30
32
|
{}
|
|
31
33
|
end
|
|
32
34
|
ingest = settings[:ingest] || {}
|
|
33
|
-
|
|
35
|
+
runner_class.full_ingest(
|
|
34
36
|
token: token,
|
|
35
37
|
top_people: ingest.fetch(:top_people, 10),
|
|
36
38
|
message_depth: ingest.fetch(:message_depth, 50)
|
|
37
|
-
|
|
39
|
+
)
|
|
40
|
+
rescue StandardError => e
|
|
41
|
+
Legion::Logging.error("ProfileIngest: #{e.message}") if defined?(Legion::Logging)
|
|
38
42
|
end
|
|
39
43
|
|
|
40
44
|
private
|