Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ibm_tools-people

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ibm_tools-people

  • 1.1.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

IMPORTANT

Comunicate 1

Due to the new mandatory change regarding the new Tokenization of the API we launch the version 1.1, now aside from the default parameters, we will have to request your token via boarding process and then use it with the API, details regarding the api usage, were updated, but if you want to know more about the tokenization, check the FAQ.

Comunicate 2

Due to the case-2022-05-05-1450 opened by the CSIRT team we had to migrate from the Public Github to the Github Enterprise, this change forced us to change the name of the gem.

Since the ruby does require the name of the gem to be used as the name of the class. Check below what changed:

Action 1 - Gemfile

Change the name of the gem to the new one in your Gemfile file and hit bundle install on your terminal.

# From
gem 'rails_ibm-uprofile', '~> 0.3.2', require: 'rails_ibm/uprofile'

# To
gem 'ibm_tools-people', '~> 1.0.0', require: 'ibm_tools/people'

Action 2 - Usage

Change everywhere you have within your application from the old class name to the new one.

# From
RailsIbm::Uprofile.info

# To
IbmTools::People.info

From now on it should be transparent and require no other action.




IBM Tools

Welcome to your Rais IBM Tools module! This gem intend to provide you some fetures used on IBM Web applications *.

* IBM VPN is required

IBM Tools\People

Fetch data from the user based on search params.

IBM Tools\SSO

Feature to come.

Code of Conduct

Everyone interacting in the IbmTools::People project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Table of Contents

Installation

Add this line to your application's Gemfile:

gem 'ibm_tools-people'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install ibm_tools-people

IbmTools::People

This module allow you to fetch information from Profile directory (using the Unified-profile).

Usage

This module have different methods to search the users and provide different data:

#Info(args*: value[, options])

This module allos you to search one or more entries at time, it will return the information about the employee(s)

require 'ibm_tools/people'

IbmTools::People.info(uid: '000000000')
Args*

Since there are different kind of ways to search the user and to ensure readability we split it in several alternatives. It is important to know that at least one of these args are required.

namevalueUsage
uidStringIbmTools::People.info(uid: '000000000')
uidsArrayIbmTools::People.info(uids: ['000000000', '111111111'])
emailStringIbmTools::People.info(email: 'johndoe@ibm.com')
emailsArrayIbmTools::People.info(emails: ['johndoe@ibm.com', 'janedoe@ibm.com'])
queryStringIbmTools::People.info(query: 'John Doe')
tokenStringtoken: nbvcsw23456yhbvfrt6789olkmnhyu8i9olkmnhgtrdf*

Token can be used as a argument of the module, but it will also look for the environment variable IBM_PEOPLE_API_KEY

Options (optional)
AttribureTypeDefaultPurpose
parsedBooleantrueReturns a Parsed Object
if false Return a PeopleUnifiedProfileAPI Object
remapBooleanfalseReturns a Remapped Object.
This option is ignored if parsed is true
serialString'000000'Will increase the performance of the search by fetching first entries that are peers from the serial informed.
Only available for query arg.
limitNumber10Will limit the result of the API in the number specified.
Only available for query arg.
startNumber0Will start from this position of the list (common used for pagination).
Only available for query arg.
arrayBooleantrueThe result will be an array instead of an object.
Only available for query arg.
This option is ignored if detailed is false.
Schemas

These are the following models available in this API.

Parsed Object
UID
{
    :"uid_#{query}": PeopleUnifiedProfileAPI.content
}

# Ex.:
#    $ IbmTools::People.info(uid: '000000000')
#    $ => { uid_000000000: PeopleUnifiedProfileAPI.content }
Email
{
    :"#{query}": PeopleUnifiedProfileAPI.content
}

# Ex.:
#    $ IbmTools::People.info(email: 'johndoe@ibm.com')
#    $ => { johndoe@ibm.com: PeopleUnifiedProfileAPI.content }
Remapped Object

It will rewrite the object to a DefaultTemplate used by this module (preferred for authentications)

DefaultTemplate
{
    uid: PeopleUnifiedProfileAPI.content.uid,
    name: PeopleUnifiedProfileAPI.content.nameFull,
    email: PeopleUnifiedProfileAPI.content.preferredIdentity,
    shortname: PeopleUnifiedProfileAPI.content.nameDisplay || PeopleUnifiedProfileAPI.content.nameFull
}
UID
{
    :"uid_#{query}": DefaultTemplate
}

# Ex.:
#    $ IbmTools::People.info(uid: '000000000')
#    $ => { uid_000000000: ShortDataUserObject }
Email
{
    :"#{query}": DefaultTemplate
}

# Ex.:
#    $ IbmTools::People.info(email: 'johndoe@ibm.com')
#    $ => { johndoe@ibm.com: ShortDataUserObject }

#Skills(args*: value)

This method only allows one search at time and it will return the skill set information of the employee.

require 'ibm_tools/people'

IbmTools::People.skills(uid: '000000000')

This module have 2 variations, you can check the details below:

Args*

Since there are different kind of ways to search the user and to ensure readability we split it in several alternatives. It is important to know that at least one of these args are required.

namevalueUsage
uidStringIbmTools::People.info(uid: '000000000')
emailStringIbmTools::People.info(email: 'johndoe@ibm.com')
tokenStringtoken: nbvcsw23456yhbvfrt6789olkmnhyu8i9olkmnhgtrdf*

Token can be used as a argument of the module, but it will also look for the environment variable IBM_PEOPLE_API_KEY

Schemas

There are no special remapping or parsing for this results, the schema can be checked on PeopleUnifiedProfileAPI docs

#Teams(args*: value)

This method only allows one search at time and it will return the peers and hierarchical tree of the employee (Inside and Outside the country)

require 'ibm_tools/people'

IbmTools::People.skills(uid: '000000000')

This module have 2 variations, you can check the details below:

Args*

Since there are different kind of ways to search the user and to ensure readability we split it in several alternatives. It is important to know that at least one of these args are required.

namevalueUsage
uidStringIbmTools::People.info(uid: '000000000')
emailStringIbmTools::People.info(email: 'johndoe@ibm.com')
tokenStringtoken: nbvcsw23456yhbvfrt6789olkmnhyu8i9olkmnhgtrdf*

Token can be used as a argument of the module, but it will also look for the environment variable IBM_PEOPLE_API_KEY

Schemas

There are no special remapping or parsing for this results, the schema can be checked on PeopleUnifiedProfileAPI docs

#all(args*: value)

This method only allows one search at time and it will return the peers and hierarchical tree of the employee (Inside and Outside the country)

require 'ibm_tools/people'

IbmTools::People.skills(uid: '000000000')

This module have 2 variations, you can check the details below:

Args*

Since there are different kind of ways to search the user and to ensure readability we split it in several alternatives. It is important to know that at least one of these args are required.

namevalueUsage
uidStringIbmTools::People.info(uid: '000000000')
emailStringIbmTools::People.info(email: 'johndoe@ibm.com')
tokenStringtoken: nbvcsw23456yhbvfrt6789olkmnhyu8i9olkmnhgtrdf*

Token can be used as a argument of the module, but it will also look for the environment variable IBM_PEOPLE_API_KEY

Schemas

There are no special remapping or parsing for this results, the schema can be checked on PeopleUnifiedProfileAPI docs

Tests

I'm in shame to do this, but since I was in a hurry, we got some testers to verify this project, and I know I should implement some automated tests. But this module were created for a project and because of this I had to do this way.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.ibm.com/thiagogs/ibm_tools-people. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 23 May 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc