
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
This Ruby Gem is intended for Ruby web application developers to access Office 365 Services, which includes OneDrive for Business, Outlook, etc. This initial version targets subset of v1.0 OneDrive Business Files APIs. The details of the Office 365 REST APIs can be found at http://dev.office.com under documentation section.
This library is will evolve over time. We encourage developer community engagement and feedback to improve the quality and enhance the features.
In order to use the SDK against Office 365 service the developer will need a Office 365 tenant and Azure account that is linked to Office 365 tenant.
This allows App registration and configuration, which is a key input into creating a client.
Add this line to your application's Gemfile:
gem 'o365rubylib'
And then execute:
$ bundle
Or install it yourself as:
$ gem install o365rubylib
In your Application require o365rubylib
require 'o365rubylib'
This library supports Oauth2 protocol. The first step is to supply the following application configuration required to create a session.
To create a Session object, supply the input configuration details.
APP_CONFIG = {
client_id: "32ea5265-35bc-49c7-bf03-fa7928bc07dc",
redirect_uri: "http://localhost:4567/go",
secret: "C+WTbpXIt26drLsv3lXY/qyOQn6hPfGcLHo8IYnHO1Q=",
resource_uri: "https://<tenant-name>-my.sharepoint.com/",
fileservice_uri: "https://<tenant-name>-my.sharepoint.com/_api/v1.0/me/"
}
Next, create a session by passing the configuration information to the session object.
session = O365rubylib::Session.new (APP_CONFIG)
When the user visits your application, ensure that you have the required consent. You can redirect the user to Azure authentication service and have them consent the necessary permissions needed by your App.
You can create an authorization URL as follows
auth_url = session.get_auth_url
After consent, Azure will redirect to the URL supplied in the "redirect_uri". In that page/service, create the Oauth2 access token OneDrive Files client.
accesstoken = session.get_access_token(params[:code])
fileClient = O365rubylib::OneDriveClient.new (session)
Now armed with the client, you can access O365 Files APIs.
accesstoken = session.get_access_token(params[:code])
fileClient = O365rubylib::OneDriveClient.new (session)
Get File or Folder metadata. You'll receive a hash of the item:
enc_path = URI::encode('resource-path')
item = fileClient.getItemByPath(enc_path)
print item ['name']
List the children of a folder:
enc_path = URI::encode('resource-path')
resp = fileClient.getChildrenByPath(enc_path)
resphash = resp["value"]
resphash.each do |arr|
print arr['name']
print arr['parentReference']['path']
...
end
Delete a resource:
enc_path = URI::encode('resource-path')
fileClient.deleteItem(enc_path)
Download a file to a local destination:
enc_path = URI::encode('resource-path')
fileClient.downloadFile(enc_path, local_path)
Upload a file:
enc_path = URI::encode('resource-path')
fileClient.uploadFileToPath(enc_path, local_path)
More coming...
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that O365RubyEasy 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.