Skip to content

Commit

Permalink
Apply cfformat changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeers authored and github-actions[bot] committed Aug 1, 2024
1 parent e3b2677 commit 9837080
Show file tree
Hide file tree
Showing 10 changed files with 568 additions and 573 deletions.
35 changes: 19 additions & 16 deletions ModuleConfig.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,37 @@ component {

// Model Namespace
this.modelNamespace = "cbsso";
this.autoMapModels = true;
this.autoMapModels = true;
// CF Mapping
this.cfmapping = "cbsso";
this.entryPoint = "/cbsso";
this.cfmapping = "cbsso";
this.entryPoint = "/cbsso";

// Dependencies
this.dependencies = [ "hyper", "jwtcfml" ];

routes = [
{ pattern: "/auth/:providerName/start", handler: "Auth", action: "start" },
{ pattern: "/auth/:providerName", handler: "Auth", action: "authorize" }
{
pattern : "/auth/:providerName/start",
handler : "Auth",
action : "start"
},
{
pattern : "/auth/:providerName",
handler : "Auth",
action : "authorize"
}
];

/**
* Configure Module
*/
function configure(){
settings = {
enableCBAuthIntegration: false,
errorRedirect: "",
successRedirect: "",
providers : [
// Your google login API credentials
enableCBAuthIntegration : false,
errorRedirect : "",
successRedirect : "",
providers : [
// Your google login API credentials
// "google": {
// clientId : getSystemSetting( key = "GOOGLE_CLIENT_ID", defaultValue = "" ),
// clientSecret : getSystemSetting( key = "GOOGLE_CLIENT_SECRET", defaultValue = "" ),
Expand All @@ -47,12 +55,7 @@ component {
]
};

interceptorSettings = {
customInterceptionPoints = [
"CBSSOMissingProvider",
"CBSSOAuthorization"
]
};
interceptorSettings = { customInterceptionPoints : [ "CBSSOMissingProvider", "CBSSOAuthorization" ] };
};


Expand Down
22 changes: 12 additions & 10 deletions models/ISSOAuthorizationResponse.cfc
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
interface {
public boolean function wasSuccessful();
public string function getSessionId();
public string function getUserId();
public string function getEmail();
public string function getName();
public string function getFirstName();
public string function getLastName();
public any function getRawResponseData();
public string function getErrorMessage();
}

public boolean function wasSuccessful();
public string function getSessionId();
public string function getUserId();
public string function getEmail();
public string function getName();
public string function getFirstName();
public string function getLastName();
public any function getRawResponseData();
public string function getErrorMessage();

}
10 changes: 6 additions & 4 deletions models/ISSOIntegrationProvider.cfc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
interface {
public string function getName();
public string function startAuthenticationWorflow( required any event );
public any function processAuthorizationEvent( required any event );
}

public string function getName();
public string function startAuthenticationWorflow( required any event );
public any function processAuthorizationEvent( required any event );

}
25 changes: 15 additions & 10 deletions models/ProviderService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ component accessors="true" singleton threadsafe {
variables.moduleSettings.providers.each( function( providerDefinition ){
var provider = wirebox.getInstance( providerDefinition.type );

for( var setting in providerDefinition ){
if( !structKeyExists( provider, "set#setting#" ) ){
for ( var setting in providerDefinition ) {
if ( !structKeyExists( provider, "set#setting#" ) ) {
continue;
}

invoke( provider, "set#setting#", [ providerDefinition[ setting ] ] );
invoke(
provider,
"set#setting#",
[ providerDefinition[ setting ] ]
);
}

providers[ provider.getName() ] = provider;
Expand All @@ -30,25 +34,26 @@ component accessors="true" singleton threadsafe {
public array function getRenderableProviderData(){
return variables.providers
.keyArray()
.map( (name) => {
.map( ( name ) => {
var provider = variables.providers[ name ];
return {
"name": provider.getName(),
"url": "/cbsso/auth/#provider.getName()#/start"
"name" : provider.getName(),
"url" : "/cbsso/auth/#provider.getName()#/start"
};
});
} );
}

public any function getAllProviders(){
return variables.providers.valueArray()
return variables.providers
.valueArray()
.map( ( providerRecord ) => {
if( isNull( providerRecord.provider) ){
if ( isNull( providerRecord.provider ) ) {
providerRecord.provider = buildProvider( provider: providerRecord.name );
providerRecord.createdOn = now();
}

return providerRecord.provider;
});
} );
}

function get( required name ){
Expand Down
78 changes: 40 additions & 38 deletions models/SSOAuthorizationResponse.cfc
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
component implements="cbsso.models.ISSOAuthorizationResponse" accessors = true {
property name="wasSuccessful";
property name="SessionId";
property name="UserId";
property name="Email";
property name="Name";
property name="FirstName";
property name="LastName";
property name="RawResponseData";
property name="ErrorMessage";
component implements="cbsso.models.ISSOAuthorizationResponse" accessors=true {

public boolean function wasSuccessful(){
return variables.wasSuccessful;
}
public string function getSessionId(){
return variables.SessionId;
}
public string function getUserId(){
return variables.UserId;
}
public string function getEmail(){
return variables.Email;
}
public string function getName(){
return variables.FirstName;
}
public string function getFirstName(){
return variables.FirstName;
}
public string function getLastName(){
return variables.LastName;
}
public any function getRawResponseData(){
return variables.RawResponseData;
}
public string function getErrormessage(){
return variables.ErrorMessage;
}
}
property name="wasSuccessful";
property name="SessionId";
property name="UserId";
property name="Email";
property name="Name";
property name="FirstName";
property name="LastName";
property name="RawResponseData";
property name="ErrorMessage";

public boolean function wasSuccessful(){
return variables.wasSuccessful;
}
public string function getSessionId(){
return variables.SessionId;
}
public string function getUserId(){
return variables.UserId;
}
public string function getEmail(){
return variables.Email;
}
public string function getName(){
return variables.FirstName;
}
public string function getFirstName(){
return variables.FirstName;
}
public string function getLastName(){
return variables.LastName;
}
public any function getRawResponseData(){
return variables.RawResponseData;
}
public string function getErrormessage(){
return variables.ErrorMessage;
}

}
Loading

0 comments on commit 9837080

Please sign in to comment.