mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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[]) => {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user