Auth: Add expiry date for service accounts access tokens (#58885)

* Add new configuration option for SA tokens

* Add new expiry date option to frontend components

* Add backend validation


Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
This commit is contained in:
linoman
2022-11-22 10:08:40 +01:00
committed by GitHub
parent c1eabb893f
commit f8f61c1a69
10 changed files with 67 additions and 15 deletions

View File

@@ -16,6 +16,7 @@ export interface DatePickerProps {
onChange: (value: Date) => void;
value?: Date;
minDate?: Date;
maxDate?: Date;
}
/** @public */
@@ -38,7 +39,7 @@ export const DatePicker = memo<DatePickerProps>((props) => {
DatePicker.displayName = 'DatePicker';
const Body = memo<DatePickerProps>(({ value, minDate, onChange }) => {
const Body = memo<DatePickerProps>(({ value, minDate, maxDate, onChange }) => {
const styles = useStyles2(getBodyStyles);
return (
@@ -47,6 +48,7 @@ const Body = memo<DatePickerProps>(({ value, minDate, onChange }) => {
tileClassName={styles.title}
value={value || new Date()}
minDate={minDate}
maxDate={maxDate}
nextLabel={<Icon name="angle-right" />}
prevLabel={<Icon name="angle-left" />}
onChange={(ev: Date | Date[]) => {

View File

@@ -15,6 +15,8 @@ export interface DatePickerWithInputProps extends Omit<InputProps, 'ref' | 'valu
value?: Date | string;
/** The minimum date the value can be set to */
minDate?: Date;
/** The maximum date the value can be set to */
maxDate?: Date;
/** Handles changes when a new date is selected */
onChange: (value: Date | string) => void;
/** Hide the calendar when date is selected */
@@ -27,6 +29,7 @@ export interface DatePickerWithInputProps extends Omit<InputProps, 'ref' | 'valu
export const DatePickerWithInput = ({
value,
minDate,
maxDate,
onChange,
closeOnSelect,
placeholder = 'Date',
@@ -56,6 +59,7 @@ export const DatePickerWithInput = ({
isOpen={open}
value={value && typeof value !== 'string' ? value : dateTime().toDate()}
minDate={minDate}
maxDate={maxDate}
onChange={(ev) => {
onChange(ev);
if (closeOnSelect) {