pub(crate) fn claims_table(list: GetClaimsResponse) -> String {
    let mut table = Table::new();
    crate::util::configure_table_style(&mut table);

    table.add_row(Row::new(vec![TableCell::new_with_alignment(
        "Claims",
        2,
        Alignment::Center,
    )]));

    list.claims.iter().for_each(|c| {
        table.add_row(Row::new(vec![
            TableCell::new_with_alignment("Issuer", 1, Alignment::Left),
            TableCell::new_with_alignment(
                c.get("iss").unwrap_or(&"".to_string()),
                1,
                Alignment::Left,
            ),
        ]));
        table.add_row(Row::new(vec![
            TableCell::new_with_alignment("Subject", 1, Alignment::Left),
            TableCell::new_with_alignment(
                c.get("sub").unwrap_or(&"".to_string()),
                1,
                Alignment::Left,
            ),
        ]));
        table.add_row(Row::new(vec![
            TableCell::new_with_alignment("Capabilities", 1, Alignment::Left),
            TableCell::new_with_alignment(
                c.get("caps").unwrap_or(&"".to_string()),
                1,
                Alignment::Left,
            ),
        ]));
        table.add_row(Row::new(vec![
            TableCell::new_with_alignment("Version", 1, Alignment::Left),
            TableCell::new_with_alignment(
                c.get("version").unwrap_or(&"".to_string()),
                1,
                Alignment::Left,
            ),
        ]));
        table.add_row(Row::new(vec![
            TableCell::new_with_alignment("Revision", 1, Alignment::Left),
            TableCell::new_with_alignment(
                c.get("rev").unwrap_or(&"".to_string()),
                1,
                Alignment::Left,
            ),
        ]));
        table.add_row(Row::new(vec![TableCell::new_with_alignment(
            format!(""),
            2,
            Alignment::Center,
        )]));
    });

    table.render()
}
/// Helper function to transform a ClaimsList into a table string for printing
Helper function to transform a ClaimsList into a table string for printing
Helper function to transform a ClaimsList into a table string for printing
pub(crate) fn claims_table(list: GetClaimsResponse) -> String {
    let mut table = Table::new();
    crate::util::configure_table_style(&mut table);
    table.add_row(Row::new(vec![TableCell::new_with_alignment(
        "Claims",
        2,
        Alignment::Center,
    )]));
    list.claims.iter().for_each(|c| {
        table.add_row(Row::new(vec![
            TableCell::new_with_alignment("Issuer", 1, Alignment::Left),
            TableCell::new_with_alignment(
                c.get("iss").unwrap_or(&"".to_string()),
                1,
                Alignment::Left,
            ),
        ]));
        table.add_row(Row::new(vec![
            TableCell::new_with_alignment("Subject", 1, Alignment::Left),
            TableCell::new_with_alignment(
                c.get("sub").unwrap_or(&"".to_string()),
                1,
                Alignment::Left,
            ),
        ]));
        table.add_row(Row::new(vec![
            TableCell::new_with_alignment("Capabilities", 1, Alignment::Left),
            TableCell::new_with_alignment(
                c.get("caps").unwrap_or(&"".to_string()),
                1,
                Alignment::Left,
            ),
        ]));
        table.add_row(Row::new(vec![
            TableCell::new_with_alignment("Version", 1, Alignment::Left),
            TableCell::new_with_alignment(
                c.get("version").unwrap_or(&"".to_string()),
                1,
                Alignment::Left,
            ),
        ]));
        table.add_row(Row::new(vec![
            TableCell::new_with_alignment("Revision", 1, Alignment::Left),
            TableCell::new_with_alignment(
                c.get("rev").unwrap_or(&"".to_string()),
                1,
                Alignment::Left,
            ),
        ]));
        table.add_row(Row::new(vec![TableCell::new_with_alignment(
            format!(""),
            2,
            Alignment::Center,
        )]));
    });
    table.render()
}
pub ( crate ) fn claims_table ( list : GetClaimsResponse ) -> String { let mut table = Table :: new ( ) ; crate :: util :: configure_table_style ( & mut table ) ; table . add_row ( Row :: new ( vec ! [ TableCell new_with_alignment ( " " 2 Alignment Center ) ] ) ) ; list . claims . iter ( ) . for_each ( | c | { table . add_row ( Row :: new ( vec ! [ TableCell new_with_alignment ( " " 1 Alignment Left ) TableCell new_with_alignment ( c get ( " " ) unwrap_or ( " " to_string ( ) ) 1 Alignment Left ) ] ) ) ; table . add_row ( Row :: new ( vec ! [ TableCell new_with_alignment ( " " 1 Alignment Left ) TableCell new_with_alignment ( c get ( " " ) unwrap_or ( " " to_string ( ) ) 1 Alignment Left ) ] ) ) ; table . add_row ( Row :: new ( vec ! [ TableCell new_with_alignment ( " " 1 Alignment Left ) TableCell new_with_alignment ( c get ( " " ) unwrap_or ( " " to_string ( ) ) 1 Alignment Left ) ] ) ) ; table . add_row ( Row :: new ( vec ! [ TableCell new_with_alignment ( " " 1 Alignment Left ) TableCell new_with_alignment ( c get ( " " ) unwrap_or ( " " to_string ( ) ) 1 Alignment Left ) ] ) ) ; table . add_row ( Row :: new ( vec ! [ TableCell new_with_alignment ( " " 1 Alignment Left ) TableCell new_with_alignment ( c get ( " " ) unwrap_or ( " " to_string ( ) ) 1 Alignment Left ) ] ) ) ; table . add_row ( Row :: new ( vec ! [ TableCell new_with_alignment ( format ( " " ) 2 Alignment Center ) ] ) ) ; } ) ; table . render ( ) }
Helper function to transform a ClaimsList into a table string for printing
Helper function to transform a ClaimsList into a table string for printing
list
GetClaimsResponse