feat: Added support for standalone shield server with sdk#39
Merged
feat: Added support for standalone shield server with sdk#39
Conversation
eaabccb to
e085828
Compare
e085828 to
5692089
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes made
SHIELD_SERVICEenv var fallback on all--serviceCLI options:shield status,shield enable,shield disable,shield maintenance, andshield scheduleall readSHIELD_SERVICEautomatically, set it once withexport SHIELD_SERVICE=payments-serviceand every command scopes itself to that service without repeating--service. An explicit--serviceflag always wins.shield current-servicecommand: shows the active service context from theSHIELD_SERVICEenvironment variable, or a hint to set it when the variable is absent.shield servicescommand: lists all distinct service names registered with the Shield Server, so you can discover which services are connected before switching context.set_rate_limit_policy(): attempting to add a rate limit policy for a route that does not exist now raisesRouteNotFoundExceptionimmediately; the REST API returns404and the CLI prints a clear error, preventing phantom policies from accumulating.ShieldSDK.rate_limit_backendparameter: pass aRedisBackendinstance to share rate limit counters across all replicas of a service connected to the same Shield Server; without it each replica enforces limits independently.rl_policyenvelopes and applied to every connected SDK client in real time, no restart required.ShieldSDKauto-login (username/passwordparams): pass credentials directly toShieldSDKinstead of a pre-issued token; on startup the SDK callsPOST /api/auth/loginwithplatform="sdk"and caches the resulting long-lived token for the life of the process, no manual token management required.sdk_token_expiry):ShieldServerandShieldAdminnow acceptsdk_token_expiry(default 1 year) independently fromtoken_expiry(default 24 h for dashboard / CLI users), so service apps can run indefinitely without re-authentication while human sessions remain short-lived.platformfield onPOST /api/auth/login: the login endpoint now accepts"cli"(default) or"sdk"in the request body;"sdk"tokens usesdk_token_expiryand are intended for machine-to-machine service authentication.