Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
launchdarkly-openfeature-server-sdk
Advanced tools
This provider allows for using LaunchDarkly with the OpenFeature SDK for Ruby.
This provider is designed primarily for use in multi-user systems such as web servers and applications. It follows the server-side LaunchDarkly model for multi-user contexts. It is not intended for use in desktop and embedded systems applications.
[!WARNING] This is a beta version. The API is not stabilized and may introduce breaking changes.
[!NOTE] This OpenFeature provider uses production versions of the LaunchDarkly SDK, which adhere to our standard versioning policy.
LaunchDarkly is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. Get started using LaunchDarkly today!
This version of the LaunchDarkly provider works with Ruby 3.1 and above.
Install the library
$ gem install launchdarkly-openfeature-server
require 'open_feature/sdk'
require 'ldclient-rb'
require 'ldclient-openfeature'
provider = LaunchDarkly::OpenFeature::Provider.new(
'sdk-key',
LaunchDarkly::Config.new
)
OpenFeature::SDK.configure do |config|
config.set_provider(provider)
end
# Refer to OpenFeature documentation for getting a client and performing evaluations.
Refer to the SDK reference guide for instructions on getting started with using the SDK.
For information on using the OpenFeature client please refer to the OpenFeature Documentation.
LaunchDarkly evaluates contexts, and it can either evaluate a single-context, or a multi-context. When using OpenFeature both single and multi-contexts must be encoded into a single EvaluationContext
. This is accomplished by looking for an attribute named kind
in the EvaluationContext
.
There are 4 different scenarios related to the kind
:
kind
attribute. In this case the provider will treat the context as a single context containing a "user" kind.kind
attribute, and the value of that attribute is "multi". This will indicate to the provider that the context is a multi-context.kind
attribute, and the value of that attribute is a string other than "multi". This will indicate to the provider a single context of the kind specified.kind
attribute, and the attribute is not a string. In this case the value of the attribute will be discarded, and the context will be treated as a "user". An error message will be logged.The kind
attribute should be a string containing only contain ASCII letters, numbers, .
, _
or -
.
The OpenFeature specification allows for an optional targeting key, but LaunchDarkly requires a key for evaluation. A targeting key must be specified for each context being evaluated. It may be specified using either targeting_key
, as it is in the OpenFeature specification, or key
, which is the typical LaunchDarkly identifier for the targeting key. If a targeting_key
and a key
are specified, then the targeting_key
will take precedence.
There are several other attributes which have special functionality within a single or multi-context.
privateAttributes
. Must be an array of string values.anonymous
. Must be a boolean value.name
. Must be a string.context = EvaluationContext(key: "the-key")
context = EvaluationContext(key: "org-key", kind: "organization")
attributes = {
kind: "multi",
organization: {
name: "the-org-name",
key, "my-org-key",
myCustomAttribute, "myAttributeValue"
},
user: {
key: "my-user-key",
anonymous, true
}
}
context = EvaluationContext(**attributes)
attributes = {
key: "org-key",
kind: "organization",
myCustomAttribute: "myAttributeValue",
privateAttributes: ["myCustomAttribute"]
}
context = EvaluationContext(**attributes)
attributes = {
kind: "organization",
organization: {
name: "the-org-name",
key: "my-org-key",
# This will ONLY apply to the "organization" attributes.
privateAttributes: ["myCustomAttribute"],
# This attribute will be private.
myCustomAttribute: "myAttributeValue",
},
user: [
key: "my-user-key",
anonymous = > true,
# This attribute will not be private.
myCustomAttribute: "myAttributeValue",
]
}
context = EvaluationContext(**attributes)
Check out our documentation for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the complete reference guide for this SDK.
The authoritative description of all properties and methods is in the ruby documentation.
We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this SDK.
FAQs
Unknown package
We found that launchdarkly-openfeature-server-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.