Class: StarkBank::Project
- Inherits:
-
User
- Object
- Utils::Resource
- User
- StarkBank::Project
- Defined in:
- lib/user/project.rb
Overview
# Project object
The Project object is the main authentication entity for the SDK. All requests to the Stark Bank API must be authenticated via a project, which must have been previously created at the Stark Bank website
before you can use it in this SDK. Projects may be passed as a parameter on each request or may be defined as the default user at the start (See README).
## Parameters (required):
-
id [string]: unique id required to identify project. ex: ‘5656565656565656’
-
private_key [EllipticCurve.Project()]: PEM string of the private key linked to the project. ex: ‘—–BEGIN PUBLIC KEY—–nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEyTIHK6jYuik6ktM9FIF3yCEYzpLjO5X/ntqDioGM+R2RyW0QEo+1DG8BrUf4UXHSvCjtQ0yLppygz23z0yPZYfw==n—–END PUBLIC KEY—–’
-
environment [string]: environment where the project is being used. ex: ‘sandbox’ or ‘production’
## Attributes (return-only):
-
name [string, default ‘]: project name. ex: ’MyProject’
-
allowed_ips [list of strings]: list containing the strings of the ips allowed to make requests on behalf of this project. ex: [‘190.190.0.50’]
-
pem [string]: private key in pem format. ex: ‘—–BEGIN PUBLIC KEY—–nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEyTIHK6jYuik6ktM9FIF3yCEYzpLjO5X/ntqDioGM+R2RyW0QEo+1DG8BrUf4UXHSvCjtQ0yLppygz23z0yPZYfw==n—–END PUBLIC KEY—–’
Instance Attribute Summary collapse
-
#allowed_ips ⇒ Object
readonly
Returns the value of attribute allowed_ips.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from User
Attributes inherited from Utils::Resource
Instance Method Summary collapse
-
#initialize(environment:, id:, private_key:, name: '', allowed_ips: nil) ⇒ Project
constructor
A new instance of Project.
Methods inherited from User
Methods inherited from Utils::Resource
Constructor Details
#initialize(environment:, id:, private_key:, name: '', allowed_ips: nil) ⇒ Project
Returns a new instance of Project.
26 27 28 29 30 |
# File 'lib/user/project.rb', line 26 def initialize(environment:, id:, private_key:, name: '', allowed_ips: nil) super(environment, id, private_key) @name = name @allowed_ips = allowed_ips end |
Instance Attribute Details
#allowed_ips ⇒ Object (readonly)
Returns the value of attribute allowed_ips.
25 26 27 |
# File 'lib/user/project.rb', line 25 def allowed_ips @allowed_ips end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
25 26 27 |
# File 'lib/user/project.rb', line 25 def name @name end |