forked from coldbox-modules/cbgithub
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathToken.cfc
More file actions
37 lines (30 loc) · 1.04 KB
/
Copy pathToken.cfc
File metadata and controls
37 lines (30 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
component accessors="true" {
property name="APIRequest"
inject="APIRequest@cbgithub"
setter="false"
getter="false";
property name="id";
property name="token";
property name="hashedToken";
property name="tokenLastEight";
property name="note";
property name="scopes";
property name="createdDate";
property name="updatedDate";
function onDIComplete() {
if ( structKeyExists( application, "cbcontroller" ) ) {
variables.settings = application.wirebox.getInstance( dsl = "coldbox:modulesettings:cbgithub" );
}
}
function delete(
string username,
string password,
string oneTimePassword = ""
) {
if ( isNull( username ) ) { username = settings.username; }
if ( isNull( password ) ) { password = settings.password; }
arguments.headers = { "X-GitHub-OTP" = oneTimePassword };
arguments.endpoint = "/authorizations/#getId()#";
APIRequest.delete( argumentCollection = arguments );
}
}