Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
elastic-workplace-search
Advanced tools
A first-party Ruby client for Elastic Workplace Search.
To install the gem, execute:
gem install elastic-workplace-search
Or place gem 'elastic-workplace-search', '~> 0.4.1
in your Gemfile
and run bundle install
.
Create a new instance of the Elastic Workplace Search client with your access token:
Elastic::WorkplaceSearch.access_token = '' # your access token
client = Elastic::WorkplaceSearch::Client.new
client = Elastic::WorkplaceSearch::Client.new
Elastic::WorkplaceSearch.endpoint = 'https://your-server.example.com/api/ws/v1'
client = Elastic::WorkplaceSearch::Client.new(:proxy => 'http://localhost:8888')
This example shows how to use the index_documents method:
content_source_key = '' # your content source key
documents = [
{
'id' => 'INscMGmhmX4',
'url' => 'http://www.youtube.com/watch?v=v1uyQZNg2vE',
'title' => 'The Original Grumpy Cat',
'body' => 'this is a test'
},
{
'id' => 'JNDFojsd02',
'url' => 'http://www.youtube.com/watch?v=tsdfhk2j',
'title' => 'Another Grumpy Cat',
'body' => 'this is also a test'
}
]
begin
document_receipts = client.index_documents(content_source_key, documents)
# handle results
rescue Elastic::WorkplaceSearch::ClientException => e
# handle error
end
content_source_key = '' # your content source key
document_ids = ['INscMGmhmX4', 'JNDFojsd02']
begin
destroy_document_results = client.destroy_documents(content_source_key, document_ids)
# handle destroy document results
rescue Elastic::WorkplaceSearch::ClientException => e
# handle error
end
content_source_key = '' # your content source key
client.list_all_permissions(content_source_key)
content_source_key = '' # your content source key
client.list_all_permissions(content_source_key, :current => 2, :size => 20)
content_source_key = '' # your content source key
user = 'enterprise_search'
client.get_user_permissions(content_source_key, user)
content_source_key = '' # your content source key
user = 'enterprise_search'
permissions = ['permission1']
client.add_user_permissions(content_source_key, user, :permissions => permissions)
content_source_key = '' # your content source key
user = 'enterprise_search'
permissions = ['permission2']
client.update_user_permissions(content_source_key, user, :permissions => permissions)
content_source_key = '' # your content source key
user = 'enterprise_search'
permissions = ['permission2']
client.remove_user_permissions(content_source_key, user, :permissions => permissions)
Run tests via rspec:
$ ENDPOINT=http://localhost:3002/api/ws/v1 bundle exec rspec
If something is not working as expected, please open an issue.
We welcome contributors to the project. Before you begin, a couple notes...
Thank you to all the contributors!
FAQs
Unknown package
We found that elastic-workplace-search demonstrated a not healthy version release cadence and project activity because the last version was released 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.