Insert generated URL into python script after authorization - parsing

I would like to know how to render a newly generated URL to my Python script without manually copy and pasting it.
I am being redirected from my script to the web page where I need to authenticate.
I want after I authenticate on a page that the new link is passed to the script.
Specifically, this is an OAuth1 process. This link is used to get my access token.
Thanks in advance!
If I copy and paste the link, i can perfectly get all the information and connect, but this is manually.

Related

Unable to add attachments to a Jira issue using Power automate

For the internal communication without our organization we're trying to setup a power automate flow to get the data from a microsoft forms form and create a issue in jira.
Using a Jira connector for Power-Automate we're able to create a issue but we're unable to add attachments to that issue.
We've created a Power-Automate flow that follows the following steps:
When a response is submitted, This is the trigger. When a response is submitted to the form the power automate flow will trigger.
Initialize a variable.
In order to add multiple attachments to a issue we're creating a array called aAttachments.
Apply to each loop.
Get response details from form
Create jira issue
Get attachments from form
Insert attachments in a json object.
loop trough all the entries in the json
Get file contents
Add file to array
HTTP Post request. Communicatie with the jira rest API and trying to send the file information.
All steps work apart from step 11. We keep getting a 404 return with the following output.
Issue doesnt exist or you dont have the right permissions to view the issue.
We know the issue exists because the issue is created, and the persmissions needed are open to the public.
This is the Post request:
What should change in order to add the attachments to the issue created.
This may help:
Issue attachments not getting through for non-admin users via email
1 - Navigate to the project where the issues are being created > Project Settings > Permissions and check if the user that is creating the issue (Or the default reporter set for your e-mail handler) is configured with the Create Attachments permission.
2 - Check if the attachment you are trying to add has the size allowed in your site, under Jira Settings > System > Attachments
Unable to attach files to issues in Jira

Jenkins blue ocean change github access token

Jenkins blue ocean pretty cool continuous integration tool, but I faced the following problem:
At the main page, as was asked, I inserted my GitHub access token
And after that I realized that was incorrect token from another company.
And now I want to change to another token but there is no option to do that. I'm always getting the following screen without the possibility to change the key.
I found out that if I the token was deleted from GiHub tokens page I can insert the new one at the page depicted above. But now there is no way to delete that token. I need to resolve the problem from Jenkins UI.
Any Ideas how to change?
Steps to delete the Access-Token:
Go to the 'old' interface (i.e. not Blue Ocean)
Click on your username in the top right
Click on Credentials on the left
You should see an entry with the domain blueocean-github-domain the id github and the name <username>/****** (Github Access Token).
Delete it.
Afterward, BlueOcean will ask for an Access Token again, when using "Github" as the source.
I tried many things, at the moment best solution is to delete project and create new blueocean project with new credentials.
Add a new credential in Jenkins and choose "Username and Password" as the type. The username should be your GitHub username and the password is the API token. Make sure the credential is added to a store that the project has access to.
tkausl's instructions didn't work for me because there was no "Delete" or "Modify" button. So here is my extended solution (it needs shell access).
With shell access, you can find the file where your token is stored (in my case it was ./users//config.xml). However, you cannot just edit that file, because the token is stored in encrypted form (and base64-encoded). So instead, create a new dummy credential with the correct token. The dummy credential gets added (in encrypted form) in the file ./credentials.xml. Open that file and copy the password (in base64 and encrypted form) into where the actual credentials are (./users//config.xml). Finally, go to "Manage Jenkins" > "Reload Configuration from Disk".
I think #bhow has something similar but just to make it clear - you don't need to delete the project or the existing token.
You can go to Blue Ocean, choose the project and then choose the gear icon to change the project settings.
Under "Branch Sources" you'll see the current Github credentials. From there you can choose to add new credentials. In my case I added a new "Username with password" where the username was my username, and password was my Github token. By choosing this new option from the credentials dropdown I could see that the authenticated user changed.

user/project names in CircleCI 1.1 API

I'm trying to get information from the Circle CI REST API.
I can get make any call that doesn't require a vcstype/username/project to work properly such as /me?circle-token=<token>, however I can't get any that require vcstype/username/project to return anything except a 404 error.
In particular:
What is my username? Is it my github username (SuperTango)? I login to circleci with github, and the circleci "account settings" webpage doesn't actually show me any username. The /me API response has a field called login (which in my case is also "SuperTango"), but it doesn't have a field named username
What is the actual project name I should use here? Is it the name of the github project?
When trying to get a list of builds for a particular project, I have the following:
my username is "SuperTango"
i'm a github user
the project in github is called "funkware/funkware_app"
The docs say the url is:
GET: /project/:vcs-type/:username/:project
Build summary for each of the last 30 builds for a single git repo.
The base URL for all circleCI API requests is
https://circleci.com/api/v1.1/
Here's what I'm trying for the URL:
https://circleci.com/api/v1.1/project/github/SuperTango/funkware/funkware_app?circle-token=<token>
This URL is not working for me. I get back a 404 response with the webpage. As I mentioned up top, I can make the "/me" call, so I know my circle-token is correct. I don't know what else to try.
This question was already answered in the CircleCI Doc's GitHub project. I'll answer again here for completeness.
What is my username? - This is the username for your repository on GitHub or Bitbucket. This could be a personal user account, or it can be an organization username.
What is the actual project name? - This is the repository name on GitHub or Bitbucket.
For the example provided, the API call would be: https://circleci.com/api/v1.1/project/github/funkware/funkware_app?circle-token=<MY_TOKEN>.

Accessing raw files on GitHub using a URL + token

In a Gradle script I have referenced a file directly on my GitHub account like so:
buildscript { scriptHandler ->
apply from: 'https://github.com/raw/foo/bar-repo/master/repos.gradle?token=DFXD68SDF9DFKvNY-801UJHUHDUVdsd782MewA%3fks5D%3D', to: scriptHandler
dependencies {
// some dependencies
}
}
I got the URL by going to the "Raw" link on my GitHub page for the file in question.
When I run a local build everything works perfectly and my build can retrieve the raw file referenced with the URL that contains an access token.
Are there any dangers to this (I am keeping the URL private within my org). Will the token expire? I want to share common configuration such as URLs within the buildscript block, and this seems to be the simplest way of doing it.
EDIT:
I've gone to the Security section of my GitHub account and revoked all sessions and logged out (to end my current session). The URL still works.

How can I set the jenkins authentication token?

On my Jenkins build server, I want to set an Authentication Token so that only users that know the token can fire off builds. (As described here.)
This doc page says that it should be configurable under my job's "Build Triggers" configuration.
However, my server has no such fields, and I'm running the latest version (1.546). Mine looks like this:
.
As you can see, this doesn't really look like the docs say it should.
How can I set this token?
You're missing the Trigger builds remotely (e.g., from scripts) Build Trigger:
This is only visible with Security enabled. To get this option from a freshly downloaded 1.546 WAR, I changed Configure Global Security from Anyone can do anything to at least Logged-in users can do anything. For ease/speed of testing, under Security Realm I selected Jenkins’ own user database and Allow users to sign up:
You can go to http://Jenkins-IP/jobs/me/configure to check and change your API access token. Also check whether the user you intend to use has necessary permissions to execute the builds in Manage Jenkins>Configure Global Security
Each jenkins user gets an authentication token - applicable since version 1.426 (more).
You can see yours, provided you are logged in your jenkins server, at http://your.jenkins.server/me/configure
(press 'show API token' button)
Then you can copy and paste it in your scripts (e.g. see here for an example usage).

Resources