-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨🔧 452 - [Feature branch] - Add ega permissions integration #457
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments are about code strictness and readability/maintainability. There's nothing very functional happening here to request changes for.
DACO_UI_BASE_URL=https://dac.dev.argo.cancercollaboratory.org | ||
DACO_UI_BASE_URL=http://localhost:3000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for removing specific system references.
README.md
Outdated
## Environment Variables | ||
|
||
| Name | Description | Type | Required | Default | | ||
| ------------------- | ----------------------------------------------------------------------------- | -------- | -------- | ------- | | ||
| EGA_CLIENT_ID | Client ID for EGA API | `string` | true | | | ||
| EGA_AUTH_HOST | Root URL for EGA authentication server | `string` | true | | | ||
| EGA_AUTH_REALM_NAME | Realm name for EGA authentication server | `string` | true | | | ||
| EGA_API_URL | Root URL for EGA API | `string` | true | | | ||
| EGA_USERNAME | Username for account used to gain access token from EGA authentication server | `string` | true | | | ||
| EGA_PASSWORD | Password for account used to gain access token from EGA authentication server | `string` | true | | | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
src/jobs/ega/egaClient.ts
Outdated
}, | ||
); | ||
|
||
const token = response.data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data
has type any
. Are we planning to ensure that the response data matches the type IdpToken
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm adding Zod in the next PR, i will add a safeParse
call for this and the refreshToken return
src/jobs/ega/egaClient.ts
Outdated
}, | ||
); | ||
|
||
return response.data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repeat comment, data
has type any
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix as in above comment
src/jobs/ega/egaClient.ts
Outdated
const getDacs = async () => { | ||
const response = await apiAxiosClient.get('/dacs'); | ||
return response.data; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getDacs: () => Promise<any>
and no comments. Can you add tsdocs to this so I know what this is supposed to be returning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be removed in the next PR!
|
||
import { BadRequest } from '../utils/errors'; | ||
|
||
export function validateId(id: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TSDocs please, no idea what this is validating or when to use.
return id; | ||
} | ||
|
||
export function validateType(type: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TSDocs please, no idea what this is validating or when to use.
export const EGA_API = { | ||
DACS: 'dacs', | ||
PERMISSIONS: 'permissions', | ||
USERS: 'users', | ||
MEMBERS: 'members', | ||
REQUESTS: 'requests', | ||
DATASETS: 'datasets', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats the use of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are pathnames for the ega api requests, they'll come into play in the next PR(s). I'll add a comment tho
Before you merge this, you mentioned "Next PR" a couple times, should we be collecting this work into a larger feature branch? |
453 ega api funcs
#461) * add pThrottle source code dir, add throttling to all egaClient functions
✨ 454 - implement ega job flow
🥅 455 - Error handling and retries + job reporting
✨ 454 - Add refresh token logic to Axios client
Note: This will be the base branch for work associated with the new EGA permissions flow.
Includes work from:
Adds initial setup for EGA API client.
EGA Job
config.ts
to include values for EGA APIsDocumentation
.env.example
fileDocker Compose
latest
image available on dockerhubmailhog
image to a forked version to allow building Multi Arch Docker images: https://hub.docker.com/r/jcalonso/mailhogDependencies
axios
and types support forjsonwebtoken
Cleanup
applications.ts
) to their own file