-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding authorization functionality to increase request limit #19
Conversation
### What's done: 1. New diktat version 2. Authorization functionality 3. Refactoring
ArgType.String, | ||
shortName = "a", | ||
description = """GitHub username and authorization token separated by ':' | ||
| (can be used to extend the number of requests)""".trimMargin() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, provide some info about token requirements (scopes, permissions)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't get what you mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github tokens can have different scopes and give token bearers different permission (read only or write). You should specify required settings for token for your app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need any permissions, as we expect to access only open public repositories
token here is only to have a bigger limit of attempts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but if I want to use git-stat with token and I open token creation page what should I choose? If I generate token with minimum permissions, will it be enough, or will I have to regenerate it again? I'd feel confused in this situation.
auth.let { | ||
val splitAuth = auth.split(":") | ||
if (splitAuth.size != 2) { | ||
"""Incorrect value ($auth) is passed to 'auth' property. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you should log it here - user sees the command they just entered, and logging secret token might be considered a security risk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely agree
@@ -10,6 +10,7 @@ import kotlin.system.exitProcess | |||
|
|||
/** | |||
* Yes, it is yet another logger, because the quality and functionality of the current loggers is extremely poor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really see a reason for this: for JVM projects you still can use kotlin-logging as a facade and logback/log4j as an implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will make it later, but I do not think that it is a good idea actually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I don't insist and for a small CLI tool it's probably fine to have a small custom logger, I'm just not quite convinced of advantages over existing solutions.
### What's done: 1. Review notes
What's done: