jeremyheiler / lein-paprika Goto Github PK
View Code? Open in Web Editor NEWA Leiningen plugin for interacting with the App.net API with Clojure.
A Leiningen plugin for interacting with the App.net API with Clojure.
It should be possible to cache multiple tokens. The reason for this is because you could use Leiningen profiles to manage different accounts, or identical accounts with different scopes. In order to do this there needs to be a way to differentiate between the cached tokens, and determining which token is appropriate for the current session.
Cache invalidation should only operate on the token for the specific set of credentials being used. All other tokens should remain unaffected, except when there is a read error and the whole cache needs to be invalidated.
How should cached tokens be differentiated?
paprika.core/token
.{:client-id-a {:user-1 {:access-token "user-1-token"}}
{:user-2 {:access-token "user-2-token"}}}
With issue #1 complete, the latest token fetched from App.net will be cached. However, once a token is cached it will be used regardless if you're using different credentials. There needs to be a way to invalidate the cache and obtain a new token if the credentials are different.
If there is an error reading the cache, then it's safe to assume the file was corrupted at some point. In this case the file should be deleted and a new token should be obtained with the provided credentials.
Any endpoint in paprika.core
should be executable as a subcommand.
lein paprika create-post :text "This is this post's text."
All the parameters will be bundled into a map and passed into the function. The token will be extracted from the map if it is provided by the command (ditto with client id and secret), otherwise it will be obtained by the usual methods.
Should there be an alias? Perhaps paprika
or adn
.
Perhaps like this?
lein paprika auth :output :json
Even though it's the default, it should support :edn
as an option.
A token should be cached if it was obtained by authenticating the user. If the token was provided by the user, then it must not cache it. Any token that is provided by the user must take precedence over any cached token. Consideration must be taken into account with regard to using multiple profiles for multiple apps.
A cached token could live in the .paprika-token
file from within a project, or in the ~/.lein/paprika-token
file when not. A subcommand should be introduced to clear the cached token.
Should the entire user map be cached, or just the token?
It should be possible to provide an access token if you already have one.
As a command line parameter:
lein paprika repl :token $TOKEN
As a key under :paprika
in the project map:
{:paprika {:token $TOKEN}}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.