Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
The core of this gem its on SingtelSdp::BaseAdapter
and SingtelSdp::BaseAdapterController
.
Implementing these 2 classes will let you decide what to do with each request received from the sdp.
SingtelSdp let you forget about the xml connections, result codes and messages. It gives you the chance to focus on the implementation of the actions for each request.
This gem solves most of the hard problems with the integration with singtel.
Add this to your Gemfile
.
gem 'singtel_sdp', '~>1.0.0', git: 'git://github.com/dropmyemail/singtel_sdp.git'
Use the provided generator to create the model, controller and initializer file for SingtelSdp.
rails g singtel_sdp
SingtelSdp::BaseAdapter
is an abstract class, You need to implement the abstract methods.
# app/models/singtel_Adapter.rb
#
class SingtelAdapter < SingtelSdp::BaseAdapter
def roles
# here you should return a list of the possible roles. eg ['ADMIN','DEFAULT']
end
def find_singtel_customer(isvcustno)
# Find and return a singtel customer here, can be an instances of any class that represents an active customer.
end
def find_singtel_product(isvsubsid)
# Find and return a singtel product subscription here, can be an instances of any class that represents an active subscription to a product in your domain.
end
def find_singtel_user(isvuserid)
# Find and return your singtel user here, can be an instances of any class that represents your active user.
end
def on_create_customer
#create your singtel customer here. in arguments variable you ll find a hash with the params received in the request. eg: arguments[:ISVCUSTNO], return the ivcustno as a string if everything went fine, if not nil.
end
def on_update_customer
#update your singtel customer here. in arguments variable you ll find a hash with the params received in the request. eg: arguments[:ISVCUSTNO], return the ivcustno as a string if everything went fine, if not nil.
end
def on_delete_customer
#delete your singtel customer here. in arguments variable you ll find a hash with the params received in the request. eg: arguments[:ISVCUSTNO], return the ivcustno as a string if everything went fine, if not nil.
end
def on_create_product
# Create your singtel product here. In arguments variable you ll find a hash with the params received in the request. eg arguments[:ISVSUBSID], return the isvsubsid as a string if everything went fine, if not nil.
end
def on_update_product
# Update your singtel product here. In arguments variable you ll find a hash with the params received in the request. eg: arguments[:NEWISVSUBSID], return the newisvsubsid as a string if everything went fine, if not nil.
end
def on_delete_product
# Update your singtel product here. In arguments variable you ll find a hash with the params received in the request. eg: arguments[:NEWISVSUBSID], return the newisvsubsid as a string if everything went fine, if not nil.
end
def on_create_user
end
def on_update_user
end
def on_delete_user
end
end
The SintelSdp::BaseAdapterController
should be overriden. You have to override SingtelSdp::SingtelBaseAdapterController#sign\_in\_singtel\_user #sign\_in\_singtel\_user
.
Optionally you can override SingtelSdp::SingtelBaseAdapterController#on\_singtel\_login\_success #on\_singtel\_login\_success
and SingtelSdp::SingtelBaseAdapterController#on\_singtel\_login\_failure #on\_singtel\_login\_failure
# app/controller/singtel_controller.rb
class SingtelController < SingtelSdp::BaseAdapterController
def sign_in_singtel_user(isvuserid)
# this is an implementation :P
end
end
We provide a shortcut so you can add the SingtelSdp::BaseAdapterController BaseAdapterController
to your routes.rb
.
Here's a snippet showing two different ways of mounting the routes:
# your routes.rb
YourApp::Application.routes.draw do
# Will mount the default SingtelSdp:BaseAdapterController in the
# /singtel path.
add_singtel_sdp_routes
end
SingtelSdp will redirect to invalid session template if an sso login fails:
You can copy the the built in template into your app's directory structure and customize them:
$ rails g singtel_sdp_views
MIT-LICENSE. Check LICENSE for more details
FAQs
Unknown package
We found that singtel_sdp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.