Skip to content

Instantly share code, notes, and snippets.

View goravseth's full-sized avatar

Gorav Seth goravseth

View GitHub Profile
@goravseth
goravseth / Screensteps API External Service Definition - Beta2
Last active August 7, 2020 21:59
external service definition to pull in screensteps articles to flow. can search title, tags, text, and can pass site ID as a parameter.
{
"swagger": "2.0",
"info": {
"description": "defaultDescription",
"version": "0.1",
"title": "defaultTitle"
},
"paths": {
"/{site}/search": {
"get": {
global class License_Upgrade implements Database.Batchable<sObject> {
global Database.QueryLocator start(Database.BatchableContext BC){
// Query all active users with Profile : 'Base Programs'
String query ='Select UsersId,Users.ProfileId,Users.UserPermissionsMarketingUser,Users.Name, LastModifiedDate,LoginType,createddate,SessionType From AuthSession Where LoginType = \'Application\' and SessionType = \'UI\' and createddate = today and lastmodifieddate = today Order by lastmodifieddate';
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, List<AuthSession> AuthSesuserLst){
Profile p = [SELECT Id, Name FROM Profile WHERE Name= 'Base Programs' LIMIT 1];
@goravseth
goravseth / Screensteps API Response w Links
Last active August 4, 2020 12:12
sample api response from screensteps - used to create external service definition via swagger inspector
@goravseth
goravseth / ExternalService_2
Last active May 29, 2020 02:02
adding response schema
{
"swagger": "2.0",
"info": {
"title": "Sample API",
"description": "API description in Markdown.",
"version": "1.0.0"
},
"paths": {
"/": {
"post": {
// must be plain text, not rich text.
// ff user id is formula field to pull $user.Id, you can pass any id
{"id" : "{!ffUserID}"}
{
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
}
{
"swagger": "2.0",
"info": {
"title": "Sample API",
"description": "API description in Markdown.",
"version": "1.0.0"
},
"paths": {
"/": {
"post": {
Compromised User / Davice SOP
Freeze user
Notify techsupport (to freeze active directory account)
Revoke activations (setup - security controls - activations). note that both login IPs and activated browsers need to be revoked.
Revoke all oAuth connections (user detail - oAuth connected apps)
Revoke Third Party Account Links (ensures they need to reauthorize for SSO)
Review login history for any anomalies
If there are no anomalies
Add two factor authentication to user profile (permission set - system : two factor authentication required)
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes">
<forceChatter:publisher context="RECORD" recordId="0F94F0000008QLySAM" />
<forceChatter:feed type="Record" subjectId="0F94F0000008QLySAM" feedDesign="DEFAULT"/>
</aura:component>
@goravseth
goravseth / findDupes
Created October 25, 2017 13:16
invocable apex to find duplicate contacts using the new findDuplicates apex stuff
public class Flow_FindDupes {
//https://developer.salesforce.com/forums/?id=906F0000000AzDeIAK
@InvocableMethod(label='Get Dupes' description='Returns something')
public static List<Contact> getDuplicateContacts(List<Contact> contacts) {
system.debug('contacts size = ' + contacts.size());
list<sObject> dasContacts = new list<sobject>();
dasContacts.addall((List<sObject>)(contacts));
list<Contact> duplicateContacts = new list<Contact>();