Commit Graph

107 Commits

Author SHA1 Message Date
Henrique Joaquim
58d2ea1637 Auto login on the SDK if local session is found (#4297)
* token generation on the terminal

* revoke and show commands

* auto login on the sdk if local session is found

* fix tests

---------

Co-authored-by: Luqman <luqazino@gmail.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
2023-02-22 14:40:01 +00:00
Henrique Joaquim
a054e5d005 User UUID to use the designated column instead (#4299)
* token generation on the terminal

* revoke and show commands

* uuid on the right column

* adding logs to the account commands

* login info at this point does not make sense anymore

* get_user_uuid function

* log formatter to use get_user_uuid function

* ruff + black

* fix tests

* fix tests

---------

Co-authored-by: James Maslek <jmaslek11@gmail.com>
2023-02-22 14:22:05 +00:00
Colin Delahunty
cebf454cdf Added flake8-simplify (#4227)
* Added flake8-simplify

* Update linting.yml

* update.  left 1 for you colin

* Fix that one

* Missed

* Fix

* mypy

---------

Co-authored-by: james <jmaslek11@gmail.com>
2023-02-20 19:27:34 -05:00
Henrique Joaquim
7998ae7887 Adds Personal Access Token Commands (#4266)
* token generation on the terminal

* revoke and show commands

* save to keys

* test for hub_model

* black

* controller tests

* fix wrong merge

---------
2023-02-17 17:13:51 +00:00
james
a0f3ad125b Other mypy fixes 2023-02-16 09:06:31 -05:00
montezdesousa
e57de3b453 Account menu improvements (#4252)
* ask for confirmation on delete, replace

* fix logout

---------

Co-authored-by: James Maslek <jmaslek11@gmail.com>
2023-02-15 14:59:15 +00:00
Henrique Joaquim
46b230f146 Minor fixes on login (#4234)
* block logout

* fix default behaviour to no ask for creds

* enables to use --login on
Welcome to OpenBB Terminal v2.3.1
╭─────────────────────────────────── Home ───────────────────────────────────╮
│                                                                            │
│ Information, guides and support for the OpenBB Terminal:                   │
│     intro              introduction on the OpenBB Terminal                 │
│     about              discover the capabilities of the OpenBB Terminal (h │
│     support            pre-populate a support ticket for our team to evalu │
│     survey             fill in our 2-minute survey so we better understand │
│     update             attempt to update the terminal automatically (GitHu │
│     wiki               search for an expression in Wikipedia (https://www. │
│     news               display news articles based on term and data source │
│                                                                            │
│ Configure your own terminal:                                               │
│ >   keys               set API keys and check their validity               │
│ >   featflags          enable and disable feature flags                    │
│ >   sources            select your preferred data sources                  │
│ >   settings           tune settings (export folder, timezone, language, p │
│                                                                            │
│ Record and execute your own .openbb routine scripts:                       │
│     record             start recording current session                     │
│     stop               stop session recording and convert to .openbb routi │
│     exe                execute .openbb routine scripts (use exe --example  │
│                                                                            │
│ Main menu:                                                                 │
│ >   stocks             access historical pricing data, options, sector and │
│ >   crypto             dive into onchain data, tokenomics, circulation sup │
│ >   etf                exchange traded funds. Historical pricing, compare  │
│ >   economy            global macroeconomic data, e.g. futures, yield, tre │
│ >   forex              foreign exchanges, quotes, forward rates for curren │
│ >   futures            commodities, bonds, index, bitcoin and forex        │
│ >   alternative        alternative datasets, such as COVID and open source │
│ >   funds              mutual funds search, overview, holdings and sector  │
│                                                                            │
│ OpenBB Toolkits:                                                           │
│ >   econometrics       statistical and quantitative methods for relationsh │
│ >   forecast           timeseries forecasting with machine learning        │
│ >   portfolio          perform portfolio optimization and look at portfoli │
│ >   dashboards         interactive dashboards using voila and jupyter note │
│ >   reports            customizable research reports through jupyter noteb │
│                                                                            │
╰─────────────────────────────── OpenBB Terminal v2.3.1 (https://openbb.co) ─╯
You are using the latest stable version

2023 Feb 14, 06:39 (🦋) / $

[h] help menu    [q] return to previous menu    [e] exit terminal    [cmd -h] s
                                                                               e
                            2023 Feb 14, 06:39 (🦋) / $
The OpenBB Terminal is the result of a strong community building an investment research platform for everyone, anywhere.

We are always eager to welcome new contributors and you can find our open jobs here:
https://www.openbb.co/company/careers#open-roles

Join us           : https://openbb.co/discord
Follow us         : https://twitter.com/openbb_finance
Ask support       : https://openbb.co/support
Request a feature : https://openbb.co/request-a-feature

Fill in our 2-minute survey so we better understand how we can improve the OpenBB Terminal at https://openbb.co/survey

In the meantime access investment research from your chatting platform using the OpenBB Bot
Try it today, for FREE: https://openbb.co/products/bot

* reverting the condition to the original state

* openbb to match python terminal.py

* adding unauthorized

* reverting changes

* getting the value of the status

---------

Co-authored-by: Diogo Sousa <montezdesousa@gmail.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
2023-02-15 14:55:22 +00:00
montezdesousa
825b8955df Set guest by default and put authentication behind environment variable (#4197)
* small bug

* small bug on routines list

* guest as default

* limit logout to users2

* simpler this way

* add logout

* move logout to account & add env var

* put authentication under env var

* fix tests

* remove login

* remove openbb vars on login

* ruff

* revert .toml

* Delete Icon

* Update .env

* fix sdk guest not loading keys

* ruff

* remove press enter & --login

* ruff

* move env load

* load env

* move dot env loading to terminal.py

* fix user sdk login mixing .env with user

* now it works

* fix reset

* fix tests

* ruff

* Login on the SDK using the OpenBB Personal Access Token (#4206)

* openbb key on keys menu

* adding sdk endpoints

* adding login via token to the sdk

* base url

* rename to personal access token

* added docstrings and examples

* openbb is special

* removing extra break line

* making keys working with the personal access token

* resolve conflicting tests

* Revert "resolve conflicting tests"

This reverts commit 2fca2c0ec3.

* using custom requests

* tests

* tests

* tests

* using process_session_response instead

* rewriting some tests

* Fix sdk guest not loading keys (#4207)

* fix sdk guest not loading keys

* ruff

* remove comment

* tests

---------

Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Co-authored-by: Diogo Sousa <montezdesousa@gmail.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>

* test record mode vcr none

* remove yes from tests yml

* specify modules to reload

* try disable check api

* UPdate spec file

* Small stocks bug

* avoid reloading in test mode

* will this work?

* skip session tests

* try with env var as well

* mock sdk reload

* pylint

* bump poetry on python 3.8

* adapt to python 3.8

* adapt to python 3.8 remaining tests

* Tests : update cassettes

* Fix linting

* Makes login conditions simpler

* Tests : txt

---------

Co-authored-by: James Maslek <jmaslek11@gmail.com>
Co-authored-by: Chavithra <chavithra@gmail.com>
Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
2023-02-14 09:56:03 +00:00
James Maslek
c292f416e1 Merge branch 'develop' into hotfix/banner-spaced 2023-02-09 14:27:29 -05:00
teh_coderer
2be68c1092 Update banner.txt 2023-02-09 12:19:40 -05:00
Diogo Sousa
df10cb2cbe change register link 2023-02-09 17:02:41 +00:00
Diogo Sousa
c39358eefd new msg 2023-02-09 16:53:19 +00:00
Diogo Sousa
c06c5c8b91 update msg 2023-02-09 16:51:21 +00:00
Diogo Sousa
40b95c40a9 ruff 2023-02-09 14:19:36 +00:00
Diogo Sousa
e568f7a60f change register link to dev 2023-02-09 14:08:41 +00:00
montezdesousa
5953be0a42 Terminal authentication + keys/settings/routines (#4015)
* import order

* pylint

* no login, go to prompt

* add logout and whoami

* clear before prompt

* black

* these are unecessary

* error

* improve login prompt message

* login does not follow the controller pattern, so will name it differently

* nop

* move logout and change to results

* change return obj

* ruff

* pyupgrade

* remove user from statics

* message

* fetch configs at start

* remove unecessary func

* unecessary dataclass

* change user vars

* change login flow

* remote logout should not be used

* simplify

* fix double exit logout bug

* wrong exception

* apply keys

* change controller

* mypy

* save if no internet

* pylint

* logout everywhere

* breaking changes: move to local/hub models

* unused import

* fix logout bug

* whoami in guest mode

* add todo

* small bug guest allowed

* limit flair length

* fix bug on user pull

* logout working

* handle no connection

* logout user when logout

* remove keys push

* split logger funcs

* commant apply configs for now

* account to session

* rename user

* clear sounds better

* breaking changes: splitting guest from logged users

* pull imports up

* delete session model

* move logout func

* add ability to save and apply keys from remote

* no sensitive keys

* add support for feature flags

* unecessary print

* allow settings from differnt modules

* change setff to static

* change way to set ff

* fix bug in applying configs

* simplify obbff application

* bug on setting configs

* allow text ff

* obbff in settings

* add upload to cfg_plot 1

* data sources + backend

* this solves circular import?

* move create_session to model

* rever logs changes, not needed for now

* sync optionally

* outline account controller interface

* don't sync when guest

* block guest on installer

* or not and

* start routines

* fix bug on ff, settings

* is installer

* implementing chavi suggestions

* fix colors on installer prompt

* Logging login (#4046)

* basic logging for the login

* removing unused import

* hacking the logs custom filter to not filter the email

* black

* cooping with the new changes

* removing redundant method

* ruff

* ruff

* mypy

* SDK login (#4051)

* sdk login

* adding to the trail map

* minor fix

* improve sdk expirience

* adapting to new changes

* add docstrings

* block guest from account

* change guest msg

* change guest messages

* add sync on/off

* display onoff

* missing paragraph

* fix glitch on logout

* add sys clear

* filtering password

* filtering the email from user

* avoid writing to multiple log files if a user logs out

* fix bug, guest allowed in installer without connection

* log user on the sdk

* split login from lauch

* add clear and change messages on account

* docstrings

* start pull cmd

* change account menu description

* Fix login bug and decouple some logic (#4056)

* fix bug, guest allowed in installer without connection

* split login from lauch

* improvements on the sdk login

---------

Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>

* sync fix

* change account controller description

* ruff

* add help on account cmds

* update clear prompt

* fix email not in jwt

* remove jwt from requiremnts

* pull command output

* remove character

* pull cmd when no data

* add space below whoami

* fix log filenotfound exception

* changed arg name

* delete .hist on logout

* add asteriscs to password

* pylint

* uncomment rich config

* show only diffs on pull

* black#

* warn when no changes#

* pull msg was switched

* apply diff only

* breaking?: strbool change

* reduce some code

* add timeout to hub requests

* black

* add remote logout

* success msg only if success

* remove colors in prompt

* update docstrings

* keep timeout outside funcs

* update clear

* clear and patch

* delete session

* routine upload

* move .his file to .openbb folder

* change apply configs

* refactor logout

* remove mixed portfolio changes

* fix bug in lock file

* fix bug pwidth, pheight are floats

* fix sources command & add choices

* refactor timezone setting

* userdata

* fix flair

* need to cast paths

* cast on diff

* fix flair default

* save session test

* get session

* data

* test remove

* test remove with assert

* add bad test cases

* add exception cases to unittests

* test remove cli hist file

* black

* test apply configs

* test apply with sync flag

* test create session, session model

* login tests, session model

* some tests for the hub_model

* test logout user

* black

* test clear vars, reload

* test create session

* update user-json to user

* update user class

* add user tests

* tests sdk session

* tests for hub_model

* start account controller tsts

* unused import

* tests account controller: clear, pull

* tests for session_controller

* logout success bugfix

* add integration test for account

* black

* move routine related commands to other PR

* test for the user input

* completed tests for session controller

* convert to hist to str)

* fix import errors

* ruff

* ruff tests

* fix qa

* add help to settings cmds

* ruff

* fix pull keys bug

* point to dev

* account model tests

* black

* ruff

* fix for empty feature settings

* ruff

* don't display config msg if wrong token

* general msgs

* remove print

* ruff

* fix sources not updated real time

* missing return doc

* add guest if no email

* Routine remote storage (#4143)

* add upload routine command

* remove prints

* point to local again

* add commands

* add delete

* add download command and upload 409

* list comprehension

* add download & save plus upload fixe

* add user uuid folder

* add list command

* ruff

* en.yml detail

* provide choices to delete & download

* add choices to upload

* change menu text

* starting adding unit tests

* bad english

* Update test_print_help.txt

* genearl msgs

* remove print

* add docstrings

* add unit tests to account controller

* change parser

* fix routine upload test

* add to be implemented tests hub

* add to be implemented tests local

* add total pages to title

* split list into model and view

* add docstring

* print msg if character

* add local model tests

* hub tests routines

* fix test

* point to dev and glob

* fix small bug on upload

* missing return

* log decorators missing

* black

* ruff

* change prompt display

* rewrite test

* rewrite expected

* rewrite call

* try passing git action

* change .yml everywhere

---------

Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
2023-02-09 13:35:44 +00:00
Diogo Sousa
11ee026f80 change prompt display 2023-02-09 10:49:21 +00:00
montezdesousa
ead2e2e76a Routine remote storage (#4143)
* add upload routine command

* remove prints

* point to local again

* add commands

* add delete

* add download command and upload 409

* list comprehension

* add download & save plus upload fixe

* add user uuid folder

* add list command

* ruff

* en.yml detail

* provide choices to delete & download

* add choices to upload

* change menu text

* starting adding unit tests

* bad english

* Update test_print_help.txt

* genearl msgs

* remove print

* add docstrings

* add unit tests to account controller

* change parser

* fix routine upload test

* add to be implemented tests hub

* add to be implemented tests local

* add total pages to title

* split list into model and view

* add docstring

* print msg if character

* add local model tests

* hub tests routines

* fix test

* point to dev and glob

* fix small bug on upload

* missing return

* log decorators missing

* black

* ruff
2023-02-09 09:55:05 +00:00
Diogo Sousa
759a2c7557 add guest if no email 2023-02-09 09:14:24 +00:00
Diogo Sousa
b9bc0aaac7 ruff 2023-02-08 11:43:54 +00:00
Diogo Sousa
b764198ff5 remove print 2023-02-06 23:06:11 +00:00
Diogo Sousa
4475e74e43 general msgs 2023-02-06 23:02:05 +00:00
Diogo Sousa
c7993c42ba don't display config msg if wrong token 2023-02-06 16:40:11 +00:00
hjoaquim
126ff86e6c fix for empty feature settings 2023-02-06 13:24:39 +00:00
hjoaquim
142cbb9638 Merge branch 'feature/login' of github.com:OpenBB-finance/OpenBBTerminal into feature/login 2023-02-06 11:10:42 +00:00
Diogo Sousa
928e652d35 point to dev 2023-02-06 11:05:06 +00:00
Diogo Sousa
c7342cd43d ruff 2023-02-05 19:29:48 +00:00
hjoaquim
2b00f5647c test for the user input 2023-02-03 17:28:33 +00:00
hjoaquim
9b7a281c28 Merge branch 'feature/login' of github.com:OpenBB-finance/OpenBBTerminal into feature/login 2023-02-03 13:35:09 +00:00
Diogo Sousa
66450d143a logout success bugfix 2023-02-03 13:31:04 +00:00
hjoaquim
4622e30ce8 tests for session_controller 2023-02-03 13:14:55 +00:00
hjoaquim
10aafd139d tests for hub_model 2023-02-03 12:15:17 +00:00
Diogo Sousa
1f7baeac4f add user tests 2023-02-02 23:42:22 +00:00
Diogo Sousa
851abfc000 update user class 2023-02-02 22:09:56 +00:00
Diogo Sousa
354031e258 update user-json to user 2023-02-02 22:09:48 +00:00
Diogo Sousa
9f796bcb11 test logout user 2023-02-02 18:39:01 +00:00
Diogo Sousa
9df58b633a login tests, session model 2023-02-02 17:15:17 +00:00
Diogo Sousa
ac00d522cf test create session, session model 2023-02-02 16:17:08 +00:00
Diogo Sousa
5c96937e4c add exception cases to unittests 2023-02-02 12:58:48 +00:00
Diogo Sousa
9e89ce0353 add bad test cases 2023-02-02 12:50:44 +00:00
Diogo Sousa
e9f381de52 fix flair default 2023-02-01 23:54:03 +00:00
Diogo Sousa
81aceeb8da need to cast paths 2023-02-01 23:29:24 +00:00
Diogo Sousa
6c146c62a9 fix flair 2023-02-01 23:13:42 +00:00
Diogo Sousa
41d01ac68c userdata 2023-02-01 20:19:37 +00:00
Diogo Sousa
20bc8ae2bf fix bug pwidth, pheight are floats 2023-02-01 13:01:00 +00:00
Diogo Sousa
d265a126a5 refactor logout 2023-02-01 11:26:23 +00:00
Diogo Sousa
cef3057e2b change apply configs 2023-02-01 11:11:55 +00:00
Diogo Sousa
2bb47c6e03 move .his file to .openbb folder 2023-02-01 11:02:33 +00:00
Diogo Sousa
4240d4e077 routine upload 2023-02-01 10:50:09 +00:00
Diogo Sousa
01f7aa0d18 delete session 2023-02-01 10:47:44 +00:00