Coder Social home page Coder Social logo

tdi's Introduction

โš  This is a hackathon project with no official support or quality guarantee

Hackathon 2022

tdi

The command-line interface, for some, is the natural way to work on a computer. The "To Do" app is the standard, simple interface to a simple problem. Microsoft has a wonderful desktop/GUI application for doing such things - https://todo.microsoft.com/tasks/. tdi (short for To Do Interface) intends to create a CLI app and interface to Microsoft Graph, the store for Microsoft To Do's managed tasks. The app will be built in and released through Github - hoping for Windows, macOS and Linux builds.

License

MIT

Development

There is an "official" application registration in Azure for the client. But if you're wanting to use your own for development you can follow these steps:

https://learn.microsoft.com/en-us/azure/healthcare-apis/register-application

You will need both the CLIENT_ID and CLIENT_SECRET. In addition you'll need to add the appropriate API permissions for user.read and tasks.readwrite in order for the application to access the Graph API. With the credentials in hand you will then add them into the source code before building - here: https://github.com/microsofthackathons/tdi/blob/develop/src/tasks.rs#L17

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Bill of Materials

A SBOM is generated, and captured in the repo at bom.xml in CycloneDX format.

To produce the SBOM, from the project repo's root directory run:

$ cargo install cargo-cyclonedx
$ cargo cyclonedx

Privacy

See PRIVACY.md

tdi's People

Contributors

cedric05 avatar dmossberg avatar kelim-msft avatar kitplummer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tdi's Issues

Implement authentication/authorization to Microsoft Graph/Azure...

As a tdi user, I need to be able to login with my Microsoft credentials in order to gain access to my To Do tasks.

DoD: when a user can run a tdi login command and capture an authentication token locally - requiring the full authentication loop to/from the browser.

Add help doc for "tasks" action

tdi 0.0.1
Simple CLI for Microsoft's To Do tasks

USAGE:
    tdi.exe [SUBCOMMAND]

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    add         Create a new task in ToDo
    complete    Complete the given task
    delete      Delete the given task
    help        Print this message or the help of the given subcommand(s)
    intr        Repl todo shell
    lists       Show the lists in the user's ToDo
    login       Login to Microsoft's Graph database
    logout      Logout of Microsoft's SSO
    me          Show user details
    reopen      Reopen the given task
    show        Display the kanban board
    tasks

Test loop that includes an "auth" cycle

In order to add to the functional tests suite, need to be able to short-circuit the auth loop, or somehow include it. Requires some serious investigation.

add todos to graph-rs library (upstream)

this is a question, as much as a task. need to determine if adding the ToDos API to the graph-rs library is worth the effort, versus implementing the select REST API calls required to support it within this app.

Logout

Need an ability to reset the browser-auth, and delete the locally stored authorization token.

If auth token doesn't exist locally, handle smartly

Currently:

PS C:\Users\kitplummer\Code\tdi> cargo run me    
    Finished dev [unoptimized + debuginfo] target(s) in 0.77s
     Running `target\debug\tdi.exe me`
thread 'main' panicked at 'tdi: unable to read access token configuration.: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', src\auth.rs:85:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\tdi.exe me` (exit code: 101)

Handle case where token has expired...

     Running `target\debug\tdi.exe me`
Error: Graph error:
GraphError {
    headers: Some(
        GraphHeaders {
            url: "https://graph.microsoft.com/v1.0/me",
            status: 401,
            header_map: {
                "transfer-encoding": "chunked",
                "content-type": "application/json",
                "strict-transport-security": "max-age=31536000",
                "request-id": "1740feb8-b33a-4c08-a6ee-ab5cfc5a18c4",
                "client-request-id": "1740feb8-b33a-4c08-a6ee-ab5cfc5a18c4",
                "x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"South Central US\",\"Slice\":\"E\",\"Ring\":\"5\",\"ScaleUnit\":\"003\",\"RoleInstance\":\"SN4PEPF0000050E\"}}",
                "www-authenticate": "Bearer realm=\"\", authorization_uri=\"https://login.microsoftonline.com/common/oauth2/authorize\", client_id=\"00000003-0000-0000-c000-000000000000\"",
                "date": "Fri, 23 Sep 2022 11:57:49 GMT",
            },
        },
    ),
    code: 401,
    error_message: ErrorMessage {
        error: Some(
            ErrorStatus {
                code: Some(
                    "InvalidAuthenticationToken",
                ),
                message: Some(
                    "Access token has expired or is not yet valid.",
                ),
                inner_error: Some(
                    InnerError {
                        code: None,
                        request_id: Some(
                            "1740feb8-b33a-4c08-a6ee-ab5cfc5a18c4",
                        ),
                        date: Some(
                            "2022-09-23T11:57:50",
                        ),
                    },
                ),
            },
        ),
    },
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.