-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df7340e
commit 347b720
Showing
14 changed files
with
485 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import SecurityClient from '~/utilities/SecurityClient'; | ||
|
||
|
||
interface workspaceProps { | ||
workspaceId: string; | ||
offset: number; | ||
limit: number; | ||
} | ||
|
||
/** | ||
* This function fetches the secret snapshots for a certain project | ||
* @param {object} obj | ||
* @param {string} obj.workspaceId - project id for which we are trying to get project secret snapshots | ||
* @param {object} obj.offset - teh starting point of snapshots that we want to pull | ||
* @param {object} obj.limit - how many snapshots will we output | ||
* @returns | ||
*/ | ||
const getProjectSecretShanpshots = async ({ workspaceId, offset, limit }: workspaceProps) => { | ||
return SecurityClient.fetchCall( | ||
'/api/v1/workspace/' + workspaceId + '/secret-snapshots?' + | ||
new URLSearchParams({ | ||
offset: String(offset), | ||
limit: String(limit) | ||
}), { | ||
method: 'GET', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
} | ||
).then(async (res) => { | ||
if (res && res.status == 200) { | ||
return (await res.json()).secretSnapshots; | ||
} else { | ||
console.log('Failed to get project secret snapshots'); | ||
} | ||
}); | ||
}; | ||
|
||
export default getProjectSecretShanpshots; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import SecurityClient from '~/utilities/SecurityClient'; | ||
|
||
|
||
interface workspaceProps { | ||
workspaceId: string; | ||
} | ||
|
||
/** | ||
* This function fetches the count of secret snapshots for a certain project | ||
* @param {object} obj | ||
* @param {string} obj.workspaceId - project id for which we are trying to get project secret snapshots | ||
* @returns | ||
*/ | ||
const getProjectSercetSnapshotsCount = async ({ workspaceId }: workspaceProps) => { | ||
return SecurityClient.fetchCall( | ||
'/api/v1/workspace/' + workspaceId + '/secret-snapshots/count', { | ||
method: 'GET', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
} | ||
).then(async (res) => { | ||
if (res && res.status == 200) { | ||
return (await res.json()).count; | ||
} else { | ||
console.log('Failed to get the count of project secret snapshots'); | ||
} | ||
}); | ||
}; | ||
|
||
export default getProjectSercetSnapshotsCount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import SecurityClient from '~/utilities/SecurityClient'; | ||
|
||
|
||
interface SnapshotProps { | ||
secretSnapshotId: string; | ||
} | ||
|
||
/** | ||
* This function fetches the secrets for a certain secret snapshot | ||
* @param {object} obj | ||
* @param {string} obj.secretSnapshotId - snapshot id for which we are trying to get secrets | ||
* @returns | ||
*/ | ||
const getSecretSnapshotData = async ({ secretSnapshotId }: SnapshotProps) => { | ||
return SecurityClient.fetchCall( | ||
'/api/v1/secret-snapshot/' + secretSnapshotId, { | ||
method: 'GET', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
} | ||
).then(async (res) => { | ||
if (res && res.status == 200) { | ||
return (await res.json()).secretSnapshot; | ||
} else { | ||
console.log('Failed to get the secrets of a certain snapshot'); | ||
} | ||
}); | ||
}; | ||
|
||
export default getSecretSnapshotData; |
Oops, something went wrong.