-
Notifications
You must be signed in to change notification settings - Fork 7
Introduce vendor namespace support #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json | ||
| language: en-US | ||
|
|
||
| reviews: | ||
| request_changes_workflow: false | ||
| high_level_summary: true | ||
| poem: false | ||
|
|
||
| path_instructions: | ||
| - path: "Sources/**/*.swift" | ||
| instructions: | | ||
| Flag any hardcoded occurrence of the literal `thunderid`/`ThunderID`/`THUNDERID` (any casing) used to | ||
| build a runtime key or name — Keychain service names, log tags, and similar. | ||
|
|
||
| Do not flag the module name or a type whose purpose IS to represent the SDK itself (e.g. | ||
| `ThunderIDClient`, `ThunderIDProvider`). That's a fixed identity, not a per-tenant value. | ||
|
|
||
| For everything else, ask: **"Should this read from `ThunderIDConfig.vendor` instead of hardcoding the | ||
| vendor name?"** The best fix is avoiding the vendor name entirely when the brand prefix isn't | ||
| load-bearing. When a brand-scoped namespace is genuinely required, it should resolve through | ||
| `config.vendor` (which already defaults to `"thunderid"`) rather than a literal string. If the same | ||
| default-resolution logic starts appearing in more than one place, ask for it to be extracted into a | ||
| shared helper instead of repeated inline. | ||
|
|
||
| auto_review: | ||
| enabled: true | ||
| ignore_title_keywords: | ||
| - "WIP" | ||
| - "DO NOT MERGE" | ||
| base_branches: | ||
| - main | ||
|
|
||
| path_filters: | ||
| - "!**/.build/**" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). | ||
| * | ||
| * WSO2 LLC. licenses this file to you under the Apache License, | ||
| * Version 2.0 (the "License"); you may not use this file except | ||
| * in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| /// Constants for vendor-specific configuration. | ||
| /// | ||
| /// By default, the vendor is inferred as ThunderID. | ||
| public enum VendorConstants { | ||
| /// The prefix used for vendor-specific storage identifiers (e.g. Keychain service name), or other | ||
| /// runtime keys/names. | ||
| public static let vendorPrefix: String = "thunderid" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Default i18n storage key changes from
"thunder_locale"to"thunderid_locale", silently losing existing locale preferences.The previous default
ThunderIDI18n()usedstorageKey: "thunder_locale". The new defaultThunderIDI18n(storageKey: "\(config.vendor)_locale")produces"thunderid_locale"for the default vendor. Existing users upgrading will have their stored locale preference orphaned under the old key, silently reverting to the fallback locale.Consider a migration fallback in
ThunderIDI18n.init— if the new key has no stored value, read from the old key and migrate.🛡️ Proposed migration fallback in ThunderIDI18n.init
public init( bundles: [String: [String: String]] = [:], language: String? = nil, fallbackLanguage: String = "en-US", storageKey: String = "thunder_locale" ) { self.bundles = bundles self.fallbackLocale = fallbackLanguage self.storageKey = storageKey - let stored = UserDefaults.standard.string(forKey: storageKey) + let defaults = UserDefaults.standard + var stored = defaults.string(forKey: storageKey) + if stored == nil, storageKey != "thunder_locale" { + stored = defaults.string(forKey: "thunder_locale") + if let stored { defaults.set(stored, forKey: storageKey) } + } self.activeLocale = language ?? stored ?? fallbackLanguage }🤖 Prompt for AI Agents