ofrak icon indicating copy to clipboard operation
ofrak copied to clipboard

Add license check to OFRAK

Open rbs-jacob opened this issue 1 year ago • 0 comments

One sentence summary of this PR (This should go in the CHANGELOG!)

Add license check to OFRAK. Just CLI license check included for now. Not meant to be airtight (since there are a million ways to bypass it at this point), just to prompt users to think about the license on first run.

flowchart TD
    subgraph download [Run OFRAK for the first time]
        script[Run script] & config["Run `ofrak configure` command"]
        run_gui[Run GUI]
    end
    script & config --> |CLI license flow| flow
    run_gui --> |GUI license flow| flow
    subgraph flow [License flow]
        subgraph validate [Validate the license]
            direction TB
            display[Print license type to standard output] --> check_sig[Validate license signature]
            check_sig --> confirm_date[Confirm the license has not expired]
        end
        validate --> |Valid license| continue[Continue running the original script/task]
        validate --> |Invalid or expired license| error[Display an error and abort]
        check[Check for license in expected location] --> |License exists| validate
        check --> |License does not exist| type[Choose Community or Pro License]
        type --> |Community| comunity_agree[Prompt to accept license agreement]
            --> write_disk[Write Community License to expected location on disk] 
            --> validate
        type --> |Pro| locate_or_obtain[Prompt to locate a license on disk or obtain one]
            -->  |Locate on disk| locate[Input path to license]
            -->  pro_agree[Prompt to accept license agreement]
            --> copy[Copy license to expected location on disk]
        locate_or_obtain ----> |Obtain license| obtain[Request license on OFRAK website]
            --> call[Have a call with RBS and get full or trial license]
        copy --> validate
    end

rbs-jacob avatar Jul 02 '24 17:07 rbs-jacob