Skip to content

Instantly share code, notes, and snippets.

View kbortnik's full-sized avatar

Kristian Bortnik kbortnik

View GitHub Profile
@kbortnik
kbortnik / CustomEProductManager.cs
Last active January 21, 2017 13:06
Kentico modular system for e-products
using System;
using System.Collections.Generic;
using System.Linq;
using CMS.Ecommerce;
using CMS.Helpers;
namespace CustomEProducts
{
public static class CustomEProductManager
{
@kbortnik
kbortnik / jira-oauth.js
Last active November 22, 2017 14:51
JIRA 2-legged OAuth authentication in Node.js with mashape-oauth
/*
It seems that JIRA's 2-legged OAuth is actually 1-legged.
The tricky things about authenticating to JIRA via OAuth are:
* JIRA ignores the Authentication header in the request. All OAuth parameters must be in the query string
* The signature method is RSA-SHA1. JIRA does not accept HMAC-SHA1, which is the most commonly used
* The `oauth_token` parameter must be provided, simply as an empty string. If not provided, JIRA will ignore the OAuth parameters
Make sure you configure JIRA (https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-oauth-authentication#JIRARESTAPIExample-OAuthauthentication-Step1:ConfiguringJIRA)
Only the linked step 1 is relevant.
Create a RSA-SHA1 public key and private key pair with, for example, `openssl`: